false

Contract Address Details

0xf3Cd8F422ffE23434C011f43F61879373b31a913

Contract Name
LunarSunrise
Creator
0x3160f7–ae3e2c at 0x75511a–85cb7b
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
18,829 Transactions
Transfers
20,168 Transfers
Gas Used
2,130,136,285
Last Balance Update
88034086
Contract name:
LunarSunrise




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




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

Constructor Arguments


              

LunarSunrise.sol

{{
  "language": "Solidity",
  "sources": {
    "LunarSunrise.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.6.12;\n\nimport \"IERC20.sol\";\nimport \"SafeERC20.sol\";\n\nimport \"ContractGuard.sol\";\nimport \"IBasisAsset.sol\";\nimport \"ILunarTreasury.sol\";\n\ncontract LunarShareWrapper {\n    using SafeMath for uint256;\n    using SafeERC20 for IERC20;\n\n    IERC20 public share;\n\n    uint256 private _totalSupply;\n    mapping(address => uint256) private _balances;\n\n    function totalSupply() public view returns (uint256) {\n        return _totalSupply;\n    }\n\n    function balanceOf(address account) public view returns (uint256) {\n        return _balances[account];\n    }\n\n    function stake(uint256 amount) public virtual {\n        _totalSupply = _totalSupply.add(amount);\n        _balances[msg.sender] = _balances[msg.sender].add(amount);\n        share.safeTransferFrom(msg.sender, address(this), amount);\n    }\n\n    function withdraw(uint256 amount) public virtual {\n        uint256 masonShare = _balances[msg.sender];\n        require(masonShare >= amount, \"Masonry: withdraw request greater than staked amount\");\n        _totalSupply = _totalSupply.sub(amount);\n        _balances[msg.sender] = masonShare.sub(amount);\n        share.safeTransfer(msg.sender, amount);\n    }\n}\n\n/*\n    ____        __           _         _______\n   / __ \\____  / /___ ______(_)____   / ____(_)___  ____ _____  ________\n  / /_/ / __ \\/ / __ `/ ___/ / ___/  / /_  / / __ \\/ __ `/ __ \\/ ___/ _ \\\n / ____/ /_/ / / /_/ / /  / (__  )  / __/ / / / / / /_/ / / / / /__/  __/\n/_/    \\____/_/\\__,_/_/  /_/____/  /_/   /_/_/ /_/\\__,_/_/ /_/\\___/\\___/\n\n    https://polarisfinance.io\n*/\ncontract LunarSunrise is LunarShareWrapper, ContractGuard {\n    using SafeERC20 for IERC20;\n    using Address for address;\n    using SafeMath for uint256;\n\n    /* ========== DATA STRUCTURES ========== */\n\n    struct Masonseat {\n        uint256 lastSnapshotIndex;\n        uint256 rewardEarned;\n        uint256 epochTimerStart;\n    }\n\n    struct MasonrySnapshot {\n        uint256 time;\n        uint256 rewardReceived;\n        uint256 rewardPerShare;\n    }\n\n    /* ========== STATE VARIABLES ========== */\n\n    // governance\n    address public operator;\n\n    // flags\n    bool public initialized = false;\n\n    IERC20 public polar;\n    ITreasury public treasury;\n\n    mapping(address => Masonseat) public masons;\n    MasonrySnapshot[] public masonryHistory;\n\n    uint256 public withdrawLockupEpochs;\n    uint256 public rewardLockupEpochs;\n\n    /* ========== EVENTS ========== */\n\n    event Initialized(address indexed executor, uint256 at);\n    event Staked(address indexed user, uint256 amount);\n    event Withdrawn(address indexed user, uint256 amount);\n    event RewardPaid(address indexed user, uint256 reward);\n    event RewardAdded(address indexed user, uint256 reward);\n\n    /* ========== Modifiers =============== */\n\n    modifier onlyOperator() {\n        require(operator == msg.sender, \"Masonry: caller is not the operator\");\n        _;\n    }\n\n    modifier masonExists {\n        require(balanceOf(msg.sender) > 0, \"Masonry: The mason does not exist\");\n        _;\n    }\n\n    modifier updateReward(address mason) {\n        if (mason != address(0)) {\n            Masonseat memory seat = masons[mason];\n            seat.rewardEarned = earned(mason);\n            seat.lastSnapshotIndex = latestSnapshotIndex();\n            masons[mason] = seat;\n        }\n        _;\n    }\n\n    modifier notInitialized {\n        require(!initialized, \"Masonry: already initialized\");\n        _;\n    }\n\n    /* ========== GOVERNANCE ========== */\n\n    function initialize(\n        IERC20 _polar,\n        IERC20 _share,\n        ITreasury _treasury\n    ) public notInitialized {\n        polar = _polar;\n        share = _share;\n        treasury = _treasury;\n\n        MasonrySnapshot memory genesisSnapshot = MasonrySnapshot({time : block.number, rewardReceived : 0, rewardPerShare : 0});\n        masonryHistory.push(genesisSnapshot);\n\n        withdrawLockupEpochs = 3; // Lock for 3 epochs (18h) before release withdraw\n        rewardLockupEpochs = 2; // Lock for 2 epochs (12h) before release claimReward\n\n        initialized = true;\n        operator = msg.sender;\n        emit Initialized(msg.sender, block.number);\n    }\n\n    function setOperator(address _operator) external onlyOperator {\n        operator = _operator;\n    }\n\n    function setLockUp(uint256 _withdrawLockupEpochs, uint256 _rewardLockupEpochs) external onlyOperator {\n        require(_withdrawLockupEpochs >= _rewardLockupEpochs && _withdrawLockupEpochs <= 56, \"_withdrawLockupEpochs: out of range\"); // <= 2 week\n        withdrawLockupEpochs = _withdrawLockupEpochs;\n        rewardLockupEpochs = _rewardLockupEpochs;\n    }\n\n    /* ========== VIEW FUNCTIONS ========== */\n\n    // =========== Snapshot getters\n\n    function latestSnapshotIndex() public view returns (uint256) {\n        return masonryHistory.length.sub(1);\n    }\n\n    function getLatestSnapshot() internal view returns (MasonrySnapshot memory) {\n        return masonryHistory[latestSnapshotIndex()];\n    }\n\n    function getLastSnapshotIndexOf(address mason) public view returns (uint256) {\n        return masons[mason].lastSnapshotIndex;\n    }\n\n    function getLastSnapshotOf(address mason) internal view returns (MasonrySnapshot memory) {\n        return masonryHistory[getLastSnapshotIndexOf(mason)];\n    }\n\n    function canWithdraw(address mason) external view returns (bool) {\n        return masons[mason].epochTimerStart.add(withdrawLockupEpochs) <= treasury.epoch();\n    }\n\n    function canClaimReward(address mason) external view returns (bool) {\n        return masons[mason].epochTimerStart.add(rewardLockupEpochs) <= treasury.epoch();\n    }\n\n    function epoch() external view returns (uint256) {\n        return treasury.epoch();\n    }\n\n    function nextEpochPoint() external view returns (uint256) {\n        return treasury.nextEpochPoint();\n    }\n\n    function getLunarPrice() external view returns (uint256) {\n        return treasury.getlunarPrice();\n    }\n\n    // =========== Mason getters\n\n    function rewardPerShare() public view returns (uint256) {\n        return getLatestSnapshot().rewardPerShare;\n    }\n\n    function earned(address mason) public view returns (uint256) {\n        uint256 latestRPS = getLatestSnapshot().rewardPerShare;\n        uint256 storedRPS = getLastSnapshotOf(mason).rewardPerShare;\n\n        return balanceOf(mason).mul(latestRPS.sub(storedRPS)).div(1e18).add(masons[mason].rewardEarned);\n    }\n\n    /* ========== MUTATIVE FUNCTIONS ========== */\n\n    function stake(uint256 amount) public override onlyOneBlock updateReward(msg.sender) {\n        require(amount > 0, \"Masonry: Cannot stake 0\");\n        super.stake(amount);\n        masons[msg.sender].epochTimerStart = treasury.epoch(); // reset timer\n        emit Staked(msg.sender, amount);\n    }\n\n    function withdraw(uint256 amount) public override onlyOneBlock masonExists updateReward(msg.sender) {\n        require(amount > 0, \"Masonry: Cannot withdraw 0\");\n        require(masons[msg.sender].epochTimerStart.add(withdrawLockupEpochs) <= treasury.epoch(), \"Masonry: still in withdraw lockup\");\n        claimReward();\n        super.withdraw(amount);\n        emit Withdrawn(msg.sender, amount);\n    }\n\n    function exit() external {\n        withdraw(balanceOf(msg.sender));\n    }\n\n    function claimReward() public updateReward(msg.sender) {\n        uint256 reward = masons[msg.sender].rewardEarned;\n        if (reward > 0) {\n            require(masons[msg.sender].epochTimerStart.add(rewardLockupEpochs) <= treasury.epoch(), \"Masonry: still in reward lockup\");\n            masons[msg.sender].epochTimerStart = treasury.epoch(); // reset timer\n            masons[msg.sender].rewardEarned = 0;\n            polar.safeTransfer(msg.sender, reward);\n            emit RewardPaid(msg.sender, reward);\n        }\n    }\n\n    function allocateSeigniorage(uint256 amount) external onlyOneBlock onlyOperator {\n        require(amount > 0, \"Masonry: Cannot allocate 0\");\n        require(totalSupply() > 0, \"Masonry: Cannot allocate when totalSupply is 0\");\n\n        // Create & add new snapshot\n        uint256 prevRPS = getLatestSnapshot().rewardPerShare;\n        uint256 nextRPS = prevRPS.add(amount.mul(1e18).div(totalSupply()));\n\n        MasonrySnapshot memory newSnapshot = MasonrySnapshot({\n            time: block.number,\n            rewardReceived: amount,\n            rewardPerShare: nextRPS\n        });\n        masonryHistory.push(newSnapshot);\n\n        polar.safeTransferFrom(msg.sender, address(this), amount);\n        emit RewardAdded(msg.sender, amount);\n    }\n\n    function governanceRecoverUnsupported(IERC20 _token, uint256 _amount, address _to) external onlyOperator {\n        // do not allow to drain core tokens\n        require(address(_token) != address(polar), \"polar\");\n        require(address(_token) != address(share), \"share\");\n        _token.safeTransfer(_to, _amount);\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"
    },
    "ContractGuard.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.6.12;\n\ncontract ContractGuard {\n    mapping(uint256 => mapping(address => bool)) private _status;\n\n    function checkSameOriginReentranted() internal view returns (bool) {\n        return _status[block.number][tx.origin];\n    }\n\n    function checkSameSenderReentranted() internal view returns (bool) {\n        return _status[block.number][msg.sender];\n    }\n\n    modifier onlyOneBlock() {\n        require(!checkSameOriginReentranted(), \"ContractGuard: one block, one function\");\n        require(!checkSameSenderReentranted(), \"ContractGuard: one block, one function\");\n\n        _;\n\n        _status[block.number][tx.origin] = true;\n        _status[block.number][msg.sender] = true;\n    }\n}\n"
    },
    "IBasisAsset.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.6.0;\n\ninterface IBasisAsset {\n    function mint(address recipient, uint256 amount) external returns (bool);\n\n    function burn(uint256 amount) external;\n\n    function burnFrom(address from, uint256 amount) external;\n\n    function isOperator() external returns (bool);\n\n    function operator() external view returns (address);\n\n    function transferOperator(address newOperator_) external;\n}\n"
    },
    "ILunarTreasury.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.6.12;\n\ninterface ITreasury {\n    function epoch() external view returns (uint256);\n\n    function nextEpochPoint() external view returns (uint256);\n\n    function getlunarPrice() external view returns (uint256);\n\n    function buyBonds(uint256 amount, uint256 targetPrice) external;\n\n    function redeemBonds(uint256 amount, uint256 targetPrice) external;\n}\n"
    }
  },
  "settings": {
    "evmVersion": "istanbul",
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "libraries": {
      "LunarSunrise.sol": {}
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "abi"
        ]
      }
    }
  }
}}
        

Contract ABI

[{"type":"event","name":"Initialized","inputs":[{"type":"address","name":"executor","internalType":"address","indexed":true},{"type":"uint256","name":"at","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardAdded","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"reward","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"RewardPaid","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"reward","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Staked","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Withdrawn","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"allocateSeigniorage","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canClaimReward","inputs":[{"type":"address","name":"mason","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"canWithdraw","inputs":[{"type":"address","name":"mason","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"earned","inputs":[{"type":"address","name":"mason","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"epoch","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"exit","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLastSnapshotIndexOf","inputs":[{"type":"address","name":"mason","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLunarPrice","inputs":[]},{"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":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"address","name":"_polar","internalType":"contract IERC20"},{"type":"address","name":"_share","internalType":"contract IERC20"},{"type":"address","name":"_treasury","internalType":"contract ITreasury"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"initialized","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"latestSnapshotIndex","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"time","internalType":"uint256"},{"type":"uint256","name":"rewardReceived","internalType":"uint256"},{"type":"uint256","name":"rewardPerShare","internalType":"uint256"}],"name":"masonryHistory","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"lastSnapshotIndex","internalType":"uint256"},{"type":"uint256","name":"rewardEarned","internalType":"uint256"},{"type":"uint256","name":"epochTimerStart","internalType":"uint256"}],"name":"masons","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nextEpochPoint","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"operator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"polar","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardLockupEpochs","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"rewardPerShare","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLockUp","inputs":[{"type":"uint256","name":"_withdrawLockupEpochs","internalType":"uint256"},{"type":"uint256","name":"_rewardLockupEpochs","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOperator","inputs":[{"type":"address","name":"_operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"share","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"stake","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ITreasury"}],"name":"treasury","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawLockupEpochs","inputs":[]}]
              

Contract Creation Code

0x60806040526004805460ff60a01b1916905534801561001d57600080fd5b50611fa38061002d6000396000f3fe608060405234801561001057600080fd5b50600436106101ce5760003560e01c8063570ca73511610104578063a694fc3a116100a2578063c0c53b8b11610071578063c0c53b8b1461044e578063c5967c2614610486578063e0f6dc9e1461048e578063e9fad8ee146104b4576101ce565b8063a694fc3a146103fb578063a8d5fd6514610418578063b3ab15fb14610420578063b88a802f14610446576101ce565b8063714b4658116100de578063714b4658146103755780638cd9a27f1461039b578063900cf0cf146103d657806397ffe1d7146103de576101ce565b8063570ca7351461033f57806361d027b31461034757806370a082311461034f576101ce565b80631e85cd65116101715780632ffaaa091161014b5780632ffaaa09146102d65780633f9e3f04146102f9578063446a2ec81461030157806354575af414610309576101ce565b80631e85cd65146102a757806322749a7d146102af5780632e1a7d4d146102b7576101ce565b80630996dc30116101ad5780630996dc301461024d578063158ef93e1461027157806318160ddd1461027957806319262d3014610281576101ce565b80628cc262146101d3578063022ba18d1461020b578063046335d014610213575b600080fd5b6101f9600480360360208110156101e957600080fd5b50356001600160a01b03166104bc565b60408051918252519081900360200190f35b6101f961053d565b6102396004803603602081101561022957600080fd5b50356001600160a01b0316610543565b604080519115158252519081900360200190f35b6102556105e4565b604080516001600160a01b039092168252519081900360200190f35b6102396105f3565b6101f9610603565b6102396004803603602081101561029757600080fd5b50356001600160a01b0316610609565b6101f96106a2565b6101f96106a8565b6102d4600480360360208110156102cd57600080fd5b503561071e565b005b6102d4600480360360408110156102ec57600080fd5b5080359060200135610a38565b6101f9610ad8565b6101f9610aee565b6102d46004803603606081101561031f57600080fd5b506001600160a01b03813581169160208101359160409091013516610b01565b610255610bf9565b610255610c08565b6101f96004803603602081101561036557600080fd5b50356001600160a01b0316610c17565b6101f96004803603602081101561038b57600080fd5b50356001600160a01b0316610c32565b6103b8600480360360208110156103b157600080fd5b5035610c4d565b60408051938452602084019290925282820152519081900360600190f35b6101f9610c7d565b6102d4600480360360208110156103f457600080fd5b5035610cc2565b6102d46004803603602081101561041157600080fd5b5035610fa6565b61025561122b565b6102d46004803603602081101561043657600080fd5b50356001600160a01b031661123a565b6102d46112a5565b6102d46004803603606081101561046457600080fd5b506001600160a01b038135811691602081013582169160409091013516611532565b6101f96116e4565b6103b8600480360360208110156104a457600080fd5b50356001600160a01b0316611729565b6102d461174a565b6000806104c761175d565b60400151905060006104d8846117b5565b6040908101516001600160a01b0386166000908152600760205291909120600101549091506105359061052f670de0b6b3a764000061052961051a8787611810565b6105238a610c17565b90611872565b906118d2565b90611939565b949350505050565b600a5481565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561058857600080fd5b505afa15801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b5051600a546001600160a01b0384166000908152600760205260409020600201546105dc91611939565b111592915050565b6005546001600160a01b031681565b600454600160a01b900460ff1681565b60015490565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561064e57600080fd5b505afa158015610662573d6000803e3d6000fd5b505050506040513d602081101561067857600080fd5b50516009546001600160a01b0384166000908152600760205260409020600201546105dc91611939565b60095481565b60065460408051637662d07160e11b815290516000926001600160a01b03169163ecc5a0e2916004808301926020929190829003018186803b1580156106ed57600080fd5b505afa158015610701573d6000803e3d6000fd5b505050506040513d602081101561071757600080fd5b5051905090565b610726611993565b156107625760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b61076a6119b4565b156107a65760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b60006107b133610c17565b116107ed5760405162461bcd60e51b8152600401808060200182810382526021815260200180611edc6021913960400191505060405180910390fd5b338015610887576107fc611df1565b506001600160a01b0381166000908152600760209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152610845826104bc565b6020820152610852610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b600082116108dc576040805162461bcd60e51b815260206004820152601a60248201527f4d61736f6e72793a2043616e6e6f742077697468647261772030000000000000604482015290519081900360640190fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561092a57600080fd5b505afa15801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516009543360009081526007602052604090206002015461097591611939565b11156109b25760405162461bcd60e51b8152600401808060200182810382526021815260200180611efd6021913960400191505060405180910390fd5b6109ba6112a5565b6109c3826119d5565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250504360009081526003602090815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6004546001600160a01b03163314610a815760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b808210158015610a92575060388211155b610acd5760405162461bcd60e51b8152600401808060200182810382526023815260200180611eb96023913960400191505060405180910390fd5b600991909155600a55565b600854600090610ae9906001611810565b905090565b6000610af861175d565b60400151905090565b6004546001600160a01b03163314610b4a5760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b6005546001600160a01b0384811691161415610b95576040805162461bcd60e51b81526020600482015260056024820152643837b630b960d91b604482015290519081900360640190fd5b6000546001600160a01b0384811691161415610be0576040805162461bcd60e51b8152602060048201526005602482015264736861726560d81b604482015290519081900360640190fd5b610bf46001600160a01b0384168284611a65565b505050565b6004546001600160a01b031681565b6006546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6001600160a01b031660009081526007602052604090205490565b60088181548110610c5a57fe5b600091825260209091206003909102018054600182015460029092015490925083565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b1580156106ed57600080fd5b610cca611993565b15610d065760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b610d0e6119b4565b15610d4a5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b6004546001600160a01b03163314610d935760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b60008111610de8576040805162461bcd60e51b815260206004820152601a60248201527f4d61736f6e72793a2043616e6e6f7420616c6c6f636174652030000000000000604482015290519081900360640190fd5b6000610df2610603565b11610e2e5760405162461bcd60e51b815260040180806020018281038252602e815260200180611e13602e913960400191505060405180910390fd5b6000610e3861175d565b6040015190506000610e67610e60610e4e610603565b61052986670de0b6b3a7640000611872565b8390611939565b9050610e71611df1565b5060408051606081018252438152602081018581529181018381526008805460018101825560009190915282517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360039092029182015592517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4840155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee590920191909155600554610f2f906001600160a01b0316333087611ab7565b60408051858152905133917fac24935fd910bc682b5ccb1a07b718cadf8cf2f6d1404c4f3ddc3662dae40e29919081900360200190a250504360009081526003602090815260408083203284529091528082208054600160ff19918216811790925533845291909220805490911690911790555050565b610fae611993565b15610fea5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b610ff26119b4565b1561102e5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b3380156110c85761103d611df1565b506001600160a01b0381166000908152600760209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152611086826104bc565b6020820152611093610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b6000821161111d576040805162461bcd60e51b815260206004820152601760248201527f4d61736f6e72793a2043616e6e6f74207374616b652030000000000000000000604482015290519081900360640190fd5b61112682611b17565b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561117457600080fd5b505afa158015611188573d6000803e3d6000fd5b505050506040513d602081101561119e57600080fd5b505133600081815260076020908152604091829020600201939093558051858152905191927f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d92918290030190a250504360009081526003602090815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6000546001600160a01b031681565b6004546001600160a01b031633146112835760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b33801561133f576112b4611df1565b506001600160a01b03811660009081526007602090815260409182902082516060810184528154815260018201549281019290925260020154918101919091526112fd826104bc565b602082015261130a610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b33600090815260076020526040902060010154801561152e57600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a657600080fd5b505afa1580156113ba573d6000803e3d6000fd5b505050506040513d60208110156113d057600080fd5b5051600a54336000908152600760205260409020600201546113f191611939565b1115611444576040805162461bcd60e51b815260206004820152601f60248201527f4d61736f6e72793a207374696c6c20696e20726577617264206c6f636b757000604482015290519081900360640190fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d60208110156114bc57600080fd5b505133600081815260076020526040812060028101939093556001909201919091556005546114f7916001600160a01b039091169083611a65565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b600454600160a01b900460ff1615611591576040805162461bcd60e51b815260206004820152601c60248201527f4d61736f6e72793a20616c726561647920696e697469616c697a656400000000604482015290519081900360640190fd5b600580546001600160a01b038086166001600160a01b0319928316179092556000805485841690831617905560068054928416929091169190911790556115d6611df1565b50604080516060810182524380825260006020808401828152848601838152600880546001810182559452855160039485027ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee381019190915591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4830155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee5909101556009919091556002600a55600480546001600160a01b031960ff60a01b19909116600160a01b171633908117909155845192835293519293927f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce799281900390910190a250505050565b600654604080516362cb3e1360e11b815290516000926001600160a01b03169163c5967c26916004808301926020929190829003018186803b1580156106ed57600080fd5b60076020526000908152604090208054600182015460029092015490919083565b61175b61175633610c17565b61071e565b565b611765611df1565b600861176f610ad8565b8154811061177957fe5b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b6117bd611df1565b60086117c883610c32565b815481106117d257fe5b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b600082821115611867576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000826118815750600061186c565b8282028284828161188e57fe5b04146118cb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e986021913960400191505060405180910390fd5b9392505050565b6000808211611928576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161193157fe5b049392505050565b6000828201838110156118cb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b43600090815260036020908152604080832032845290915290205460ff1690565b43600090815260036020908152604080832033845290915290205460ff1690565b3360009081526002602052604090205481811015611a245760405162461bcd60e51b8152600401808060200182810382526034815260200180611e416034913960400191505060405180910390fd5b600154611a319083611810565b600155611a3e8183611810565b33600081815260026020526040812092909255905461152e916001600160a01b0390911690845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bf4908490611b70565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b11908590611b70565b50505050565b600154611b249082611939565b60015533600090815260026020526040902054611b419082611939565b336000818152600260205260408120929092559054611b6d916001600160a01b03909116903084611ab7565b50565b6060611bc5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c219092919063ffffffff16565b805190915015610bf457808060200190516020811015611be457600080fd5b5051610bf45760405162461bcd60e51b815260040180806020018281038252602a815260200180611f1e602a913960400191505060405180910390fd5b6060610535848460008585611c3585611d47565b611c86576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611cc55780518252601f199092019160209182019101611ca6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611d27576040519150601f19603f3d011682016040523d82523d6000602084013e611d2c565b606091505b5091509150611d3c828286611d4d565b979650505050505050565b3b151590565b60608315611d5c5750816118cb565b825115611d6c5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611db6578181015183820152602001611d9e565b50505050905090810190601f168015611de35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040518060600160405280600081526020016000815260200160008152509056fe4d61736f6e72793a2043616e6e6f7420616c6c6f63617465207768656e20746f74616c537570706c7920697320304d61736f6e72793a20776974686472617720726571756573742067726561746572207468616e207374616b656420616d6f756e744d61736f6e72793a2063616c6c6572206973206e6f7420746865206f70657261746f72536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f77697468647261774c6f636b757045706f6368733a206f7574206f662072616e67654d61736f6e72793a20546865206d61736f6e20646f6573206e6f742065786973744d61736f6e72793a207374696c6c20696e207769746864726177206c6f636b75705361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6ea26469706673582212208e237895bcd8731119552d88d9283d1776a83a80a2316312a6d2f988ddade9e764736f6c634300060c0033

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101ce5760003560e01c8063570ca73511610104578063a694fc3a116100a2578063c0c53b8b11610071578063c0c53b8b1461044e578063c5967c2614610486578063e0f6dc9e1461048e578063e9fad8ee146104b4576101ce565b8063a694fc3a146103fb578063a8d5fd6514610418578063b3ab15fb14610420578063b88a802f14610446576101ce565b8063714b4658116100de578063714b4658146103755780638cd9a27f1461039b578063900cf0cf146103d657806397ffe1d7146103de576101ce565b8063570ca7351461033f57806361d027b31461034757806370a082311461034f576101ce565b80631e85cd65116101715780632ffaaa091161014b5780632ffaaa09146102d65780633f9e3f04146102f9578063446a2ec81461030157806354575af414610309576101ce565b80631e85cd65146102a757806322749a7d146102af5780632e1a7d4d146102b7576101ce565b80630996dc30116101ad5780630996dc301461024d578063158ef93e1461027157806318160ddd1461027957806319262d3014610281576101ce565b80628cc262146101d3578063022ba18d1461020b578063046335d014610213575b600080fd5b6101f9600480360360208110156101e957600080fd5b50356001600160a01b03166104bc565b60408051918252519081900360200190f35b6101f961053d565b6102396004803603602081101561022957600080fd5b50356001600160a01b0316610543565b604080519115158252519081900360200190f35b6102556105e4565b604080516001600160a01b039092168252519081900360200190f35b6102396105f3565b6101f9610603565b6102396004803603602081101561029757600080fd5b50356001600160a01b0316610609565b6101f96106a2565b6101f96106a8565b6102d4600480360360208110156102cd57600080fd5b503561071e565b005b6102d4600480360360408110156102ec57600080fd5b5080359060200135610a38565b6101f9610ad8565b6101f9610aee565b6102d46004803603606081101561031f57600080fd5b506001600160a01b03813581169160208101359160409091013516610b01565b610255610bf9565b610255610c08565b6101f96004803603602081101561036557600080fd5b50356001600160a01b0316610c17565b6101f96004803603602081101561038b57600080fd5b50356001600160a01b0316610c32565b6103b8600480360360208110156103b157600080fd5b5035610c4d565b60408051938452602084019290925282820152519081900360600190f35b6101f9610c7d565b6102d4600480360360208110156103f457600080fd5b5035610cc2565b6102d46004803603602081101561041157600080fd5b5035610fa6565b61025561122b565b6102d46004803603602081101561043657600080fd5b50356001600160a01b031661123a565b6102d46112a5565b6102d46004803603606081101561046457600080fd5b506001600160a01b038135811691602081013582169160409091013516611532565b6101f96116e4565b6103b8600480360360208110156104a457600080fd5b50356001600160a01b0316611729565b6102d461174a565b6000806104c761175d565b60400151905060006104d8846117b5565b6040908101516001600160a01b0386166000908152600760205291909120600101549091506105359061052f670de0b6b3a764000061052961051a8787611810565b6105238a610c17565b90611872565b906118d2565b90611939565b949350505050565b600a5481565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561058857600080fd5b505afa15801561059c573d6000803e3d6000fd5b505050506040513d60208110156105b257600080fd5b5051600a546001600160a01b0384166000908152600760205260409020600201546105dc91611939565b111592915050565b6005546001600160a01b031681565b600454600160a01b900460ff1681565b60015490565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b15801561064e57600080fd5b505afa158015610662573d6000803e3d6000fd5b505050506040513d602081101561067857600080fd5b50516009546001600160a01b0384166000908152600760205260409020600201546105dc91611939565b60095481565b60065460408051637662d07160e11b815290516000926001600160a01b03169163ecc5a0e2916004808301926020929190829003018186803b1580156106ed57600080fd5b505afa158015610701573d6000803e3d6000fd5b505050506040513d602081101561071757600080fd5b5051905090565b610726611993565b156107625760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b61076a6119b4565b156107a65760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b60006107b133610c17565b116107ed5760405162461bcd60e51b8152600401808060200182810382526021815260200180611edc6021913960400191505060405180910390fd5b338015610887576107fc611df1565b506001600160a01b0381166000908152600760209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152610845826104bc565b6020820152610852610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b600082116108dc576040805162461bcd60e51b815260206004820152601a60248201527f4d61736f6e72793a2043616e6e6f742077697468647261772030000000000000604482015290519081900360640190fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561092a57600080fd5b505afa15801561093e573d6000803e3d6000fd5b505050506040513d602081101561095457600080fd5b50516009543360009081526007602052604090206002015461097591611939565b11156109b25760405162461bcd60e51b8152600401808060200182810382526021815260200180611efd6021913960400191505060405180910390fd5b6109ba6112a5565b6109c3826119d5565b60408051838152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250504360009081526003602090815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6004546001600160a01b03163314610a815760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b808210158015610a92575060388211155b610acd5760405162461bcd60e51b8152600401808060200182810382526023815260200180611eb96023913960400191505060405180910390fd5b600991909155600a55565b600854600090610ae9906001611810565b905090565b6000610af861175d565b60400151905090565b6004546001600160a01b03163314610b4a5760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b6005546001600160a01b0384811691161415610b95576040805162461bcd60e51b81526020600482015260056024820152643837b630b960d91b604482015290519081900360640190fd5b6000546001600160a01b0384811691161415610be0576040805162461bcd60e51b8152602060048201526005602482015264736861726560d81b604482015290519081900360640190fd5b610bf46001600160a01b0384168284611a65565b505050565b6004546001600160a01b031681565b6006546001600160a01b031681565b6001600160a01b031660009081526002602052604090205490565b6001600160a01b031660009081526007602052604090205490565b60088181548110610c5a57fe5b600091825260209091206003909102018054600182015460029092015490925083565b6006546040805163900cf0cf60e01b815290516000926001600160a01b03169163900cf0cf916004808301926020929190829003018186803b1580156106ed57600080fd5b610cca611993565b15610d065760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b610d0e6119b4565b15610d4a5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b6004546001600160a01b03163314610d935760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b60008111610de8576040805162461bcd60e51b815260206004820152601a60248201527f4d61736f6e72793a2043616e6e6f7420616c6c6f636174652030000000000000604482015290519081900360640190fd5b6000610df2610603565b11610e2e5760405162461bcd60e51b815260040180806020018281038252602e815260200180611e13602e913960400191505060405180910390fd5b6000610e3861175d565b6040015190506000610e67610e60610e4e610603565b61052986670de0b6b3a7640000611872565b8390611939565b9050610e71611df1565b5060408051606081018252438152602081018581529181018381526008805460018101825560009190915282517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360039092029182015592517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4840155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee590920191909155600554610f2f906001600160a01b0316333087611ab7565b60408051858152905133917fac24935fd910bc682b5ccb1a07b718cadf8cf2f6d1404c4f3ddc3662dae40e29919081900360200190a250504360009081526003602090815260408083203284529091528082208054600160ff19918216811790925533845291909220805490911690911790555050565b610fae611993565b15610fea5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b610ff26119b4565b1561102e5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f486026913960400191505060405180910390fd5b3380156110c85761103d611df1565b506001600160a01b0381166000908152600760209081526040918290208251606081018452815481526001820154928101929092526002015491810191909152611086826104bc565b6020820152611093610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b6000821161111d576040805162461bcd60e51b815260206004820152601760248201527f4d61736f6e72793a2043616e6e6f74207374616b652030000000000000000000604482015290519081900360640190fd5b61112682611b17565b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561117457600080fd5b505afa158015611188573d6000803e3d6000fd5b505050506040513d602081101561119e57600080fd5b505133600081815260076020908152604091829020600201939093558051858152905191927f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d92918290030190a250504360009081526003602090815260408083203284529091528082208054600160ff1991821681179092553384529190922080549091169091179055565b6000546001600160a01b031681565b6004546001600160a01b031633146112835760405162461bcd60e51b8152600401808060200182810382526023815260200180611e756023913960400191505060405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b33801561133f576112b4611df1565b506001600160a01b03811660009081526007602090815260409182902082516060810184528154815260018201549281019290925260020154918101919091526112fd826104bc565b602082015261130a610ad8565b81526001600160a01b038216600090815260076020908152604091829020835181559083015160018201559101516002909101555b33600090815260076020526040902060010154801561152e57600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156113a657600080fd5b505afa1580156113ba573d6000803e3d6000fd5b505050506040513d60208110156113d057600080fd5b5051600a54336000908152600760205260409020600201546113f191611939565b1115611444576040805162461bcd60e51b815260206004820152601f60248201527f4d61736f6e72793a207374696c6c20696e20726577617264206c6f636b757000604482015290519081900360640190fd5b600660009054906101000a90046001600160a01b03166001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561149257600080fd5b505afa1580156114a6573d6000803e3d6000fd5b505050506040513d60208110156114bc57600080fd5b505133600081815260076020526040812060028101939093556001909201919091556005546114f7916001600160a01b039091169083611a65565b60408051828152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a25b5050565b600454600160a01b900460ff1615611591576040805162461bcd60e51b815260206004820152601c60248201527f4d61736f6e72793a20616c726561647920696e697469616c697a656400000000604482015290519081900360640190fd5b600580546001600160a01b038086166001600160a01b0319928316179092556000805485841690831617905560068054928416929091169190911790556115d6611df1565b50604080516060810182524380825260006020808401828152848601838152600880546001810182559452855160039485027ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee381019190915591517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee4830155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee5909101556009919091556002600a55600480546001600160a01b031960ff60a01b19909116600160a01b171633908117909155845192835293519293927f25ff68dd81b34665b5ba7e553ee5511bf6812e12adb4a7e2c0d9e26b3099ce799281900390910190a250505050565b600654604080516362cb3e1360e11b815290516000926001600160a01b03169163c5967c26916004808301926020929190829003018186803b1580156106ed57600080fd5b60076020526000908152604090208054600182015460029092015490919083565b61175b61175633610c17565b61071e565b565b611765611df1565b600861176f610ad8565b8154811061177957fe5b90600052602060002090600302016040518060600160405290816000820154815260200160018201548152602001600282015481525050905090565b6117bd611df1565b60086117c883610c32565b815481106117d257fe5b906000526020600020906003020160405180606001604052908160008201548152602001600182015481526020016002820154815250509050919050565b600082821115611867576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b6000826118815750600061186c565b8282028284828161188e57fe5b04146118cb5760405162461bcd60e51b8152600401808060200182810382526021815260200180611e986021913960400191505060405180910390fd5b9392505050565b6000808211611928576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161193157fe5b049392505050565b6000828201838110156118cb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b43600090815260036020908152604080832032845290915290205460ff1690565b43600090815260036020908152604080832033845290915290205460ff1690565b3360009081526002602052604090205481811015611a245760405162461bcd60e51b8152600401808060200182810382526034815260200180611e416034913960400191505060405180910390fd5b600154611a319083611810565b600155611a3e8183611810565b33600081815260026020526040812092909255905461152e916001600160a01b0390911690845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610bf4908490611b70565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611b11908590611b70565b50505050565b600154611b249082611939565b60015533600090815260026020526040902054611b419082611939565b336000818152600260205260408120929092559054611b6d916001600160a01b03909116903084611ab7565b50565b6060611bc5826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611c219092919063ffffffff16565b805190915015610bf457808060200190516020811015611be457600080fd5b5051610bf45760405162461bcd60e51b815260040180806020018281038252602a815260200180611f1e602a913960400191505060405180910390fd5b6060610535848460008585611c3585611d47565b611c86576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611cc55780518252601f199092019160209182019101611ca6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611d27576040519150601f19603f3d011682016040523d82523d6000602084013e611d2c565b606091505b5091509150611d3c828286611d4d565b979650505050505050565b3b151590565b60608315611d5c5750816118cb565b825115611d6c5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611db6578181015183820152602001611d9e565b50505050905090810190601f168015611de35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6040518060600160405280600081526020016000815260200160008152509056fe4d61736f6e72793a2043616e6e6f7420616c6c6f63617465207768656e20746f74616c537570706c7920697320304d61736f6e72793a20776974686472617720726571756573742067726561746572207468616e207374616b656420616d6f756e744d61736f6e72793a2063616c6c6572206973206e6f7420746865206f70657261746f72536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775f77697468647261774c6f636b757045706f6368733a206f7574206f662072616e67654d61736f6e72793a20546865206d61736f6e20646f6573206e6f742065786973744d61736f6e72793a207374696c6c20696e207769746864726177206c6f636b75705361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564436f6e747261637447756172643a206f6e6520626c6f636b2c206f6e652066756e6374696f6ea26469706673582212208e237895bcd8731119552d88d9283d1776a83a80a2316312a6d2f988ddade9e764736f6c634300060c0033