false
false
0

Contract Address Details

0x0a7518f21189c6412047946441ccBfBE9b86F2E6

Contract Name
ICO
Creator
0xc7d98cā€“7f3521 at 0x1afae8ā€“858909
Balance
0 CLO
Tokens
Fetching tokens...
Transactions
Fetching transactions...
Transfers
Fetching transfers...
Gas Used
Fetching gas used...
Last Balance Update
16288441
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ICO




Optimization enabled
true
Compiler version
v0.8.19+commit.7dd6d404




Optimization runs
200
EVM Version
default




Verified at
2024-09-26T15:32:05.101159Z

Constructor Arguments

0x000000000000000000000000e1a77164e5c6d9e0fc0b23d11e0874de6b328e68000000000000000000000000ec038badb02ab74f66f7892badd93ddcb7987f9b

Arg [0] (address) : 0xe1a77164e5c6d9e0fc0b23d11e0874de6b328e68
Arg [1] (address) : 0xec038badb02ab74f66f7892badd93ddcb7987f9b

              

Contract source code

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

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () {
        _owner = msg.sender;
        emit OwnershipTransferred(address(0), msg.sender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
        _;
    }

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

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function decimals() external view returns (uint8);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
}

interface IVesting {
    function allocateTokens(
        address to, // beneficiary of tokens
        uint256 amount, // amount of token
        uint256 unlockPercentage,   // percentage of initially unlocked token
        uint256 finishVesting,       // Timestamp (unix time) when starts vesting. First vesting will be at this time
        uint256 cliffPercentage,  // percentage of tokens will be unlocked every interval (i.e. 10% per 30 days)
        uint256 cliffInterval     // interval (in seconds) of vesting (i.e. 30 days)
    ) external;
}

contract ICO is Ownable {
    address public ICOtoken;    // ICO token and receiving token must have 18 decimals
    address public vestingContract; 

    uint256 public unlockPercentage = 50; // percentage of initially unlocked token
    uint256 public vestingPeriod = 182 days;    // vesting period (in seconds)
    uint256 public cliffPercentage = 33;        // percentage of locked tokens will be unlocked every interval (i.e. 10% per 30 days)
    uint256 public cliffInterval = 30 days;     // interval (in seconds) of vesting (i.e. 30 days)

    struct Round {
        uint256 amount;     // amount of tokens to sell in this round
        uint64 startDate;   // timestamp when round starts
        uint64 endDate;     // timestamp when round finishes
        uint128 price;      // price per token (in payTokens value)
        address payTokens;  // token should be paid (address(0) - native coin)
        uint256 totalSold;  // amount of tokens sold 
        uint256 totalReceived;  // total payments received in round
    }

    Round[] public rounds;  // starts from round 1
    uint256 public currentRound;
    bool public isPause;

    event BuyToken(uint256 round, address paidToken, uint256 paidAmount, uint256 sellAmount);

    constructor (address _ICOtoken, address _vestingContract) {
        rounds.push();  // starts from round 1
        ICOtoken = _ICOtoken;
        vestingContract = _vestingContract;
    }

    modifier checkRound() {
        uint256 len = rounds.length;
        uint256 i = currentRound;
        for (; i<len; i++) {
            if(rounds[i].endDate >= block.timestamp) break; 
        }
        currentRound = i;
        require(i < len, "ICO finished");
        require(block.timestamp >= rounds[i].startDate, "ICO round is not started yet");
        require(!isPause, "ICO is paused");
        _;
    }

    // returns current or next (if it was not started yet) round information
    function getRound() external view returns(Round memory round) {
        uint256 len = rounds.length;
        uint256 i = currentRound;
        for (; i<len; i++) {
            if(rounds[i].endDate >= block.timestamp) break; 
        }   
        if (i < len) return rounds[i];
    }

    receive() external payable {
        buyToken(msg.value);
    }

    // Buy ICO tokens for amount of pay tokens
    function buyToken(uint256 amount) public payable checkRound {
        Round storage r = rounds[currentRound];
        uint256 rest;
        uint256 sellAmount = amount * 1e18 / r.price;
        if(r.totalSold + sellAmount > r.amount) {
            sellAmount = r.amount - r.totalSold;
            rest = amount - (sellAmount * r.price / 1e18);  // amount to refund user
        }
        if (r.payTokens == address(0)) {
            require(amount == msg.value, "wrong amount");
            if(rest != 0) safeTransferCLO(msg.sender, rest);
        }
        else {
            require(msg.value == 0, "Should pay with tokens");
            safeTransferFrom(r.payTokens, msg.sender, address(this), amount-rest);
        }
        uint256 finishVesting = block.timestamp + vestingPeriod;
        uint256 unlockedAmount = sellAmount * unlockPercentage / 100;
        uint256 lockedAmount = sellAmount - unlockedAmount;
        if (lockedAmount != 0) {
            safeTransfer(ICOtoken, vestingContract, lockedAmount);
            IVesting(vestingContract).allocateTokens(msg.sender, lockedAmount, 0, finishVesting, cliffPercentage, cliffInterval);
        }
        safeTransfer(ICOtoken, msg.sender, unlockedAmount);
        emit BuyToken(currentRound, r.payTokens, amount-rest, sellAmount);
    }

    function addRound(
        uint256 amount,     // amount of tokens to sell in this round
        uint64 startDate,   // timestamp when round starts
        uint64 endDate,     // timestamp when round finishes
        uint128 price,       // price per token       
        address payTokens  // token should be paid (address(0) - native coin)
    ) external onlyOwner {
        Round storage r = rounds[rounds.length-1];
        require(r.endDate < startDate, "New round must start after previous");
        require(startDate < endDate && startDate > block.timestamp, "wrong dates");
        rounds.push(Round(amount, startDate, endDate, price, payTokens, 0, 0));
    }

    function changRound(
        uint256 roundId,    // round to change
        uint256 amount,     // amount of tokens to sell in this round
        uint64 startDate,   // timestamp when round starts
        uint64 endDate,     // timestamp when round finishes
        uint128 price,       // price per token
        address payTokens  // token should be paid (address(0) - native coin)
    ) external onlyOwner {
        require(roundId > 0 && roundId < rounds.length, "wrong round id");
        //require(rounds[roundId].startDate > block.timestamp, "Round already started");
        require(rounds[roundId-1].endDate < startDate, "Round must start after previous");
        if(roundId < rounds.length-1) require(rounds[roundId+1].startDate > endDate, "Round must finish before next");
        require(startDate < endDate, "wrong dates");        
        rounds[roundId].amount = amount;
        rounds[roundId].startDate = startDate;
        rounds[roundId].endDate = endDate;
        rounds[roundId].price = price;
        rounds[roundId].payTokens = payTokens;
    }

    function setPause(bool pause) external onlyOwner {
        isPause = pause;
    }

    function setVesting(
        address _vestingContract,  // address of vesting contract
        uint256 _unlockPercentage, // percentage of initially unlocked token
        uint256 _vestingPeriod,    // vesting period (in seconds)
        uint256 _cliffPercentage,  // percentage of locked tokens will be unlocked every interval (i.e. 10% per 30 days)
        uint256 _cliffInterval     // interval (in seconds) of vesting (i.e. 30 days)
    ) external onlyOwner {
        vestingContract = _vestingContract;
        unlockPercentage = _unlockPercentage;
        vestingPeriod = _vestingPeriod;
        cliffPercentage = _cliffPercentage;
        cliffInterval = _cliffInterval;
    }

    // allow to receive ERC223 tokens
    function tokenReceived(address _from, uint256, bytes memory) external virtual returns(bytes4) {
        require(msg.sender == ICOtoken && _from == owner(), "ERC223 wrong token");
        return this.tokenReceived.selector;
    }

    event Rescue(address _token, uint256 _amount);
    function rescueTokens(address _token) onlyOwner external {
        uint256 amount;
        if (_token == address(0)) {
            amount = address(this).balance;
            safeTransferCLO(msg.sender, amount);
        } else {
            amount = IERC20(_token).balanceOf(address(this));
            safeTransfer(_token, msg.sender, amount);
        }
        emit Rescue(_token, amount);
    }

    function safeTransfer(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function safeTransferCLO(address to, uint value) internal {
        (bool success,) = to.call{value:value}(new bytes(0));
        require(success, 'TransferHelper: CLO_TRANSFER_FAILED');
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_ICOtoken","internalType":"address"},{"type":"address","name":"_vestingContract","internalType":"address"}]},{"type":"event","name":"BuyToken","inputs":[{"type":"uint256","name":"round","internalType":"uint256","indexed":false},{"type":"address","name":"paidToken","internalType":"address","indexed":false},{"type":"uint256","name":"paidAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"sellAmount","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":"Rescue","inputs":[{"type":"address","name":"_token","internalType":"address","indexed":false},{"type":"uint256","name":"_amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ICOtoken","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRound","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint64","name":"startDate","internalType":"uint64"},{"type":"uint64","name":"endDate","internalType":"uint64"},{"type":"uint128","name":"price","internalType":"uint128"},{"type":"address","name":"payTokens","internalType":"address"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"buyToken","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"changRound","inputs":[{"type":"uint256","name":"roundId","internalType":"uint256"},{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint64","name":"startDate","internalType":"uint64"},{"type":"uint64","name":"endDate","internalType":"uint64"},{"type":"uint128","name":"price","internalType":"uint128"},{"type":"address","name":"payTokens","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cliffInterval","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"cliffPercentage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentRound","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"round","internalType":"struct ICO.Round","components":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint64","name":"startDate","internalType":"uint64"},{"type":"uint64","name":"endDate","internalType":"uint64"},{"type":"uint128","name":"price","internalType":"uint128"},{"type":"address","name":"payTokens","internalType":"address"},{"type":"uint256","name":"totalSold","internalType":"uint256"},{"type":"uint256","name":"totalReceived","internalType":"uint256"}]}],"name":"getRound","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"rescueTokens","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint64","name":"startDate","internalType":"uint64"},{"type":"uint64","name":"endDate","internalType":"uint64"},{"type":"uint128","name":"price","internalType":"uint128"},{"type":"address","name":"payTokens","internalType":"address"},{"type":"uint256","name":"totalSold","internalType":"uint256"},{"type":"uint256","name":"totalReceived","internalType":"uint256"}],"name":"rounds","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPause","inputs":[{"type":"bool","name":"pause","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setVesting","inputs":[{"type":"address","name":"_vestingContract","internalType":"address"},{"type":"uint256","name":"_unlockPercentage","internalType":"uint256"},{"type":"uint256","name":"_vestingPeriod","internalType":"uint256"},{"type":"uint256","name":"_cliffPercentage","internalType":"uint256"},{"type":"uint256","name":"_cliffInterval","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"tokenReceived","inputs":[{"type":"address","name":"_from","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"unlockPercentage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"vestingContract","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"vestingPeriod","inputs":[]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

Verify & Publish
0x6080604052603260035562eff100600455602160055562278d006006553480156200002957600080fd5b5060405162001c6038038062001c608339810160408190526200004c91620000e9565b600080546001600160a01b0319163390811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600780546001908101825560009190915280546001600160a01b039384166001600160a01b0319918216179091556002805492909316911617905562000121565b80516001600160a01b0381168114620000e457600080fd5b919050565b60008060408385031215620000fd57600080fd5b6200010883620000cc565b91506200011860208401620000cc565b90509250929050565b611b2f80620001316000396000f3fe6080604052600436106101175760003560e01c80637313ee5a116100a05780639f8743f7116100645780639f8743f714610342578063bedb86fb146103c8578063d274ac47146103e8578063f2fde38b14610408578063ff0938a71461042857600080fd5b80637313ee5a1461024c5780638943ec02146102625780638a19c8bc1461029b5780638c65c81f146102b15780638da5cb5b1461032457600080fd5b8063335727df116100e7578063335727df146101a85780633b3fba16146101c85780633c21e595146101de57806346ff80ee146101f45780635e6f60451461022c57600080fd5b8062ae3bf81461012c57806319496ca31461014c5780632a2eddde146101755780632d296bf11461019557600080fd5b366101275761012534610452565b005b600080fd5b34801561013857600080fd5b50610125610147366004611738565b6108cc565b34801561015857600080fd5b5061016260065481565b6040519081526020015b60405180910390f35b34801561018157600080fd5b5061012561019036600461175a565b6109e1565b6101256101a336600461179c565b610452565b3480156101b457600080fd5b506101256101c33660046117e3565b610a4c565b3480156101d457600080fd5b5061016260035481565b3480156101ea57600080fd5b5061016260055481565b34801561020057600080fd5b50600154610214906001600160a01b031681565b6040516001600160a01b03909116815260200161016c565b34801561023857600080fd5b50600254610214906001600160a01b031681565b34801561025857600080fd5b5061016260045481565b34801561026e57600080fd5b5061028261027d366004611857565b610d20565b6040516001600160e01b0319909116815260200161016c565b3480156102a757600080fd5b5061016260085481565b3480156102bd57600080fd5b506102d16102cc36600461179c565b610d9b565b604080519788526001600160401b03968716602089015294909516938601939093526001600160801b039190911660608501526001600160a01b0316608084015260a083015260c082015260e00161016c565b34801561033057600080fd5b506000546001600160a01b0316610214565b34801561034e57600080fd5b50610357610e0d565b60408051825181526020808401516001600160401b03908116918301919091528383015116918101919091526060808301516001600160801b0316908201526080808301516001600160a01b03169082015260a0808301519082015260c0918201519181019190915260e00161016c565b3480156103d457600080fd5b506101256103e3366004611932565b610f54565b3480156103f457600080fd5b5061012561040336600461194f565b610fa0565b34801561041457600080fd5b50610125610423366004611738565b61130a565b34801561043457600080fd5b506009546104429060ff1681565b604051901515815260200161016c565b6007546008545b818110156104b1574260078281548110610475576104756119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b031610156104b157806104a9816119e1565b915050610459565b60088190558181106104f95760405162461bcd60e51b815260206004820152600c60248201526b1250d3c8199a5b9a5cda195960a21b60448201526064015b60405180910390fd5b6007818154811061050c5761050c6119b5565b60009182526020909120600160059092020101546001600160401b03164210156105785760405162461bcd60e51b815260206004820152601c60248201527f49434f20726f756e64206973206e6f742073746172746564207965740000000060448201526064016104f0565b60095460ff16156105bb5760405162461bcd60e51b815260206004820152600d60248201526c1250d3c81a5cc81c185d5cd959609a1b60448201526064016104f0565b60006007600854815481106105d2576105d26119b5565b6000918252602082206005919091020160018101549092508190600160801b90046001600160801b031661060e87670de0b6b3a76400006119fa565b6106189190611a17565b9050826000015481846003015461062f9190611a39565b111561068957600383015483546106469190611a4c565b6001840154909150670de0b6b3a76400009061067290600160801b90046001600160801b0316836119fa565b61067c9190611a17565b6106869087611a4c565b91505b60028301546001600160a01b03166106ee573486146106d95760405162461bcd60e51b815260206004820152600c60248201526b1ddc9bdb99c8185b5bdd5b9d60a21b60448201526064016104f0565b81156106e9576106e93383611403565b610758565b34156107355760405162461bcd60e51b815260206004820152601660248201527553686f756c6420706179207769746820746f6b656e7360501b60448201526064016104f0565b6002830154610758906001600160a01b03163330610753868b611a4c565b6114d1565b6000600454426107689190611a39565b9050600060646003548461077c91906119fa565b6107869190611a17565b905060006107948285611a4c565b9050801561083f576001546002546107b9916001600160a01b03908116911683611601565b6002546005546006546040516335ebd4bd60e11b8152336004820152602481018590526000604482015260648101879052608481019290925260a48201526001600160a01b0390911690636bd7a97a9060c401600060405180830381600087803b15801561082657600080fd5b505af115801561083a573d6000803e3d6000fd5b505050505b600154610856906001600160a01b03163384611601565b60085460028701547f4a6ff06470586eac6fcf5d4104ec282dfbc230e274e5571a4295cf648bf402d491906001600160a01b0316610894888d611a4c565b604080519384526001600160a01b039092166020840152908201526060810186905260800160405180910390a1505050505050505050565b336108df6000546001600160a01b031690565b6001600160a01b0316146109055760405162461bcd60e51b81526004016104f090611a5f565b60006001600160a01b0382166109265750476109213382611403565b61099b565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561096a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098e9190611a94565b905061099b823383611601565b604080516001600160a01b0384168152602081018390527f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af2910160405180910390a15050565b336109f46000546001600160a01b031690565b6001600160a01b031614610a1a5760405162461bcd60e51b81526004016104f090611a5f565b600280546001600160a01b0319166001600160a01b039690961695909517909455600392909255600455600555600655565b33610a5f6000546001600160a01b031690565b6001600160a01b031614610a855760405162461bcd60e51b81526004016104f090611a5f565b6007805460009190610a9990600190611a4c565b81548110610aa957610aa96119b5565b90600052602060002090600502019050846001600160401b03168160010160089054906101000a90046001600160401b03166001600160401b031610610b3d5760405162461bcd60e51b815260206004820152602360248201527f4e657720726f756e64206d7573742073746172742061667465722070726576696044820152626f757360e81b60648201526084016104f0565b836001600160401b0316856001600160401b0316108015610b66575042856001600160401b0316115b610ba05760405162461bcd60e51b815260206004820152600b60248201526a77726f6e6720646174657360a81b60448201526064016104f0565b506040805160e0810182529586526001600160401b03948516602087019081529385169086019081526001600160801b03928316606087019081526001600160a01b0392831660808801908152600060a0890181815260c08a01828152600780546001810182559352995160059092027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68881019290925596517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982018054955194518816600160801b02948a16600160401b026fffffffffffffffffffffffffffffffff199096169190991617939093179094161790945590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a84018054919092166001600160a01b0319909116179055517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b82015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68c90910155565b6001546000906001600160a01b031633148015610d4a57506000546001600160a01b038581169116145b610d8b5760405162461bcd60e51b815260206004820152601260248201527122a921991919903bb937b733903a37b5b2b760711b60448201526064016104f0565b506344a1f60160e11b9392505050565b60078181548110610dab57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401549294506001600160401b0380831694600160401b840490911693600160801b9093046001600160801b0316926001600160a01b039092169187565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526007546008545b81811015610ea5574260078281548110610e6957610e696119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b03161015610ea55780610e9d816119e1565b915050610e4d565b81811015610f4f5760078181548110610ec057610ec06119b5565b60009182526020918290206040805160e0810182526005939093029091018054835260018101546001600160401b0380821695850195909552600160401b810490941691830191909152600160801b9092046001600160801b0316606082015260028201546001600160a01b03166080820152600382015460a082015260049091015460c08201529392505050565b505090565b33610f676000546001600160a01b031690565b6001600160a01b031614610f8d5760405162461bcd60e51b81526004016104f090611a5f565b6009805460ff1916911515919091179055565b33610fb36000546001600160a01b031690565b6001600160a01b031614610fd95760405162461bcd60e51b81526004016104f090611a5f565b600086118015610fea575060075486105b6110275760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c81c9bdd5b99081a5960921b60448201526064016104f0565b6001600160401b038416600761103e600189611a4c565b8154811061104e5761104e6119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b0316106110bf5760405162461bcd60e51b815260206004820152601f60248201527f526f756e64206d7573742073746172742061667465722070726576696f75730060448201526064016104f0565b6007546110ce90600190611a4c565b861015611166576001600160401b03831660076110ec886001611a39565b815481106110fc576110fc6119b5565b60009182526020909120600160059092020101546001600160401b0316116111665760405162461bcd60e51b815260206004820152601d60248201527f526f756e64206d7573742066696e697368206265666f7265206e65787400000060448201526064016104f0565b826001600160401b0316846001600160401b0316106111b55760405162461bcd60e51b815260206004820152600b60248201526a77726f6e6720646174657360a81b60448201526064016104f0565b84600787815481106111c9576111c96119b5565b90600052602060002090600502016000018190555083600787815481106111f2576111f26119b5565b906000526020600020906005020160010160006101000a8154816001600160401b0302191690836001600160401b03160217905550826007878154811061123b5761123b6119b5565b906000526020600020906005020160010160086101000a8154816001600160401b0302191690836001600160401b031602179055508160078781548110611284576112846119b5565b906000526020600020906005020160010160106101000a8154816001600160801b0302191690836001600160801b0316021790555080600787815481106112cd576112cd6119b5565b906000526020600020906005020160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050505050565b3361131d6000546001600160a01b031690565b6001600160a01b0316146113435760405162461bcd60e51b81526004016104f090611a5f565b6001600160a01b0381166113a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b604080516000808252602082019092526001600160a01b03841690839060405161142d9190611aad565b60006040518083038185875af1925050503d806000811461146a576040519150601f19603f3d011682016040523d82523d6000602084013e61146f565b606091505b50509050806114cc5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a20434c4f5f5452414e534645525f46414960448201526213115160ea1b60648201526084016104f0565b505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916115359190611aad565b6000604051808303816000865af19150503d8060008114611572576040519150601f19603f3d011682016040523d82523d6000602084013e611577565b606091505b50915091508180156115a15750805115806115a15750808060200190518101906115a19190611adc565b6115f95760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016104f0565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161165d9190611aad565b6000604051808303816000865af19150503d806000811461169a576040519150601f19603f3d011682016040523d82523d6000602084013e61169f565b606091505b50915091508180156116c95750805115806116c95750808060200190518101906116c99190611adc565b6117155760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016104f0565b5050505050565b80356001600160a01b038116811461173357600080fd5b919050565b60006020828403121561174a57600080fd5b6117538261171c565b9392505050565b600080600080600060a0868803121561177257600080fd5b61177b8661171c565b97602087013597506040870135966060810135965060800135945092505050565b6000602082840312156117ae57600080fd5b5035919050565b80356001600160401b038116811461173357600080fd5b80356001600160801b038116811461173357600080fd5b600080600080600060a086880312156117fb57600080fd5b8535945061180b602087016117b5565b9350611819604087016117b5565b9250611827606087016117cc565b91506118356080870161171c565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561186c57600080fd5b6118758461171c565b92506020840135915060408401356001600160401b038082111561189857600080fd5b818601915086601f8301126118ac57600080fd5b8135818111156118be576118be611841565b604051601f8201601f19908116603f011681019083821181831017156118e6576118e6611841565b816040528281528960208487010111156118ff57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b801515811461192f57600080fd5b50565b60006020828403121561194457600080fd5b813561175381611921565b60008060008060008060c0878903121561196857600080fd5b863595506020870135945061197f604088016117b5565b935061198d606088016117b5565b925061199b608088016117cc565b91506119a960a0880161171c565b90509295509295509295565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119f3576119f36119cb565b5060010190565b8082028115828204841417611a1157611a116119cb565b92915050565b600082611a3457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115611a1157611a116119cb565b81810381811115611a1157611a116119cb565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611aa657600080fd5b5051919050565b6000825160005b81811015611ace5760208186018101518583015201611ab4565b506000920191825250919050565b600060208284031215611aee57600080fd5b81516117538161192156fea26469706673582212200f2b48f8c5aa3f8c9f01110101af414364a9c328cecf48203f7c2aeda6c8368a64736f6c63430008130033000000000000000000000000e1a77164e5c6d9e0fc0b23d11e0874de6b328e68000000000000000000000000ec038badb02ab74f66f7892badd93ddcb7987f9b

Deployed ByteCode

0x6080604052600436106101175760003560e01c80637313ee5a116100a05780639f8743f7116100645780639f8743f714610342578063bedb86fb146103c8578063d274ac47146103e8578063f2fde38b14610408578063ff0938a71461042857600080fd5b80637313ee5a1461024c5780638943ec02146102625780638a19c8bc1461029b5780638c65c81f146102b15780638da5cb5b1461032457600080fd5b8063335727df116100e7578063335727df146101a85780633b3fba16146101c85780633c21e595146101de57806346ff80ee146101f45780635e6f60451461022c57600080fd5b8062ae3bf81461012c57806319496ca31461014c5780632a2eddde146101755780632d296bf11461019557600080fd5b366101275761012534610452565b005b600080fd5b34801561013857600080fd5b50610125610147366004611738565b6108cc565b34801561015857600080fd5b5061016260065481565b6040519081526020015b60405180910390f35b34801561018157600080fd5b5061012561019036600461175a565b6109e1565b6101256101a336600461179c565b610452565b3480156101b457600080fd5b506101256101c33660046117e3565b610a4c565b3480156101d457600080fd5b5061016260035481565b3480156101ea57600080fd5b5061016260055481565b34801561020057600080fd5b50600154610214906001600160a01b031681565b6040516001600160a01b03909116815260200161016c565b34801561023857600080fd5b50600254610214906001600160a01b031681565b34801561025857600080fd5b5061016260045481565b34801561026e57600080fd5b5061028261027d366004611857565b610d20565b6040516001600160e01b0319909116815260200161016c565b3480156102a757600080fd5b5061016260085481565b3480156102bd57600080fd5b506102d16102cc36600461179c565b610d9b565b604080519788526001600160401b03968716602089015294909516938601939093526001600160801b039190911660608501526001600160a01b0316608084015260a083015260c082015260e00161016c565b34801561033057600080fd5b506000546001600160a01b0316610214565b34801561034e57600080fd5b50610357610e0d565b60408051825181526020808401516001600160401b03908116918301919091528383015116918101919091526060808301516001600160801b0316908201526080808301516001600160a01b03169082015260a0808301519082015260c0918201519181019190915260e00161016c565b3480156103d457600080fd5b506101256103e3366004611932565b610f54565b3480156103f457600080fd5b5061012561040336600461194f565b610fa0565b34801561041457600080fd5b50610125610423366004611738565b61130a565b34801561043457600080fd5b506009546104429060ff1681565b604051901515815260200161016c565b6007546008545b818110156104b1574260078281548110610475576104756119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b031610156104b157806104a9816119e1565b915050610459565b60088190558181106104f95760405162461bcd60e51b815260206004820152600c60248201526b1250d3c8199a5b9a5cda195960a21b60448201526064015b60405180910390fd5b6007818154811061050c5761050c6119b5565b60009182526020909120600160059092020101546001600160401b03164210156105785760405162461bcd60e51b815260206004820152601c60248201527f49434f20726f756e64206973206e6f742073746172746564207965740000000060448201526064016104f0565b60095460ff16156105bb5760405162461bcd60e51b815260206004820152600d60248201526c1250d3c81a5cc81c185d5cd959609a1b60448201526064016104f0565b60006007600854815481106105d2576105d26119b5565b6000918252602082206005919091020160018101549092508190600160801b90046001600160801b031661060e87670de0b6b3a76400006119fa565b6106189190611a17565b9050826000015481846003015461062f9190611a39565b111561068957600383015483546106469190611a4c565b6001840154909150670de0b6b3a76400009061067290600160801b90046001600160801b0316836119fa565b61067c9190611a17565b6106869087611a4c565b91505b60028301546001600160a01b03166106ee573486146106d95760405162461bcd60e51b815260206004820152600c60248201526b1ddc9bdb99c8185b5bdd5b9d60a21b60448201526064016104f0565b81156106e9576106e93383611403565b610758565b34156107355760405162461bcd60e51b815260206004820152601660248201527553686f756c6420706179207769746820746f6b656e7360501b60448201526064016104f0565b6002830154610758906001600160a01b03163330610753868b611a4c565b6114d1565b6000600454426107689190611a39565b9050600060646003548461077c91906119fa565b6107869190611a17565b905060006107948285611a4c565b9050801561083f576001546002546107b9916001600160a01b03908116911683611601565b6002546005546006546040516335ebd4bd60e11b8152336004820152602481018590526000604482015260648101879052608481019290925260a48201526001600160a01b0390911690636bd7a97a9060c401600060405180830381600087803b15801561082657600080fd5b505af115801561083a573d6000803e3d6000fd5b505050505b600154610856906001600160a01b03163384611601565b60085460028701547f4a6ff06470586eac6fcf5d4104ec282dfbc230e274e5571a4295cf648bf402d491906001600160a01b0316610894888d611a4c565b604080519384526001600160a01b039092166020840152908201526060810186905260800160405180910390a1505050505050505050565b336108df6000546001600160a01b031690565b6001600160a01b0316146109055760405162461bcd60e51b81526004016104f090611a5f565b60006001600160a01b0382166109265750476109213382611403565b61099b565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561096a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098e9190611a94565b905061099b823383611601565b604080516001600160a01b0384168152602081018390527f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af2910160405180910390a15050565b336109f46000546001600160a01b031690565b6001600160a01b031614610a1a5760405162461bcd60e51b81526004016104f090611a5f565b600280546001600160a01b0319166001600160a01b039690961695909517909455600392909255600455600555600655565b33610a5f6000546001600160a01b031690565b6001600160a01b031614610a855760405162461bcd60e51b81526004016104f090611a5f565b6007805460009190610a9990600190611a4c565b81548110610aa957610aa96119b5565b90600052602060002090600502019050846001600160401b03168160010160089054906101000a90046001600160401b03166001600160401b031610610b3d5760405162461bcd60e51b815260206004820152602360248201527f4e657720726f756e64206d7573742073746172742061667465722070726576696044820152626f757360e81b60648201526084016104f0565b836001600160401b0316856001600160401b0316108015610b66575042856001600160401b0316115b610ba05760405162461bcd60e51b815260206004820152600b60248201526a77726f6e6720646174657360a81b60448201526064016104f0565b506040805160e0810182529586526001600160401b03948516602087019081529385169086019081526001600160801b03928316606087019081526001600160a01b0392831660808801908152600060a0890181815260c08a01828152600780546001810182559352995160059092027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68881019290925596517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68982018054955194518816600160801b02948a16600160401b026fffffffffffffffffffffffffffffffff199096169190991617939093179094161790945590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a84018054919092166001600160a01b0319909116179055517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b82015590517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68c90910155565b6001546000906001600160a01b031633148015610d4a57506000546001600160a01b038581169116145b610d8b5760405162461bcd60e51b815260206004820152601260248201527122a921991919903bb937b733903a37b5b2b760711b60448201526064016104f0565b506344a1f60160e11b9392505050565b60078181548110610dab57600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401549294506001600160401b0380831694600160401b840490911693600160801b9093046001600160801b0316926001600160a01b039092169187565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526007546008545b81811015610ea5574260078281548110610e6957610e696119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b03161015610ea55780610e9d816119e1565b915050610e4d565b81811015610f4f5760078181548110610ec057610ec06119b5565b60009182526020918290206040805160e0810182526005939093029091018054835260018101546001600160401b0380821695850195909552600160401b810490941691830191909152600160801b9092046001600160801b0316606082015260028201546001600160a01b03166080820152600382015460a082015260049091015460c08201529392505050565b505090565b33610f676000546001600160a01b031690565b6001600160a01b031614610f8d5760405162461bcd60e51b81526004016104f090611a5f565b6009805460ff1916911515919091179055565b33610fb36000546001600160a01b031690565b6001600160a01b031614610fd95760405162461bcd60e51b81526004016104f090611a5f565b600086118015610fea575060075486105b6110275760405162461bcd60e51b815260206004820152600e60248201526d1ddc9bdb99c81c9bdd5b99081a5960921b60448201526064016104f0565b6001600160401b038416600761103e600189611a4c565b8154811061104e5761104e6119b5565b6000918252602090912060059091020160010154600160401b90046001600160401b0316106110bf5760405162461bcd60e51b815260206004820152601f60248201527f526f756e64206d7573742073746172742061667465722070726576696f75730060448201526064016104f0565b6007546110ce90600190611a4c565b861015611166576001600160401b03831660076110ec886001611a39565b815481106110fc576110fc6119b5565b60009182526020909120600160059092020101546001600160401b0316116111665760405162461bcd60e51b815260206004820152601d60248201527f526f756e64206d7573742066696e697368206265666f7265206e65787400000060448201526064016104f0565b826001600160401b0316846001600160401b0316106111b55760405162461bcd60e51b815260206004820152600b60248201526a77726f6e6720646174657360a81b60448201526064016104f0565b84600787815481106111c9576111c96119b5565b90600052602060002090600502016000018190555083600787815481106111f2576111f26119b5565b906000526020600020906005020160010160006101000a8154816001600160401b0302191690836001600160401b03160217905550826007878154811061123b5761123b6119b5565b906000526020600020906005020160010160086101000a8154816001600160401b0302191690836001600160401b031602179055508160078781548110611284576112846119b5565b906000526020600020906005020160010160106101000a8154816001600160801b0302191690836001600160801b0316021790555080600787815481106112cd576112cd6119b5565b906000526020600020906005020160020160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505050505050565b3361131d6000546001600160a01b031690565b6001600160a01b0316146113435760405162461bcd60e51b81526004016104f090611a5f565b6001600160a01b0381166113a85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b604080516000808252602082019092526001600160a01b03841690839060405161142d9190611aad565b60006040518083038185875af1925050503d806000811461146a576040519150601f19603f3d011682016040523d82523d6000602084013e61146f565b606091505b50509050806114cc5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a20434c4f5f5452414e534645525f46414960448201526213115160ea1b60648201526084016104f0565b505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908816916115359190611aad565b6000604051808303816000865af19150503d8060008114611572576040519150601f19603f3d011682016040523d82523d6000602084013e611577565b606091505b50915091508180156115a15750805115806115a15750808060200190518101906115a19190611adc565b6115f95760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f46416044820152631253115160e21b60648201526084016104f0565b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b179052915160009283929087169161165d9190611aad565b6000604051808303816000865af19150503d806000811461169a576040519150601f19603f3d011682016040523d82523d6000602084013e61169f565b606091505b50915091508180156116c95750805115806116c95750808060200190518101906116c99190611adc565b6117155760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c45440060448201526064016104f0565b5050505050565b80356001600160a01b038116811461173357600080fd5b919050565b60006020828403121561174a57600080fd5b6117538261171c565b9392505050565b600080600080600060a0868803121561177257600080fd5b61177b8661171c565b97602087013597506040870135966060810135965060800135945092505050565b6000602082840312156117ae57600080fd5b5035919050565b80356001600160401b038116811461173357600080fd5b80356001600160801b038116811461173357600080fd5b600080600080600060a086880312156117fb57600080fd5b8535945061180b602087016117b5565b9350611819604087016117b5565b9250611827606087016117cc565b91506118356080870161171c565b90509295509295909350565b634e487b7160e01b600052604160045260246000fd5b60008060006060848603121561186c57600080fd5b6118758461171c565b92506020840135915060408401356001600160401b038082111561189857600080fd5b818601915086601f8301126118ac57600080fd5b8135818111156118be576118be611841565b604051601f8201601f19908116603f011681019083821181831017156118e6576118e6611841565b816040528281528960208487010111156118ff57600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b801515811461192f57600080fd5b50565b60006020828403121561194457600080fd5b813561175381611921565b60008060008060008060c0878903121561196857600080fd5b863595506020870135945061197f604088016117b5565b935061198d606088016117b5565b925061199b608088016117cc565b91506119a960a0880161171c565b90509295509295509295565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016119f3576119f36119cb565b5060010190565b8082028115828204841417611a1157611a116119cb565b92915050565b600082611a3457634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115611a1157611a116119cb565b81810381811115611a1157611a116119cb565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611aa657600080fd5b5051919050565b6000825160005b81811015611ace5760208186018101518583015201611ab4565b506000920191825250919050565b600060208284031215611aee57600080fd5b81516117538161192156fea26469706673582212200f2b48f8c5aa3f8c9f01110101af414364a9c328cecf48203f7c2aeda6c8368a64736f6c63430008130033