Contract 0x4758de8640cf7fef229c20299ad853c86c0c1e39

Contract Overview

Balance:
10,075.19712423 CRO

CRO Value:
$693.98 (@ $0.07/CRO)

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xcfc0f1874ee9f32314dc4c758b1495795422e1b700d7023c1e9c0319c4b3833aTransfer Ownersh...72935012023-03-08 6:38:4817 days 17 hrs ago0x902a3f17114f815573cb1d87e16a027d52e2a158 IN  0x4758de8640cf7fef229c20299ad853c86c0c1e390 CRO0.13739138419 4,797.52022455
0xeb759590368c23136161f6d4485437f3f34cf91f1fcc5c5302930aaa9f98ff8eTransfer64530222023-01-12 6:25:1472 days 17 hrs ago0xacde0162a47202d400514e49ab708eca11707f71 IN  0x4758de8640cf7fef229c20299ad853c86c0c1e396,500 CRO0.101834375199 4,836.588705753
0xf39c3c6c06c762110bad2fbe4ecef3317532317c4471f1acde2a3edb7568c5120x60a0604064504332023-01-12 2:19:3372 days 22 hrs ago0x902a3f17114f815573cb1d87e16a027d52e2a158 IN  Create: FeeDistributor0 CRO7.514231001916 4,838.20830951
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x7df9d6f69e26770741ab53ec01d6b472a76d95320aeb5ff370420fff7d00e9a675158482023-03-22 19:53:233 days 4 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e337.996870212108981081 CRO
0x7df9d6f69e26770741ab53ec01d6b472a76d95320aeb5ff370420fff7d00e9a675158482023-03-22 19:53:233 days 4 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39337.996870212108981081 CRO
0x7df9d6f69e26770741ab53ec01d6b472a76d95320aeb5ff370420fff7d00e9a675158482023-03-22 19:53:233 days 4 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token16,747.74491901 CRO
0x37817eaba8b383e51fb87fc71ba630205383494926700efef7e2011ccdf1d8ca74097002023-03-15 21:15:0510 days 3 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e310.429896255499495616 CRO
0x37817eaba8b383e51fb87fc71ba630205383494926700efef7e2011ccdf1d8ca74097002023-03-15 21:15:0510 days 3 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39310.429896255499495616 CRO
0x37817eaba8b383e51fb87fc71ba630205383494926700efef7e2011ccdf1d8ca74097002023-03-15 21:15:0510 days 3 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token15,381.80135946 CRO
0x7edfa4d6e525c8d3d7126af68838990d01d06d092ec8bfa922f9c4aa8b6cdb4d73029812023-03-08 21:30:2617 days 2 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e269.464583577194754532 CRO
0x7edfa4d6e525c8d3d7126af68838990d01d06d092ec8bfa922f9c4aa8b6cdb4d73029812023-03-08 21:30:2617 days 2 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39269.464583577194754532 CRO
0x7edfa4d6e525c8d3d7126af68838990d01d06d092ec8bfa922f9c4aa8b6cdb4d73029812023-03-08 21:30:2617 days 2 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token13,351.97011625 CRO
0x0de65a977cfc0019cd0a8acc6073afa4b8ae1169cdb58e194e2a81b84a0b559371968072023-03-01 23:03:4024 days 1 hr ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e205.305294824621596077 CRO
0x0de65a977cfc0019cd0a8acc6073afa4b8ae1169cdb58e194e2a81b84a0b559371968072023-03-01 23:03:4024 days 1 hr ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39205.305294824621596077 CRO
0x0de65a977cfc0019cd0a8acc6073afa4b8ae1169cdb58e194e2a81b84a0b559371968072023-03-01 23:03:4024 days 1 hr ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token10,172.87735856 CRO
0x91ba585b91078041d1648599a3e85d846555f27a30bb01ce3cffd8283bb6a32a70906902023-02-23 0:36:4730 days 23 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e220.878648256508579006 CRO
0x91ba585b91078041d1648599a3e85d846555f27a30bb01ce3cffd8283bb6a32a70906902023-02-23 0:36:4730 days 23 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39220.878648256508579006 CRO
0x91ba585b91078041d1648599a3e85d846555f27a30bb01ce3cffd8283bb6a32a70906902023-02-23 0:36:4730 days 23 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token10,944.53702111 CRO
0x7f362a7490334a5dc7f10979d5130e5eb55839a63825e522256f40710f0047b169844592023-02-16 1:52:4637 days 22 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e211.082882135216952802 CRO
0x7f362a7490334a5dc7f10979d5130e5eb55839a63825e522256f40710f0047b169844592023-02-16 1:52:4637 days 22 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39211.082882135216952802 CRO
0x7f362a7490334a5dc7f10979d5130e5eb55839a63825e522256f40710f0047b169844592023-02-16 1:52:4637 days 22 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token10,459.1568098 CRO
0xf2862d98f907d0187df6466f4af0c87a110e6489d6a8663c3316dfdaa624a6cb68783282023-02-09 3:17:2444 days 21 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e203.486578794550958756 CRO
0xf2862d98f907d0187df6466f4af0c87a110e6489d6a8663c3316dfdaa624a6cb68783282023-02-09 3:17:2444 days 21 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39203.486578794550958756 CRO
0xf2862d98f907d0187df6466f4af0c87a110e6489d6a8663c3316dfdaa624a6cb68783282023-02-09 3:17:2444 days 21 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token10,082.75997927 CRO
0x504f2305467e7068ac95022003b42b79e8432d889ef544f7ccf65115fe6031c567718492023-02-02 4:10:0351 days 20 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e187.382167213925329501 CRO
0x504f2305467e7068ac95022003b42b79e8432d889ef544f7ccf65115fe6031c567718492023-02-02 4:10:0351 days 20 hrs ago Cronos: WCRO Token 0x4758de8640cf7fef229c20299ad853c86c0c1e39187.382167213925329501 CRO
0x504f2305467e7068ac95022003b42b79e8432d889ef544f7ccf65115fe6031c567718492023-02-02 4:10:0351 days 20 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e39 Cronos: WCRO Token9,284.78638545 CRO
0xada536fcf9ecf4635d2ad3c3b4caf43f424f2859a20ada4b820605c5e057af5666655792023-01-26 4:51:1458 days 19 hrs ago 0x4758de8640cf7fef229c20299ad853c86c0c1e390x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e169.609739202018164038 CRO
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FeeDistributor

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 3 of 14 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 14 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 5 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 6 of 14 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 7 of 14 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 14 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 11 of 14 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/structs/EnumerableSet.sol)

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 *  Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable.
 *  See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 *  In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

File 12 of 14 : FeeDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./interfaces/IFeeDistributor.sol";
import "./interfaces/IWCRO.sol";

/**
 * @title FeeDistributor
 * @notice Distribute fee accrued in protocol to treasury, reservoir and Veno bot.
 *         Veno bot will only split  WCRO reward, if protocol expands to include other reward token
 *         it'll only be splitted between reservoir and treasury
 */
contract FeeDistributor is IFeeDistributor, ReentrancyGuard, Ownable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    address public treasury;
    address public reservoir;
    address public bot;
    uint256 public treasuryShares;
    uint256 public reservoirShares;
    uint256 public botShares;

    uint256 public immutable REWARD_DURATION_IN_BLOCKS;
    uint256 public periodEndBlock;
    uint256 public lastUpdatedBlock;

    mapping(address => uint256) public rewardTokenToCurrRewardsPerBlock;
    EnumerableSet.AddressSet internal rewardTokens;
    IWCRO wcro;

    event UpdateShares(uint256 reservoirShares, uint256 treasuryShares, uint256 botShares);
    event SetTreasury(address treasury);
    event SetReservoir(address reservoir);
    event SetBot(address bot);
    event AddRewardToken(address rewardToken);

    /**
     * @param _reservoir address of reservoir
     * @param _reservoirShares share of reservoir reward
     * @param _treasury address of treasury
     * @param _treasuryShares share of treasury reward
     * @param _bot address of Veno bot on cronos
     * @param _botShares share of Veno bot - only applicable for wcro reward token
     * @param _REWARD_DURATION_IN_BLOCKS how long each reward period should last
     * @param _startBlock when rewardPerBlock calculation starts
     * @param _wcro wrapped cro address
     * @dev fees should be sent to the contract before reward calculation start so when startBlock
     *      is hit, rewardPerBlock would have some value
     */
    constructor(
        address _reservoir,
        uint256 _reservoirShares,
        address _treasury,
        uint256 _treasuryShares,
        address _bot,
        uint256 _botShares,
        uint256 _REWARD_DURATION_IN_BLOCKS,
        uint256 _startBlock,
        IWCRO _wcro
    ) {
        require(_REWARD_DURATION_IN_BLOCKS > 0, "Reward duration is 0");
        require(_startBlock > block.number, "Start block should be in future");
        require(address(_wcro) != address(0), "WCRO should not be address(0)");
        require(address(_reservoir) != address(0), "Reservoir should not be address(0)");
        require(address(_treasury) != address(0), "Treasury should not be address(0)");
        require(address(_bot) != address(0), "Bot should not be address(0)");

        reservoir = _reservoir;
        reservoirShares = _reservoirShares;
        treasury = _treasury;
        treasuryShares = _treasuryShares;
        bot = _bot;
        botShares = _botShares;
        REWARD_DURATION_IN_BLOCKS = _REWARD_DURATION_IN_BLOCKS;
        wcro = _wcro;

        rewardTokens.add(address(wcro));

        periodEndBlock = _startBlock;
        lastUpdatedBlock = block.number;
    }

    function setTreasury(address _treasury) external onlyOwner {
        require(_treasury != address(0), "ADDRESS_ZERO");
        require(treasury != _treasury, "SAME_ADDRESS");

        treasury = _treasury;
        emit SetTreasury(treasury);
    }

    function setReservoir(address _reservoir) external onlyOwner {
        require(_reservoir != address(0), "ADDRESS_ZERO");
        require(reservoir != _reservoir, "SAME_ADDRESS");

        reservoir = _reservoir;
        emit SetReservoir(_reservoir);
    }

    function setBot(address _bot) external onlyOwner {
        require(_bot != address(0), "ADDRESS_ZERO");
        require(bot != _bot, "SAME_ADDRESS");

        bot = _bot;
        emit SetBot(bot);
    }

    function updateShares(
        uint256 _reservoirShares,
        uint256 _treasuryShares,
        uint256 _botShares
    ) external onlyOwner {
        require(_botShares < _treasuryShares, "Bot share too much");

        // Distribute any pending reward before update share
        claimRewards();

        reservoirShares = _reservoirShares;
        treasuryShares = _treasuryShares;
        botShares = _botShares;

        emit UpdateShares(reservoirShares, treasuryShares, botShares);
    }

    function addRewardToken(IERC20 _rewardToken) public onlyOwner {
        require(!rewardTokens.contains(address(_rewardToken)), "Reward token already exist");
        rewardTokens.add(address(_rewardToken));

        emit AddRewardToken(address(_rewardToken));
    }

    /**
     * @notice Release any pending reward to treasury, reservoir & bot. RewardPerBlock include
     *         1) how long since  periodEndBlock before this function called
     *         2) rewardDurationInBlock
     *         Example: current block 210, periodEndBlock = 200, rewardDurationInBlock = 100 with 500 cro in contract
     *         rewardPerBlock = 500 cro / (rewardDuration + 10 block). 10 block from current block - periodEndBlock
     *
     *         This also would handle the case where there might be extended inactivity where this function isnt called
     */
    function claimRewards() public nonReentrant {
        if (block.number <= periodEndBlock) {
            _releaseTokenRewards();
        } else {
            // Implies end of the previous reward round and start of the new reward round.
            // First, distribute last round pending reward, then update next round reward per block.
            // Finally distribute any pending reward of current reward round
            _releaseTokenRewards();
            _updateRewardsPerBlock();
            _releaseTokenRewards();
        }
    }

    /**
     * @notice convert all cro balance in contract to wcro
     */
    function convertCroToWcro() public {
        uint256 balance = address(this).balance;
        wcro.deposit{value: balance}();
    }

    /**
     * @param rewardToken token to query pending reward
     * @return pending reward amount of rewardToken for reservoir
     */
    function pendingReward(address rewardToken) public view returns (uint256) {
        if (!rewardTokens.contains(rewardToken)) {
            return 0;
        }

        // Calculate current round reward
        uint256 currRewardsPerBlock = rewardTokenToCurrRewardsPerBlock[rewardToken];
        (uint256 multiplier, ) = _getMultiplier();
        uint256 pendingRewardsForCurrentRound = multiplier * currRewardsPerBlock;
        if (block.number <= periodEndBlock) {
            return pendingRewardsForCurrentRound;
        }

        // Calculate next round reward, if wcro include cro balance
        uint256 rewardTokenBal = IERC20(rewardToken).balanceOf(address(this));
        if (rewardToken == address(wcro)) {
            rewardTokenBal += address(this).balance;
        }

        uint256 totalShares = reservoirShares + treasuryShares;
        if (rewardToken == address(wcro)) {
            totalShares += botShares; // only include bot share if token is wcro
        }
        uint256 rewardBal = rewardTokenBal - pendingRewardsForCurrentRound;
        uint256 reservoirRewards = (rewardBal * reservoirShares) / (totalShares);
        uint256 nextPeriodEndBlock = block.number + REWARD_DURATION_IN_BLOCKS;
        uint256 nextRewardPerBlock = (reservoirRewards / (nextPeriodEndBlock - periodEndBlock));
        uint256 pendingRewardsForNextRound = (block.number - periodEndBlock) * nextRewardPerBlock;

        return pendingRewardsForCurrentRound + pendingRewardsForNextRound;
    }

    /**
     * @dev return list of reward tokens stored. It is very unlikely the protocol will expand to
     *      more than 10 chains in the long term. Otherwise will need to re-look at the gas cost of this
     *      function
     */
    function getRewardTokens() public view returns (address[] memory) {
        return rewardTokens.values();
    }

    receive() external payable {}

    function _releaseTokenRewards() internal {
        // limits the rewards to the current reward round wrt _lastUpdatedBlock
        (uint256 multiplier, uint256 _lastUpdatedBlock) = _getMultiplier();

        for (uint256 i = 0; i < rewardTokens.length(); i++) {
            address rewardToken = rewardTokens.at(i);

            uint256 currRewardsPerBlock = rewardTokenToCurrRewardsPerBlock[rewardToken];
            if (currRewardsPerBlock > 0) {
                uint256 amountToTransfer = multiplier * currRewardsPerBlock;

                IERC20(rewardToken).safeTransfer(reservoir, amountToTransfer);
            }
        }

        lastUpdatedBlock = _lastUpdatedBlock;
    }

    function _updateRewardsPerBlock() internal {
        if (block.number > periodEndBlock) {
            convertCroToWcro();

            periodEndBlock = block.number + REWARD_DURATION_IN_BLOCKS;

            // Set rewardPerBlock for each reward token
            for (uint256 i = 0; i < rewardTokens.length(); i++) {
                address rewardToken = rewardTokens.at(i);

                uint256 totalShares = reservoirShares + treasuryShares;
                if (rewardToken == address(wcro)) {
                    totalShares += botShares; // only include bot share if token is wcro
                }

                // calculate how much reward for reservoir/treasury
                uint256 rewardBal = IERC20(rewardToken).balanceOf(address(this));
                uint256 reservoirRewards = (rewardBal * reservoirShares) / totalShares;
                uint256 treasuryRewards = (rewardBal * treasuryShares) / totalShares;

                // update reward per block and give treasury cro
                uint256 currRewardsPerBlock = reservoirRewards / (periodEndBlock - lastUpdatedBlock);
                rewardTokenToCurrRewardsPerBlock[rewardToken] = currRewardsPerBlock;
                IERC20(rewardToken).safeTransfer(treasury, treasuryRewards);

                // if token == wcro, convert to CRO before send to  bot
                if (rewardToken == address(wcro)) {
                    uint256 botReward = rewardBal - reservoirRewards - treasuryRewards;
                    wcro.withdraw(botReward);
                    (bool success, ) = bot.call{value: botReward}("");
                }
            }
        }
    }

    /**
     * @notice returns the number of blocks from now since last reward block
     */
    function _getMultiplier() internal view returns (uint256, uint256) {
        if (block.number <= periodEndBlock) {
            return (block.number - lastUpdatedBlock, block.number);
        } else {
            // considers only pending rewards in previous round
            return (periodEndBlock - lastUpdatedBlock, periodEndBlock);
        }
    }
}

File 13 of 14 : IFeeDistributor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

/**
 * @title IFeeDistributor
 * @notice Protocol fee will be IBC to this contract and splitted between
 *         treasury and reservoir.
 */
interface IFeeDistributor {
    /**
     * @notice harvest any pending reward from the fee distributor
     */
    function claimRewards() external;

    function pendingReward(address rewardToken) external view returns (uint256);

    /**
     * @return list of reward tokens given out
     */
    function getRewardTokens() external view returns (address[] memory);
}

File 14 of 14 : IWCRO.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

interface IWCRO {
    function deposit() external payable;

    function withdraw(uint256 amt) external;
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "nft-staking-module/=lib/nft-staking-module/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_reservoir","type":"address"},{"internalType":"uint256","name":"_reservoirShares","type":"uint256"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_treasuryShares","type":"uint256"},{"internalType":"address","name":"_bot","type":"address"},{"internalType":"uint256","name":"_botShares","type":"uint256"},{"internalType":"uint256","name":"_REWARD_DURATION_IN_BLOCKS","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"contract IWCRO","name":"_wcro","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"}],"name":"AddRewardToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"bot","type":"address"}],"name":"SetBot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"reservoir","type":"address"}],"name":"SetReservoir","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"treasury","type":"address"}],"name":"SetTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reservoirShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"treasuryShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"botShares","type":"uint256"}],"name":"UpdateShares","type":"event"},{"inputs":[],"name":"REWARD_DURATION_IN_BLOCKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"}],"name":"addRewardToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bot","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"botShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"convertCroToWcro","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdatedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"rewardToken","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reservoir","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"reservoirShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardTokenToCurrRewardsPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_bot","type":"address"}],"name":"setBot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reservoir","type":"address"}],"name":"setReservoir","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"treasuryShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_reservoirShares","type":"uint256"},{"internalType":"uint256","name":"_treasuryShares","type":"uint256"},{"internalType":"uint256","name":"_botShares","type":"uint256"}],"name":"updateShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040523480156200001157600080fd5b50604051620019dd380380620019dd8339810160408190526200003491620003cb565b60016000556200004433620002ee565b600083116200009a5760405162461bcd60e51b815260206004820152601460248201527f526577617264206475726174696f6e206973203000000000000000000000000060448201526064015b60405180910390fd5b438211620000eb5760405162461bcd60e51b815260206004820152601f60248201527f537461727420626c6f636b2073686f756c6420626520696e2066757475726500604482015260640162000091565b6001600160a01b038116620001435760405162461bcd60e51b815260206004820152601d60248201527f5743524f2073686f756c64206e6f742062652061646472657373283029000000604482015260640162000091565b6001600160a01b038916620001a65760405162461bcd60e51b815260206004820152602260248201527f5265736572766f69722073686f756c64206e6f74206265206164647265737328604482015261302960f01b606482015260840162000091565b6001600160a01b038716620002085760405162461bcd60e51b815260206004820152602160248201527f54726561737572792073686f756c64206e6f74206265206164647265737328306044820152602960f81b606482015260840162000091565b6001600160a01b038516620002605760405162461bcd60e51b815260206004820152601c60248201527f426f742073686f756c64206e6f74206265206164647265737328302900000000604482015260640162000091565b600380546001600160a01b03199081166001600160a01b038c81169190911790925560068a90556002805482168a8416179055600588905560048054821688841617905560078690556080859052600d80549091169183169182179055620002d790600b9062000340602090811b62000ab817901c565b505060085550504360095550620004679350505050565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600062000357836001600160a01b03841662000360565b90505b92915050565b6000818152600183016020526040812054620003a9575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200035a565b5060006200035a565b6001600160a01b0381168114620003c857600080fd5b50565b60008060008060008060008060006101208a8c031215620003eb57600080fd5b8951620003f881620003b2565b60208b015160408c0151919a5098506200041281620003b2565b60608b015160808c015191985096506200042c81620003b2565b8095505060a08a0151935060c08a0151925060e08a015191506101008a01516200045681620003b2565b809150509295985092959850929598565b60805161154c620004916000396000818161022401528181610a3e0152610c02015261154c6000f3fe6080604052600436106101395760003560e01c8063715018a6116100ab578063c4f59f9b1161006f578063c4f59f9b14610348578063cb61b42d1461036a578063f0f442601461038a578063f2fde38b146103aa578063f40f0f52146103ca578063f90ce5ba146103ea57600080fd5b8063715018a6146102b25780638da5cb5b146102c757806397817229146102e5578063b5634ba114610305578063baec8b0f1461033257600080fd5b8063372500ab116100fd578063372500ab146101fd5780633e248be814610212578063442da82f146102465780635f1def131461025c57806361d027b3146102725780636b5caec41461029257600080fd5b806310814c3714610145578063151e6aa5146101825780631c03e6cc146101a25780633452b06a146101c4578063352051a2146101e857600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50600454610165906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561018e57600080fd5b50600354610165906001600160a01b031681565b3480156101ae57600080fd5b506101c26101bd3660046112c5565b610400565b005b3480156101d057600080fd5b506101da60065481565b604051908152602001610179565b3480156101f457600080fd5b506101c26104b1565b34801561020957600080fd5b506101c2610515565b34801561021e57600080fd5b506101da7f000000000000000000000000000000000000000000000000000000000000000081565b34801561025257600080fd5b506101da60085481565b34801561026857600080fd5b506101da60075481565b34801561027e57600080fd5b50600254610165906001600160a01b031681565b34801561029e57600080fd5b506101c26102ad3660046112c5565b6105a1565b3480156102be57600080fd5b506101c261064a565b3480156102d357600080fd5b506001546001600160a01b0316610165565b3480156102f157600080fd5b506101c26103003660046112c5565b61065e565b34801561031157600080fd5b506101da6103203660046112c5565b600a6020526000908152604090205481565b34801561033e57600080fd5b506101da60055481565b34801561035457600080fd5b5061035d610707565b60405161017991906112e2565b34801561037657600080fd5b506101c261038536600461132f565b610718565b34801561039657600080fd5b506101c26103a53660046112c5565b6107c1565b3480156103b657600080fd5b506101c26103c53660046112c5565b61086a565b3480156103d657600080fd5b506101da6103e53660046112c5565b6108e3565b3480156103f657600080fd5b506101da60095481565b610408610ad6565b610413600b82610b30565b156104655760405162461bcd60e51b815260206004820152601a60248201527f52657761726420746f6b656e20616c726561647920657869737400000000000060448201526064015b60405180910390fd5b610470600b82610ab8565b506040516001600160a01b03821681527f851bbb4304bf0768ed98b97e429b5bd1dcc1f194b36cd1650f40293e951ae393906020015b60405180910390a150565b600d5460408051630d0e30db60e41b8152905147926001600160a01b03169163d0e30db091849160048082019260009290919082900301818588803b1580156104f957600080fd5b505af115801561050d573d6000803e3d6000fd5b505050505050565b6002600054036105675760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161045c565b600260005560085443116105825761057d610b52565b61059a565b61058a610b52565b610592610beb565b61059a610b52565b6001600055565b6105a9610ad6565b6001600160a01b0381166105cf5760405162461bcd60e51b815260040161045c9061135b565b6004546001600160a01b038083169116036105fc5760405162461bcd60e51b815260040161045c90611381565b600480546001600160a01b0319166001600160a01b0383169081179091556040519081527f33295f3f3adbe56651e571633bde467a6f5571258578224b1e45db68774998d8906020016104a6565b610652610ad6565b61065c6000610e79565b565b610666610ad6565b6001600160a01b03811661068c5760405162461bcd60e51b815260040161045c9061135b565b6003546001600160a01b038083169116036106b95760405162461bcd60e51b815260040161045c90611381565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fb2697f038e71a33345f8ee159cbcfecb61a9c1bbb5b8725dca0983956a9e7dac906020016104a6565b6060610713600b610ecb565b905090565b610720610ad6565b8181106107645760405162461bcd60e51b8152602060048201526012602482015271084dee840e6d0c2e4ca40e8dede40daeac6d60731b604482015260640161045c565b61076c610515565b60068390556005829055600781905560408051848152602081018490529081018290527f64c94d581fb7cb437cd1e3005aab5b574323ceec38914c05cb8c7cdbd7a3b5b89060600160405180910390a1505050565b6107c9610ad6565b6001600160a01b0381166107ef5760405162461bcd60e51b815260040161045c9061135b565b6002546001600160a01b0380831691160361081c5760405162461bcd60e51b815260040161045c90611381565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef3906020016104a6565b610872610ad6565b6001600160a01b0381166108d75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161045c565b6108e081610e79565b50565b60006108f0600b83610b30565b6108fc57506000919050565b6001600160a01b0382166000908152600a60205260408120549061091e610edf565b509050600061092d83836113bd565b9050600854431161094057949350505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038716906370a0823190602401602060405180830381865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab91906113dc565b600d549091506001600160a01b03908116908716036109d1576109ce47826113f5565b90505b60006005546006546109e391906113f5565b600d549091506001600160a01b0390811690881603610a0c57600754610a0990826113f5565b90505b6000610a18848461140d565b905060008260065483610a2b91906113bd565b610a359190611424565b90506000610a637f0000000000000000000000000000000000000000000000000000000000000000436113f5565b9050600060085482610a75919061140d565b610a7f9084611424565b905060008160085443610a92919061140d565b610a9c91906113bd565b9050610aa881896113f5565b9c9b505050505050505050505050565b6000610acd836001600160a01b038416610f1b565b90505b92915050565b6001546001600160a01b0316331461065c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161045c565b6001600160a01b03811660009081526001830160205260408120541515610acd565b600080610b5d610edf565b9150915060005b610b6e600b610f6a565b811015610be4576000610b82600b83610f74565b6001600160a01b0381166000908152600a60205260409020549091508015610bcf576000610bb082876113bd565b600354909150610bcd906001600160a01b03858116911683610f80565b505b50508080610bdc90611446565b915050610b64565b5060095550565b60085443111561065c57610bfd6104b1565b610c277f0000000000000000000000000000000000000000000000000000000000000000436113f5565b60085560005b610c37600b610f6a565b8110156108e0576000610c4b600b83610f74565b90506000600554600654610c5f91906113f5565b600d549091506001600160a01b0390811690831603610c8857600754610c8590826113f5565b90505b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf391906113dc565b905060008260065483610d0691906113bd565b610d109190611424565b905060008360055484610d2391906113bd565b610d2d9190611424565b90506000600954600854610d41919061140d565b610d4b9084611424565b6001600160a01b038088166000818152600a60205260409020839055600254929350610d7a9290911684610f80565b600d546001600160a01b0390811690871603610e6057600082610d9d858761140d565b610da7919061140d565b600d54604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b158015610dee57600080fd5b505af1158015610e02573d6000803e3d6000fd5b5050600454604051600093506001600160a01b03909116915083908381818185875af1925050503d8060008114610e55576040519150601f19603f3d011682016040523d82523d6000602084013e610e5a565b606091505b50505050505b5050505050508080610e7190611446565b915050610c2d565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610ed883610fd7565b9392505050565b6000806008544311610f0057600954610ef8904361140d565b924392509050565b600954600854610f10919061140d565b600854915091509091565b6000818152600183016020526040812054610f6257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610ad0565b506000610ad0565b6000610ad0825490565b6000610acd8383611033565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610fd290849061105d565b505050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561102757602002820191906000526020600020905b815481526020019060010190808311611013575b50505050509050919050565b600082600001828154811061104a5761104a61145f565b9060005260206000200154905092915050565b60006110b2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661112f9092919063ffffffff16565b805190915015610fd257808060200190518101906110d09190611475565b610fd25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161045c565b606061113e8484600085611146565b949350505050565b6060824710156111a75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161045c565b6001600160a01b0385163b6111fe5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161045c565b600080866001600160a01b0316858760405161121a91906114c7565b60006040518083038185875af1925050503d8060008114611257576040519150601f19603f3d011682016040523d82523d6000602084013e61125c565b606091505b509150915061126c828286611277565b979650505050505050565b60608315611286575081610ed8565b8251156112965782518084602001fd5b8160405162461bcd60e51b815260040161045c91906114e3565b6001600160a01b03811681146108e057600080fd5b6000602082840312156112d757600080fd5b8135610ed8816112b0565b6020808252825182820181905260009190848201906040850190845b818110156113235783516001600160a01b0316835292840192918401916001016112fe565b50909695505050505050565b60008060006060848603121561134457600080fd5b505081359360208301359350604090920135919050565b6020808252600c908201526b414444524553535f5a45524f60a01b604082015260600190565b6020808252600c908201526b53414d455f4144445245535360a01b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156113d7576113d76113a7565b500290565b6000602082840312156113ee57600080fd5b5051919050565b60008219821115611408576114086113a7565b500190565b60008282101561141f5761141f6113a7565b500390565b60008261144157634e487b7160e01b600052601260045260246000fd5b500490565b600060018201611458576114586113a7565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561148757600080fd5b81518015158114610ed857600080fd5b60005b838110156114b257818101518382015260200161149a565b838111156114c1576000848401525b50505050565b600082516114d9818460208701611497565b9190910192915050565b6020815260008251806020840152611502816040850160208701611497565b601f01601f1916919091016040019291505056fea2646970667358221220e5b2f7b2f3e2f00b907ed09509c8a64097dbec8aa4cfac3b97b01243299add7664736f6c634300080f003300000000000000000000000021179329c1dcfd36ffe0862cca2c7e85538cca0700000000000000000000000000000000000000000000000000000000000013f6000000000000000000000000c7b88708fd851223b79555251153669adc9e306d00000000000000000000000000000000000000000000000000000000000011f80000000000000000000000008c0ec5772bd92d55edd1325d022ec07e54ae1b0e00000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000019e79000000000000000000000000000000000000000000000000000000000064157c0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000021179329c1dcfd36ffe0862cca2c7e85538cca0700000000000000000000000000000000000000000000000000000000000013f6000000000000000000000000c7b88708fd851223b79555251153669adc9e306d00000000000000000000000000000000000000000000000000000000000011f80000000000000000000000008c0ec5772bd92d55edd1325d022ec07e54ae1b0e00000000000000000000000000000000000000000000000000000000000000c80000000000000000000000000000000000000000000000000000000000019e79000000000000000000000000000000000000000000000000000000000064157c0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23

-----Decoded View---------------
Arg [0] : _reservoir (address): 0x21179329c1dcfd36ffe0862cca2c7e85538cca07
Arg [1] : _reservoirShares (uint256): 5110
Arg [2] : _treasury (address): 0xc7b88708fd851223b79555251153669adc9e306d
Arg [3] : _treasuryShares (uint256): 4600
Arg [4] : _bot (address): 0x8c0ec5772bd92d55edd1325d022ec07e54ae1b0e
Arg [5] : _botShares (uint256): 200
Arg [6] : _REWARD_DURATION_IN_BLOCKS (uint256): 106105
Arg [7] : _startBlock (uint256): 6559100
Arg [8] : _wcro (address): 0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 00000000000000000000000021179329c1dcfd36ffe0862cca2c7e85538cca07
Arg [1] : 00000000000000000000000000000000000000000000000000000000000013f6
Arg [2] : 000000000000000000000000c7b88708fd851223b79555251153669adc9e306d
Arg [3] : 00000000000000000000000000000000000000000000000000000000000011f8
Arg [4] : 0000000000000000000000008c0ec5772bd92d55edd1325d022ec07e54ae1b0e
Arg [5] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [6] : 0000000000000000000000000000000000000000000000000000000000019e79
Arg [7] : 000000000000000000000000000000000000000000000000000000000064157c
Arg [8] : 0000000000000000000000005c7f8a570d578ed84e63fdfa7b1ee72deae1ae23


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.