ETH Price: $3,258.30 (+6.62%)
Gas: 39 Gwei

Contract

0x7776C65E112475Cebd4A2fC72E685f35641DB3dA
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Distribute Rewar...161735562022-12-13 5:00:11441 days 5 hrs ago1670907611IN
0x7776C6...641DB3dA
0 ETH0.0025752115.18064908
Distribute Rewar...161664012022-12-12 5:00:11442 days 5 hrs ago1670821211IN
0x7776C6...641DB3dA
0 ETH0.0024078914.19431326
Distribute Rewar...161592362022-12-11 5:00:11443 days 5 hrs ago1670734811IN
0x7776C6...641DB3dA
0 ETH0.0024221614.27842948
Distribute Rewar...161520732022-12-10 5:00:11444 days 5 hrs ago1670648411IN
0x7776C6...641DB3dA
0 ETH0.0027800216.38796778
Distribute Rewar...161449262022-12-09 5:00:11445 days 5 hrs ago1670562011IN
0x7776C6...641DB3dA
0 ETH0.0027131815.99398511
Distribute Rewar...161377652022-12-08 5:00:11446 days 5 hrs ago1670475611IN
0x7776C6...641DB3dA
0 ETH0.0030717716.20664132
Distribute Rewar...161317112022-12-07 8:40:47447 days 1 hr ago1670402447IN
0x7776C6...641DB3dA
0 ETH0.0022348412.75879728
Distribute Rewar...161163712022-12-05 5:00:11449 days 5 hrs ago1670216411IN
0x7776C6...641DB3dA
0 ETH0.0022966213.53838286
Distribute Rewar...161092202022-12-04 5:00:11450 days 5 hrs ago1670130011IN
0x7776C6...641DB3dA
0 ETH0.0022438913.22754766
Distribute Rewar...161020592022-12-03 5:00:11451 days 5 hrs ago1670043611IN
0x7776C6...641DB3dA
0 ETH0.0021987812.96160466
Distribute Rewar...160948902022-12-02 5:00:11452 days 5 hrs ago1669957211IN
0x7776C6...641DB3dA
0 ETH0.0021908812.9150705
Distribute Rewar...160877272022-12-01 5:00:11453 days 5 hrs ago1669870811IN
0x7776C6...641DB3dA
0 ETH0.0021785712.84247655
Distribute Rewar...160805762022-11-30 5:00:11454 days 5 hrs ago1669784411IN
0x7776C6...641DB3dA
0 ETH0.0020848212.28986504
Distribute Rewar...160734192022-11-29 5:00:11455 days 5 hrs ago1669698011IN
0x7776C6...641DB3dA
0 ETH0.0021466612.65437121
Distribute Rewar...160662512022-11-28 5:00:11456 days 5 hrs ago1669611611IN
0x7776C6...641DB3dA
0 ETH0.0020754112.23438492
Distribute Rewar...160590912022-11-27 5:00:11457 days 5 hrs ago1669525211IN
0x7776C6...641DB3dA
0 ETH0.0020495412.08189388
Distribute Rewar...160519332022-11-26 5:00:11458 days 5 hrs ago1669438811IN
0x7776C6...641DB3dA
0 ETH0.0018496710.90365717
Distribute Rewar...160447732022-11-25 5:00:11459 days 5 hrs ago1669352411IN
0x7776C6...641DB3dA
0 ETH0.002124812.52552493
Distribute Rewar...160376112022-11-24 5:00:11460 days 5 hrs ago1669266011IN
0x7776C6...641DB3dA
0 ETH0.0023237213.69813769
Distribute Rewar...160304702022-11-23 5:00:11461 days 5 hrs ago1669179611IN
0x7776C6...641DB3dA
0 ETH0.0022994313.12752401
Distribute Rewar...160233222022-11-22 5:00:23462 days 5 hrs ago1669093223IN
0x7776C6...641DB3dA
0 ETH0.0018920711.15359095
Distribute Rewar...160161622022-11-21 5:00:23463 days 5 hrs ago1669006823IN
0x7776C6...641DB3dA
0 ETH0.0020778811.99971956
Distribute Rewar...160089992022-11-20 5:00:11464 days 5 hrs ago1668920411IN
0x7776C6...641DB3dA
0 ETH0.0024890714.67288391
Distribute Rewar...160018322022-11-19 5:00:11465 days 5 hrs ago1668834011IN
0x7776C6...641DB3dA
0 ETH0.0021554312.7060655
Distribute Rewar...159946682022-11-18 5:00:11466 days 5 hrs ago1668747611IN
0x7776C6...641DB3dA
0 ETH0.0023861514.06614775
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakingManager

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 22000 runs

Other Settings:
default evmVersion
File 1 of 15 : StakingManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/IBasePool.sol";
import "./base/TokenSaver.sol";

contract StakingManager is TokenSaver {
    using SafeERC20 for IERC20;

    bytes32 public constant GOV_ROLE = keccak256("GOV_ROLE");
    bytes32 public constant REWARD_DISTRIBUTOR_ROLE = keccak256("REWARD_DISTRIBUTOR_ROLE");
    uint256 public MAX_POOL_COUNT = 10;

    IERC20 public immutable reward;
    address public immutable rewardSource;
    uint256 public rewardPerSecond; //total reward amount per second
    uint256 public lastDistribution; //when rewards were last pushed
    uint256 public totalWeight;

    mapping(address => bool) public poolAdded;
    Pool[] public pools;

    struct Pool {
        IBasePool poolContract;
        uint256 weight;
    }

    modifier onlyGov() {
        require(hasRole(GOV_ROLE, _msgSender()), "StakingManager.onlyGov: permission denied");
        _;
    }

    modifier onlyRewardDistributor() {
        require(
            hasRole(REWARD_DISTRIBUTOR_ROLE, _msgSender()),
            "StakingManager.onlyRewardDistributor: permission denied"
        );
        _;
    }

    modifier onlyGovOrRewardDistributor() {
        require(
            hasRole(GOV_ROLE, _msgSender()) || hasRole(REWARD_DISTRIBUTOR_ROLE, _msgSender()),
            "StakingManager.onlyGovOrRewardDistributor: permission denied"
        );
        _;
    }

    event PoolAdded(address indexed pool, uint256 weight);
    event PoolRemoved(uint256 indexed poolId, address indexed pool);
    event WeightAdjusted(uint256 indexed poolId, address indexed pool, uint256 newWeight);
    event RewardsPerSecondSet(uint256 rewardsPerSecond);
    event RewardsDistributed(address _from, uint256 indexed _amount);

    constructor(address _reward, address _rewardSource) {
        require(_reward != address(0), "StakingManager.constructor: reward token must be set");
        require(_rewardSource != address(0), "StakingManager.constructor: rewardSource token must be set");
        reward = IERC20(_reward);
        rewardSource = _rewardSource;
    }

    function addPool(address _poolContract, uint256 _weight) external onlyGov {
        distributeRewards();
        require(_poolContract != address(0), "StakingManager.addPool: pool contract must be set");
        require(!poolAdded[_poolContract], "StakingManager.addPool: Pool already added");
        require(pools.length < MAX_POOL_COUNT, "StakingManager.addPool: Max amount of pools reached");
        // add pool
        pools.push(Pool({poolContract: IBasePool(_poolContract), weight: _weight}));
        poolAdded[_poolContract] = true;

        // increase totalWeight
        totalWeight += _weight;

        // Approve max token amount
        reward.safeApprove(_poolContract, type(uint256).max);

        emit PoolAdded(_poolContract, _weight);
    }

    function removePool(uint256 _poolId) external onlyGov {
        require(_poolId < pools.length, "StakingManager.removePool: Pool does not exist");
        distributeRewards();
        address poolAddress = address(pools[_poolId].poolContract);
        reward.safeApprove(poolAddress, 0);
        // decrease totalWeight
        totalWeight -= pools[_poolId].weight;

        // remove pool
        pools[_poolId] = pools[pools.length - 1];
        pools.pop();
        poolAdded[poolAddress] = false;

        emit PoolRemoved(_poolId, poolAddress);
    }

    function adjustWeight(uint256 _poolId, uint256 _newWeight) external onlyGov {
        require(_poolId < pools.length, "StakingManager.adjustWeight: Pool does not exist");
        distributeRewards();
        Pool storage pool = pools[_poolId];

        totalWeight -= pool.weight;
        totalWeight += _newWeight;

        pool.weight = _newWeight;

        emit WeightAdjusted(_poolId, address(pool.poolContract), _newWeight);
    }

    function setRewardPerSecond(uint256 _rewardPerSecond) external onlyGov {
        distributeRewards();
        rewardPerSecond = _rewardPerSecond;

        emit RewardsPerSecondSet(_rewardPerSecond);
    }

    /**
     * @dev distribute token to Pool(s)
     *
     * Requirements:
     * - LiquidityMiningManager must be approved by rewardSource
     */
    function distributeRewards() public onlyGovOrRewardDistributor {
        uint256 timePassed = block.timestamp - lastDistribution;
        uint256 totalRewardAmount = rewardPerSecond * timePassed;
        lastDistribution = block.timestamp;

        // return if pool length == 0
        if (pools.length == 0) {
            return;
        }

        // return if accrued rewards == 0
        if (totalRewardAmount == 0) {
            return;
        }

        reward.safeTransferFrom(rewardSource, address(this), totalRewardAmount);

        for (uint256 i = 0; i < pools.length; i++) {
            Pool memory pool = pools[i];
            uint256 poolRewardAmount = (totalRewardAmount * pool.weight) / totalWeight;
            // Ignore tx failing to prevent a single pool from halting reward distribution
            address(pool.poolContract).call(
                abi.encodeWithSelector(pool.poolContract.distributeRewards.selector, poolRewardAmount)
            );
        }

        uint256 leftOverReward = reward.balanceOf(address(this));

        // send back excess but ignore dust
        if (leftOverReward > 1) {
            reward.safeTransfer(rewardSource, leftOverReward);
        }

        emit RewardsDistributed(_msgSender(), totalRewardAmount);
    }

    function getPools() external view returns (Pool[] memory result) {
        return pools;
    }
}

File 2 of 15 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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);
}

File 3 of 15 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.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));
        }
    }

    /**
     * @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 4 of 15 : IBasePool.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
interface IBasePool {
    function distributeRewards(uint256 _amount) external;
}

File 5 of 15 : TokenSaver.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";

contract TokenSaver is AccessControlEnumerable {
    using SafeERC20 for IERC20;

    bytes32 public constant TOKEN_SAVER_ROLE = keccak256("TOKEN_SAVER_ROLE");

    event TokenSaved(address indexed by, address indexed receiver, address indexed token, uint256 amount);

    modifier onlyTokenSaver() {
        require(hasRole(TOKEN_SAVER_ROLE, _msgSender()), "TokenSaver.onlyTokenSaver: permission denied");
        _;
    }

    constructor() {
        _setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
    }

    function saveToken(address _token, address _receiver, uint256 _amount) external onlyTokenSaver {
        IERC20(_token).safeTransfer(_receiver, _amount);
        emit TokenSaved(_msgSender(), _receiver, _token, _amount);
    }

}

File 6 of 15 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 15 : AccessControlEnumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";

/**
 * @dev Extension of {AccessControl} that allows enumerating the members of each role.
 */
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view override returns (address) {
        return _roleMembers[role].at(index);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view override returns (uint256) {
        return _roleMembers[role].length();
    }

    /**
     * @dev Overload {grantRole} to track enumerable memberships
     */
    function grantRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.grantRole(role, account);
        _roleMembers[role].add(account);
    }

    /**
     * @dev Overload {revokeRole} to track enumerable memberships
     */
    function revokeRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.revokeRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {renounceRole} to track enumerable memberships
     */
    function renounceRole(bytes32 role, address account) public virtual override(AccessControl, IAccessControl) {
        super.renounceRole(role, account);
        _roleMembers[role].remove(account);
    }

    /**
     * @dev Overload {_setupRole} to track enumerable memberships
     */
    function _setupRole(bytes32 role, address account) internal virtual override {
        super._setupRole(role, account);
        _roleMembers[role].add(account);
    }
}

File 8 of 15 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 9 of 15 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 10 of 15 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

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.
 */
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;

        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;

        assembly {
            result := store
        }

        return result;
    }
}

File 11 of 15 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 12 of 15 : Context.sol
// SPDX-License-Identifier: MIT

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 13 of 15 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 14 of 15 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 15 of 15 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 22000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_reward","type":"address"},{"internalType":"address","name":"_rewardSource","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"PoolRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"RewardsDistributed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardsPerSecond","type":"uint256"}],"name":"RewardsPerSecondSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenSaved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"pool","type":"address"},{"indexed":false,"internalType":"uint256","name":"newWeight","type":"uint256"}],"name":"WeightAdjusted","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOV_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_POOL_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_DISTRIBUTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_SAVER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_poolContract","type":"address"},{"internalType":"uint256","name":"_weight","type":"uint256"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_newWeight","type":"uint256"}],"name":"adjustWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"distributeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPools","outputs":[{"components":[{"internalType":"contract IBasePool","name":"poolContract","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"internalType":"struct StakingManager.Pool[]","name":"result","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastDistribution","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"poolAdded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"contract IBasePool","name":"poolContract","type":"address"},{"internalType":"uint256","name":"weight","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"removePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reward","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardSource","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"saveToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"}],"name":"setRewardPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c0604052600a6002553480156200001657600080fd5b5060405162002d7838038062002d788339810160408190526200003991620002c5565b6200004660003362000143565b6001600160a01b038216620000b75760405162461bcd60e51b8152602060048201526034602482015260008051602062002d5883398151915260448201527f726420746f6b656e206d7573742062652073657400000000000000000000000060648201526084015b60405180910390fd5b6001600160a01b038116620001245760405162461bcd60e51b815260206004820152603a602482015260008051602062002d5883398151915260448201527f7264536f7572636520746f6b656e206d757374206265207365740000000000006064820152608401620000ae565b6001600160601b0319606092831b8116608052911b1660a052620002fd565b6200015a82826200018660201b6200170b1760201c565b6000828152600160209081526040909120620001819183906200171962000196821b17901c565b505050565b620001928282620001b6565b5050565b6000620001ad836001600160a01b03841662000256565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000192576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002123390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200029f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001b0565b506000620001b0565b80516001600160a01b0381168114620002c057600080fd5b919050565b60008060408385031215620002d957600080fd5b620002e483620002a8565b9150620002f460208401620002a8565b90509250929050565b60805160601c60a05160601c6129fe6200035a600039600081816103a601528181610c990152610f2a0152600081816101eb0152818161090201528181610c7701528181610e5401528181610f0801526112b201526129fe6000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80639010d07c116100f9578063a717639c11610097578063b9c849b611610071578063b9c849b614610452578063ca15c87314610465578063d3b91d8414610478578063d547741f1461049b57600080fd5b8063a717639c146103e3578063ac4afa38146103ec578063b536818a1461042b57600080fd5b80639afdb2c2116100d35780639afdb2c21461038e5780639cfbc002146103a1578063a217fddf146103c8578063a38dcbd0146103d057600080fd5b80639010d07c1461032e57806391d148541461034157806396c82e571461038557600080fd5b806336568abe11610166578063673a2a1f11610140578063673a2a1f146102e15780636f4a2cd0146102f657806376175b06146102fe5780638f10369a1461032557600080fd5b806336568abe146102b25780635a8c2e26146102c557806366da5815146102ce57600080fd5b80632f2ff15d116101975780632f2ff15d1461026357806332a9caba1461027857806332e4bb0a1461028b57600080fd5b806301ffc9a7146101be578063228cb733146101e6578063248a9ca314610232575b600080fd5b6101d16101cc36600461261d565b6104ae565b60405190151581526020015b60405180910390f35b61020d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101dd565b6102556102403660046125b6565b60009081526020819052604090206001015490565b6040519081526020016101dd565b6102766102713660046125cf565b61050a565b005b61027661028636600461256a565b610531565b6102557fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b6102766102c03660046125cf565b61099d565b61025560025481565b6102766102dc3660046125b6565b6109bf565b6102e9610ab8565b6040516101dd9190612715565b610276610b3a565b6102557fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d81565b61025560035481565b61020d61033c3660046125fb565b610f9f565b6101d161034f3660046125cf565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61025560055481565b61027661039c36600461252e565b610fbe565b61020d7f000000000000000000000000000000000000000000000000000000000000000081565b610255600081565b6102766103de3660046125b6565b61111e565b61025560045481565b6103ff6103fa3660046125b6565b6114a1565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016101dd565b6102557f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba81565b6102766104603660046125fb565b6114e6565b6102556104733660046125b6565b6116ea565b6101d1610486366004612513565b60066020526000908152604090205460ff1681565b6102766104a93660046125cf565b611701565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f00000000000000000000000000000000000000000000000000000000148061050457506105048261173b565b92915050565b61051482826117d2565b600082815260016020526040902061052c9082611719565b505050565b61055b7f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b6105ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105f4610b3a565b73ffffffffffffffffffffffffffffffffffffffff8216610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f5374616b696e674d616e616765722e616464506f6f6c3a20706f6f6c20636f6e60448201527f7472616374206d7573742062652073657400000000000000000000000000000060648201526084016105e3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526006602052604090205460ff161561074d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5374616b696e674d616e616765722e616464506f6f6c3a20506f6f6c20616c7260448201527f656164792061646465640000000000000000000000000000000000000000000060648201526084016105e3565b600254600754106107e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5374616b696e674d616e616765722e616464506f6f6c3a204d617820616d6f7560448201527f6e74206f6620706f6f6c7320726561636865640000000000000000000000000060648201526084016105e3565b60408051808201825273ffffffffffffffffffffffffffffffffffffffff84811680835260208084018681526007805460018082018355600092835296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600290920291820180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919097161790955590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689909401939093559082526006905291822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055600580548392906108e29084906127cb565b90915550610949905073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117f8565b8173ffffffffffffffffffffffffffffffffffffffff167f0c98febfffcec480c66a977e13f14bafdb5199ea9603591a0715b0cabe0c3ae28260405161099191815260200190565b60405180910390a25050565b6109a78282611a07565b600082815260016020526040902061052c9082611ab6565b6109e97f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b610a75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b610a7d610b3a565b60038190556040518181527fa779fa0f0a75020027d18183bb38fa4a9abeea71bb307e00ac7f5410527967ab9060200160405180910390a150565b60606007805480602002602001604051908101604052809291908181526020016000905b82821015610b315760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610adc565b50505050905090565b610b647f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b80610b945750610b947fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b4493361034f565b610c20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f5374616b696e674d616e616765722e6f6e6c79476f764f72526577617264446960448201527f737472696275746f723a207065726d697373696f6e2064656e6965640000000060648201526084016105e3565b600060045442610c30919061285b565b9050600081600354610c42919061281e565b42600455600754909150610c54575050565b80610c5d575050565b610cbf73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167f00000000000000000000000000000000000000000000000000000000000000003084611ad8565b60005b600754811015610e2257600060078281548110610ce157610ce161296a565b6000918252602080832060408051808201909152600290930201805473ffffffffffffffffffffffffffffffffffffffff16835260010154908201819052600554919350610d2f908661281e565b610d3991906127e3565b825160408051602480820185905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f59974e3800000000000000000000000000000000000000000000000000000000179052905192935073ffffffffffffffffffffffffffffffffffffffff90911691610dc89190612678565b6000604051808303816000865af19150503d8060008114610e05576040519150601f19603f3d011682016040523d82523d6000602084013e610e0a565b606091505b50505050508080610e1a906128d3565b915050610cc2565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b158015610eab57600080fd5b505afa158015610ebf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee3919061265f565b90506001811115610f4f57610f4f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000083611b3c565b817fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece0863360405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a2505050565b6000828152600160205260408120610fb79083611b92565b9392505050565b610fe87fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d3361034f565b611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f546f6b656e53617665722e6f6e6c79546f6b656e53617665723a207065726d6960448201527f7373696f6e2064656e696564000000000000000000000000000000000000000060648201526084016105e3565b61109573ffffffffffffffffffffffffffffffffffffffff84168383611b3c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff166110ca3390565b73ffffffffffffffffffffffffffffffffffffffff167f30d87cec6b4c56cede1018725d1e6d9304e2f7ee6d25b004b7e2183f793f26bc8460405161111191815260200190565b60405180910390a4505050565b6111487f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b6111d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b6007548110611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5374616b696e674d616e616765722e72656d6f7665506f6f6c3a20506f6f6c2060448201527f646f6573206e6f7420657869737400000000000000000000000000000000000060648201526084016105e3565b61126d610b3a565b6000600782815481106112825761128261296a565b6000918252602082206002909102015473ffffffffffffffffffffffffffffffffffffffff90811692506112dc917f00000000000000000000000000000000000000000000000000000000000000009091169083906117f8565b600782815481106112ef576112ef61296a565b90600052602060002090600202016001015460056000828254611312919061285b565b9091555050600780546113279060019061285b565b815481106113375761133761296a565b9060005260206000209060020201600783815481106113585761135861296a565b60009182526020909120825460029092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117815560019182015491015560078054806113c6576113c661293b565b6000828152602080822060027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9094019384020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001018290559190925573ffffffffffffffffffffffffffffffffffffffff83168083526006909152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551909184917f18e9d3644c306f9be50ade92ee325ee173812431fa971a0b8d46f9eb707396019190a35050565b600781815481106114b157600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff909116915082565b6115107f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b61159c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b600754821061162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5374616b696e674d616e616765722e61646a7573745765696768743a20506f6f60448201527f6c20646f6573206e6f742065786973740000000000000000000000000000000060648201526084016105e3565b611635610b3a565b60006007838154811061164a5761164a61296a565b90600052602060002090600202019050806001015460056000828254611670919061285b565b92505081905550816005600082825461168991906127cb565b909155505060018101829055805460405183815273ffffffffffffffffffffffffffffffffffffffff9091169084907f4bd857a398c0fb71cc804d86dac2b437d1e5ca0b8a3161ec9638515c5d1997c29060200160405180910390a3505050565b600081815260016020526040812061050490611b9e565b6109a78282611ba8565b6117158282611bce565b5050565b6000610fb78373ffffffffffffffffffffffffffffffffffffffff8416611cbe565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061050457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610504565b6000828152602081905260409020600101546117ee8133611d0d565b61052c8383611bce565b8015806118a757506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561186d57600080fd5b505afa158015611881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a5919061265f565b155b611933576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016105e3565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261052c9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611ddd565b73ffffffffffffffffffffffffffffffffffffffff81163314611aac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016105e3565b6117158282611ee9565b6000610fb78373ffffffffffffffffffffffffffffffffffffffff8416611fa0565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611b369085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611985565b50505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261052c9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611985565b6000610fb78383612093565b6000610504825490565b600082815260208190526040902060010154611bc48133611d0d565b61052c8383611ee9565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166117155760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611c603390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054611d0557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610504565b506000610504565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661171557611d638173ffffffffffffffffffffffffffffffffffffffff1660146120bd565b611d6e8360206120bd565b604051602001611d7f929190612694565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526105e39160040161277a565b6000611e3f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123009092919063ffffffff16565b80519091501561052c5780806020019051810190611e5d9190612594565b61052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105e3565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156117155760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015612089576000611fc460018361285b565b8554909150600090611fd89060019061285b565b905081811461203d576000866000018281548110611ff857611ff861296a565b906000526020600020015490508087600001848154811061201b5761201b61296a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061204e5761204e61293b565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610504565b6000915050610504565b60008260000182815481106120aa576120aa61296a565b9060005260206000200154905092915050565b606060006120cc83600261281e565b6120d79060026127cb565b67ffffffffffffffff8111156120ef576120ef612999565b6040519080825280601f01601f191660200182016040528015612119576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106121505761215061296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106121b3576121b361296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006121ef84600261281e565b6121fa9060016127cb565b90505b6001811115612297577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061223b5761223b61296a565b1a60f81b8282815181106122515761225161296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936122908161289e565b90506121fd565b508315610fb7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e3565b606061230f8484600085612317565b949350505050565b6060824710156123a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105e3565b843b612411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105e3565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161243a9190612678565b60006040518083038185875af1925050503d8060008114612477576040519150601f19603f3d011682016040523d82523d6000602084013e61247c565b606091505b509150915061248c828286612497565b979650505050505050565b606083156124a6575081610fb7565b8251156124b65782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e3919061277a565b803573ffffffffffffffffffffffffffffffffffffffff8116811461250e57600080fd5b919050565b60006020828403121561252557600080fd5b610fb7826124ea565b60008060006060848603121561254357600080fd5b61254c846124ea565b925061255a602085016124ea565b9150604084013590509250925092565b6000806040838503121561257d57600080fd5b612586836124ea565b946020939093013593505050565b6000602082840312156125a657600080fd5b81518015158114610fb757600080fd5b6000602082840312156125c857600080fd5b5035919050565b600080604083850312156125e257600080fd5b823591506125f2602084016124ea565b90509250929050565b6000806040838503121561260e57600080fd5b50508035926020909101359150565b60006020828403121561262f57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610fb757600080fd5b60006020828403121561267157600080fd5b5051919050565b6000825161268a818460208701612872565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126cc816017850160208801612872565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612709816028840160208801612872565b01602801949350505050565b602080825282518282018190526000919060409081850190868401855b8281101561276d578151805173ffffffffffffffffffffffffffffffffffffffff168552860151868501529284019290850190600101612732565b5091979650505050505050565b6020815260008251806020840152612799816040850160208701612872565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156127de576127de61290c565b500190565b600082612819577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128565761285661290c565b500290565b60008282101561286d5761286d61290c565b500390565b60005b8381101561288d578181015183820152602001612875565b83811115611b365750506000910152565b6000816128ad576128ad61290c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129055761290561290c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220435e7c90109f00019167d43dc76aac8aeff6b33d2d91eb4c0f714b744fd5089f64736f6c634300080700335374616b696e674d616e616765722e636f6e7374727563746f723a20726577610000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f51100000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101b95760003560e01c80639010d07c116100f9578063a717639c11610097578063b9c849b611610071578063b9c849b614610452578063ca15c87314610465578063d3b91d8414610478578063d547741f1461049b57600080fd5b8063a717639c146103e3578063ac4afa38146103ec578063b536818a1461042b57600080fd5b80639afdb2c2116100d35780639afdb2c21461038e5780639cfbc002146103a1578063a217fddf146103c8578063a38dcbd0146103d057600080fd5b80639010d07c1461032e57806391d148541461034157806396c82e571461038557600080fd5b806336568abe11610166578063673a2a1f11610140578063673a2a1f146102e15780636f4a2cd0146102f657806376175b06146102fe5780638f10369a1461032557600080fd5b806336568abe146102b25780635a8c2e26146102c557806366da5815146102ce57600080fd5b80632f2ff15d116101975780632f2ff15d1461026357806332a9caba1461027857806332e4bb0a1461028b57600080fd5b806301ffc9a7146101be578063228cb733146101e6578063248a9ca314610232575b600080fd5b6101d16101cc36600461261d565b6104ae565b60405190151581526020015b60405180910390f35b61020d7f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f51181565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101dd565b6102556102403660046125b6565b60009081526020819052604090206001015490565b6040519081526020016101dd565b6102766102713660046125cf565b61050a565b005b61027661028636600461256a565b610531565b6102557fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b44981565b6102766102c03660046125cf565b61099d565b61025560025481565b6102766102dc3660046125b6565b6109bf565b6102e9610ab8565b6040516101dd9190612715565b610276610b3a565b6102557fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d81565b61025560035481565b61020d61033c3660046125fb565b610f9f565b6101d161034f3660046125cf565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b61025560055481565b61027661039c36600461252e565b610fbe565b61020d7f00000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c81565b610255600081565b6102766103de3660046125b6565b61111e565b61025560045481565b6103ff6103fa3660046125b6565b6114a1565b6040805173ffffffffffffffffffffffffffffffffffffffff90931683526020830191909152016101dd565b6102557f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba81565b6102766104603660046125fb565b6114e6565b6102556104733660046125b6565b6116ea565b6101d1610486366004612513565b60066020526000908152604090205460ff1681565b6102766104a93660046125cf565b611701565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f00000000000000000000000000000000000000000000000000000000148061050457506105048261173b565b92915050565b61051482826117d2565b600082815260016020526040902061052c9082611719565b505050565b61055b7f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b6105ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6105f4610b3a565b73ffffffffffffffffffffffffffffffffffffffff8216610697576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f5374616b696e674d616e616765722e616464506f6f6c3a20706f6f6c20636f6e60448201527f7472616374206d7573742062652073657400000000000000000000000000000060648201526084016105e3565b73ffffffffffffffffffffffffffffffffffffffff821660009081526006602052604090205460ff161561074d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5374616b696e674d616e616765722e616464506f6f6c3a20506f6f6c20616c7260448201527f656164792061646465640000000000000000000000000000000000000000000060648201526084016105e3565b600254600754106107e0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5374616b696e674d616e616765722e616464506f6f6c3a204d617820616d6f7560448201527f6e74206f6620706f6f6c7320726561636865640000000000000000000000000060648201526084016105e3565b60408051808201825273ffffffffffffffffffffffffffffffffffffffff84811680835260208084018681526007805460018082018355600092835296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600290920291820180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919097161790955590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689909401939093559082526006905291822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055600580548392906108e29084906127cb565b90915550610949905073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f51116837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6117f8565b8173ffffffffffffffffffffffffffffffffffffffff167f0c98febfffcec480c66a977e13f14bafdb5199ea9603591a0715b0cabe0c3ae28260405161099191815260200190565b60405180910390a25050565b6109a78282611a07565b600082815260016020526040902061052c9082611ab6565b6109e97f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b610a75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b610a7d610b3a565b60038190556040518181527fa779fa0f0a75020027d18183bb38fa4a9abeea71bb307e00ac7f5410527967ab9060200160405180910390a150565b60606007805480602002602001604051908101604052809291908181526020016000905b82821015610b315760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610adc565b50505050905090565b610b647f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b80610b945750610b947fb814ff4a26ea3ec5cd1fa579daad86324826254265f3acfec78303a19845b4493361034f565b610c20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f5374616b696e674d616e616765722e6f6e6c79476f764f72526577617264446960448201527f737472696275746f723a207065726d697373696f6e2064656e6965640000000060648201526084016105e3565b600060045442610c30919061285b565b9050600081600354610c42919061281e565b42600455600754909150610c54575050565b80610c5d575050565b610cbf73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f511167f00000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c3084611ad8565b60005b600754811015610e2257600060078281548110610ce157610ce161296a565b6000918252602080832060408051808201909152600290930201805473ffffffffffffffffffffffffffffffffffffffff16835260010154908201819052600554919350610d2f908661281e565b610d3991906127e3565b825160408051602480820185905282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f59974e3800000000000000000000000000000000000000000000000000000000179052905192935073ffffffffffffffffffffffffffffffffffffffff90911691610dc89190612678565b6000604051808303816000865af19150503d8060008114610e05576040519150601f19603f3d011682016040523d82523d6000602084013e610e0a565b606091505b50505050508080610e1a906128d3565b915050610cc2565b506040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f51173ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b158015610eab57600080fd5b505afa158015610ebf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee3919061265f565b90506001811115610f4f57610f4f73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f511167f00000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c83611b3c565b817fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece0863360405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a2505050565b6000828152600160205260408120610fb79083611b92565b9392505050565b610fe87fd9d917c4034cff8a8c5fa1e40f9fbaf906b827c33ae3ab1fcabbb616cb8ef24d3361034f565b611074576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f546f6b656e53617665722e6f6e6c79546f6b656e53617665723a207065726d6960448201527f7373696f6e2064656e696564000000000000000000000000000000000000000060648201526084016105e3565b61109573ffffffffffffffffffffffffffffffffffffffff84168383611b3c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff166110ca3390565b73ffffffffffffffffffffffffffffffffffffffff167f30d87cec6b4c56cede1018725d1e6d9304e2f7ee6d25b004b7e2183f793f26bc8460405161111191815260200190565b60405180910390a4505050565b6111487f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b6111d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b6007548110611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f5374616b696e674d616e616765722e72656d6f7665506f6f6c3a20506f6f6c2060448201527f646f6573206e6f7420657869737400000000000000000000000000000000000060648201526084016105e3565b61126d610b3a565b6000600782815481106112825761128261296a565b6000918252602082206002909102015473ffffffffffffffffffffffffffffffffffffffff90811692506112dc917f0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f5119091169083906117f8565b600782815481106112ef576112ef61296a565b90600052602060002090600202016001015460056000828254611312919061285b565b9091555050600780546113279060019061285b565b815481106113375761133761296a565b9060005260206000209060020201600783815481106113585761135861296a565b60009182526020909120825460029092020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff90921691909117815560019182015491015560078054806113c6576113c661293b565b6000828152602080822060027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9094019384020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556001018290559190925573ffffffffffffffffffffffffffffffffffffffff83168083526006909152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551909184917f18e9d3644c306f9be50ade92ee325ee173812431fa971a0b8d46f9eb707396019190a35050565b600781815481106114b157600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff909116915082565b6115107f0603f2636f0ca34ae3ea5a23bb826e2bd2ffd59fb1c01edc1ba10fba2899d1ba3361034f565b61159c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5374616b696e674d616e616765722e6f6e6c79476f763a207065726d6973736960448201527f6f6e2064656e696564000000000000000000000000000000000000000000000060648201526084016105e3565b600754821061162d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f5374616b696e674d616e616765722e61646a7573745765696768743a20506f6f60448201527f6c20646f6573206e6f742065786973740000000000000000000000000000000060648201526084016105e3565b611635610b3a565b60006007838154811061164a5761164a61296a565b90600052602060002090600202019050806001015460056000828254611670919061285b565b92505081905550816005600082825461168991906127cb565b909155505060018101829055805460405183815273ffffffffffffffffffffffffffffffffffffffff9091169084907f4bd857a398c0fb71cc804d86dac2b437d1e5ca0b8a3161ec9638515c5d1997c29060200160405180910390a3505050565b600081815260016020526040812061050490611b9e565b6109a78282611ba8565b6117158282611bce565b5050565b6000610fb78373ffffffffffffffffffffffffffffffffffffffff8416611cbe565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061050457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610504565b6000828152602081905260409020600101546117ee8133611d0d565b61052c8383611bce565b8015806118a757506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e9060440160206040518083038186803b15801561186d57600080fd5b505afa158015611881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a5919061265f565b155b611933576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016105e3565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261052c9084907f095ea7b300000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611ddd565b73ffffffffffffffffffffffffffffffffffffffff81163314611aac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016105e3565b6117158282611ee9565b6000610fb78373ffffffffffffffffffffffffffffffffffffffff8416611fa0565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611b369085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611985565b50505050565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261052c9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611985565b6000610fb78383612093565b6000610504825490565b600082815260208190526040902060010154611bc48133611d0d565b61052c8383611ee9565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff166117155760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611c603390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000818152600183016020526040812054611d0557508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610504565b506000610504565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1661171557611d638173ffffffffffffffffffffffffffffffffffffffff1660146120bd565b611d6e8360206120bd565b604051602001611d7f929190612694565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a00000000000000000000000000000000000000000000000000000000082526105e39160040161277a565b6000611e3f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166123009092919063ffffffff16565b80519091501561052c5780806020019051810190611e5d9190612594565b61052c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016105e3565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16156117155760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60008181526001830160205260408120548015612089576000611fc460018361285b565b8554909150600090611fd89060019061285b565b905081811461203d576000866000018281548110611ff857611ff861296a565b906000526020600020015490508087600001848154811061201b5761201b61296a565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061204e5761204e61293b565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610504565b6000915050610504565b60008260000182815481106120aa576120aa61296a565b9060005260206000200154905092915050565b606060006120cc83600261281e565b6120d79060026127cb565b67ffffffffffffffff8111156120ef576120ef612999565b6040519080825280601f01601f191660200182016040528015612119576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106121505761215061296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106121b3576121b361296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006121ef84600261281e565b6121fa9060016127cb565b90505b6001811115612297577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061223b5761223b61296a565b1a60f81b8282815181106122515761225161296a565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936122908161289e565b90506121fd565b508315610fb7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e3565b606061230f8484600085612317565b949350505050565b6060824710156123a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016105e3565b843b612411576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105e3565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161243a9190612678565b60006040518083038185875af1925050503d8060008114612477576040519150601f19603f3d011682016040523d82523d6000602084013e61247c565b606091505b509150915061248c828286612497565b979650505050505050565b606083156124a6575081610fb7565b8251156124b65782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e3919061277a565b803573ffffffffffffffffffffffffffffffffffffffff8116811461250e57600080fd5b919050565b60006020828403121561252557600080fd5b610fb7826124ea565b60008060006060848603121561254357600080fd5b61254c846124ea565b925061255a602085016124ea565b9150604084013590509250925092565b6000806040838503121561257d57600080fd5b612586836124ea565b946020939093013593505050565b6000602082840312156125a657600080fd5b81518015158114610fb757600080fd5b6000602082840312156125c857600080fd5b5035919050565b600080604083850312156125e257600080fd5b823591506125f2602084016124ea565b90509250929050565b6000806040838503121561260e57600080fd5b50508035926020909101359150565b60006020828403121561262f57600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610fb757600080fd5b60006020828403121561267157600080fd5b5051919050565b6000825161268a818460208701612872565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516126cc816017850160208801612872565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612709816028840160208801612872565b01602801949350505050565b602080825282518282018190526000919060409081850190868401855b8281101561276d578151805173ffffffffffffffffffffffffffffffffffffffff168552860151868501529284019290850190600101612732565b5091979650505050505050565b6020815260008251806020840152612799816040850160208701612872565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156127de576127de61290c565b500190565b600082612819577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128565761285661290c565b500290565b60008282101561286d5761286d61290c565b500390565b60005b8381101561288d578181015183820152602001612875565b83811115611b365750506000910152565b6000816128ad576128ad61290c565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156129055761290561290c565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220435e7c90109f00019167d43dc76aac8aeff6b33d2d91eb4c0f714b744fd5089f64736f6c63430008070033

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

0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f51100000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c

-----Decoded View---------------
Arg [0] : _reward (address): 0x9F52c8ecbEe10e00D9faaAc5Ee9Ba0fF6550F511
Arg [1] : _rewardSource (address): 0x72a845C409951C7464e5764DA655a69Fd82Fbd8c

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000009f52c8ecbee10e00d9faaac5ee9ba0ff6550f511
Arg [1] : 00000000000000000000000072a845c409951c7464e5764da655a69fd82fbd8c


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.