false

Contract Address Details

0x6aB21bB15Ef208c37A7c8794EBd9ac422cB755a3

Contract Name
LunarGenesisRewardPool
Creator
0x3160f7–ae3e2c at 0xc81020–ce5eba
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
2,016 Transactions
Transfers
2,799 Transfers
Gas Used
194,788,007
Last Balance Update
87916333
Contract name:
LunarGenesisRewardPool




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
Verified at
2023-02-09T13:14:41.711449Z

Constructor Arguments

00000000000000000000000025e801eb75859ba4052c4ac4233cec0264eadf8c0000000000000000000000000000000000000000000000000000000062373360000000000000000000000000fd7cbeae92ed5ec9c58b88fe5af9a78115a82cd8

Arg [0] (address) : 0x25e801eb75859ba4052c4ac4233cec0264eadf8c
Arg [1] (uint256) : 1647784800
Arg [2] (address) : 0xfd7cbeae92ed5ec9c58b88fe5af9a78115a82cd8

              

LunarGenesisRewardPool.sol

{{
  "language": "Solidity",
  "sources": {
    "LunarGenesisRewardPool.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.6.12;\n\nimport \"IERC20.sol\";\nimport \"SafeERC20.sol\";\nimport \"SafeMath.sol\";\n\n// Note that this pool has no minter key of LUNAR (rewards).\n// Instead, the governance will call LUNAR distributeReward method and send reward to this pool at the beginning.\ncontract LunarGenesisRewardPool {\n    using SafeMath for uint256;\n    using SafeERC20 for IERC20;\n\n    // governance\n    address public operator;\n\n    // Info of each user.\n    struct UserInfo {\n        uint256 amount; // How many tokens the user has provided.\n        uint256 rewardDebt; // Reward debt. See explanation below.\n    }\n\n    // Info of each pool.\n    struct PoolInfo {\n        IERC20 token; // Address of LP token contract.\n        uint256 allocPoint; // How many allocation points assigned to this pool. LUNAR to distribute.\n        uint256 lastRewardTime; // Last time that LUNAR distribution occurs.\n        uint256 accLunarPerShare; // Accumulated LUNAR per share, times 1e18. See below.\n        bool isStarted; // if lastRewardBlock has passed\n        uint256 daoFee;\n    }\n\n    IERC20 public lunar;\n\n    // Info of each pool.\n    PoolInfo[] public poolInfo;\n\n    // Info of each user that stakes LP tokens.\n    mapping(uint256 => mapping(address => UserInfo)) public userInfo;\n\n    // Total allocation points. Must be the sum of all allocation points in all pools.\n    uint256 public totalAllocPoint = 0;\n\n    // The time when LUNAR mining starts.\n    uint256 public poolStartTime;\n\n    // The time when LUNAR mining ends.\n    uint256 public poolEndTime;\n\n    address public daoAddress;\n    // TESTNET\n    // uint256 public lunarPerSecond = 3.0555555e18; // 11000 LUNAR / (1h * 60min * 60s)\n    // uint256 public runningTime = 24 hours; // 1 hours\n    // uint256 public constant TOTAL_REWARDS = 11000e18;\n    // END TESTNET\n\n    // MAINNET\n    uint256 public lunarPerSecond = 0.0081018519e18; // 700 LUNAR / (24h * 60min * 60s)\n    uint256 public runningTime = 1 days; // 1 days\n    uint256 public constant TOTAL_REWARDS = 700e18;\n    // END MAINNET\n\n    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);\n    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);\n    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);\n    event RewardPaid(address indexed user, uint256 amount);\n\n    constructor(\n        address _lunar,\n        uint256 _poolStartTime,\n        address _daoAddress\n    ) public {\n        require(block.timestamp < _poolStartTime, \"late\");\n        if (_lunar != address(0)) lunar = IERC20(_lunar);\n        daoAddress = _daoAddress;\n        poolStartTime = _poolStartTime;\n        poolEndTime = poolStartTime + runningTime;\n        operator = msg.sender;\n    }\n\n    modifier onlyOperator() {\n        require(operator == msg.sender, \"LunarGenesisPool: caller is not the operator\");\n        _;\n    }\n\n    function checkPoolDuplicate(IERC20 _token) internal view {\n        uint256 length = poolInfo.length;\n        for (uint256 pid = 0; pid < length; ++pid) {\n            require(poolInfo[pid].token != _token, \"LunarGenesisPool: existing pool?\");\n        }\n    }\n\n    // Add a new token to the pool. Can only be called by the owner.\n    function add(\n        uint256 _allocPoint,\n        IERC20 _token,\n        bool _withUpdate,\n        uint256 _lastRewardTime,\n        uint _daoFee\n    ) public onlyOperator {\n        require(_daoFee <= 100, \"fee can not be above 1%\");\n        checkPoolDuplicate(_token);\n        if (_withUpdate) {\n            massUpdatePools();\n        }\n        if (block.timestamp < poolStartTime) {\n            // chef is sleeping\n            if (_lastRewardTime == 0) {\n                _lastRewardTime = poolStartTime;\n            } else {\n                if (_lastRewardTime < poolStartTime) {\n                    _lastRewardTime = poolStartTime;\n                }\n            }\n        } else {\n            // chef is cooking\n            if (_lastRewardTime == 0 || _lastRewardTime < block.timestamp) {\n                _lastRewardTime = block.timestamp;\n            }\n        }\n        bool _isStarted =\n        (_lastRewardTime <= poolStartTime) ||\n        (_lastRewardTime <= block.timestamp);\n        poolInfo.push(PoolInfo({\n            token : _token,\n            allocPoint : _allocPoint,\n            lastRewardTime : _lastRewardTime,\n            accLunarPerShare : 0,\n            isStarted : _isStarted,\n            daoFee: _daoFee\n            }));\n        if (_isStarted) {\n            totalAllocPoint = totalAllocPoint.add(_allocPoint);\n        }\n    }\n\n    // Update the given pool's LUNAR allocation point. Can only be called by the owner.\n    function set(uint256 _pid, uint256 _allocPoint) public onlyOperator {\n        massUpdatePools();\n        PoolInfo storage pool = poolInfo[_pid];\n        if (pool.isStarted) {\n            totalAllocPoint = totalAllocPoint.sub(pool.allocPoint).add(\n                _allocPoint\n            );\n        }\n        pool.allocPoint = _allocPoint;\n    }\n\n    // Return accumulate rewards over the given _from to _to block.\n    function getGeneratedReward(uint256 _fromTime, uint256 _toTime) public view returns (uint256) {\n        if (_fromTime >= _toTime) return 0;\n        if (_toTime >= poolEndTime) {\n            if (_fromTime >= poolEndTime) return 0;\n            if (_fromTime <= poolStartTime) return poolEndTime.sub(poolStartTime).mul(lunarPerSecond);\n            return poolEndTime.sub(_fromTime).mul(lunarPerSecond);\n        } else {\n            if (_toTime <= poolStartTime) return 0;\n            if (_fromTime <= poolStartTime) return _toTime.sub(poolStartTime).mul(lunarPerSecond);\n            return _toTime.sub(_fromTime).mul(lunarPerSecond);\n        }\n    }\n\n    // View function to see pending LUNAR on frontend.\n    function pendingLUNAR(uint256 _pid, address _user) external view returns (uint256) {\n        PoolInfo storage pool = poolInfo[_pid];\n        UserInfo storage user = userInfo[_pid][_user];\n        uint256 accLunarPerShare = pool.accLunarPerShare;\n        uint256 tokenSupply = pool.token.balanceOf(address(this));\n        if (block.timestamp > pool.lastRewardTime && tokenSupply != 0) {\n            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);\n            uint256 _lunarReward = _generatedReward.mul(pool.allocPoint).div(totalAllocPoint);\n            accLunarPerShare = accLunarPerShare.add(_lunarReward.mul(1e18).div(tokenSupply));\n        }\n        return user.amount.mul(accLunarPerShare).div(1e18).sub(user.rewardDebt);\n    }\n\n    // Update reward variables for all pools. Be careful of gas spending!\n    function massUpdatePools() public {\n        uint256 length = poolInfo.length;\n        for (uint256 pid = 0; pid < length; ++pid) {\n            updatePool(pid);\n        }\n    }\n\n    // Update reward variables of the given pool to be up-to-date.\n    function updatePool(uint256 _pid) public {\n        PoolInfo storage pool = poolInfo[_pid];\n        if (block.timestamp <= pool.lastRewardTime) {\n            return;\n        }\n        uint256 tokenSupply = pool.token.balanceOf(address(this));\n        if (tokenSupply == 0) {\n            pool.lastRewardTime = block.timestamp;\n            return;\n        }\n        if (!pool.isStarted) {\n            pool.isStarted = true;\n            totalAllocPoint = totalAllocPoint.add(pool.allocPoint);\n        }\n        if (totalAllocPoint > 0) {\n            uint256 _generatedReward = getGeneratedReward(pool.lastRewardTime, block.timestamp);\n            uint256 _lunarReward = _generatedReward.mul(pool.allocPoint).div(totalAllocPoint);\n            pool.accLunarPerShare = pool.accLunarPerShare.add(_lunarReward.mul(1e18).div(tokenSupply));\n        }\n        pool.lastRewardTime = block.timestamp;\n    }\n\n    // Deposit LP tokens.\n    function deposit(uint256 _pid, uint256 _amount) public {\n        address _sender = msg.sender;\n        PoolInfo storage pool = poolInfo[_pid];\n        UserInfo storage user = userInfo[_pid][_sender];\n        updatePool(_pid);\n        if (user.amount > 0) {\n            uint256 _pending = user.amount.mul(pool.accLunarPerShare).div(1e18).sub(user.rewardDebt);\n            if (_pending > 0) {\n                safeLunarTransfer(_sender, _pending);\n                emit RewardPaid(_sender, _pending);\n            }\n        }\n        if (_amount > 0) {\n            pool.token.safeTransferFrom(_sender, address(this), _amount);\n            if (pool.daoFee > 0) {\n                uint256 _fee = _amount.mul(pool.daoFee).div(10000);\n                pool.token.safeTransfer(daoAddress, _fee);\n                user.amount = user.amount.add(_amount.sub(_fee));\n            }\n            else {\n                user.amount = user.amount.add(_amount);\n            }\n            \n        }\n        user.rewardDebt = user.amount.mul(pool.accLunarPerShare).div(1e18);\n        emit Deposit(_sender, _pid, _amount);\n    }\n\n    // Withdraw LP tokens.\n    function withdraw(uint256 _pid, uint256 _amount) public {\n        address _sender = msg.sender;\n        PoolInfo storage pool = poolInfo[_pid];\n        UserInfo storage user = userInfo[_pid][_sender];\n        require(user.amount >= _amount, \"withdraw: not good\");\n        updatePool(_pid);\n        uint256 _pending = user.amount.mul(pool.accLunarPerShare).div(1e18).sub(user.rewardDebt);\n        if (_pending > 0) {\n            safeLunarTransfer(_sender, _pending);\n            emit RewardPaid(_sender, _pending);\n        }\n        if (_amount > 0) {\n            user.amount = user.amount.sub(_amount);\n            pool.token.safeTransfer(_sender, _amount);\n        }\n        user.rewardDebt = user.amount.mul(pool.accLunarPerShare).div(1e18);\n        emit Withdraw(_sender, _pid, _amount);\n    }\n\n    // Withdraw without caring about rewards. EMERGENCY ONLY.\n    function emergencyWithdraw(uint256 _pid) public {\n        PoolInfo storage pool = poolInfo[_pid];\n        UserInfo storage user = userInfo[_pid][msg.sender];\n        uint256 _amount = user.amount;\n        user.amount = 0;\n        user.rewardDebt = 0;\n        pool.token.safeTransfer(msg.sender, _amount);\n        emit EmergencyWithdraw(msg.sender, _pid, _amount);\n    }\n\n    // Safe LUNAR transfer function, just in case if rounding error causes pool to not have enough LUNARs.\n    function safeLunarTransfer(address _to, uint256 _amount) internal {\n        uint256 _lunarBalance = lunar.balanceOf(address(this));\n        if (_lunarBalance > 0) {\n            if (_amount > _lunarBalance) {\n                lunar.safeTransfer(_to, _lunarBalance);\n            } else {\n                lunar.safeTransfer(_to, _amount);\n            }\n        }\n    }\n\n    function setOperator(address _operator) external onlyOperator {\n        operator = _operator;\n    }\n\n    function governanceRecoverUnsupported(IERC20 _token, uint256 amount, address to) external onlyOperator {\n        if (block.timestamp < poolEndTime + 90 days) {\n            // do not allow to drain core token (LUNAR or lps) if less than 90 days after pool ends\n            require(_token != lunar, \"lunar\");\n            uint256 length = poolInfo.length;\n            for (uint256 pid = 0; pid < length; ++pid) {\n                PoolInfo storage pool = poolInfo[pid];\n                require(_token != pool.token, \"pool.token\");\n            }\n        }\n        _token.safeTransfer(to, amount);\n    }\n\n    function setDaoFee(uint256 _pid, uint _fee) external onlyOperator {\n        require(_fee <= 100, \"fee can not be above 1%\");\n        PoolInfo storage pool = poolInfo[_pid];\n        pool.daoFee = _fee;\n    }\n}\n"
    },
    "IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `recipient`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `sender` to `recipient` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
    },
    "SafeERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\nimport \"IERC20.sol\";\nimport \"SafeMath.sol\";\nimport \"Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using SafeMath for uint256;\n    using Address for address;\n\n    function safeTransfer(IERC20 token, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(IERC20 token, address spender, uint256 value) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        // solhint-disable-next-line max-line-length\n        require((value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).add(value);\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n        uint256 newAllowance = token.allowance(address(this), spender).sub(value, \"SafeERC20: decreased allowance below zero\");\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length > 0) { // Return data is optional\n            // solhint-disable-next-line max-line-length\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
    },
    "SafeMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.0 <0.8.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        uint256 c = a + b;\n        if (c < a) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b > a) return (false, 0);\n        return (true, a - b);\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n        // benefit is lost if 'b' is also tested.\n        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n        if (a == 0) return (true, 0);\n        uint256 c = a * b;\n        if (c / a != b) return (false, 0);\n        return (true, c);\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a / b);\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        if (b == 0) return (false, 0);\n        return (true, a % b);\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        uint256 c = a + b;\n        require(c >= a, \"SafeMath: addition overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b <= a, \"SafeMath: subtraction overflow\");\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (a == 0) return 0;\n        uint256 c = a * b;\n        require(c / a == b, \"SafeMath: multiplication overflow\");\n        return c;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b > 0, \"SafeMath: division by zero\");\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        require(b > 0, \"SafeMath: modulo by zero\");\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b <= a, errorMessage);\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\n        require(b > 0, errorMessage);\n        return a % b;\n    }\n}\n"
    },
    "Address.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.6.2 <0.8.0;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize, which returns 0 for contracts in\n        // construction, since the code is only stored at the end of the\n        // constructor execution.\n\n        uint256 size;\n        // solhint-disable-next-line no-inline-assembly\n        assembly { size := extcodesize(account) }\n        return size > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\n        (bool success, ) = recipient.call{ value: amount }(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain`call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n      return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.call{ value: value }(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        // solhint-disable-next-line avoid-low-level-calls\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return _verifyCallResult(success, returndata, errorMessage);\n    }\n\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                // solhint-disable-next-line no-inline-assembly\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"
    }
  },
  "settings": {
    "evmVersion": "istanbul",
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "libraries": {
      "LunarGenesisRewardPool.sol": {}
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "abi"
        ]
      }
    }
  }
}}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_lunar","internalType":"address"},{"type":"uint256","name":"_poolStartTime","internalType":"uint256"},{"type":"address","name":"_daoAddress","internalType":"address"}]},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardPaid","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"TOTAL_REWARDS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"uint256","name":"_allocPoint","internalType":"uint256"},{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"bool","name":"_withUpdate","internalType":"bool"},{"type":"uint256","name":"_lastRewardTime","internalType":"uint256"},{"type":"uint256","name":"_daoFee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"daoAddress","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getGeneratedReward","inputs":[{"type":"uint256","name":"_fromTime","internalType":"uint256"},{"type":"uint256","name":"_toTime","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"governanceRecoverUnsupported","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"lunar","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lunarPerSecond","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"massUpdatePools","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"operator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingLUNAR","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolEndTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"token","internalType":"contract IERC20"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardTime","internalType":"uint256"},{"type":"uint256","name":"accLunarPerShare","internalType":"uint256"},{"type":"bool","name":"isStarted","internalType":"bool"},{"type":"uint256","name":"daoFee","internalType":"uint256"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolStartTime","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"runningTime","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"set","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_allocPoint","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDaoFee","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_fee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOperator","inputs":[{"type":"address","name":"_operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updatePool","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"rewardDebt","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_pid","internalType":"uint256"},{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
              

Contract Creation Code

0x60806040526000600455661cc8976485b7006008556201518060095534801561002757600080fd5b50604051611a83380380611a838339818101604052606081101561004a57600080fd5b5080516020820151604090920151909190428211610098576040805162461bcd60e51b815260206004808301919091526024820152636c61746560e01b604482015290519081900360640190fd5b6001600160a01b038316156100c357600180546001600160a01b0319166001600160a01b0385161790555b600780546001600160a01b039092166001600160a01b031992831617905560058290556009549091016006556000805490911633179055506119798061010a6000396000f3fe608060405234801561001057600080fd5b506004361061014d5760003560e01c80635f96dc11116100c357806393f1a40b1161007c57806393f1a40b1461037e578063943f013d146103c3578063a3514773146103cb578063b3ab15fb146103d3578063d7e981c7146103f9578063e2bbb158146104015761014d565b80635f96dc11146102d757806362e006c7146102df578063630b5ba11461031f5780636ab25a6f146103275780636e271dd514610353578063771d1baf1461035b5761014d565b8063231f0c6a11610115578063231f0c6a14610219578063441a3e701461023c57806351eb05a61461025f5780635312ea8e1461027c57806354575af414610299578063570ca735146102cf5761014d565b806309cf6091146101525780631526fe271461016c57806317caf6f1146101c85780631ab06ee5146101d05780632131c68c146101f5575b600080fd5b61015a610424565b60408051918252519081900360200190f35b6101896004803603602081101561018257600080fd5b5035610431565b604080516001600160a01b03909716875260208701959095528585019390935260608501919091521515608084015260a0830152519081900360c00190f35b61015a610484565b6101f3600480360360408110156101e657600080fd5b508035906020013561048a565b005b6101fd610538565b604080516001600160a01b039092168252519081900360200190f35b61015a6004803603604081101561022f57600080fd5b5080359060200135610547565b6101f36004803603604081101561025257600080fd5b508035906020013561060c565b6101f36004803603602081101561027557600080fd5b50356107c9565b6101f36004803603602081101561029257600080fd5b5035610927565b6101f3600480360360608110156102af57600080fd5b506001600160a01b038135811691602081013591604090910135166109c3565b6101fd610b0a565b61015a610b19565b6101f3600480360360a08110156102f557600080fd5b508035906001600160a01b0360208201351690604081013515159060608101359060800135610b1f565b6101f3610d9c565b61015a6004803603604081101561033d57600080fd5b50803590602001356001600160a01b0316610dbf565b61015a610f1b565b6101f36004803603604081101561037157600080fd5b5080359060200135610f21565b6103aa6004803603604081101561039457600080fd5b50803590602001356001600160a01b0316610fe4565b6040805192835260208301919091528051918290030190f35b61015a611008565b61015a61100e565b6101f3600480360360208110156103e957600080fd5b50356001600160a01b0316611014565b6101fd61107f565b6101f36004803603604081101561041757600080fd5b508035906020013561108e565b6825f273933db570000081565b6002818154811061043e57fe5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0390941695509193909260ff9091169086565b60045481565b6000546001600160a01b031633146104d35760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6104db610d9c565b6000600283815481106104ea57fe5b60009182526020909120600690910201600481015490915060ff16156105315761052d82610527836001015460045461126390919063ffffffff16565b906112c0565b6004555b6001015550565b6007546001600160a01b031681565b600081831061055857506000610606565b60065482106105c057600654831061057257506000610606565b60055483116105a55761059e60085461059860055460065461126390919063ffffffff16565b90611321565b9050610606565b61059e6008546105988560065461126390919063ffffffff16565b60055482116105d157506000610606565b60055483116105f55761059e6008546105986005548561126390919063ffffffff16565b60085461059e906105988486611263565b92915050565b600033905060006002848154811061062057fe5b600091825260208083208784526003825260408085206001600160a01b0388168652909252922080546006909202909201925084111561069c576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6106a5856107c9565b60006106e282600101546106dc670de0b6b3a76400006106d68760030154876000015461132190919063ffffffff16565b9061137a565b90611263565b90508015610734576106f484826113e1565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b841561075e5781546107469086611263565b8255825461075e906001600160a01b03168587611497565b6003830154825461077c91670de0b6b3a7640000916106d691611321565b600183015560408051868152905187916001600160a01b038716917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b6000600282815481106107d857fe5b90600052602060002090600602019050806002015442116107f95750610924565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561084357600080fd5b505afa158015610857573d6000803e3d6000fd5b505050506040513d602081101561086d57600080fd5b5051905080610883575042600290910155610924565b600482015460ff166108b4576004808301805460ff1916600190811790915583015490546108b0916112c0565b6004555b6004541561091b5760006108cc836002015442610547565b905060006108ed6004546106d686600101548561132190919063ffffffff16565b9050610913610908846106d684670de0b6b3a7640000611321565b6003860154906112c0565b600385015550505b50426002909101555b50565b60006002828154811061093657fe5b600091825260208083208584526003825260408085203380875293528420805485825560018201959095556006909302018054909450919291610986916001600160a01b03919091169083611497565b604080518281529051859133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a350505050565b6000546001600160a01b03163314610a0c5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6006546276a70001421015610af1576001546001600160a01b0384811691161415610a66576040805162461bcd60e51b8152602060048201526005602482015264363ab730b960d91b604482015290519081900360640190fd5b60025460005b81811015610aee57600060028281548110610a8357fe5b6000918252602090912060069091020180549091506001600160a01b0387811691161415610ae5576040805162461bcd60e51b815260206004820152600a6024820152693837b7b6173a37b5b2b760b11b604482015290519081900360640190fd5b50600101610a6c565b50505b610b056001600160a01b0384168284611497565b505050565b6000546001600160a01b031681565b60055481565b6000546001600160a01b03163314610b685760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6064811115610bb8576040805162461bcd60e51b81526020600482015260176024820152766665652063616e206e6f742062652061626f766520312560481b604482015290519081900360640190fd5b610bc1846114e9565b8215610bcf57610bcf610d9c565b600554421015610bfd5781610be8576005549150610bf8565b600554821015610bf85760055491505b610c12565b811580610c0957504282105b15610c12574291505b600060055483111580610c255750428311155b6040805160c0810182526001600160a01b038881168252602082018a8152928201878152600060608401818152861580156080870190815260a087018b815260028054600181018255955296517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600690950294850180546001600160a01b031916919097161790955595517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf83015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad082015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad182015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad28201805460ff191691151591909117905590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad390910155909150610d9457600454610d9090876112c0565b6004555b505050505050565b60025460005b81811015610dbb57610db3816107c9565b600101610da2565b5050565b60008060028481548110610dcf57fe5b60009182526020808320878452600380835260408086206001600160a01b03808b168852908552818720600690960290930191820154825482516370a0823160e01b815230600482015292519398509596909590949316926370a0823192602480840193829003018186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d6020811015610e7157600080fd5b5051600285015490915042118015610e8857508015155b15610ee5576000610e9d856002015442610547565b90506000610ebe6004546106d688600101548561132190919063ffffffff16565b9050610ee0610ed9846106d684670de0b6b3a7640000611321565b85906112c0565b935050505b610f1083600101546106dc670de0b6b3a76400006106d686886000015461132190919063ffffffff16565b979650505050505050565b60065481565b6000546001600160a01b03163314610f6a5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6064811115610fba576040805162461bcd60e51b81526020600482015260176024820152766665652063616e206e6f742062652061626f766520312560481b604482015290519081900360640190fd5b600060028381548110610fc957fe5b60009182526020909120600560069092020101919091555050565b60036020908152600092835260408084209091529082529020805460019091015482565b60095481565b60085481565b6000546001600160a01b0316331461105d5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b60003390506000600284815481106110a257fe5b600091825260208083208784526003825260408085206001600160a01b03881686529092529220600690910290910191506110dc856107c9565b80541561116857600061111482600101546106dc670de0b6b3a76400006106d68760030154876000015461132190919063ffffffff16565b905080156111665761112684826113e1565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505b83156111f9578154611185906001600160a01b0316843087611583565b6005820154156111ea5760006111ae6127106106d685600501548861132190919063ffffffff16565b60075484549192506111cd916001600160a01b03908116911683611497565b6111e26111da8683611263565b8354906112c0565b8255506111f9565b80546111f690856112c0565b81555b6003820154815461121791670de0b6b3a7640000916106d691611321565b600182015560408051858152905186916001600160a01b038616917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b6000828211156112ba576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008282018381101561131a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008261133057506000610606565b8282028284828161133d57fe5b041461131a5760405162461bcd60e51b81526004018080602001828103825260218152602001806118cd6021913960400191505060405180910390fd5b60008082116113d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816113d957fe5b049392505050565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561142c57600080fd5b505afa158015611440573d6000803e3d6000fd5b505050506040513d602081101561145657600080fd5b505190508015610b0557808211156114845760015461147f906001600160a01b03168483611497565b610b05565b600154610b05906001600160a01b031684845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b059084906115e3565b60025460005b81811015610b0557826001600160a01b03166002828154811061150e57fe5b60009182526020909120600690910201546001600160a01b0316141561157b576040805162461bcd60e51b815260206004820181905260248201527f4c756e617247656e65736973506f6f6c3a206578697374696e6720706f6f6c3f604482015290519081900360640190fd5b6001016114ef565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526115dd9085906115e3565b50505050565b6060611638826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116949092919063ffffffff16565b805190915015610b055780806020019051602081101561165757600080fd5b5051610b055760405162461bcd60e51b815260040180806020018281038252602a81526020018061191a602a913960400191505060405180910390fd5b60606116a384846000856116ab565b949350505050565b6060824710156116ec5760405162461bcd60e51b81526004018080602001828103825260268152602001806118a76026913960400191505060405180910390fd5b6116f5856117fc565b611746576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106117855780518252601f199092019160209182019101611766565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146117e7576040519150601f19603f3d011682016040523d82523d6000602084013e6117ec565b606091505b5091509150610f10828286611802565b3b151590565b6060831561181157508161131a565b8251156118215782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561186b578181015183820152602001611853565b50505050905090810190601f1680156118985780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774c756e617247656e65736973506f6f6c3a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c0b558f8edc4cdfd24f8445b233b2b9cbd2420e0315f07a9050bf76a8f8c3d8a64736f6c634300060c003300000000000000000000000025e801eb75859ba4052c4ac4233cec0264eadf8c0000000000000000000000000000000000000000000000000000000062373360000000000000000000000000fd7cbeae92ed5ec9c58b88fe5af9a78115a82cd8

Deployed ByteCode

0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80635f96dc11116100c357806393f1a40b1161007c57806393f1a40b1461037e578063943f013d146103c3578063a3514773146103cb578063b3ab15fb146103d3578063d7e981c7146103f9578063e2bbb158146104015761014d565b80635f96dc11146102d757806362e006c7146102df578063630b5ba11461031f5780636ab25a6f146103275780636e271dd514610353578063771d1baf1461035b5761014d565b8063231f0c6a11610115578063231f0c6a14610219578063441a3e701461023c57806351eb05a61461025f5780635312ea8e1461027c57806354575af414610299578063570ca735146102cf5761014d565b806309cf6091146101525780631526fe271461016c57806317caf6f1146101c85780631ab06ee5146101d05780632131c68c146101f5575b600080fd5b61015a610424565b60408051918252519081900360200190f35b6101896004803603602081101561018257600080fd5b5035610431565b604080516001600160a01b03909716875260208701959095528585019390935260608501919091521515608084015260a0830152519081900360c00190f35b61015a610484565b6101f3600480360360408110156101e657600080fd5b508035906020013561048a565b005b6101fd610538565b604080516001600160a01b039092168252519081900360200190f35b61015a6004803603604081101561022f57600080fd5b5080359060200135610547565b6101f36004803603604081101561025257600080fd5b508035906020013561060c565b6101f36004803603602081101561027557600080fd5b50356107c9565b6101f36004803603602081101561029257600080fd5b5035610927565b6101f3600480360360608110156102af57600080fd5b506001600160a01b038135811691602081013591604090910135166109c3565b6101fd610b0a565b61015a610b19565b6101f3600480360360a08110156102f557600080fd5b508035906001600160a01b0360208201351690604081013515159060608101359060800135610b1f565b6101f3610d9c565b61015a6004803603604081101561033d57600080fd5b50803590602001356001600160a01b0316610dbf565b61015a610f1b565b6101f36004803603604081101561037157600080fd5b5080359060200135610f21565b6103aa6004803603604081101561039457600080fd5b50803590602001356001600160a01b0316610fe4565b6040805192835260208301919091528051918290030190f35b61015a611008565b61015a61100e565b6101f3600480360360208110156103e957600080fd5b50356001600160a01b0316611014565b6101fd61107f565b6101f36004803603604081101561041757600080fd5b508035906020013561108e565b6825f273933db570000081565b6002818154811061043e57fe5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b0390941695509193909260ff9091169086565b60045481565b6000546001600160a01b031633146104d35760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6104db610d9c565b6000600283815481106104ea57fe5b60009182526020909120600690910201600481015490915060ff16156105315761052d82610527836001015460045461126390919063ffffffff16565b906112c0565b6004555b6001015550565b6007546001600160a01b031681565b600081831061055857506000610606565b60065482106105c057600654831061057257506000610606565b60055483116105a55761059e60085461059860055460065461126390919063ffffffff16565b90611321565b9050610606565b61059e6008546105988560065461126390919063ffffffff16565b60055482116105d157506000610606565b60055483116105f55761059e6008546105986005548561126390919063ffffffff16565b60085461059e906105988486611263565b92915050565b600033905060006002848154811061062057fe5b600091825260208083208784526003825260408085206001600160a01b0388168652909252922080546006909202909201925084111561069c576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b6106a5856107c9565b60006106e282600101546106dc670de0b6b3a76400006106d68760030154876000015461132190919063ffffffff16565b9061137a565b90611263565b90508015610734576106f484826113e1565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b841561075e5781546107469086611263565b8255825461075e906001600160a01b03168587611497565b6003830154825461077c91670de0b6b3a7640000916106d691611321565b600183015560408051868152905187916001600160a01b038716917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a3505050505050565b6000600282815481106107d857fe5b90600052602060002090600602019050806002015442116107f95750610924565b8054604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561084357600080fd5b505afa158015610857573d6000803e3d6000fd5b505050506040513d602081101561086d57600080fd5b5051905080610883575042600290910155610924565b600482015460ff166108b4576004808301805460ff1916600190811790915583015490546108b0916112c0565b6004555b6004541561091b5760006108cc836002015442610547565b905060006108ed6004546106d686600101548561132190919063ffffffff16565b9050610913610908846106d684670de0b6b3a7640000611321565b6003860154906112c0565b600385015550505b50426002909101555b50565b60006002828154811061093657fe5b600091825260208083208584526003825260408085203380875293528420805485825560018201959095556006909302018054909450919291610986916001600160a01b03919091169083611497565b604080518281529051859133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a350505050565b6000546001600160a01b03163314610a0c5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6006546276a70001421015610af1576001546001600160a01b0384811691161415610a66576040805162461bcd60e51b8152602060048201526005602482015264363ab730b960d91b604482015290519081900360640190fd5b60025460005b81811015610aee57600060028281548110610a8357fe5b6000918252602090912060069091020180549091506001600160a01b0387811691161415610ae5576040805162461bcd60e51b815260206004820152600a6024820152693837b7b6173a37b5b2b760b11b604482015290519081900360640190fd5b50600101610a6c565b50505b610b056001600160a01b0384168284611497565b505050565b6000546001600160a01b031681565b60055481565b6000546001600160a01b03163314610b685760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6064811115610bb8576040805162461bcd60e51b81526020600482015260176024820152766665652063616e206e6f742062652061626f766520312560481b604482015290519081900360640190fd5b610bc1846114e9565b8215610bcf57610bcf610d9c565b600554421015610bfd5781610be8576005549150610bf8565b600554821015610bf85760055491505b610c12565b811580610c0957504282105b15610c12574291505b600060055483111580610c255750428311155b6040805160c0810182526001600160a01b038881168252602082018a8152928201878152600060608401818152861580156080870190815260a087018b815260028054600181018255955296517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600690950294850180546001600160a01b031916919097161790955595517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf83015591517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad082015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad182015590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad28201805460ff191691151591909117905590517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad390910155909150610d9457600454610d9090876112c0565b6004555b505050505050565b60025460005b81811015610dbb57610db3816107c9565b600101610da2565b5050565b60008060028481548110610dcf57fe5b60009182526020808320878452600380835260408086206001600160a01b03808b168852908552818720600690960290930191820154825482516370a0823160e01b815230600482015292519398509596909590949316926370a0823192602480840193829003018186803b158015610e4757600080fd5b505afa158015610e5b573d6000803e3d6000fd5b505050506040513d6020811015610e7157600080fd5b5051600285015490915042118015610e8857508015155b15610ee5576000610e9d856002015442610547565b90506000610ebe6004546106d688600101548561132190919063ffffffff16565b9050610ee0610ed9846106d684670de0b6b3a7640000611321565b85906112c0565b935050505b610f1083600101546106dc670de0b6b3a76400006106d686886000015461132190919063ffffffff16565b979650505050505050565b60065481565b6000546001600160a01b03163314610f6a5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b6064811115610fba576040805162461bcd60e51b81526020600482015260176024820152766665652063616e206e6f742062652061626f766520312560481b604482015290519081900360640190fd5b600060028381548110610fc957fe5b60009182526020909120600560069092020101919091555050565b60036020908152600092835260408084209091529082529020805460019091015482565b60095481565b60085481565b6000546001600160a01b0316331461105d5760405162461bcd60e51b815260040180806020018281038252602c8152602001806118ee602c913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b60003390506000600284815481106110a257fe5b600091825260208083208784526003825260408085206001600160a01b03881686529092529220600690910290910191506110dc856107c9565b80541561116857600061111482600101546106dc670de0b6b3a76400006106d68760030154876000015461132190919063ffffffff16565b905080156111665761112684826113e1565b6040805182815290516001600160a01b038616917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b505b83156111f9578154611185906001600160a01b0316843087611583565b6005820154156111ea5760006111ae6127106106d685600501548861132190919063ffffffff16565b60075484549192506111cd916001600160a01b03908116911683611497565b6111e26111da8683611263565b8354906112c0565b8255506111f9565b80546111f690856112c0565b81555b6003820154815461121791670de0b6b3a7640000916106d691611321565b600182015560408051858152905186916001600160a01b038616917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b6000828211156112ba576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008282018381101561131a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008261133057506000610606565b8282028284828161133d57fe5b041461131a5760405162461bcd60e51b81526004018080602001828103825260218152602001806118cd6021913960400191505060405180910390fd5b60008082116113d0576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816113d957fe5b049392505050565b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561142c57600080fd5b505afa158015611440573d6000803e3d6000fd5b505050506040513d602081101561145657600080fd5b505190508015610b0557808211156114845760015461147f906001600160a01b03168483611497565b610b05565b600154610b05906001600160a01b031684845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b059084906115e3565b60025460005b81811015610b0557826001600160a01b03166002828154811061150e57fe5b60009182526020909120600690910201546001600160a01b0316141561157b576040805162461bcd60e51b815260206004820181905260248201527f4c756e617247656e65736973506f6f6c3a206578697374696e6720706f6f6c3f604482015290519081900360640190fd5b6001016114ef565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526115dd9085906115e3565b50505050565b6060611638826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116949092919063ffffffff16565b805190915015610b055780806020019051602081101561165757600080fd5b5051610b055760405162461bcd60e51b815260040180806020018281038252602a81526020018061191a602a913960400191505060405180910390fd5b60606116a384846000856116ab565b949350505050565b6060824710156116ec5760405162461bcd60e51b81526004018080602001828103825260268152602001806118a76026913960400191505060405180910390fd5b6116f5856117fc565b611746576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106117855780518252601f199092019160209182019101611766565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146117e7576040519150601f19603f3d011682016040523d82523d6000602084013e6117ec565b606091505b5091509150610f10828286611802565b3b151590565b6060831561181157508161131a565b8251156118215782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561186b578181015183820152602001611853565b50505050905090810190601f1680156118985780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774c756e617247656e65736973506f6f6c3a2063616c6c6572206973206e6f7420746865206f70657261746f725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220c0b558f8edc4cdfd24f8445b233b2b9cbd2420e0315f07a9050bf76a8f8c3d8a64736f6c634300060c0033