ETH Price: $3,160.42 (-8.67%)
Gas: 3 Gwei

Contract

0xc2F44Bc508b6b50047a2F3AfB1984eD105070bE1
 
Transaction Hash
Method
Block
From
To
Withdraw195507182024-03-31 1:49:11116 days ago1711849751IN
X2Y2: Presale
0 ETH0.0015314518.28754754
Harvest195507042024-03-31 1:46:23116 days ago1711849583IN
X2Y2: Presale
0 ETH0.0016453320.09793552
Withdraw194321812024-03-14 8:52:35132 days ago1710406355IN
X2Y2: Presale
0 ETH0.005761547.68709451
Withdraw194301522024-03-14 2:00:23133 days ago1710381623IN
X2Y2: Presale
0 ETH0.0039261746.88361647
Withdraw193752802024-03-06 9:37:35140 days ago1709717855IN
X2Y2: Presale
0 ETH0.0080250366.42199035
Withdraw193593992024-03-04 4:25:47143 days ago1709526347IN
X2Y2: Presale
0 ETH0.0042199841.84706466
Harvest193223632024-02-28 0:08:47148 days ago1709078927IN
X2Y2: Presale
0 ETH0.0043174852.73842061
Withdraw193172292024-02-27 6:54:47149 days ago1709016887IN
X2Y2: Presale
0 ETH0.0040941139.47317175
Withdraw193100552024-02-26 6:49:23150 days ago1708930163IN
X2Y2: Presale
0 ETH0.0021224224.5030521
Withdraw193040142024-02-25 10:31:11150 days ago1708857071IN
X2Y2: Presale
0 ETH0.0026517826.29614804
Harvest193039782024-02-25 10:23:59150 days ago1708856639IN
X2Y2: Presale
0 ETH0.0019465223.77694117
Withdraw192558632024-02-18 16:26:35157 days ago1708273595IN
X2Y2: Presale
0 ETH0.0028442833.96446225
Harvest192558592024-02-18 16:25:47157 days ago1708273547IN
X2Y2: Presale
0 ETH0.0021801133.66134537
Withdraw192266762024-02-14 14:03:59161 days ago1707919439IN
X2Y2: Presale
0 ETH0.0051410261.39052555
Harvest192266742024-02-14 14:03:23161 days ago1707919403IN
X2Y2: Presale
0 ETH0.0046253356.49888455
Harvest191624592024-02-05 13:46:35170 days ago1707140795IN
X2Y2: Presale
0 ETH0.001697620.73635086
Withdraw191530472024-02-04 6:03:47172 days ago1707026627IN
X2Y2: Presale
0 ETH0.0015336114.78621332
Withdraw190500822024-01-20 19:11:23186 days ago1705777883IN
X2Y2: Presale
0 ETH0.0016483713.64332005
Harvest189990692024-01-13 16:09:59193 days ago1705162199IN
X2Y2: Presale
0 ETH0.0022661522.89833433
Harvest188849022023-12-28 15:08:35209 days ago1703776115IN
X2Y2: Presale
0 ETH0.0033403551.57575855
Withdraw188322662023-12-21 5:49:35217 days ago1703137775IN
X2Y2: Presale
0 ETH0.0034126132.90251492
Withdraw187311972023-12-07 1:39:23231 days ago1701913163IN
X2Y2: Presale
0 ETH0.0034292740.95
Withdraw187311912023-12-07 1:38:11231 days ago1701913091IN
X2Y2: Presale
0 ETH0.0041295240.95
Harvest187256202023-12-06 6:52:59232 days ago1701845579IN
X2Y2: Presale
0 ETH0.0044698854.6
Harvest187255732023-12-06 6:43:35232 days ago1701845015IN
X2Y2: Presale
0 ETH0.0051957152.5
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
142085512022-02-15 4:21:13891 days ago1644898873
X2Y2: Presale
1,500 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Presale

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 10 : Presale.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;
pragma abicoder v2;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import './ITokenStaked.sol';

contract Presale is Ownable, ReentrancyGuard, ITokenStaked {
    using SafeERC20 for IERC20;

    enum SalePhase {
        Sale,
        SaleOver,
        Staking
    }

    struct UserInfo {
        uint256 tokensClaimed;
        uint256 rewardDebt;
        bool hasShare;
    }

    uint256 public immutable safetyBufferInBlocks;

    IERC20 public immutable x2y2Token; // x2y2
    IERC20 public immutable rewardToken; // weth

    // staking period in blocks
    uint256 public immutable STAKING_PERIOD_IN_BLOCKS;
    uint256 public immutable stakingStartBlock;
    uint256 public immutable stakingEndBlock;

    uint256 public immutable TOTAL_TOKEN_AMOUNT;
    uint256 public immutable TOTAL_RAISING_AMOUNT;
    uint256 public immutable MAX_SHARES;
    uint256 public immutable PRICE_PER_SHARE;
    uint256 public immutable TOKENS_PER_SHARE;

    SalePhase public currentPhase;

    // total shares sold (length of userInfo)
    uint256 public totalShareSold;
    // share * TOKENS_PER_SHARE
    uint256 public totalTokensSold;

    // weth harvested by user
    uint256 public totalRewardDistributed;
    // withdrawn reward token
    uint256 public tokenRewardTreasuryWithdrawn;

    mapping(address => bool) public signers;
    mapping(address => UserInfo) public userInfo;

    event SignerUpdate(address signer, bool isRemoval);
    event Deposit(address indexed user);
    event Harvest(address indexed user, uint256 amount);
    event NewPhase(SalePhase newSalePhase);
    event Withdraw(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 amount);
    event TreasuryWithdraw(uint256 amount);

    constructor(
        IERC20 _x2y2Token,
        IERC20 _rewardToken,
        uint256 _stakingStartBlock,
        uint256 _stakingEndBlock,
        address[] memory _signers
    ) {
        x2y2Token = (_x2y2Token);
        rewardToken = (_rewardToken);

        for (uint256 i = 0; i < _signers.length; i++) {
            signers[_signers[i]] = true;
            emit SignerUpdate(_signers[i], false);
        }

        // 15M token presale
        TOTAL_TOKEN_AMOUNT = 15_000_000 ether;
        TOTAL_RAISING_AMOUNT = 1500 ether;
        MAX_SHARES = 1000;
        PRICE_PER_SHARE = TOTAL_RAISING_AMOUNT / MAX_SHARES;
        TOKENS_PER_SHARE = TOTAL_TOKEN_AMOUNT / MAX_SHARES;

        STAKING_PERIOD_IN_BLOCKS = _stakingEndBlock - _stakingStartBlock;
        stakingStartBlock = _stakingStartBlock;
        stakingEndBlock = _stakingEndBlock;

        currentPhase = SalePhase.Sale;
        safetyBufferInBlocks = 30 * 6500; // ~ 1 month
    }

    function getTotalStaked() external view override returns (uint256) {
        if (block.number >= stakingStartBlock && block.number < stakingEndBlock) {
            return totalTokensSold;
        }
        return 0;
    }

    function updateSigners(address[] memory toAdd, address[] memory toRemove) public onlyOwner {
        for (uint256 i = 0; i < toAdd.length; i++) {
            signers[toAdd[i]] = true;
            emit SignerUpdate(toAdd[i], false);
        }
        for (uint256 i = 0; i < toRemove.length; i++) {
            delete signers[toRemove[i]];
            emit SignerUpdate(toRemove[i], true);
        }
    }

    function deposit(
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external payable nonReentrant {
        require(currentPhase == SalePhase.Sale, 'Deposit: Phase must be Sale');
        require(!userInfo[msg.sender].hasShare, 'Deposit: Has deposited');
        require(msg.value == PRICE_PER_SHARE, 'Deposit: Wrong amount');
        require(totalShareSold < MAX_SHARES, 'Deposit: Not raising anymore');

        address signer = ECDSA.recover(keccak256(abi.encode(msg.sender)), v, r, s);
        require(signers[signer], 'Deposit: Signature error');

        userInfo[msg.sender].hasShare = true;

        totalShareSold += 1;
        totalTokensSold += TOKENS_PER_SHARE;

        emit Deposit(msg.sender);
    }

    function _totalReward() internal view returns (uint256) {
        return
            tokenRewardTreasuryWithdrawn +
            totalRewardDistributed +
            rewardToken.balanceOf(address(this));
    }

    function _pendingReward(address user) internal view returns (uint256, uint256) {
        uint256 totalReward = _totalReward();
        uint256 userDebt = userInfo[user].rewardDebt;
        uint256 userTokensLeft = TOKENS_PER_SHARE - userInfo[user].tokensClaimed;

        uint256 theoreticalReward = totalReward / totalShareSold;
        uint256 userReward = ((theoreticalReward - userDebt) * userTokensLeft) / TOKENS_PER_SHARE;

        return (userReward, theoreticalReward);
    }

    function pendingRewards(address[] memory users) external view returns (uint256) {
        uint256 total;
        for (uint256 i = 0; i < users.length; i++) {
            (uint256 pending, uint256 _debt) = _pendingReward(users[i]);
            total += pending;
        }
        return total;
    }

    function pendingReward(address user) external view returns (uint256) {
        (uint256 _amount, uint256 _debt) = _pendingReward(user);
        return _amount;
    }

    function _pendingTokens(address user) internal view returns (uint256) {
        uint256 claimed = userInfo[user].tokensClaimed;

        if (block.number < stakingStartBlock) {
            return 0;
        } else if (block.number >= stakingEndBlock) {
            return TOKENS_PER_SHARE - claimed;
        }

        uint256 passingBlocks = block.number - stakingStartBlock;
        uint256 unlockedAmount = (TOKENS_PER_SHARE * passingBlocks) / STAKING_PERIOD_IN_BLOCKS;

        return unlockedAmount - claimed;
    }

    function pendingTokens(address user) external view returns (uint256) {
        return _pendingTokens(user);
    }

    function _harvest(address user) internal returns (uint256) {
        (uint256 _pending, uint256 _debt) = _pendingReward(user);

        if (_pending > 0) {
            totalRewardDistributed += _pending;
            userInfo[user].rewardDebt = _debt;
            rewardToken.safeTransfer(user, _pending);
            emit Harvest(user, _pending);
        }
        return _pending;
    }

    function harvest() external nonReentrant {
        require(currentPhase == SalePhase.Staking, 'Harvest: Phase must be Staking');
        require(userInfo[msg.sender].hasShare, 'Harvest: User not eligible');

        require(_harvest(msg.sender) > 0, 'Harvest: No pending reward');
    }

    function withdraw() external nonReentrant {
        require(currentPhase == SalePhase.Staking, 'Withdraw: Phase must be Staking');
        require(userInfo[msg.sender].hasShare, 'Withdraw: User not eligible');

        uint256 pending = _pendingTokens(msg.sender);

        require(pending > 0, 'Withdraw: No pending token');

        _harvest(msg.sender);

        userInfo[msg.sender].tokensClaimed += pending;
        x2y2Token.safeTransfer(msg.sender, pending);

        emit Withdraw(msg.sender, pending);
    }

    function emergencyWithdraw() external nonReentrant {
        require(block.number >= stakingEndBlock, 'Withdraw: Too early');
        require(currentPhase == SalePhase.Staking, 'Withdraw: Phase must be Staking');
        require(userInfo[msg.sender].hasShare, 'Withdraw: User not eligible');

        uint256 amount = TOKENS_PER_SHARE - userInfo[msg.sender].tokensClaimed;
        require(amount > 0, 'Withdraw: No pending token');

        x2y2Token.safeTransfer(msg.sender, amount);
        userInfo[msg.sender].tokensClaimed = TOKENS_PER_SHARE;
        emit EmergencyWithdraw(msg.sender, amount);
    }

    // withdraw presale ETH & remaining token, update to saleover
    function withdrawPresale() external onlyOwner nonReentrant {
        require(currentPhase == SalePhase.Sale, 'Owner: Phase must be Sale');

        uint256 balance = address(this).balance;
        Address.sendValue(payable(msg.sender), balance);

        uint256 returnAmount = x2y2Token.balanceOf(address(this)) -
            totalShareSold *
            TOKENS_PER_SHARE;
        if (returnAmount > 0) {
            x2y2Token.safeTransfer(msg.sender, returnAmount);
        }

        currentPhase = SalePhase.SaleOver;
        emit NewPhase(SalePhase.SaleOver);
    }

    function updatePhaseToStaking() external onlyOwner nonReentrant {
        require(currentPhase == SalePhase.SaleOver, 'Owner: Phase must be SaleOver');
        currentPhase = SalePhase.Staking;
        emit NewPhase(SalePhase.Staking);
    }

    function treasuryWithdraw(uint256 amount) external onlyOwner nonReentrant {
        require(
            block.number > stakingEndBlock + safetyBufferInBlocks,
            'Owner: staking have not ended yet'
        );
        require(amount > 0, 'Owner: withdraw > 0');

        tokenRewardTreasuryWithdrawn += amount;
        rewardToken.safeTransfer(msg.sender, amount);
        emit TreasuryWithdraw(amount);
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @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 is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied 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.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @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 making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 4 of 10 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 5 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 6 of 10 : ITokenStaked.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface ITokenStaked {
    function getTotalStaked() external view returns (uint256);
}

File 7 of 10 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 8 of 10 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

File 9 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 10 of 10 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_x2y2Token","type":"address"},{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_stakingStartBlock","type":"uint256"},{"internalType":"uint256","name":"_stakingEndBlock","type":"uint256"},{"internalType":"address[]","name":"_signers","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Presale.SalePhase","name":"newSalePhase","type":"uint8"}],"name":"NewPhase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bool","name":"isRemoval","type":"bool"}],"name":"SignerUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TreasuryWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"MAX_SHARES","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE_PER_SHARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKING_PERIOD_IN_BLOCKS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKENS_PER_SHARE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_RAISING_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_TOKEN_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentPhase","outputs":[{"internalType":"enum Presale.SalePhase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTotalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"pendingTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"safetyBufferInBlocks","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"signers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingStartBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenRewardTreasuryWithdrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalRewardDistributed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShareSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokensSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"treasuryWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updatePhaseToStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"toAdd","type":"address[]"},{"internalType":"address[]","name":"toRemove","type":"address[]"}],"name":"updateSigners","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"tokensClaimed","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"bool","name":"hasShare","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawPresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"x2y2Token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

6101e06040523480156200001257600080fd5b5060405162002b2138038062002b21833981016040819052620000359162000256565b6200004033620001c5565b600180556001600160a01b0380861660a052841660c05260005b815181101562000140576001600760008484815181106200007f576200007f6200036b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc648f6265408cc54c0dc26d24ba51dfc9f35ce1a63baa2228f65d93aaf11cc67828281518110620000f457620000f46200036b565b60200260200101516000604051620001239291906001600160a01b039290921682521515602082015260400190565b60405180910390a180620001378162000397565b9150506200005a565b506a0c685fa11e01ec6f00000061014052685150ae84a8cdf000006101608190526103e86101808190526200017591620003b5565b6101a05261018051610140516200018d9190620003b5565b6101c0526200019d8383620003d8565b60e05250610100919091526101205250506002805460ff191690556202f9b8608052620003f2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200022b57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b8051620002518162000215565b919050565b600080600080600060a086880312156200026f57600080fd5b85516200027c8162000215565b80955050602080870151620002918162000215565b6040880151606089015160808a015192975090955093506001600160401b0380821115620002be57600080fd5b818901915089601f830112620002d357600080fd5b815181811115620002e857620002e86200022e565b8060051b604051601f19603f830116810181811085821117156200031057620003106200022e565b60405291825284820192508381018501918c8311156200032f57600080fd5b938501935b828510156200035857620003488562000244565b8452938501939285019262000334565b8096505050505050509295509295909350565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415620003ae57620003ae62000381565b5060010190565b600082620003d357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015620003ed57620003ed62000381565b500390565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516125f26200052f600039600081816104bc01528181610f38015281816113580152818161154d015281816115da01528181611759015281816117db01528181611afd0152611b3901526000818161057901526111ac01526000818161035401526112130152600061046601526000610689015260008181610218015281816106da01528181610d280152818161146d015261172e0152600081816105e1015281816106af015281816116fd015261178b0152600081816102bf01526117b601526000818161065501528181610e0f015281816118730152611f0a0152600081816105ad01528181610afb01528181610f7b0152818161101001526115a00152600081816105100152610d0701526125f26000f3fe6080604052600436106101ae5760003560e01c80637267994e116100ed578063ce9d16fe11610090578063ce9d16fe14610532578063db2e21bc14610552578063df1fb71314610567578063ebde5ee61461059b578063ec2fc051146105cf578063f2fde38b14610603578063f40f0f5214610623578063f7c618c114610643578063fc9768271461067757600080fd5b80637267994e146103eb578063736c0d5b146103fe5780638337c3c01461043e5780638da1a403146104545780638da5cb5b14610488578063b9bd4730146104aa578063c031a66f146104de578063ca90c8c6146104fe57600080fd5b8063350b236911610155578063350b23691461030d5780633ccfd60b1461032d5780633e8ff57b146103425780634641257d1461037657806363b201171461038b57806365267139146103a15780636df5ee2b146103c1578063715018a6146103d657600080fd5b8063055ad42e146101b35780630917e776146101e35780630a122c8a14610206578063194bf5541461023a5780631959a002146102515780631c9b1736146102ad5780632ce9785f146102e157806330188ee8146102f7575b600080fd5b3480156101bf57600080fd5b506002546101cd9060ff1681565b6040516101da919061212d565b60405180910390f35b3480156101ef57600080fd5b506101f86106ab565b6040519081526020016101da565b34801561021257600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b34801561024657600080fd5b5061024f61070e565b005b34801561025d57600080fd5b5061029061026c366004612171565b60086020526000908152604090208054600182015460029092015490919060ff1683565b6040805193845260208401929092521515908201526060016101da565b3480156102b957600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b3480156102ed57600080fd5b506101f860065481565b34801561030357600080fd5b506101f860055481565b34801561031957600080fd5b5061024f610328366004612239565b61081c565b34801561033957600080fd5b5061024f610a04565b34801561034e57600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b34801561038257600080fd5b5061024f610b5f565b34801561039757600080fd5b506101f860045481565b3480156103ad57600080fd5b5061024f6103bc36600461229d565b610cab565b3480156103cd57600080fd5b5061024f610e70565b3480156103e257600080fd5b5061024f611085565b61024f6103f93660046122b6565b6110c0565b34801561040a57600080fd5b5061042e610419366004612171565b60076020526000908152604090205460ff1681565b60405190151581526020016101da565b34801561044a57600080fd5b506101f860035481565b34801561046057600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b34801561049457600080fd5b5061049d6113c2565b6040516101da91906122f1565b3480156104b657600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b3480156104ea57600080fd5b506101f86104f9366004612171565b6113d1565b34801561050a57600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b34801561053e57600080fd5b506101f861054d366004612305565b6113e2565b34801561055e57600080fd5b5061024f611443565b34801561057357600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b3480156105a757600080fd5b5061049d7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105db57600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b34801561060f57600080fd5b5061024f61061e366004612171565b61162b565b34801561062f57600080fd5b506101f861063e366004612171565b6116cb565b34801561064f57600080fd5b5061049d7f000000000000000000000000000000000000000000000000000000000000000081565b34801561068357600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000043101580156106fc57507f000000000000000000000000000000000000000000000000000000000000000043105b15610708575060045490565b50600090565b336107176113c2565b6001600160a01b0316146107465760405162461bcd60e51b815260040161073d9061233a565b60405180910390fd5b600260015414156107695760405162461bcd60e51b815260040161073d9061236f565b600260019081556002805460ff169081111561078757610787612117565b146107d45760405162461bcd60e51b815260206004820152601d60248201527f4f776e65723a205068617365206d7573742062652053616c654f766572000000604482015260640161073d565b6002805460ff1916811781556040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161080e9161212d565b60405180910390a160018055565b336108256113c2565b6001600160a01b03161461084b5760405162461bcd60e51b815260040161073d9061233a565b60005b82518110156109295760016007600085848151811061086f5761086f6123a6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc648f6265408cc54c0dc26d24ba51dfc9f35ce1a63baa2228f65d93aaf11cc678382815181106108e1576108e16123a6565b6020026020010151600060405161090f9291906001600160a01b039290921682521515602082015260400190565b60405180910390a180610921816123d2565b91505061084e565b5060005b81518110156109ff576007600083838151811061094c5761094c6123a6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557fc648f6265408cc54c0dc26d24ba51dfc9f35ce1a63baa2228f65d93aaf11cc678282815181106109b7576109b76123a6565b602002602001015160016040516109e59291906001600160a01b039290921682521515602082015260400190565b60405180910390a1806109f7816123d2565b91505061092d565b505050565b60026001541415610a275760405162461bcd60e51b815260040161073d9061236f565b60026001819055805460ff1681811115610a4357610a43612117565b14610a605760405162461bcd60e51b815260040161073d906123ed565b3360009081526008602052604090206002015460ff16610a925760405162461bcd60e51b815260040161073d90612424565b6000610a9d336116e2565b905060008111610abf5760405162461bcd60e51b815260040161073d9061245b565b610ac83361181e565b503360009081526008602052604081208054839290610ae8908490612492565b90915550610b2290506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836118e4565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a25060018055565b60026001541415610b825760405162461bcd60e51b815260040161073d9061236f565b60026001819055805460ff1681811115610b9e57610b9e612117565b14610beb5760405162461bcd60e51b815260206004820152601e60248201527f486172766573743a205068617365206d757374206265205374616b696e670000604482015260640161073d565b3360009081526008602052604090206002015460ff16610c4d5760405162461bcd60e51b815260206004820152601a60248201527f486172766573743a2055736572206e6f7420656c696769626c65000000000000604482015260640161073d565b6000610c583361181e565b11610ca55760405162461bcd60e51b815260206004820152601a60248201527f486172766573743a204e6f2070656e64696e6720726577617264000000000000604482015260640161073d565b60018055565b33610cb46113c2565b6001600160a01b031614610cda5760405162461bcd60e51b815260040161073d9061233a565b60026001541415610cfd5760405162461bcd60e51b815260040161073d9061236f565b6002600155610d4c7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612492565b4311610da45760405162461bcd60e51b815260206004820152602160248201527f4f776e65723a207374616b696e672068617665206e6f7420656e6465642079656044820152601d60fa1b606482015260840161073d565b60008111610dea5760405162461bcd60e51b815260206004820152601360248201527204f776e65723a207769746864726177203e203606c1b604482015260640161073d565b8060066000828254610dfc9190612492565b90915550610e3690506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836118e4565b6040518181527ff1b96db22d7f3eb7ef19d9ddbc4d63be139f5d014216d4e42107e10cfd4ff16c9060200160405180910390a15060018055565b33610e796113c2565b6001600160a01b031614610e9f5760405162461bcd60e51b815260040161073d9061233a565b60026001541415610ec25760405162461bcd60e51b815260040161073d9061236f565b600260015560006002805460ff1690811115610ee057610ee0612117565b14610f295760405162461bcd60e51b81526020600482015260196024820152784f776e65723a205068617365206d7573742062652053616c6560381b604482015260640161073d565b47610f343382611936565b60007f0000000000000000000000000000000000000000000000000000000000000000600354610f6491906124aa565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610fb09030906004016122f1565b602060405180830381865afa158015610fcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff191906124c9565b610ffb91906124e2565b90508015611037576110376001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836118e4565b6002805460ff191660019081179091556040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b93916110759161212d565b60405180910390a1505060018055565b3361108e6113c2565b6001600160a01b0316146110b45760405162461bcd60e51b815260040161073d9061233a565b6110be6000611a4f565b565b600260015414156110e35760405162461bcd60e51b815260040161073d9061236f565b600260015560006002805460ff169081111561110157611101612117565b1461114e5760405162461bcd60e51b815260206004820152601b60248201527f4465706f7369743a205068617365206d7573742062652053616c650000000000604482015260640161073d565b3360009081526008602052604090206002015460ff16156111aa5760405162461bcd60e51b815260206004820152601660248201527511195c1bdcda5d0e8812185cc819195c1bdcda5d195960521b604482015260640161073d565b7f000000000000000000000000000000000000000000000000000000000000000034146112115760405162461bcd60e51b815260206004820152601560248201527411195c1bdcda5d0e8815dc9bdb99c8185b5bdd5b9d605a1b604482015260640161073d565b7f0000000000000000000000000000000000000000000000000000000000000000600354106112825760405162461bcd60e51b815260206004820152601c60248201527f4465706f7369743a204e6f742072616973696e6720616e796d6f726500000000604482015260640161073d565b60006112b63360405160200161129891906122f1565b60405160208183030381529060405280519060200120858585611a9f565b6001600160a01b03811660009081526007602052604090205490915060ff1661131c5760405162461bcd60e51b81526020600482015260186024820152772232b837b9b4ba1d1029b4b3b730ba3ab9329032b93937b960411b604482015260640161073d565b336000908152600860205260408120600201805460ff19166001908117909155600380549192909161134f908490612492565b925050819055507f0000000000000000000000000000000000000000000000000000000000000000600460008282546113889190612492565b909155505060405133907f8ce0bd46ec50cf39f0d0ea8686a686eb226af5796dcda4231b26fb84b5ef123490600090a25050600180555050565b6000546001600160a01b031690565b60006113dc826116e2565b92915050565b60008060005b835181101561143c57600080611416868481518110611409576114096123a6565b6020026020010151611ac7565b90925090506114258285612492565b935050508080611434906123d2565b9150506113e8565b5092915050565b600260015414156114665760405162461bcd60e51b815260040161073d9061236f565b60026001557f00000000000000000000000000000000000000000000000000000000000000004310156114d15760405162461bcd60e51b815260206004820152601360248201527257697468647261773a20546f6f206561726c7960681b604482015260640161073d565b6002805460ff16818111156114e8576114e8612117565b146115055760405162461bcd60e51b815260040161073d906123ed565b3360009081526008602052604090206002015460ff166115375760405162461bcd60e51b815260040161073d90612424565b33600090815260086020526040812054611571907f00000000000000000000000000000000000000000000000000000000000000006124e2565b9050600081116115935760405162461bcd60e51b815260040161073d9061245b565b6115c76001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633836118e4565b33600081815260086020526040908190207f00000000000000000000000000000000000000000000000000000000000000009055517f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969590610b509084815260200190565b336116346113c2565b6001600160a01b03161461165a5760405162461bcd60e51b815260040161073d9061233a565b6001600160a01b0381166116bf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161073d565b6116c881611a4f565b50565b60008060006116d984611ac7565b50949350505050565b6001600160a01b0381166000908152600860205260408120547f000000000000000000000000000000000000000000000000000000000000000043101561172c5750600092915050565b7f000000000000000000000000000000000000000000000000000000000000000043106117845761177d817f00000000000000000000000000000000000000000000000000000000000000006124e2565b9392505050565b60006117b07f0000000000000000000000000000000000000000000000000000000000000000436124e2565b905060007f00000000000000000000000000000000000000000000000000000000000000006117ff837f00000000000000000000000000000000000000000000000000000000000000006124aa565b61180991906124f9565b905061181583826124e2565b95945050505050565b600080600061182c84611ac7565b9092509050811561143c5781600560008282546118499190612492565b90915550506001600160a01b03808516600090815260086020526040902060010182905561189a907f00000000000000000000000000000000000000000000000000000000000000001685846118e4565b836001600160a01b03167fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba836040516118d591815260200190565b60405180910390a25092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526109ff908490611b85565b804710156119865760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161073d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119d3576040519150601f19603f3d011682016040523d82523d6000602084013e6119d8565b606091505b50509050806109ff5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161073d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000611ab087878787611c57565b91509150611abd81611d3a565b5095945050505050565b6000806000611ad4611ef0565b6001600160a01b03851660009081526008602052604081206001810154905492935091611b21907f00000000000000000000000000000000000000000000000000000000000000006124e2565b9050600060035484611b3391906124f9565b905060007f000000000000000000000000000000000000000000000000000000000000000083611b6386856124e2565b611b6d91906124aa565b611b7791906124f9565b989197509095505050505050565b6000611bda826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f9f9092919063ffffffff16565b8051909150156109ff5780806020019051810190611bf8919061251b565b6109ff5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161073d565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115611c845750600090506003611d31565b8460ff16601b14158015611c9c57508460ff16601c14155b15611cad5750600090506004611d31565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d01573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d2a57600060019250925050611d31565b9150600090505b94509492505050565b6000816004811115611d4e57611d4e612117565b1415611d575750565b6001816004811115611d6b57611d6b612117565b1415611db45760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161073d565b6002816004811115611dc857611dc8612117565b1415611e165760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161073d565b6003816004811115611e2a57611e2a612117565b1415611e835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161073d565b6004816004811115611e9757611e97612117565b14156116c85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161073d565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190611f3f9030906004016122f1565b602060405180830381865afa158015611f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8091906124c9565b600554600654611f909190612492565b611f9a9190612492565b905090565b6060611fae8484600085611fb6565b949350505050565b6060824710156120175760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161073d565b843b6120655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161073d565b600080866001600160a01b03168587604051612081919061256d565b60006040518083038185875af1925050503d80600081146120be576040519150601f19603f3d011682016040523d82523d6000602084013e6120c3565b606091505b50915091506120d38282866120de565b979650505050505050565b606083156120ed57508161177d565b8251156120fd5782518084602001fd5b8160405162461bcd60e51b815260040161073d9190612589565b634e487b7160e01b600052602160045260246000fd5b602081016003831061214f57634e487b7160e01b600052602160045260246000fd5b91905290565b80356001600160a01b038116811461216c57600080fd5b919050565b60006020828403121561218357600080fd5b61177d82612155565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126121b357600080fd5b8135602067ffffffffffffffff808311156121d0576121d061218c565b8260051b604051601f19603f830116810181811084821117156121f5576121f561218c565b60405293845285810183019383810192508785111561221357600080fd5b83870191505b848210156120d35761222a82612155565b83529183019190830190612219565b6000806040838503121561224c57600080fd5b823567ffffffffffffffff8082111561226457600080fd5b612270868387016121a2565b9350602085013591508082111561228657600080fd5b50612293858286016121a2565b9150509250929050565b6000602082840312156122af57600080fd5b5035919050565b6000806000606084860312156122cb57600080fd5b833560ff811681146122dc57600080fd5b95602085013595506040909401359392505050565b6001600160a01b0391909116815260200190565b60006020828403121561231757600080fd5b813567ffffffffffffffff81111561232e57600080fd5b611fae848285016121a2565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156123e6576123e66123bc565b5060010190565b6020808252601f908201527f57697468647261773a205068617365206d757374206265205374616b696e6700604082015260600190565b6020808252601b908201527f57697468647261773a2055736572206e6f7420656c696769626c650000000000604082015260600190565b6020808252601a908201527f57697468647261773a204e6f2070656e64696e6720746f6b656e000000000000604082015260600190565b600082198211156124a5576124a56123bc565b500190565b60008160001904831182151516156124c4576124c46123bc565b500290565b6000602082840312156124db57600080fd5b5051919050565b6000828210156124f4576124f46123bc565b500390565b60008261251657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561252d57600080fd5b8151801515811461177d57600080fd5b60005b83811015612558578181015183820152602001612540565b83811115612567576000848401525b50505050565b6000825161257f81846020870161253d565b9190910192915050565b60208152600082518060208401526125a881604085016020870161253d565b601f01601f1916919091016040019291505056fea26469706673582212200156799ca4c281d83cfb56358298509d08fafcf9b6a142c89452a450c118d3be64736f6c634300080b00330000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000d8e0680000000000000000000000000000000000000000000000000000000000fc950800000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009b31b0bb3570fd3d62e03e1fedc8854595250071

Deployed Bytecode

0x6080604052600436106101ae5760003560e01c80637267994e116100ed578063ce9d16fe11610090578063ce9d16fe14610532578063db2e21bc14610552578063df1fb71314610567578063ebde5ee61461059b578063ec2fc051146105cf578063f2fde38b14610603578063f40f0f5214610623578063f7c618c114610643578063fc9768271461067757600080fd5b80637267994e146103eb578063736c0d5b146103fe5780638337c3c01461043e5780638da1a403146104545780638da5cb5b14610488578063b9bd4730146104aa578063c031a66f146104de578063ca90c8c6146104fe57600080fd5b8063350b236911610155578063350b23691461030d5780633ccfd60b1461032d5780633e8ff57b146103425780634641257d1461037657806363b201171461038b57806365267139146103a15780636df5ee2b146103c1578063715018a6146103d657600080fd5b8063055ad42e146101b35780630917e776146101e35780630a122c8a14610206578063194bf5541461023a5780631959a002146102515780631c9b1736146102ad5780632ce9785f146102e157806330188ee8146102f7575b600080fd5b3480156101bf57600080fd5b506002546101cd9060ff1681565b6040516101da919061212d565b60405180910390f35b3480156101ef57600080fd5b506101f86106ab565b6040519081526020016101da565b34801561021257600080fd5b506101f87f0000000000000000000000000000000000000000000000000000000000fc950881565b34801561024657600080fd5b5061024f61070e565b005b34801561025d57600080fd5b5061029061026c366004612171565b60086020526000908152604090208054600182015460029092015490919060ff1683565b6040805193845260208401929092521515908201526060016101da565b3480156102b957600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000023b4a081565b3480156102ed57600080fd5b506101f860065481565b34801561030357600080fd5b506101f860055481565b34801561031957600080fd5b5061024f610328366004612239565b61081c565b34801561033957600080fd5b5061024f610a04565b34801561034e57600080fd5b506101f87f00000000000000000000000000000000000000000000000000000000000003e881565b34801561038257600080fd5b5061024f610b5f565b34801561039757600080fd5b506101f860045481565b3480156103ad57600080fd5b5061024f6103bc36600461229d565b610cab565b3480156103cd57600080fd5b5061024f610e70565b3480156103e257600080fd5b5061024f611085565b61024f6103f93660046122b6565b6110c0565b34801561040a57600080fd5b5061042e610419366004612171565b60076020526000908152604090205460ff1681565b60405190151581526020016101da565b34801561044a57600080fd5b506101f860035481565b34801561046057600080fd5b506101f87f00000000000000000000000000000000000000000000005150ae84a8cdf0000081565b34801561049457600080fd5b5061049d6113c2565b6040516101da91906122f1565b3480156104b657600080fd5b506101f87f00000000000000000000000000000000000000000000032d26d12e980b60000081565b3480156104ea57600080fd5b506101f86104f9366004612171565b6113d1565b34801561050a57600080fd5b506101f87f000000000000000000000000000000000000000000000000000000000002f9b881565b34801561053e57600080fd5b506101f861054d366004612305565b6113e2565b34801561055e57600080fd5b5061024f611443565b34801561057357600080fd5b506101f87f00000000000000000000000000000000000000000000000014d1120d7b16000081565b3480156105a757600080fd5b5061049d7f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc981565b3480156105db57600080fd5b506101f87f0000000000000000000000000000000000000000000000000000000000d8e06881565b34801561060f57600080fd5b5061024f61061e366004612171565b61162b565b34801561062f57600080fd5b506101f861063e366004612171565b6116cb565b34801561064f57600080fd5b5061049d7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b34801561068357600080fd5b506101f87f0000000000000000000000000000000000000000000c685fa11e01ec6f00000081565b60007f0000000000000000000000000000000000000000000000000000000000d8e06843101580156106fc57507f0000000000000000000000000000000000000000000000000000000000fc950843105b15610708575060045490565b50600090565b336107176113c2565b6001600160a01b0316146107465760405162461bcd60e51b815260040161073d9061233a565b60405180910390fd5b600260015414156107695760405162461bcd60e51b815260040161073d9061236f565b600260019081556002805460ff169081111561078757610787612117565b146107d45760405162461bcd60e51b815260206004820152601d60248201527f4f776e65723a205068617365206d7573742062652053616c654f766572000000604482015260640161073d565b6002805460ff1916811781556040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b939161080e9161212d565b60405180910390a160018055565b336108256113c2565b6001600160a01b03161461084b5760405162461bcd60e51b815260040161073d9061233a565b60005b82518110156109295760016007600085848151811061086f5761086f6123a6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055507fc648f6265408cc54c0dc26d24ba51dfc9f35ce1a63baa2228f65d93aaf11cc678382815181106108e1576108e16123a6565b6020026020010151600060405161090f9291906001600160a01b039290921682521515602082015260400190565b60405180910390a180610921816123d2565b91505061084e565b5060005b81518110156109ff576007600083838151811061094c5761094c6123a6565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81549060ff02191690557fc648f6265408cc54c0dc26d24ba51dfc9f35ce1a63baa2228f65d93aaf11cc678282815181106109b7576109b76123a6565b602002602001015160016040516109e59291906001600160a01b039290921682521515602082015260400190565b60405180910390a1806109f7816123d2565b91505061092d565b505050565b60026001541415610a275760405162461bcd60e51b815260040161073d9061236f565b60026001819055805460ff1681811115610a4357610a43612117565b14610a605760405162461bcd60e51b815260040161073d906123ed565b3360009081526008602052604090206002015460ff16610a925760405162461bcd60e51b815260040161073d90612424565b6000610a9d336116e2565b905060008111610abf5760405162461bcd60e51b815260040161073d9061245b565b610ac83361181e565b503360009081526008602052604081208054839290610ae8908490612492565b90915550610b2290506001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc91633836118e4565b60405181815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364906020015b60405180910390a25060018055565b60026001541415610b825760405162461bcd60e51b815260040161073d9061236f565b60026001819055805460ff1681811115610b9e57610b9e612117565b14610beb5760405162461bcd60e51b815260206004820152601e60248201527f486172766573743a205068617365206d757374206265205374616b696e670000604482015260640161073d565b3360009081526008602052604090206002015460ff16610c4d5760405162461bcd60e51b815260206004820152601a60248201527f486172766573743a2055736572206e6f7420656c696769626c65000000000000604482015260640161073d565b6000610c583361181e565b11610ca55760405162461bcd60e51b815260206004820152601a60248201527f486172766573743a204e6f2070656e64696e6720726577617264000000000000604482015260640161073d565b60018055565b33610cb46113c2565b6001600160a01b031614610cda5760405162461bcd60e51b815260040161073d9061233a565b60026001541415610cfd5760405162461bcd60e51b815260040161073d9061236f565b6002600155610d4c7f000000000000000000000000000000000000000000000000000000000002f9b87f0000000000000000000000000000000000000000000000000000000000fc9508612492565b4311610da45760405162461bcd60e51b815260206004820152602160248201527f4f776e65723a207374616b696e672068617665206e6f7420656e6465642079656044820152601d60fa1b606482015260840161073d565b60008111610dea5760405162461bcd60e51b815260206004820152601360248201527204f776e65723a207769746864726177203e203606c1b604482015260640161073d565b8060066000828254610dfc9190612492565b90915550610e3690506001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21633836118e4565b6040518181527ff1b96db22d7f3eb7ef19d9ddbc4d63be139f5d014216d4e42107e10cfd4ff16c9060200160405180910390a15060018055565b33610e796113c2565b6001600160a01b031614610e9f5760405162461bcd60e51b815260040161073d9061233a565b60026001541415610ec25760405162461bcd60e51b815260040161073d9061236f565b600260015560006002805460ff1690811115610ee057610ee0612117565b14610f295760405162461bcd60e51b81526020600482015260196024820152784f776e65723a205068617365206d7573742062652053616c6560381b604482015260640161073d565b47610f343382611936565b60007f00000000000000000000000000000000000000000000032d26d12e980b600000600354610f6491906124aa565b6040516370a0823160e01b81526001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc916906370a0823190610fb09030906004016122f1565b602060405180830381865afa158015610fcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff191906124c9565b610ffb91906124e2565b90508015611037576110376001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc91633836118e4565b6002805460ff191660019081179091556040517f31f72b44f546d9e7eaec13f65636997665e15f134a81c82924f568f5c0d07b93916110759161212d565b60405180910390a1505060018055565b3361108e6113c2565b6001600160a01b0316146110b45760405162461bcd60e51b815260040161073d9061233a565b6110be6000611a4f565b565b600260015414156110e35760405162461bcd60e51b815260040161073d9061236f565b600260015560006002805460ff169081111561110157611101612117565b1461114e5760405162461bcd60e51b815260206004820152601b60248201527f4465706f7369743a205068617365206d7573742062652053616c650000000000604482015260640161073d565b3360009081526008602052604090206002015460ff16156111aa5760405162461bcd60e51b815260206004820152601660248201527511195c1bdcda5d0e8812185cc819195c1bdcda5d195960521b604482015260640161073d565b7f00000000000000000000000000000000000000000000000014d1120d7b16000034146112115760405162461bcd60e51b815260206004820152601560248201527411195c1bdcda5d0e8815dc9bdb99c8185b5bdd5b9d605a1b604482015260640161073d565b7f00000000000000000000000000000000000000000000000000000000000003e8600354106112825760405162461bcd60e51b815260206004820152601c60248201527f4465706f7369743a204e6f742072616973696e6720616e796d6f726500000000604482015260640161073d565b60006112b63360405160200161129891906122f1565b60405160208183030381529060405280519060200120858585611a9f565b6001600160a01b03811660009081526007602052604090205490915060ff1661131c5760405162461bcd60e51b81526020600482015260186024820152772232b837b9b4ba1d1029b4b3b730ba3ab9329032b93937b960411b604482015260640161073d565b336000908152600860205260408120600201805460ff19166001908117909155600380549192909161134f908490612492565b925050819055507f00000000000000000000000000000000000000000000032d26d12e980b600000600460008282546113889190612492565b909155505060405133907f8ce0bd46ec50cf39f0d0ea8686a686eb226af5796dcda4231b26fb84b5ef123490600090a25050600180555050565b6000546001600160a01b031690565b60006113dc826116e2565b92915050565b60008060005b835181101561143c57600080611416868481518110611409576114096123a6565b6020026020010151611ac7565b90925090506114258285612492565b935050508080611434906123d2565b9150506113e8565b5092915050565b600260015414156114665760405162461bcd60e51b815260040161073d9061236f565b60026001557f0000000000000000000000000000000000000000000000000000000000fc95084310156114d15760405162461bcd60e51b815260206004820152601360248201527257697468647261773a20546f6f206561726c7960681b604482015260640161073d565b6002805460ff16818111156114e8576114e8612117565b146115055760405162461bcd60e51b815260040161073d906123ed565b3360009081526008602052604090206002015460ff166115375760405162461bcd60e51b815260040161073d90612424565b33600090815260086020526040812054611571907f00000000000000000000000000000000000000000000032d26d12e980b6000006124e2565b9050600081116115935760405162461bcd60e51b815260040161073d9061245b565b6115c76001600160a01b037f0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc91633836118e4565b33600081815260086020526040908190207f00000000000000000000000000000000000000000000032d26d12e980b6000009055517f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd969590610b509084815260200190565b336116346113c2565b6001600160a01b03161461165a5760405162461bcd60e51b815260040161073d9061233a565b6001600160a01b0381166116bf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161073d565b6116c881611a4f565b50565b60008060006116d984611ac7565b50949350505050565b6001600160a01b0381166000908152600860205260408120547f0000000000000000000000000000000000000000000000000000000000d8e06843101561172c5750600092915050565b7f0000000000000000000000000000000000000000000000000000000000fc950843106117845761177d817f00000000000000000000000000000000000000000000032d26d12e980b6000006124e2565b9392505050565b60006117b07f0000000000000000000000000000000000000000000000000000000000d8e068436124e2565b905060007f000000000000000000000000000000000000000000000000000000000023b4a06117ff837f00000000000000000000000000000000000000000000032d26d12e980b6000006124aa565b61180991906124f9565b905061181583826124e2565b95945050505050565b600080600061182c84611ac7565b9092509050811561143c5781600560008282546118499190612492565b90915550506001600160a01b03808516600090815260086020526040902060010182905561189a907f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc21685846118e4565b836001600160a01b03167fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba836040516118d591815260200190565b60405180910390a25092915050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526109ff908490611b85565b804710156119865760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161073d565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119d3576040519150601f19603f3d011682016040523d82523d6000602084013e6119d8565b606091505b50509050806109ff5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161073d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000611ab087878787611c57565b91509150611abd81611d3a565b5095945050505050565b6000806000611ad4611ef0565b6001600160a01b03851660009081526008602052604081206001810154905492935091611b21907f00000000000000000000000000000000000000000000032d26d12e980b6000006124e2565b9050600060035484611b3391906124f9565b905060007f00000000000000000000000000000000000000000000032d26d12e980b60000083611b6386856124e2565b611b6d91906124aa565b611b7791906124f9565b989197509095505050505050565b6000611bda826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f9f9092919063ffffffff16565b8051909150156109ff5780806020019051810190611bf8919061251b565b6109ff5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161073d565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115611c845750600090506003611d31565b8460ff16601b14158015611c9c57508460ff16601c14155b15611cad5750600090506004611d31565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611d01573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d2a57600060019250925050611d31565b9150600090505b94509492505050565b6000816004811115611d4e57611d4e612117565b1415611d575750565b6001816004811115611d6b57611d6b612117565b1415611db45760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161073d565b6002816004811115611dc857611dc8612117565b1415611e165760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161073d565b6003816004811115611e2a57611e2a612117565b1415611e835760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161073d565b6004816004811115611e9757611e97612117565b14156116c85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161073d565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216906370a0823190611f3f9030906004016122f1565b602060405180830381865afa158015611f5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f8091906124c9565b600554600654611f909190612492565b611f9a9190612492565b905090565b6060611fae8484600085611fb6565b949350505050565b6060824710156120175760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161073d565b843b6120655760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161073d565b600080866001600160a01b03168587604051612081919061256d565b60006040518083038185875af1925050503d80600081146120be576040519150601f19603f3d011682016040523d82523d6000602084013e6120c3565b606091505b50915091506120d38282866120de565b979650505050505050565b606083156120ed57508161177d565b8251156120fd5782518084602001fd5b8160405162461bcd60e51b815260040161073d9190612589565b634e487b7160e01b600052602160045260246000fd5b602081016003831061214f57634e487b7160e01b600052602160045260246000fd5b91905290565b80356001600160a01b038116811461216c57600080fd5b919050565b60006020828403121561218357600080fd5b61177d82612155565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126121b357600080fd5b8135602067ffffffffffffffff808311156121d0576121d061218c565b8260051b604051601f19603f830116810181811084821117156121f5576121f561218c565b60405293845285810183019383810192508785111561221357600080fd5b83870191505b848210156120d35761222a82612155565b83529183019190830190612219565b6000806040838503121561224c57600080fd5b823567ffffffffffffffff8082111561226457600080fd5b612270868387016121a2565b9350602085013591508082111561228657600080fd5b50612293858286016121a2565b9150509250929050565b6000602082840312156122af57600080fd5b5035919050565b6000806000606084860312156122cb57600080fd5b833560ff811681146122dc57600080fd5b95602085013595506040909401359392505050565b6001600160a01b0391909116815260200190565b60006020828403121561231757600080fd5b813567ffffffffffffffff81111561232e57600080fd5b611fae848285016121a2565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156123e6576123e66123bc565b5060010190565b6020808252601f908201527f57697468647261773a205068617365206d757374206265205374616b696e6700604082015260600190565b6020808252601b908201527f57697468647261773a2055736572206e6f7420656c696769626c650000000000604082015260600190565b6020808252601a908201527f57697468647261773a204e6f2070656e64696e6720746f6b656e000000000000604082015260600190565b600082198211156124a5576124a56123bc565b500190565b60008160001904831182151516156124c4576124c46123bc565b500290565b6000602082840312156124db57600080fd5b5051919050565b6000828210156124f4576124f46123bc565b500390565b60008261251657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561252d57600080fd5b8151801515811461177d57600080fd5b60005b83811015612558578181015183820152602001612540565b83811115612567576000848401525b50505050565b6000825161257f81846020870161253d565b9190910192915050565b60208152600082518060208401526125a881604085016020870161253d565b601f01601f1916919091016040019291505056fea26469706673582212200156799ca4c281d83cfb56358298509d08fafcf9b6a142c89452a450c118d3be64736f6c634300080b0033

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

0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000d8e0680000000000000000000000000000000000000000000000000000000000fc950800000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009b31b0bb3570fd3d62e03e1fedc8854595250071

-----Decoded View---------------
Arg [0] : _x2y2Token (address): 0x1E4EDE388cbc9F4b5c79681B7f94d36a11ABEBC9
Arg [1] : _rewardToken (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _stakingStartBlock (uint256): 14213224
Arg [3] : _stakingEndBlock (uint256): 16553224
Arg [4] : _signers (address[]): 0x9b31b0BB3570Fd3d62e03E1fEDC8854595250071

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000001e4ede388cbc9f4b5c79681b7f94d36a11abebc9
Arg [1] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [2] : 0000000000000000000000000000000000000000000000000000000000d8e068
Arg [3] : 0000000000000000000000000000000000000000000000000000000000fc9508
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000009b31b0bb3570fd3d62e03e1fedc8854595250071


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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