ETH Price: $3,646.42 (+9.74%)

Contract

0xA24cb62748b33fD5de8F5436ac91B59fB6aDFF58
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw Token197015972024-04-21 5:08:59220 days ago1713676139IN
0xA24cb627...fB6aDFF58
0 ETH0.000297215.94368354
Set Claim196965272024-04-20 12:08:59221 days ago1713614939IN
0xA24cb627...fB6aDFF58
0 ETH0.000204738.10240652
Set Claim196956912024-04-20 9:19:47221 days ago1713604787IN
0xA24cb627...fB6aDFF58
0 ETH0.000331977.03628554
Set Vesting196956892024-04-20 9:19:23221 days ago1713604763IN
0xA24cb627...fB6aDFF58
0 ETH0.000785466.85574419
Set Token196956752024-04-20 9:16:35221 days ago1713604595IN
0xA24cb627...fB6aDFF58
0 ETH0.000356997.51447535
Set Time196944532024-04-20 5:10:23221 days ago1713589823IN
0xA24cb627...fB6aDFF58
0 ETH0.000203786.22772617
Set Time196804812024-04-18 6:13:35223 days ago1713420815IN
0xA24cb627...fB6aDFF58
0 ETH0.000325819.95694218
Buy196749032024-04-17 11:29:59224 days ago1713353399IN
0xA24cb627...fB6aDFF58
0 ETH0.0058315744.59483827
Buy196720212024-04-17 1:50:47224 days ago1713318647IN
0xA24cb627...fB6aDFF58
0 ETH0.000953466.94593539
Buy196713732024-04-16 23:40:23224 days ago1713310823IN
0xA24cb627...fB6aDFF58
0 ETH0.001054067.78089164
Buy196691062024-04-16 16:02:35225 days ago1713283355IN
0xA24cb627...fB6aDFF58
0 ETH0.0032375123.5953129
Buy196690482024-04-16 15:50:59225 days ago1713282659IN
0xA24cb627...fB6aDFF58
0 ETH0.0023809716.95516483
Buy196689972024-04-16 15:40:23225 days ago1713282023IN
0xA24cb627...fB6aDFF58
0 ETH0.0021992716.23034489
Buy196688452024-04-16 15:09:59225 days ago1713280199IN
0xA24cb627...fB6aDFF58
0 ETH0.0021901415.95642568
Buy196688362024-04-16 15:08:11225 days ago1713280091IN
0xA24cb627...fB6aDFF58
0 ETH0.0021632316.33298667
Buy196686382024-04-16 14:28:23225 days ago1713277703IN
0xA24cb627...fB6aDFF58
0 ETH0.0023545216.75965185
Buy196686382024-04-16 14:28:23225 days ago1713277703IN
0xA24cb627...fB6aDFF58
0 ETH0.002301416.75965185
Buy196685972024-04-16 14:19:59225 days ago1713277199IN
0xA24cb627...fB6aDFF58
0 ETH0.0011501814.51964527
Buy196685972024-04-16 14:19:59225 days ago1713277199IN
0xA24cb627...fB6aDFF58
0 ETH0.0011503614.51964527
Buy196685722024-04-16 14:14:59225 days ago1713276899IN
0xA24cb627...fB6aDFF58
0 ETH0.0025579618.84846179
Buy196685652024-04-16 14:13:35225 days ago1713276815IN
0xA24cb627...fB6aDFF58
0 ETH0.0022789816.61090355
Buy196685652024-04-16 14:13:35225 days ago1713276815IN
0xA24cb627...fB6aDFF58
0 ETH0.0023351816.63617555
Buy196685652024-04-16 14:13:35225 days ago1713276815IN
0xA24cb627...fB6aDFF58
0 ETH0.0022832416.63617555
Buy196685602024-04-16 14:12:35225 days ago1713276755IN
0xA24cb627...fB6aDFF58
0 ETH0.0023562517.16960723
Buy196685572024-04-16 14:11:59225 days ago1713276719IN
0xA24cb627...fB6aDFF58
0 ETH0.0020977316.25669704
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IDO

Compiler Version
v0.8.12+commit.f00d7308

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 12 : IDO.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

interface Decimals {
    function decimals() external view returns (uint8);
}

contract IDO is Ownable {

    using SafeERC20 for IERC20;
    bytes32 public merkleRoot;
    address public token;
    address public tokenPayment;
    uint256 public tokenPerUSDT = 10000;
    uint256 public denominator = 68;
    uint256 public startTime;
    uint256 public endTime;
    uint256 public total;
    bool public isClaimed;

    uint256 public startRelease;
    uint256 public cliff;
    uint256 public vesting;
    uint256 public tge;

    struct Tier {
        uint256 cap;
        uint256 sold;
        uint256 purchaseLimit;
    }

    mapping(uint256 => Tier) public tier;

    mapping (address => uint256) public payAmount;
    mapping (address => uint256) private tokenReleased;
    mapping(address => bool) public admin;
    mapping(bytes => bool) public usedSignatures;

    modifier verifyTransactionAmount(){
        require(payAmount[msg.sender] == 0, "IDO: PURCHASE_LIMIT_WRONG");
        _;
    }

    constructor(bytes32 _merkleRoot, uint256 _start, uint256 _end, address _tokenPayment) {
        merkleRoot = _merkleRoot;
        startTime = _start;
        endTime = _end;
        tokenPayment = _tokenPayment;

        tier[1] = Tier({
        cap: 10010 * 1e6,
        sold: 0,
        purchaseLimit: 143 * 1e6
        });

        tier[2] = Tier({
            cap: 10028 * 1e6,
            sold: 0,
            purchaseLimit: 218 * 1e6
        });

        tier[3] = Tier({
            cap: 15010 * 1e6,
            sold: 0,
            purchaseLimit: 395 * 1e6
        });

        tier[4] = Tier({
            cap: 30004 * 1e6,
            sold: 0,
            purchaseLimit: 577 * 1e6
        });

        tier[5] = Tier({
            cap: 35014 * 1e6,
            sold: 0,
            purchaseLimit: 854 * 1e6
        });
        
    }

    receive() external payable {}

    event SetPrice(uint256 price, uint256 blockTime);
    event SetTime(uint256 startTime, uint256 endTime, uint256 blockTime);
    event SetClaim(bool status, uint256 blockTime);
    event SetToken(address token, uint256 blockTime);
    event Buy(address user, uint256 amount, uint256 total, uint256 blockTime);
    event TokenReleased(address user, uint256 amount, uint256 blockTime);
    event SetMerkleRoot(bytes32 merkleRoot);
    event SetTokenPayment(address tokenPayment);
    event Withdraw(address user, uint256 amount);
    event SetDenominator(uint256 denominator);
    event SetAdmin(address admin, bool status, uint blockTime);
    event SetVesting(uint256 startRelease, uint256 cliff, uint256 vesting, uint256 tge);

    function setTier(uint256 _tier, uint256 _cap, uint256 _purchaseLimit) public onlyOwner() {
        tier[_tier].cap = _cap;
        tier[_tier].purchaseLimit = _purchaseLimit;
    }

    function setVesting(uint256 _startRelease, uint256 _cliff, uint256 _vesting, uint256 _tge) external onlyOwner() {
        require(_tge <= 100, "TGE_WRONG");
        startRelease = _startRelease;
        cliff = _cliff;
        vesting = _vesting;
        tge = _tge;
        emit SetVesting(_startRelease, _cliff, _vesting, _tge);
    }

    function setPrice(uint256 _price) external onlyOwner {
        tokenPerUSDT = _price;
        emit SetPrice(_price, block.timestamp);
    }

    function setDenominator(uint256 _denominator) external onlyOwner {
        denominator = _denominator;
        emit SetDenominator(denominator);
    }

    function setTokenPayment(address _tokenPayment) external onlyOwner {
        tokenPayment = _tokenPayment;
        emit SetTokenPayment(tokenPayment);
    }

    function setTime(uint256 _start, uint256 _end) external onlyOwner {
        startTime = _start;
        endTime = _end;
        emit SetTime(_start, _end, block.timestamp);
    }

    function setClaim(bool status) external onlyOwner {
        isClaimed = status;
        emit SetClaim(status, block.timestamp);
    }

    function setToken(address _token) external onlyOwner {
        token = _token;
        emit SetToken(_token, block.timestamp);
    }

    function setAdmin(address _admin, bool _status) external onlyOwner {
        admin[_admin] =  _status;
        emit SetAdmin(_admin, _status, block.timestamp);
    }

    function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
        merkleRoot = _merkleRoot;
        emit SetMerkleRoot(_merkleRoot);
    }

    function withdrawEther(uint256 amount) external onlyOwner {
        require(block.timestamp >= endTime, "The owner can only withdraw ETH after the IDO ends");
        (bool success, ) = msg.sender.call{value: amount}("");
        require(success, "Transfer failed.");
    }

    function withdrawToken(address _token, uint256 amount) external onlyOwner {
        require(block.timestamp >= endTime, "The owner can only withdraw ETH after the IDO ends");
        IERC20(_token).safeTransfer(msg.sender, amount);
    }

    // Function to add an address to the whitelist using MerkleProof
    function buy(bytes32[] memory proof, uint256 _tier, bytes calldata signature) external verifyTransactionAmount() {
        require(!usedSignatures[signature], "IDO: signature used.");
        require(block.timestamp > startTime && block.timestamp < endTime, "IDO: TIME_WRONG");
        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, _tier));
        require(MerkleProof.verify(proof, merkleRoot, leaf), "Invalid Merkle proof");
        bytes32 criteriaMessageHash = getMessageHash(msg.sender, _tier);
        bytes32 ethSignedMessageHash = ECDSA.toEthSignedMessageHash(criteriaMessageHash);
        require(admin[ECDSA.recover(ethSignedMessageHash, signature)],"IDO: invalid signature");
        usedSignatures[signature] = true;
        uint256 amount = tier[_tier].purchaseLimit;
        require(tier[_tier].sold + amount <= tier[_tier].cap, "AMOUNT_WRONG");
        tier[_tier].sold += amount;
        IERC20(tokenPayment).safeTransferFrom(msg.sender, address(this), amount);
        payAmount[msg.sender] += amount;
        emit Buy(msg.sender, amount, tier[_tier].sold, block.timestamp);
    }

    function verify(bytes32[] memory proof, address user, uint256 _tier) external view returns(bool) {
        bytes32 leaf = keccak256(abi.encodePacked(user, _tier));
        bool result = MerkleProof.verify(proof, merkleRoot, leaf);
        return result;
    }

    function released(address _user) public view returns(uint256){
        //withdraw
        return tokenReleased[_user];
    }

    function releasable(address _user) public view returns(uint256){
        uint256 amount;
        if(isClaimed){
            uint256 totalAllocation = payAmount[_user] * tokenPerUSDT * 10**Decimals(token).decimals() / ( 10**Decimals(tokenPayment).decimals() * denominator );
            amount = _vestingSchedule(totalAllocation, block.timestamp);
        }else{
            amount = 0;
        }
        return amount - released(_user);
    }

    function release() external {
        require(isClaimed, "IDO: IS_CLAIMED_WRONG");
        uint256 amount = releasable(msg.sender);
        require(amount > 0, "IDO: AMOUNT=0");
        tokenReleased[msg.sender] += amount;
        emit TokenReleased(msg.sender, amount, block.timestamp);
        IERC20(token).safeTransfer(msg.sender, amount);
    }

    function _vestingSchedule(uint256 totalAllocation, uint256 timestamp) internal view returns(uint256){
        if(timestamp < startRelease){
            return 0;
        } else if (timestamp > (startRelease + cliff + vesting)){
            return totalAllocation;
        } else {
            uint256 tokenTge = totalAllocation * tge / 100;
            uint256 tokenVesting = 0;
            if(timestamp > (startRelease + cliff)){
                tokenVesting = (totalAllocation - tokenTge) * (timestamp - startRelease - cliff) / vesting;
            }
            return tokenTge + tokenVesting;
        }
    }   

    function getMessageHash(
        address user,
        uint256 _tier
    ) public view returns (bytes32) {
         return
            keccak256(
                abi.encodePacked(
                    user,
                    address(this),
                    _tier
                )
            );
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 12 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 4 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount) external returns (bool);
}

File 5 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/IERC20Permit.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;

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    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));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    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");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
     * Revert on invalid signature.
     */
    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @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");
        require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
    }

    /**
     * @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).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // 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 cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return
            success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
    }
}

File 6 of 12 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @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
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, 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) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or 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 {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // 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
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

File 7 of 12 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 8 of 12 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (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 // Deprecated in v4.8
    }

    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");
        }
    }

    /**
     * @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) {
        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.
            /// @solidity memory-safe-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 {
            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 = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 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 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 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @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 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

File 9 of 12 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Tree proofs.
 *
 * The tree and the proofs can be generated using our
 * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
 * You will find a quickstart guide in the readme.
 *
 * WARNING: You should avoid using leaf values that are 64 bytes long prior to
 * hashing, or use a hash function other than keccak256 for hashing leaves.
 * This is because the concatenation of a sorted pair of internal nodes in
 * the merkle tree could be reinterpreted as a leaf value.
 * OpenZeppelin's JavaScript library generates merkle trees that are safe
 * against this attack out of the box.
 */
library MerkleProof {
    /**
     * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
     * defined by `root`. For this, a `proof` must be provided, containing
     * sibling hashes on the branch from the leaf to the root of the tree. Each
     * pair of leaves and each pair of pre-images are assumed to be sorted.
     */
    function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProof(proof, leaf) == root;
    }

    /**
     * @dev Calldata version of {verify}
     *
     * _Available since v4.7._
     */
    function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
        return processProofCalldata(proof, leaf) == root;
    }

    /**
     * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
     * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
     * hash matches the root of the tree. When processing the proof, the pairs
     * of leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Calldata version of {processProof}
     *
     * _Available since v4.7._
     */
    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            computedHash = _hashPair(computedHash, proof[i]);
        }
        return computedHash;
    }

    /**
     * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by
     * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerify(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProof(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Calldata version of {multiProofVerify}
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function multiProofVerifyCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32 root,
        bytes32[] memory leaves
    ) internal pure returns (bool) {
        return processMultiProofCalldata(proof, proofFlags, leaves) == root;
    }

    /**
     * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
     * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
     * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
     * respectively.
     *
     * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
     * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
     * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
     *
     * _Available since v4.7._
     */
    function processMultiProof(
        bytes32[] memory proof,
        bool[] memory proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    /**
     * @dev Calldata version of {processMultiProof}.
     *
     * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.
     *
     * _Available since v4.7._
     */
    function processMultiProofCalldata(
        bytes32[] calldata proof,
        bool[] calldata proofFlags,
        bytes32[] memory leaves
    ) internal pure returns (bytes32 merkleRoot) {
        // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
        // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
        // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
        // the merkle tree.
        uint256 leavesLen = leaves.length;
        uint256 proofLen = proof.length;
        uint256 totalHashes = proofFlags.length;

        // Check proof validity.
        require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");

        // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
        // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
        bytes32[] memory hashes = new bytes32[](totalHashes);
        uint256 leafPos = 0;
        uint256 hashPos = 0;
        uint256 proofPos = 0;
        // At each step, we compute the next hash using two values:
        // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
        //   get the next hash.
        // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
        //   `proof` array.
        for (uint256 i = 0; i < totalHashes; i++) {
            bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
            bytes32 b = proofFlags[i]
                ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
                : proof[proofPos++];
            hashes[i] = _hashPair(a, b);
        }

        if (totalHashes > 0) {
            require(proofPos == proofLen, "MerkleProof: invalid multiproof");
            unchecked {
                return hashes[totalHashes - 1];
            }
        } else if (leavesLen > 0) {
            return leaves[0];
        } else {
            return proof[0];
        }
    }

    function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
        return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 10 of 12 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

File 11 of 12 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

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

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

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 12 of 12 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"},{"internalType":"address","name":"_tokenPayment","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"Buy","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":"admin","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"SetAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"SetClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"SetDenominator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"SetMerkleRoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"SetPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"SetTime","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"SetToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenPayment","type":"address"}],"name":"SetTokenPayment","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startRelease","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cliff","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vesting","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tge","type":"uint256"}],"name":"SetVesting","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"blockTime","type":"uint256"}],"name":"TokenReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"uint256","name":"_tier","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cliff","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"denominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"_tier","type":"uint256"}],"name":"getMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"payAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"releasable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_denominator","type":"uint256"}],"name":"setDenominator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tier","type":"uint256"},{"internalType":"uint256","name":"_cap","type":"uint256"},{"internalType":"uint256","name":"_purchaseLimit","type":"uint256"}],"name":"setTier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenPayment","type":"address"}],"name":"setTokenPayment","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startRelease","type":"uint256"},{"internalType":"uint256","name":"_cliff","type":"uint256"},{"internalType":"uint256","name":"_vesting","type":"uint256"},{"internalType":"uint256","name":"_tge","type":"uint256"}],"name":"setVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startRelease","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tier","outputs":[{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"sold","type":"uint256"},{"internalType":"uint256","name":"purchaseLimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPayment","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPerUSDT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total","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":"bytes","name":"","type":"bytes"}],"name":"usedSignatures","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"proof","type":"bytes32[]"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"_tier","type":"uint256"}],"name":"verify","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vesting","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawEther","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405261271060045560446005553480156200001c57600080fd5b506040516200256e3803806200256e8339810160408190526200003f91620003ac565b6200004a336200035c565b6001938455600692909255600755600380546001600160a01b0319166001600160a01b039092169190911781556040805160608082018352640254a47a8082526000602080840182815263088601c0858701908152978352600e80835294517fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be95820755517fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582085595517fa7c5ba7114a813b50159add3a36832908dc83db71d0b9a24c2ad0f83be9582095583518083018552640255b723008152808701828152630cfe6a808287019081526002845285895291517f9adb202b1492743bc00c81d33cdc6423fa8c79109027eb6a845391e8fc1f048155517f9adb202b1492743bc00c81d33cdc6423fa8c79109027eb6a845391e8fc1f048255517f9adb202b1492743bc00c81d33cdc6423fa8c79109027eb6a845391e8fc1f0483558351808301855264037eaa6c80815280870182815263178b38c082870190815296835284885290517fe0283e559c29e31ee7f56467acc9dd307779c843a883aeeb3bf5c6128c90814455517fe0283e559c29e31ee7f56467acc9dd307779c843a883aeeb3bf5c6128c9081455593517fe0283e559c29e31ee7f56467acc9dd307779c843a883aeeb3bf5c6128c90814655825180820184526406fc60b500815280860185815263226452408286019081526004875284885291517fa1d6913cd9e08c872be3e7525cca82e4fc0fc298a783f19022be725b19be685a55517fa1d6913cd9e08c872be3e7525cca82e4fc0fc298a783f19022be725b19be685b55517fa1d6913cd9e08c872be3e7525cca82e4fc0fc298a783f19022be725b19be685c5582519081018352640826ff3d8081528085018481526332e701809382019384526005909452935291517fb9bec7e2561f624fe753ff070f1599b306cbf59fafd4e8d5a8184a1ea1841bce55517fb9bec7e2561f624fe753ff070f1599b306cbf59fafd4e8d5a8184a1ea1841bcf55517fb9bec7e2561f624fe753ff070f1599b306cbf59fafd4e8d5a8184a1ea1841bd055620003fd565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008060008060808587031215620003c357600080fd5b845160208601516040870151606088015192965090945092506001600160a01b0381168114620003f257600080fd5b939692955090935050565b612161806200040d6000396000f3fe6080604052600436106102295760003560e01c806378e9792511610123578063a0355eca116100ab578063de10a6361161006f578063de10a63614610669578063e949580e14610689578063f2fde38b146106c4578063fc0c546a146106e4578063fe29374b1461070457600080fd5b8063a0355eca146105d3578063a3f8eace146105f3578063a4f3a7c714610613578063a7497fa514610633578063c1e3425f1461064957600080fd5b80638da5cb5b116100f25780638da5cb5b1461051557806391b7f5ed1461054757806396ce0795146105675780639852595c1461057d5780639e281a98146105b357600080fd5b806378e97925146104aa5780637cb64759146104c0578063836a0187146104e057806386d1a69f1461050057600080fd5b80633bed33ce116101b157806363a846f81161017557806363a846f8146103d85780636c56a3f1146104085780636cec0ceb1461041e5780636dda34db1461043e578063715018a61461049557600080fd5b80633bed33ce1461034857806344c63eec146103685780634b0bddd21461037e578063512c91df1461039e57806357c9ca14146103be57600080fd5b8063211418ab116101f8578063211418ab146102c65780632ce71832146102e65780632ddbd13a146103065780632eb4a7ab1461031c5780633197cbb61461033257600080fd5b806304b38ce0146102355780631355ab6f1461026a57806313d033c01461028e578063144fa6d7146102a457600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50610255610250366004611b87565b610731565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028060045481565b604051908152602001610261565b34801561029a57600080fd5b50610280600b5481565b3480156102b057600080fd5b506102c46102bf366004611bde565b610788565b005b3480156102d257600080fd5b506102c46102e1366004611c07565b6107ea565b3480156102f257600080fd5b506102c4610301366004611c24565b610837565b34801561031257600080fd5b5061028060085481565b34801561032857600080fd5b5061028060015481565b34801561033e57600080fd5b5061028060075481565b34801561035457600080fd5b506102c4610363366004611c56565b6108e3565b34801561037457600080fd5b50610280600c5481565b34801561038a57600080fd5b506102c4610399366004611c6f565b61099c565b3480156103aa57600080fd5b506102806103b9366004611ca6565b610a0f565b3480156103ca57600080fd5b506009546102559060ff1681565b3480156103e457600080fd5b506102556103f3366004611bde565b60116020526000908152604090205460ff1681565b34801561041457600080fd5b50610280600a5481565b34801561042a57600080fd5b506102c4610439366004611c56565b610a5c565b34801561044a57600080fd5b5061047a610459366004611c56565b600e6020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610261565b3480156104a157600080fd5b506102c4610a99565b3480156104b657600080fd5b5061028060065481565b3480156104cc57600080fd5b506102c46104db366004611c56565b610aad565b3480156104ec57600080fd5b506102c46104fb366004611cd0565b610aea565b34801561050c57600080fd5b506102c4610b0a565b34801561052157600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610261565b34801561055357600080fd5b506102c4610562366004611c56565b610c1e565b34801561057357600080fd5b5061028060055481565b34801561058957600080fd5b50610280610598366004611bde565b6001600160a01b031660009081526010602052604090205490565b3480156105bf57600080fd5b506102c46105ce366004611ca6565b610c60565b3480156105df57600080fd5b506102c46105ee366004611cfc565b610c9e565b3480156105ff57600080fd5b5061028061060e366004611bde565b610cf0565b34801561061f57600080fd5b5060035461052f906001600160a01b031681565b34801561063f57600080fd5b50610280600d5481565b34801561065557600080fd5b506102c4610664366004611bde565b610e85565b34801561067557600080fd5b506102c4610684366004611d1e565b610edb565b34801561069557600080fd5b506102556106a4366004611db9565b805160208183018101805160128252928201919093012091525460ff1681565b3480156106d057600080fd5b506102c46106df366004611bde565b6112bd565b3480156106f057600080fd5b5060025461052f906001600160a01b031681565b34801561071057600080fd5b5061028061071f366004611bde565b600f6020526000908152604090205481565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050600061077e8660015484611333565b9695505050505050565b610790611349565b600280546001600160a01b0319166001600160a01b038316908117909155604080519182524260208301527f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d091015b60405180910390a150565b6107f2611349565b6009805460ff1916821515908117909155604080519182524260208301527e26d2f906aebd2c132a38eeb161cb082dd7c18e0d1f94a415ac7eaaac487ec291016107df565b61083f611349565b60648111156108815760405162461bcd60e51b81526020600482015260096024820152685447455f57524f4e4760b81b60448201526064015b60405180910390fd5b600a849055600b839055600c829055600d8190556040805185815260208101859052908101839052606081018290527f2511b3b23ef5d07ba6890deffad20517857dbb7156df50a8b82c5fdae65ca9499060800160405180910390a150505050565b6108eb611349565b60075442101561090d5760405162461bcd60e51b815260040161087890611e4e565b604051600090339083908381818185875af1925050503d806000811461094f576040519150601f19603f3d011682016040523d82523d6000602084013e610954565b606091505b50509050806109985760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610878565b5050565b6109a4611349565b6001600160a01b038216600081815260116020908152604091829020805460ff191685151590811790915582519384529083015242908201527fb2af021da0b83f71009939aa00ceeee22377a547c3ee31497a73122ea42e3864906060015b60405180910390a15050565b6040516001600160601b0319606084811b8216602084015230901b166034820152604881018290526000906068016040516020818303038152906040528051906020012090505b92915050565b610a64611349565b60058190556040518181527f4082bc252f347d223f4e804c3c4e90818ad544b959ffa807149351ad158bf016906020016107df565b610aa1611349565b610aab60006113a3565b565b610ab5611349565b60018190556040518181527f914960aef5e033ce5cae8a7992d4b7a6f0f9741227b66acb67c605b7019f8a46906020016107df565b610af2611349565b6000928352600e602052604090922090815560020155565b60095460ff16610b545760405162461bcd60e51b815260206004820152601560248201527449444f3a2049535f434c41494d45445f57524f4e4760581b6044820152606401610878565b6000610b5f33610cf0565b905060008111610ba15760405162461bcd60e51b815260206004820152600d60248201526c049444f3a20414d4f554e543d3609c1b6044820152606401610878565b3360009081526010602052604081208054839290610bc0908490611eb6565b90915550506040805133815260208101839052428183015290517f881a2e1bf4f161e12580159a60513a536736d190d8f1264819ef4f1b260921d09181900360600190a1600254610c1b906001600160a01b031633836113f3565b50565b610c26611349565b6004819055604080518281524260208201527ff9317dc3bc6dda0e00e43855c2c30847aeafb8dcea9d2ce86e9ce7a83d549f0191016107df565b610c68611349565b600754421015610c8a5760405162461bcd60e51b815260040161087890611e4e565b6109986001600160a01b03831633836113f3565b610ca6611349565b60068290556007819055604080518381526020810183905242918101919091527f19bd8abf08bba14742990b0fc9de97404cb8ca4d3aea41b2b738c2521b36a04b90606001610a03565b600954600090819060ff1615610e57576005546003546040805163313ce56760e01b81529051600093926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d729190611ece565b610d7d90600a611fd5565b610d879190611fe4565b600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190611ece565b610e0990600a611fd5565b6004546001600160a01b0387166000908152600f6020526040902054610e2f9190611fe4565b610e399190611fe4565b610e439190612003565b9050610e4f814261145b565b915050610e5b565b5060005b6001600160a01b038316600090815260106020526040902054610e7e9082612025565b9392505050565b610e8d611349565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f3e04399dab2fda81ba98a50e79057d60214788a3b57b4a3c99ee854cd6cea7c4906020016107df565b336000908152600f602052604090205415610f385760405162461bcd60e51b815260206004820152601960248201527f49444f3a2050555243484153455f4c494d49545f57524f4e47000000000000006044820152606401610878565b60128282604051610f4a92919061203c565b9081526040519081900360200190205460ff1615610fa15760405162461bcd60e51b815260206004820152601460248201527324a2279d1039b4b3b730ba3ab932903ab9b2b21760611b6044820152606401610878565b60065442118015610fb3575060075442105b610ff15760405162461bcd60e51b815260206004820152600f60248201526e49444f3a2054494d455f57524f4e4760881b6044820152606401610878565b6040516001600160601b03193360601b166020820152603481018490526000906054016040516020818303038152906040528051906020012090506110398560015483611333565b61107c5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401610878565b60006110883386610a0f565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c812091925050601160006110ff8388888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152292505050565b6001600160a01b0316815260208101919091526040016000205460ff166111615760405162461bcd60e51b815260206004820152601660248201527549444f3a20696e76616c6964207369676e617475726560501b6044820152606401610878565b60016012868660405161117592919061203c565b9081526040805160209281900383019020805460ff1916931515939093179092556000888152600e9091522060028101548154600192909201549091906111bd908390611eb6565b11156111fa5760405162461bcd60e51b815260206004820152600c60248201526b414d4f554e545f57524f4e4760a01b6044820152606401610878565b6000878152600e60205260408120600101805483929061121b908490611eb6565b9091555050600354611238906001600160a01b0316333084611546565b336000908152600f602052604081208054839290611257908490611eb6565b90915550506000878152600e60209081526040918290206001015482513381529182018490528183015242606082015290517fbeae048c6d270d9469f86cf6e8fedda3c60ad770f16c24c9fc131c8e9a09101d9181900360800190a15050505050505050565b6112c5611349565b6001600160a01b03811661132a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610878565b610c1b816113a3565b6000826113408584611584565b14949350505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610878565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03831660248201526044810182905261145690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526115c9565b505050565b6000600a5482101561146f57506000610a56565b600c54600b54600a546114829190611eb6565b61148c9190611eb6565b82111561149a575081610a56565b60006064600d54856114ac9190611fe4565b6114b69190612003565b90506000600b54600a546114ca9190611eb6565b84111561150f57600c54600b54600a546114e49087612025565b6114ee9190612025565b6114f88488612025565b6115029190611fe4565b61150c9190612003565b90505b6115198183611eb6565b92505050610a56565b6000806000611531858561169e565b9150915061153e816116e4565b509392505050565b6040516001600160a01b038085166024830152831660448201526064810182905261157e9085906323b872dd60e01b9060840161141f565b50505050565b600081815b845181101561153e576115b5828683815181106115a8576115a861204c565b6020026020010151611832565b9150806115c181612062565b915050611589565b600061161e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661185e9092919063ffffffff16565b905080516000148061163f57508080602001905181019061163f919061207d565b6114565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610878565b6000808251604114156116d55760208301516040840151606085015160001a6116c987828585611875565b945094505050506116dd565b506000905060025b9250929050565b60008160048111156116f8576116f861209a565b14156117015750565b60018160048111156117155761171561209a565b14156117635760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610878565b60028160048111156117775761177761209a565b14156117c55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610878565b60038160048111156117d9576117d961209a565b1415610c1b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610878565b600081831061184e576000828152602084905260409020610e7e565b5060009182526020526040902090565b606061186d8484600085611939565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156118ac5750600090506003611930565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611900573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661192957600060019250925050611930565b9150600090505b94509492505050565b60608247101561199a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610878565b600080866001600160a01b031685876040516119b691906120dc565b60006040518083038185875af1925050503d80600081146119f3576040519150601f19603f3d011682016040523d82523d6000602084013e6119f8565b606091505b5091509150611a0987838387611a14565b979650505050505050565b60608315611a80578251611a79576001600160a01b0385163b611a795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610878565b508161186d565b61186d8383815115611a955781518083602001fd5b8060405162461bcd60e51b815260040161087891906120f8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611aee57611aee611aaf565b604052919050565b600082601f830112611b0757600080fd5b8135602067ffffffffffffffff821115611b2357611b23611aaf565b8160051b611b32828201611ac5565b9283528481018201928281019087851115611b4c57600080fd5b83870192505b84831015611a0957823582529183019190830190611b52565b80356001600160a01b0381168114611b8257600080fd5b919050565b600080600060608486031215611b9c57600080fd5b833567ffffffffffffffff811115611bb357600080fd5b611bbf86828701611af6565b935050611bce60208501611b6b565b9150604084013590509250925092565b600060208284031215611bf057600080fd5b610e7e82611b6b565b8015158114610c1b57600080fd5b600060208284031215611c1957600080fd5b8135610e7e81611bf9565b60008060008060808587031215611c3a57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611c6857600080fd5b5035919050565b60008060408385031215611c8257600080fd5b611c8b83611b6b565b91506020830135611c9b81611bf9565b809150509250929050565b60008060408385031215611cb957600080fd5b611cc283611b6b565b946020939093013593505050565b600080600060608486031215611ce557600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d0f57600080fd5b50508035926020909101359150565b60008060008060608587031215611d3457600080fd5b843567ffffffffffffffff80821115611d4c57600080fd5b611d5888838901611af6565b9550602087013594506040870135915080821115611d7557600080fd5b818701915087601f830112611d8957600080fd5b813581811115611d9857600080fd5b886020828501011115611daa57600080fd5b95989497505060200194505050565b60006020808385031215611dcc57600080fd5b823567ffffffffffffffff80821115611de457600080fd5b818501915085601f830112611df857600080fd5b813581811115611e0a57611e0a611aaf565b611e1c601f8201601f19168501611ac5565b91508082528684828501011115611e3257600080fd5b8084840185840137600090820190930192909252509392505050565b60208082526032908201527f546865206f776e65722063616e206f6e6c7920776974686472617720455448206040820152716166746572207468652049444f20656e647360701b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ec957611ec9611ea0565b500190565b600060208284031215611ee057600080fd5b815160ff81168114610e7e57600080fd5b600181815b80851115611f2c578160001904821115611f1257611f12611ea0565b80851615611f1f57918102915b93841c9390800290611ef6565b509250929050565b600082611f4357506001610a56565b81611f5057506000610a56565b8160018114611f665760028114611f7057611f8c565b6001915050610a56565b60ff841115611f8157611f81611ea0565b50506001821b610a56565b5060208310610133831016604e8410600b8410161715611faf575081810a610a56565b611fb98383611ef1565b8060001904821115611fcd57611fcd611ea0565b029392505050565b6000610e7e60ff841683611f34565b6000816000190483118215151615611ffe57611ffe611ea0565b500290565b60008261202057634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561203757612037611ea0565b500390565b8183823760009101908152919050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561207657612076611ea0565b5060010190565b60006020828403121561208f57600080fd5b8151610e7e81611bf9565b634e487b7160e01b600052602160045260246000fd5b60005b838110156120cb5781810151838201526020016120b3565b8381111561157e5750506000910152565b600082516120ee8184602087016120b0565b9190910192915050565b60208152600082518060208401526121178160408501602087016120b0565b601f01601f1916919091016040019291505056fea2646970667358221220e9e43f06749006cc9cd354dbc07e3ebc64cafb5045e1ad5bdbc35aa43c4c182d64736f6c634300080c003331296c40449934907f6760d70eedb34c229fd2522220cd1c60ef665a1e13d85100000000000000000000000000000000000000000000000000000000661e846000000000000000000000000000000000000000000000000000000000661fd5e0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

Deployed Bytecode

0x6080604052600436106102295760003560e01c806378e9792511610123578063a0355eca116100ab578063de10a6361161006f578063de10a63614610669578063e949580e14610689578063f2fde38b146106c4578063fc0c546a146106e4578063fe29374b1461070457600080fd5b8063a0355eca146105d3578063a3f8eace146105f3578063a4f3a7c714610613578063a7497fa514610633578063c1e3425f1461064957600080fd5b80638da5cb5b116100f25780638da5cb5b1461051557806391b7f5ed1461054757806396ce0795146105675780639852595c1461057d5780639e281a98146105b357600080fd5b806378e97925146104aa5780637cb64759146104c0578063836a0187146104e057806386d1a69f1461050057600080fd5b80633bed33ce116101b157806363a846f81161017557806363a846f8146103d85780636c56a3f1146104085780636cec0ceb1461041e5780636dda34db1461043e578063715018a61461049557600080fd5b80633bed33ce1461034857806344c63eec146103685780634b0bddd21461037e578063512c91df1461039e57806357c9ca14146103be57600080fd5b8063211418ab116101f8578063211418ab146102c65780632ce71832146102e65780632ddbd13a146103065780632eb4a7ab1461031c5780633197cbb61461033257600080fd5b806304b38ce0146102355780631355ab6f1461026a57806313d033c01461028e578063144fa6d7146102a457600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50610255610250366004611b87565b610731565b60405190151581526020015b60405180910390f35b34801561027657600080fd5b5061028060045481565b604051908152602001610261565b34801561029a57600080fd5b50610280600b5481565b3480156102b057600080fd5b506102c46102bf366004611bde565b610788565b005b3480156102d257600080fd5b506102c46102e1366004611c07565b6107ea565b3480156102f257600080fd5b506102c4610301366004611c24565b610837565b34801561031257600080fd5b5061028060085481565b34801561032857600080fd5b5061028060015481565b34801561033e57600080fd5b5061028060075481565b34801561035457600080fd5b506102c4610363366004611c56565b6108e3565b34801561037457600080fd5b50610280600c5481565b34801561038a57600080fd5b506102c4610399366004611c6f565b61099c565b3480156103aa57600080fd5b506102806103b9366004611ca6565b610a0f565b3480156103ca57600080fd5b506009546102559060ff1681565b3480156103e457600080fd5b506102556103f3366004611bde565b60116020526000908152604090205460ff1681565b34801561041457600080fd5b50610280600a5481565b34801561042a57600080fd5b506102c4610439366004611c56565b610a5c565b34801561044a57600080fd5b5061047a610459366004611c56565b600e6020526000908152604090208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610261565b3480156104a157600080fd5b506102c4610a99565b3480156104b657600080fd5b5061028060065481565b3480156104cc57600080fd5b506102c46104db366004611c56565b610aad565b3480156104ec57600080fd5b506102c46104fb366004611cd0565b610aea565b34801561050c57600080fd5b506102c4610b0a565b34801561052157600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610261565b34801561055357600080fd5b506102c4610562366004611c56565b610c1e565b34801561057357600080fd5b5061028060055481565b34801561058957600080fd5b50610280610598366004611bde565b6001600160a01b031660009081526010602052604090205490565b3480156105bf57600080fd5b506102c46105ce366004611ca6565b610c60565b3480156105df57600080fd5b506102c46105ee366004611cfc565b610c9e565b3480156105ff57600080fd5b5061028061060e366004611bde565b610cf0565b34801561061f57600080fd5b5060035461052f906001600160a01b031681565b34801561063f57600080fd5b50610280600d5481565b34801561065557600080fd5b506102c4610664366004611bde565b610e85565b34801561067557600080fd5b506102c4610684366004611d1e565b610edb565b34801561069557600080fd5b506102556106a4366004611db9565b805160208183018101805160128252928201919093012091525460ff1681565b3480156106d057600080fd5b506102c46106df366004611bde565b6112bd565b3480156106f057600080fd5b5060025461052f906001600160a01b031681565b34801561071057600080fd5b5061028061071f366004611bde565b600f6020526000908152604090205481565b6040516001600160601b0319606084901b166020820152603481018290526000908190605401604051602081830303815290604052805190602001209050600061077e8660015484611333565b9695505050505050565b610790611349565b600280546001600160a01b0319166001600160a01b038316908117909155604080519182524260208301527f720764556647dd167f4229d6a4255ac86018e302a50fc29dd67a70edb7b314d091015b60405180910390a150565b6107f2611349565b6009805460ff1916821515908117909155604080519182524260208301527e26d2f906aebd2c132a38eeb161cb082dd7c18e0d1f94a415ac7eaaac487ec291016107df565b61083f611349565b60648111156108815760405162461bcd60e51b81526020600482015260096024820152685447455f57524f4e4760b81b60448201526064015b60405180910390fd5b600a849055600b839055600c829055600d8190556040805185815260208101859052908101839052606081018290527f2511b3b23ef5d07ba6890deffad20517857dbb7156df50a8b82c5fdae65ca9499060800160405180910390a150505050565b6108eb611349565b60075442101561090d5760405162461bcd60e51b815260040161087890611e4e565b604051600090339083908381818185875af1925050503d806000811461094f576040519150601f19603f3d011682016040523d82523d6000602084013e610954565b606091505b50509050806109985760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610878565b5050565b6109a4611349565b6001600160a01b038216600081815260116020908152604091829020805460ff191685151590811790915582519384529083015242908201527fb2af021da0b83f71009939aa00ceeee22377a547c3ee31497a73122ea42e3864906060015b60405180910390a15050565b6040516001600160601b0319606084811b8216602084015230901b166034820152604881018290526000906068016040516020818303038152906040528051906020012090505b92915050565b610a64611349565b60058190556040518181527f4082bc252f347d223f4e804c3c4e90818ad544b959ffa807149351ad158bf016906020016107df565b610aa1611349565b610aab60006113a3565b565b610ab5611349565b60018190556040518181527f914960aef5e033ce5cae8a7992d4b7a6f0f9741227b66acb67c605b7019f8a46906020016107df565b610af2611349565b6000928352600e602052604090922090815560020155565b60095460ff16610b545760405162461bcd60e51b815260206004820152601560248201527449444f3a2049535f434c41494d45445f57524f4e4760581b6044820152606401610878565b6000610b5f33610cf0565b905060008111610ba15760405162461bcd60e51b815260206004820152600d60248201526c049444f3a20414d4f554e543d3609c1b6044820152606401610878565b3360009081526010602052604081208054839290610bc0908490611eb6565b90915550506040805133815260208101839052428183015290517f881a2e1bf4f161e12580159a60513a536736d190d8f1264819ef4f1b260921d09181900360600190a1600254610c1b906001600160a01b031633836113f3565b50565b610c26611349565b6004819055604080518281524260208201527ff9317dc3bc6dda0e00e43855c2c30847aeafb8dcea9d2ce86e9ce7a83d549f0191016107df565b610c68611349565b600754421015610c8a5760405162461bcd60e51b815260040161087890611e4e565b6109986001600160a01b03831633836113f3565b610ca6611349565b60068290556007819055604080518381526020810183905242918101919091527f19bd8abf08bba14742990b0fc9de97404cb8ca4d3aea41b2b738c2521b36a04b90606001610a03565b600954600090819060ff1615610e57576005546003546040805163313ce56760e01b81529051600093926001600160a01b03169163313ce5679160048083019260209291908290030181865afa158015610d4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d729190611ece565b610d7d90600a611fd5565b610d879190611fe4565b600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190611ece565b610e0990600a611fd5565b6004546001600160a01b0387166000908152600f6020526040902054610e2f9190611fe4565b610e399190611fe4565b610e439190612003565b9050610e4f814261145b565b915050610e5b565b5060005b6001600160a01b038316600090815260106020526040902054610e7e9082612025565b9392505050565b610e8d611349565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527f3e04399dab2fda81ba98a50e79057d60214788a3b57b4a3c99ee854cd6cea7c4906020016107df565b336000908152600f602052604090205415610f385760405162461bcd60e51b815260206004820152601960248201527f49444f3a2050555243484153455f4c494d49545f57524f4e47000000000000006044820152606401610878565b60128282604051610f4a92919061203c565b9081526040519081900360200190205460ff1615610fa15760405162461bcd60e51b815260206004820152601460248201527324a2279d1039b4b3b730ba3ab932903ab9b2b21760611b6044820152606401610878565b60065442118015610fb3575060075442105b610ff15760405162461bcd60e51b815260206004820152600f60248201526e49444f3a2054494d455f57524f4e4760881b6044820152606401610878565b6040516001600160601b03193360601b166020820152603481018490526000906054016040516020818303038152906040528051906020012090506110398560015483611333565b61107c5760405162461bcd60e51b815260206004820152601460248201527324b73b30b634b21026b2b935b63290383937b7b360611b6044820152606401610878565b60006110883386610a0f565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c812091925050601160006110ff8388888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061152292505050565b6001600160a01b0316815260208101919091526040016000205460ff166111615760405162461bcd60e51b815260206004820152601660248201527549444f3a20696e76616c6964207369676e617475726560501b6044820152606401610878565b60016012868660405161117592919061203c565b9081526040805160209281900383019020805460ff1916931515939093179092556000888152600e9091522060028101548154600192909201549091906111bd908390611eb6565b11156111fa5760405162461bcd60e51b815260206004820152600c60248201526b414d4f554e545f57524f4e4760a01b6044820152606401610878565b6000878152600e60205260408120600101805483929061121b908490611eb6565b9091555050600354611238906001600160a01b0316333084611546565b336000908152600f602052604081208054839290611257908490611eb6565b90915550506000878152600e60209081526040918290206001015482513381529182018490528183015242606082015290517fbeae048c6d270d9469f86cf6e8fedda3c60ad770f16c24c9fc131c8e9a09101d9181900360800190a15050505050505050565b6112c5611349565b6001600160a01b03811661132a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610878565b610c1b816113a3565b6000826113408584611584565b14949350505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610878565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b03831660248201526044810182905261145690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526115c9565b505050565b6000600a5482101561146f57506000610a56565b600c54600b54600a546114829190611eb6565b61148c9190611eb6565b82111561149a575081610a56565b60006064600d54856114ac9190611fe4565b6114b69190612003565b90506000600b54600a546114ca9190611eb6565b84111561150f57600c54600b54600a546114e49087612025565b6114ee9190612025565b6114f88488612025565b6115029190611fe4565b61150c9190612003565b90505b6115198183611eb6565b92505050610a56565b6000806000611531858561169e565b9150915061153e816116e4565b509392505050565b6040516001600160a01b038085166024830152831660448201526064810182905261157e9085906323b872dd60e01b9060840161141f565b50505050565b600081815b845181101561153e576115b5828683815181106115a8576115a861204c565b6020026020010151611832565b9150806115c181612062565b915050611589565b600061161e826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661185e9092919063ffffffff16565b905080516000148061163f57508080602001905181019061163f919061207d565b6114565760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610878565b6000808251604114156116d55760208301516040840151606085015160001a6116c987828585611875565b945094505050506116dd565b506000905060025b9250929050565b60008160048111156116f8576116f861209a565b14156117015750565b60018160048111156117155761171561209a565b14156117635760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610878565b60028160048111156117775761177761209a565b14156117c55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610878565b60038160048111156117d9576117d961209a565b1415610c1b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610878565b600081831061184e576000828152602084905260409020610e7e565b5060009182526020526040902090565b606061186d8484600085611939565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156118ac5750600090506003611930565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611900573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661192957600060019250925050611930565b9150600090505b94509492505050565b60608247101561199a5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610878565b600080866001600160a01b031685876040516119b691906120dc565b60006040518083038185875af1925050503d80600081146119f3576040519150601f19603f3d011682016040523d82523d6000602084013e6119f8565b606091505b5091509150611a0987838387611a14565b979650505050505050565b60608315611a80578251611a79576001600160a01b0385163b611a795760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610878565b508161186d565b61186d8383815115611a955781518083602001fd5b8060405162461bcd60e51b815260040161087891906120f8565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611aee57611aee611aaf565b604052919050565b600082601f830112611b0757600080fd5b8135602067ffffffffffffffff821115611b2357611b23611aaf565b8160051b611b32828201611ac5565b9283528481018201928281019087851115611b4c57600080fd5b83870192505b84831015611a0957823582529183019190830190611b52565b80356001600160a01b0381168114611b8257600080fd5b919050565b600080600060608486031215611b9c57600080fd5b833567ffffffffffffffff811115611bb357600080fd5b611bbf86828701611af6565b935050611bce60208501611b6b565b9150604084013590509250925092565b600060208284031215611bf057600080fd5b610e7e82611b6b565b8015158114610c1b57600080fd5b600060208284031215611c1957600080fd5b8135610e7e81611bf9565b60008060008060808587031215611c3a57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215611c6857600080fd5b5035919050565b60008060408385031215611c8257600080fd5b611c8b83611b6b565b91506020830135611c9b81611bf9565b809150509250929050565b60008060408385031215611cb957600080fd5b611cc283611b6b565b946020939093013593505050565b600080600060608486031215611ce557600080fd5b505081359360208301359350604090920135919050565b60008060408385031215611d0f57600080fd5b50508035926020909101359150565b60008060008060608587031215611d3457600080fd5b843567ffffffffffffffff80821115611d4c57600080fd5b611d5888838901611af6565b9550602087013594506040870135915080821115611d7557600080fd5b818701915087601f830112611d8957600080fd5b813581811115611d9857600080fd5b886020828501011115611daa57600080fd5b95989497505060200194505050565b60006020808385031215611dcc57600080fd5b823567ffffffffffffffff80821115611de457600080fd5b818501915085601f830112611df857600080fd5b813581811115611e0a57611e0a611aaf565b611e1c601f8201601f19168501611ac5565b91508082528684828501011115611e3257600080fd5b8084840185840137600090820190930192909252509392505050565b60208082526032908201527f546865206f776e65722063616e206f6e6c7920776974686472617720455448206040820152716166746572207468652049444f20656e647360701b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115611ec957611ec9611ea0565b500190565b600060208284031215611ee057600080fd5b815160ff81168114610e7e57600080fd5b600181815b80851115611f2c578160001904821115611f1257611f12611ea0565b80851615611f1f57918102915b93841c9390800290611ef6565b509250929050565b600082611f4357506001610a56565b81611f5057506000610a56565b8160018114611f665760028114611f7057611f8c565b6001915050610a56565b60ff841115611f8157611f81611ea0565b50506001821b610a56565b5060208310610133831016604e8410600b8410161715611faf575081810a610a56565b611fb98383611ef1565b8060001904821115611fcd57611fcd611ea0565b029392505050565b6000610e7e60ff841683611f34565b6000816000190483118215151615611ffe57611ffe611ea0565b500290565b60008261202057634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561203757612037611ea0565b500390565b8183823760009101908152919050565b634e487b7160e01b600052603260045260246000fd5b600060001982141561207657612076611ea0565b5060010190565b60006020828403121561208f57600080fd5b8151610e7e81611bf9565b634e487b7160e01b600052602160045260246000fd5b60005b838110156120cb5781810151838201526020016120b3565b8381111561157e5750506000910152565b600082516120ee8184602087016120b0565b9190910192915050565b60208152600082518060208401526121178160408501602087016120b0565b601f01601f1916919091016040019291505056fea2646970667358221220e9e43f06749006cc9cd354dbc07e3ebc64cafb5045e1ad5bdbc35aa43c4c182d64736f6c634300080c0033

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

31296c40449934907f6760d70eedb34c229fd2522220cd1c60ef665a1e13d85100000000000000000000000000000000000000000000000000000000661e846000000000000000000000000000000000000000000000000000000000661fd5e0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7

-----Decoded View---------------
Arg [0] : _merkleRoot (bytes32): 0x31296c40449934907f6760d70eedb34c229fd2522220cd1c60ef665a1e13d851
Arg [1] : _start (uint256): 1713276000
Arg [2] : _end (uint256): 1713362400
Arg [3] : _tokenPayment (address): 0xdAC17F958D2ee523a2206206994597C13D831ec7

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 31296c40449934907f6760d70eedb34c229fd2522220cd1c60ef665a1e13d851
Arg [1] : 00000000000000000000000000000000000000000000000000000000661e8460
Arg [2] : 00000000000000000000000000000000000000000000000000000000661fd5e0
Arg [3] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7


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  ]

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.