false
false
0

Contract Address Details

0xf43Db9BeC8F8626Cb5ADD409C7EBc7272c8f5F8f

Contract Name
SOYLocalFarm
Creator
0x67c20e–f52b67 at 0xecb8fa–f6c7be
Balance
0 CLO
Tokens
Fetching tokens...
Transactions
5,544 Transactions
Transfers
322,326 Transfers
Gas Used
592,985,419
Last Balance Update
16287431
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
SOYLocalFarm




Optimization enabled
true
Compiler version
v0.8.0+commit.c7dfd78e




Optimization runs
200
EVM Version
default




Verified at
2024-09-26T15:34:17.301212Z

Constructor Arguments

0x00000000000000000000000064fa36acd0d13472fd786b03afc9c52ad5fcf0230000000000000000000000009fae2529863bd691b4a7171bdfcf33c7ebb10a650000000000000000000000001cee27d0627ce8a81df9b4d7eee0d753b8c2f613

Arg [0] (address) : 0x64fa36acd0d13472fd786b03afc9c52ad5fcf023
Arg [1] (address) : 0x9fae2529863bd691b4a7171bdfcf33c7ebb10a65
Arg [2] (address) : 0x1cee27d0627ce8a81df9b4d7eee0d753b8c2f613

              

Contract source code

// SPDX-License-Identifier: No License (None)
pragma solidity 0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

abstract contract IERC223 {
    /**
     * @dev Returns the balance of the `who` address.
     */
    function balanceOf(address who) public virtual view returns (uint);
        
    /**
     * @dev Transfers `value` tokens from `msg.sender` to `to` address
     * and returns `true` on success.
     */
    function transfer(address to, uint value) public virtual returns (bool success);
        
    /**
     * @dev Transfers `value` tokens from `msg.sender` to `to` address with `data` parameter
     * and returns `true` on success.
     */
    function transfer(address to, uint value, bytes memory data) public virtual returns (bool success);
     
     /**
     * @dev Event that is fired on successful transfer.
     */
    event Transfer(address indexed from, address indexed to, uint value);
    
     /**
     * @dev Additional event that is fired on successful transfer and logs transfer metadata,
     *      this event is implemented to keep Transfer event compatible with ERC20.
     */
    event TransferData(bytes data);
}

abstract contract IERC223Recipient {
    
 struct ERC223TransferInfo
    {
        address token_contract;
        address sender;
        uint256 value;
        bytes   data;
    }
    ERC223TransferInfo private tkn;
    
/**
 * @dev Standard ERC223 function that will handle incoming token transfers.
 *
 * @param _from  Token sender address.
 * @param _value Amount of tokens.
 * @param _data  Transaction metadata.
 */
    function tokenReceived(address _from, uint _value, bytes calldata _data) public virtual;
}


/**
 * @dev Collection of functions related to the address type,
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * This test is non-exhaustive, and there may be false-negatives: during the
     * execution of a contract's constructor, its address will be reported as
     * not containing a contract.
     *
     * > It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies in extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }
}

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 */
contract ReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}

abstract contract RewardsRecipient {
    address public globalFarm;

    function notifyRewardAmount(uint256 reward) external virtual;

    modifier onlyGlobalFarm() {
        require(msg.sender == globalFarm, "Caller is not global Farm contract");
        _;
    }
}


interface ISimplifiedGlobalFarm {
    function mintFarmingReward(address _localFarm) external;
    function getAllocationX1000(address _farm) external view returns (uint256);
    function getRewardPerSecond() external view returns (uint256);
    function rewardMintingAvailable(address _farm) external view returns (bool);
    function farmExists(address _farmAddress) external view returns (bool);
}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 *
 * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/ownership/Ownable.sol
 * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
 * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
 * build/artifacts folder) as well as the vanilla Ownable implementation from an openzeppelin version.
 */
contract Ownable {
    address private _owner;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor () {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), _owner);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(),"Not Owner");
        _;
    }

    /**
     * @return true if `msg.sender` is the owner of the contract.
     */
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

    /**
     * @dev Allows the current owner to relinquish control of the contract.
     * @notice Renouncing to ownership will leave the contract without an owner.
     * It will not be possible to call the functions with the `onlyOwner`
     * modifier anymore.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0),"Zero address not allowed");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

contract SOYLocalFarm is IERC223Recipient, ReentrancyGuard, RewardsRecipient, Ownable
{

    /* ========== EVENTS ========== */

    event RewardAdded(uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
    
    
    /* ========== VARIABLES ========== */

    struct UserInfo {
        uint256 amount;     // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
    }
    // Info of each user that stakes LP tokens.
    mapping (address => UserInfo) public userInfo;
    
    uint256 public limitAmount = 1e40; // Prevents accumulatedRewardPerShare from overflowing.
    
    IERC223 public rewardsToken;
    IERC223 public lpToken;
    
    uint256 public lastRewardTimestamp;  // Last block number that SOY distribution occurs.
    uint256 public accumulatedRewardPerShare; // Accumulated SOY per share, times 1e18. See below.

    /* ========== CONSTRUCTOR ========== */

    constructor(
        address _rewardsDistribution,   // GlobalFarm contract
        address _rewardsToken,          // SOY token
        address _lpToken           // LP token that will be staked in this Local Farm
    )
    {
        rewardsToken        = IERC223(_rewardsToken);
        lpToken             = IERC223(_lpToken);
        globalFarm          = _rewardsDistribution;
    }
    
    /* ========== ERC223 transaction handlers ====== */
    
    // Analogue of deposit() function.
    function tokenReceived(address _from, uint256 _amount, bytes memory _data) public override nonReentrant
    {
        require(msg.sender == address(lpToken), "Trying to deposit wrong token");
        require(userInfo[_from].amount + _amount <= limitAmount, 'exceed the top');

        update();
        if (userInfo[_from].amount > 0) {
            uint256 pending = userInfo[_from].amount * accumulatedRewardPerShare / 1e18 - userInfo[_from].rewardDebt;
            if(pending > 0) {
                rewardsToken.transfer(address(_from), pending);
            }
        }
        if(_amount > 0) {
            userInfo[_from].amount += _amount;
        }
        userInfo[_from].rewardDebt = userInfo[_from].amount * accumulatedRewardPerShare / 1e18;
        
        emit Staked(_from, _amount);
    }
    
    
    function notifyRewardAmount(uint256 reward) external override
    {
        emit RewardAdded(reward);
    }
    
    function getRewardPerSecond() public view returns (uint256)
    {
        return ISimplifiedGlobalFarm(globalFarm).getRewardPerSecond();
    }
    
    function getAllocationX1000() public view returns (uint256)
    {
        return ISimplifiedGlobalFarm(globalFarm).getAllocationX1000(address(this));
    }
    
    /* ========== Farm Functions ====== */

    // View function to see pending Reward on frontend.
    function pendingReward(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[_user];
        uint256 _accumulatedRewardPerShare = accumulatedRewardPerShare;
        uint256 lpSupply = lpToken.balanceOf(address(this));
        if (block.timestamp > lastRewardTimestamp && lpSupply != 0) {
            uint256 multiplier = block.timestamp - lastRewardTimestamp;
            uint256 _reward = multiplier * getRewardPerSecond() * getAllocationX1000() / 1000;
            _accumulatedRewardPerShare = accumulatedRewardPerShare + (_reward * 1e18 / lpSupply);
        }
        return user.amount * _accumulatedRewardPerShare / 1e18 - user.rewardDebt;
    }
    
    

    // Update reward variables of this Local Farm to be up-to-date.
    function update() public reward_request {
        if (block.timestamp <= lastRewardTimestamp) {
            return;
        }
        uint256 lpSupply = lpToken.balanceOf(address(this));
       
        if (lpSupply == 0) {
            lastRewardTimestamp = block.timestamp;
            return;
        }
        uint256 multiplier = block.timestamp - lastRewardTimestamp;
        
        // This silently calculates "assumed" reward!
        // This function does not take contract's actual balance into account
        // Global Farm and `reward_request` modifier are responsible for keeping this contract
        // stocked with funds to pay actual rewards.
        
        uint256 _reward = multiplier * getRewardPerSecond() * getAllocationX1000() / 1000;
        accumulatedRewardPerShare = accumulatedRewardPerShare + (_reward * 1e18 / lpSupply);
        lastRewardTimestamp = block.timestamp;
    }
    
    

    // Withdraw tokens from STAKING.
    function withdraw(uint256 _amount) public nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        
        update();
        uint256 pending = user.amount * accumulatedRewardPerShare / 1e18 - user.rewardDebt;
        if(pending > 0) {
            rewardsToken.transfer(address(msg.sender), pending);
        }
        if(_amount > 0) {
            user.amount = user.amount - _amount;
            lpToken.transfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount * accumulatedRewardPerShare / 1e18;

        emit Withdraw(msg.sender, _amount);
    }

    // Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw() public nonReentrant {
        UserInfo storage user = userInfo[msg.sender];
        lpToken.transfer(address(msg.sender), user.amount);
        emit EmergencyWithdraw(msg.sender, user.amount);
        user.amount = 0;
        user.rewardDebt = 0;
    }
    
    // Special function that allows owner to withdraw remaining unclaimed tokens of inactive farms
    function withdrawInactiveReward() public onlyOwner
    {
        require(!ISimplifiedGlobalFarm(globalFarm).farmExists(address(this)), "Farm must not be active");
        
        rewardsToken.transfer(msg.sender, rewardsToken.balanceOf(address(this)));
    }

/*
    // Withdraw reward. EMERGENCY ONLY.
    function emergencyRewardWithdraw(uint256 _amount) public onlyOwner {
        require(_amount < rewardToken.balanceOf(address(this)), 'not enough token');
        rewardsToken.transfer(address(msg.sender), _amount);
    }
    */
    
    
    modifier reward_request
    {
        if(ISimplifiedGlobalFarm(globalFarm).rewardMintingAvailable(address(this)))
        {
            ISimplifiedGlobalFarm(globalFarm).mintFarmingReward(address(this));
        }
        _;
    }
    
    function rescueERC20(address token, address to) external onlyOwner {
        require(token != address(rewardsToken), "Reward token is not prone to ERC20 issues");
        require(token != address(lpToken), "LP token is not prone to ERC20 issues");
        
        uint256 value = IERC223(token).balanceOf(address(this));
        IERC223(token).transfer(to, value);
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_rewardsDistribution","internalType":"address"},{"type":"address","name":"_rewardsToken","internalType":"address"},{"type":"address","name":"_lpToken","internalType":"address"}]},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RewardAdded","inputs":[{"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":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"accumulatedRewardPerShare","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"emergencyWithdraw","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getAllocationX1000","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getRewardPerSecond","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"globalFarm","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isOwner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"lastRewardTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"limitAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC223"}],"name":"lpToken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"notifyRewardAmount","inputs":[{"type":"uint256","name":"reward","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingReward","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueERC20","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC223"}],"name":"rewardsToken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"tokenReceived","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"update","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"rewardDebt","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawInactiveReward","inputs":[]}]
              

Contract Creation Code

Verify & Publish
0x6080604052701d6329f1c35ca4bfabb9f56100000000006008553480156200002657600080fd5b5060405162001751380380620017518339810160408190526200004991620000f8565b600680546001600160a01b0319163317908190556040516001600160a01b0391909116906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600980546001600160a01b039384166001600160a01b031991821617909155600a8054928416928216929092179091556005805493909216921691909117905562000141565b80516001600160a01b0381168114620000f357600080fd5b919050565b6000806000606084860312156200010d578283fd5b6200011884620000db565b92506200012860208501620000db565b91506200013860408501620000db565b90509250925092565b61160080620001516000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c80638943ec02116100b8578063d1af0c7d1161007c578063d1af0c7d1461022b578063da5b4ee714610233578063db2e21bc1461023b578063f2fde38b14610243578063f40f0f5214610256578063f8077fae1461026957610137565b80638943ec02146101eb5780638cb7e27c146101fe5780638da5cb5b146102065780638f32d59b1461020e578063a2e620451461022357610137565b80634f3a1ff8116100ff5780634f3a1ff8146101ab5780635d799f87146101c05780635fcbd285146101d3578063715018a6146101db57806378abafaf146101e357610137565b80631959a0021461013c5780631e29653c146101665780632e1a7d4d1461017b57806336d42195146101905780633c6b16ab14610198575b600080fd5b61014f61014a3660046111a0565b610271565b60405161015d929190611522565b60405180910390f35b61016e61028a565b60405161015d9190611519565b61018e6101893660046112d0565b610310565b005b61016e610553565b61018e6101a63660046112d0565b610559565b6101b3610593565b60405161015d9190611300565b61018e6101ce3660046111c1565b6105a2565b6101b361072a565b61018e610739565b61016e6107a7565b61018e6101f93660046111f3565b6107ad565b61018e610a1f565b6101b3610bdc565b610216610beb565b60405161015d919061132d565b61018e610bfc565b6101b3610e02565b61016e610e11565b61018e610e56565b61018e6102513660046111a0565b610f72565b61016e6102643660046111a0565b610f9f565b61016e611101565b6007602052600090815260409020805460019091015482565b60055460405163389bbbfd60e21b81526000916001600160a01b03169063e26eeff4906102bb903090600401611300565b60206040518083038186803b1580156102d357600080fd5b505afa1580156102e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030b91906112e8565b905090565b6001600460008282546103239190611530565b909155505060045433600090815260076020526040902080548311156103645760405162461bcd60e51b815260040161035b9061147f565b60405180910390fd5b61036c610bfc565b60008160010154670de0b6b3a7640000600c54846000015461038e9190611568565b6103989190611548565b6103a29190611587565b905080156104305760095460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906103dc9033908590600401611314565b602060405180830381600087803b1580156103f657600080fd5b505af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e91906112b0565b505b83156104cb578154610443908590611587565b8255600a5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906104779033908890600401611314565b602060405180830381600087803b15801561049157600080fd5b505af11580156104a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c991906112b0565b505b600c548254670de0b6b3a7640000916104e391611568565b6104ed9190611548565b600183015560405133907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436490610524908790611519565b60405180910390a25050600454811461054f5760405162461bcd60e51b815260040161035b906114e2565b5050565b600c5481565b7fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d816040516105889190611519565b60405180910390a150565b6005546001600160a01b031681565b6105aa610beb565b6105c65760405162461bcd60e51b815260040161035b90611417565b6009546001600160a01b03838116911614156105f45760405162461bcd60e51b815260040161035b90611338565b600a546001600160a01b03838116911614156106225760405162461bcd60e51b815260040161035b9061143a565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190610651903090600401611300565b60206040518083038186803b15801561066957600080fd5b505afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a191906112e8565b60405163a9059cbb60e01b81529091506001600160a01b0384169063a9059cbb906106d29085908590600401611314565b602060405180830381600087803b1580156106ec57600080fd5b505af1158015610700573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072491906112b0565b50505050565b600a546001600160a01b031681565b610741610beb565b61075d5760405162461bcd60e51b815260040161035b90611417565b6006546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600680546001600160a01b0319169055565b60085481565b6001600460008282546107c09190611530565b9091555050600454600a546001600160a01b031633146107f25760405162461bcd60e51b815260040161035b90611381565b6008546001600160a01b038516600090815260076020526040902054610819908590611530565b11156108375760405162461bcd60e51b815260040161035b906113b8565b61083f610bfc565b6001600160a01b03841660009081526007602052604090205415610939576001600160a01b03841660009081526007602052604081206001810154600c5491549091670de0b6b3a7640000916108959190611568565b61089f9190611548565b6108a99190611587565b905080156109375760095460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906108e39088908590600401611314565b602060405180830381600087803b1580156108fd57600080fd5b505af1158015610911573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093591906112b0565b505b505b821561096d576001600160a01b03841660009081526007602052604081208054859290610967908490611530565b90915550505b600c546001600160a01b038516600090815260076020526040902054670de0b6b3a76400009161099c91611568565b6109a69190611548565b6001600160a01b038516600081815260076020526040908190206001019290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d906109f6908690611519565b60405180910390a260045481146107245760405162461bcd60e51b815260040161035b906114e2565b610a27610beb565b610a435760405162461bcd60e51b815260040161035b90611417565b600554604051630d18304560e21b81526001600160a01b0390911690633460c11490610a73903090600401611300565b60206040518083038186803b158015610a8b57600080fd5b505afa158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac391906112b0565b15610ae05760405162461bcd60e51b815260040161035b906113e0565b6009546040516370a0823160e01b81526001600160a01b039091169063a9059cbb90339083906370a0823190610b1a903090600401611300565b60206040518083038186803b158015610b3257600080fd5b505afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906112e8565b6040518363ffffffff1660e01b8152600401610b87929190611314565b602060405180830381600087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd991906112b0565b50565b6006546001600160a01b031690565b6006546001600160a01b0316331490565b60055460405163445c92c560e01b81526001600160a01b039091169063445c92c590610c2c903090600401611300565b60206040518083038186803b158015610c4457600080fd5b505afa158015610c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7c91906112b0565b15610ce45760055460405163032453f160e51b81526001600160a01b039091169063648a7e2090610cb1903090600401611300565b600060405180830381600087803b158015610ccb57600080fd5b505af1158015610cdf573d6000803e3d6000fd5b505050505b600b544211610cf257610e00565b600a546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610d23903090600401611300565b60206040518083038186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7391906112e8565b905080610d84575042600b55610e00565b6000600b5442610d949190611587565b905060006103e8610da361028a565b610dab610e11565b610db59085611568565b610dbf9190611568565b610dc99190611548565b905082610dde82670de0b6b3a7640000611568565b610de89190611548565b600c54610df59190611530565b600c55505042600b55505b565b6009546001600160a01b031681565b6005546040805163da5b4ee760e01b815290516000926001600160a01b03169163da5b4ee7916004808301926020929190829003018186803b1580156102d357600080fd5b600160046000828254610e699190611530565b9091555050600480543360008181526007602052604090819020600a548154925163a9059cbb60e01b8152949591946001600160a01b039091169363a9059cbb93610eb8939192909101611314565b602060405180830381600087803b158015610ed257600080fd5b505af1158015610ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0a91906112b0565b50805460405133917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969591610f3e9190611519565b60405180910390a260008082556001909101556004548114610bd95760405162461bcd60e51b815260040161035b906114e2565b610f7a610beb565b610f965760405162461bcd60e51b815260040161035b90611417565b610bd981611107565b6001600160a01b03808216600090815260076020526040808220600c54600a5492516370a0823160e01b8152939491939092859216906370a0823190610fe9903090600401611300565b60206040518083038186803b15801561100157600080fd5b505afa158015611015573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103991906112e8565b9050600b544211801561104b57508015155b156110c6576000600b54426110609190611587565b905060006103e861106f61028a565b611077610e11565b6110819085611568565b61108b9190611568565b6110959190611548565b9050826110aa82670de0b6b3a7640000611568565b6110b49190611548565b600c546110c19190611530565b935050505b60018301548354670de0b6b3a7640000906110e2908590611568565b6110ec9190611548565b6110f69190611587565b93505050505b919050565b600b5481565b6001600160a01b03811661112d5760405162461bcd60e51b815260040161035b906114ab565b6006546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146110fc57600080fd5b6000602082840312156111b1578081fd5b6111ba82611189565b9392505050565b600080604083850312156111d3578081fd5b6111dc83611189565b91506111ea60208401611189565b90509250929050565b600080600060608486031215611207578081fd5b61121084611189565b92506020808501359250604085013567ffffffffffffffff80821115611234578384fd5b818701915087601f830112611247578384fd5b813581811115611259576112596115b4565b604051601f8201601f191681018501838111828210171561127c5761127c6115b4565b60405281815283820185018a1015611292578586fd5b81858501868301378585838301015280955050505050509250925092565b6000602082840312156112c1578081fd5b815180151581146111ba578182fd5b6000602082840312156112e1578081fd5b5035919050565b6000602082840312156112f9578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60208082526029908201527f52657761726420746f6b656e206973206e6f742070726f6e6520746f2045524360408201526832302069737375657360b81b606082015260800190565b6020808252601d908201527f547279696e6720746f206465706f7369742077726f6e6720746f6b656e000000604082015260600190565b6020808252600e908201526d06578636565642074686520746f760941b604082015260600190565b60208082526017908201527f4661726d206d757374206e6f7420626520616374697665000000000000000000604082015260600190565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b60208082526025908201527f4c5020746f6b656e206973206e6f742070726f6e6520746f2045524332302069604082015264737375657360d81b606082015260800190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b60208082526018908201527f5a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b918252602082015260400190565b600082198211156115435761154361159e565b500190565b60008261156357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156115825761158261159e565b500290565b6000828210156115995761159961159e565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dcea70390234b50e470f2104964abec5cc83ac5db05b080d619dbfff01142fdc64736f6c6343000800003300000000000000000000000064fa36acd0d13472fd786b03afc9c52ad5fcf0230000000000000000000000009fae2529863bd691b4a7171bdfcf33c7ebb10a650000000000000000000000001cee27d0627ce8a81df9b4d7eee0d753b8c2f613

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101375760003560e01c80638943ec02116100b8578063d1af0c7d1161007c578063d1af0c7d1461022b578063da5b4ee714610233578063db2e21bc1461023b578063f2fde38b14610243578063f40f0f5214610256578063f8077fae1461026957610137565b80638943ec02146101eb5780638cb7e27c146101fe5780638da5cb5b146102065780638f32d59b1461020e578063a2e620451461022357610137565b80634f3a1ff8116100ff5780634f3a1ff8146101ab5780635d799f87146101c05780635fcbd285146101d3578063715018a6146101db57806378abafaf146101e357610137565b80631959a0021461013c5780631e29653c146101665780632e1a7d4d1461017b57806336d42195146101905780633c6b16ab14610198575b600080fd5b61014f61014a3660046111a0565b610271565b60405161015d929190611522565b60405180910390f35b61016e61028a565b60405161015d9190611519565b61018e6101893660046112d0565b610310565b005b61016e610553565b61018e6101a63660046112d0565b610559565b6101b3610593565b60405161015d9190611300565b61018e6101ce3660046111c1565b6105a2565b6101b361072a565b61018e610739565b61016e6107a7565b61018e6101f93660046111f3565b6107ad565b61018e610a1f565b6101b3610bdc565b610216610beb565b60405161015d919061132d565b61018e610bfc565b6101b3610e02565b61016e610e11565b61018e610e56565b61018e6102513660046111a0565b610f72565b61016e6102643660046111a0565b610f9f565b61016e611101565b6007602052600090815260409020805460019091015482565b60055460405163389bbbfd60e21b81526000916001600160a01b03169063e26eeff4906102bb903090600401611300565b60206040518083038186803b1580156102d357600080fd5b505afa1580156102e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030b91906112e8565b905090565b6001600460008282546103239190611530565b909155505060045433600090815260076020526040902080548311156103645760405162461bcd60e51b815260040161035b9061147f565b60405180910390fd5b61036c610bfc565b60008160010154670de0b6b3a7640000600c54846000015461038e9190611568565b6103989190611548565b6103a29190611587565b905080156104305760095460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906103dc9033908590600401611314565b602060405180830381600087803b1580156103f657600080fd5b505af115801561040a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042e91906112b0565b505b83156104cb578154610443908590611587565b8255600a5460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906104779033908890600401611314565b602060405180830381600087803b15801561049157600080fd5b505af11580156104a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c991906112b0565b505b600c548254670de0b6b3a7640000916104e391611568565b6104ed9190611548565b600183015560405133907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436490610524908790611519565b60405180910390a25050600454811461054f5760405162461bcd60e51b815260040161035b906114e2565b5050565b600c5481565b7fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d816040516105889190611519565b60405180910390a150565b6005546001600160a01b031681565b6105aa610beb565b6105c65760405162461bcd60e51b815260040161035b90611417565b6009546001600160a01b03838116911614156105f45760405162461bcd60e51b815260040161035b90611338565b600a546001600160a01b03838116911614156106225760405162461bcd60e51b815260040161035b9061143a565b6040516370a0823160e01b81526000906001600160a01b038416906370a0823190610651903090600401611300565b60206040518083038186803b15801561066957600080fd5b505afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a191906112e8565b60405163a9059cbb60e01b81529091506001600160a01b0384169063a9059cbb906106d29085908590600401611314565b602060405180830381600087803b1580156106ec57600080fd5b505af1158015610700573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072491906112b0565b50505050565b600a546001600160a01b031681565b610741610beb565b61075d5760405162461bcd60e51b815260040161035b90611417565b6006546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600680546001600160a01b0319169055565b60085481565b6001600460008282546107c09190611530565b9091555050600454600a546001600160a01b031633146107f25760405162461bcd60e51b815260040161035b90611381565b6008546001600160a01b038516600090815260076020526040902054610819908590611530565b11156108375760405162461bcd60e51b815260040161035b906113b8565b61083f610bfc565b6001600160a01b03841660009081526007602052604090205415610939576001600160a01b03841660009081526007602052604081206001810154600c5491549091670de0b6b3a7640000916108959190611568565b61089f9190611548565b6108a99190611587565b905080156109375760095460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb906108e39088908590600401611314565b602060405180830381600087803b1580156108fd57600080fd5b505af1158015610911573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093591906112b0565b505b505b821561096d576001600160a01b03841660009081526007602052604081208054859290610967908490611530565b90915550505b600c546001600160a01b038516600090815260076020526040902054670de0b6b3a76400009161099c91611568565b6109a69190611548565b6001600160a01b038516600081815260076020526040908190206001019290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d906109f6908690611519565b60405180910390a260045481146107245760405162461bcd60e51b815260040161035b906114e2565b610a27610beb565b610a435760405162461bcd60e51b815260040161035b90611417565b600554604051630d18304560e21b81526001600160a01b0390911690633460c11490610a73903090600401611300565b60206040518083038186803b158015610a8b57600080fd5b505afa158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac391906112b0565b15610ae05760405162461bcd60e51b815260040161035b906113e0565b6009546040516370a0823160e01b81526001600160a01b039091169063a9059cbb90339083906370a0823190610b1a903090600401611300565b60206040518083038186803b158015610b3257600080fd5b505afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a91906112e8565b6040518363ffffffff1660e01b8152600401610b87929190611314565b602060405180830381600087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bd991906112b0565b50565b6006546001600160a01b031690565b6006546001600160a01b0316331490565b60055460405163445c92c560e01b81526001600160a01b039091169063445c92c590610c2c903090600401611300565b60206040518083038186803b158015610c4457600080fd5b505afa158015610c58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7c91906112b0565b15610ce45760055460405163032453f160e51b81526001600160a01b039091169063648a7e2090610cb1903090600401611300565b600060405180830381600087803b158015610ccb57600080fd5b505af1158015610cdf573d6000803e3d6000fd5b505050505b600b544211610cf257610e00565b600a546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610d23903090600401611300565b60206040518083038186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7391906112e8565b905080610d84575042600b55610e00565b6000600b5442610d949190611587565b905060006103e8610da361028a565b610dab610e11565b610db59085611568565b610dbf9190611568565b610dc99190611548565b905082610dde82670de0b6b3a7640000611568565b610de89190611548565b600c54610df59190611530565b600c55505042600b55505b565b6009546001600160a01b031681565b6005546040805163da5b4ee760e01b815290516000926001600160a01b03169163da5b4ee7916004808301926020929190829003018186803b1580156102d357600080fd5b600160046000828254610e699190611530565b9091555050600480543360008181526007602052604090819020600a548154925163a9059cbb60e01b8152949591946001600160a01b039091169363a9059cbb93610eb8939192909101611314565b602060405180830381600087803b158015610ed257600080fd5b505af1158015610ee6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0a91906112b0565b50805460405133917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969591610f3e9190611519565b60405180910390a260008082556001909101556004548114610bd95760405162461bcd60e51b815260040161035b906114e2565b610f7a610beb565b610f965760405162461bcd60e51b815260040161035b90611417565b610bd981611107565b6001600160a01b03808216600090815260076020526040808220600c54600a5492516370a0823160e01b8152939491939092859216906370a0823190610fe9903090600401611300565b60206040518083038186803b15801561100157600080fd5b505afa158015611015573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103991906112e8565b9050600b544211801561104b57508015155b156110c6576000600b54426110609190611587565b905060006103e861106f61028a565b611077610e11565b6110819085611568565b61108b9190611568565b6110959190611548565b9050826110aa82670de0b6b3a7640000611568565b6110b49190611548565b600c546110c19190611530565b935050505b60018301548354670de0b6b3a7640000906110e2908590611568565b6110ec9190611548565b6110f69190611587565b93505050505b919050565b600b5481565b6001600160a01b03811661112d5760405162461bcd60e51b815260040161035b906114ab565b6006546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600680546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b03811681146110fc57600080fd5b6000602082840312156111b1578081fd5b6111ba82611189565b9392505050565b600080604083850312156111d3578081fd5b6111dc83611189565b91506111ea60208401611189565b90509250929050565b600080600060608486031215611207578081fd5b61121084611189565b92506020808501359250604085013567ffffffffffffffff80821115611234578384fd5b818701915087601f830112611247578384fd5b813581811115611259576112596115b4565b604051601f8201601f191681018501838111828210171561127c5761127c6115b4565b60405281815283820185018a1015611292578586fd5b81858501868301378585838301015280955050505050509250925092565b6000602082840312156112c1578081fd5b815180151581146111ba578182fd5b6000602082840312156112e1578081fd5b5035919050565b6000602082840312156112f9578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b60208082526029908201527f52657761726420746f6b656e206973206e6f742070726f6e6520746f2045524360408201526832302069737375657360b81b606082015260800190565b6020808252601d908201527f547279696e6720746f206465706f7369742077726f6e6720746f6b656e000000604082015260600190565b6020808252600e908201526d06578636565642074686520746f760941b604082015260600190565b60208082526017908201527f4661726d206d757374206e6f7420626520616374697665000000000000000000604082015260600190565b6020808252600990820152682737ba1027bbb732b960b91b604082015260600190565b60208082526025908201527f4c5020746f6b656e206973206e6f742070726f6e6520746f2045524332302069604082015264737375657360d81b606082015260800190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b60208082526018908201527f5a65726f2061646472657373206e6f7420616c6c6f7765640000000000000000604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b918252602082015260400190565b600082198211156115435761154361159e565b500190565b60008261156357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156115825761158261159e565b500290565b6000828210156115995761159961159e565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220dcea70390234b50e470f2104964abec5cc83ac5db05b080d619dbfff01142fdc64736f6c63430008000033