ETH Price: $2,670.06 (+1.08%)

Contract

0x30c093Ee340B650a77349f552fD29C0af453D706
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw Picto T...201419122024-06-21 18:33:5962 days ago1718994839IN
0x30c093Ee...af453D706
0 ETH0.000261325.83830705
Withdraw Picto T...201418832024-06-21 18:27:5962 days ago1718994479IN
0x30c093Ee...af453D706
0 ETH0.000426856.90697205
Withdraw Referra...201413412024-06-21 16:38:2362 days ago1718987903IN
0x30c093Ee...af453D706
0 ETH0.000417776.54860313
Buy Picto Tokens201411112024-06-21 15:52:1162 days ago1718985131IN
0x30c093Ee...af453D706
0 ETH0.004048288.83304696
Whitelist Referr...201383782024-06-21 6:43:2363 days ago1718952203IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383772024-06-21 6:43:1163 days ago1718952191IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383762024-06-21 6:42:5963 days ago1718952179IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383752024-06-21 6:42:4763 days ago1718952167IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383742024-06-21 6:42:3563 days ago1718952155IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383732024-06-21 6:42:2363 days ago1718952143IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383722024-06-21 6:42:1163 days ago1718952131IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383712024-06-21 6:41:5963 days ago1718952119IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383702024-06-21 6:41:4763 days ago1718952107IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383692024-06-21 6:41:3563 days ago1718952095IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383682024-06-21 6:41:2363 days ago1718952083IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383672024-06-21 6:41:1163 days ago1718952071IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383662024-06-21 6:40:5963 days ago1718952059IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383652024-06-21 6:40:4763 days ago1718952047IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383642024-06-21 6:40:3563 days ago1718952035IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383632024-06-21 6:40:2363 days ago1718952023IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383622024-06-21 6:40:1163 days ago1718952011IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383612024-06-21 6:39:5963 days ago1718951999IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383602024-06-21 6:39:4763 days ago1718951987IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383592024-06-21 6:39:3563 days ago1718951975IN
0x30c093Ee...af453D706
0 ETH0.000144245
Whitelist Referr...201383582024-06-21 6:39:2363 days ago1718951963IN
0x30c093Ee...af453D706
0 ETH0.000144245
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:
PictoTokenSale

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 1000 runs

Other Settings:
paris EvmVersion
File 1 of 8 : PictoTokenSale.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";

contract PictoTokenSale is Ownable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    struct PaymentToken {
        address tokenAddress;
        uint256 price; //price of one pictoToken
        uint256 minPurchasedAmount;
    }

    struct ReferralInfo {
        address user;
        uint256 purchasedAmount;
    }

    struct UserInfo {
        address referrer;
        uint256 totalPurchasedAmount;
        uint256 totalWithdrawnAmount;
    }
    struct Purchase {
        address paymentToken;
        uint256 timestamp;
        uint256 pictoTokenAmount;
        uint256 payableAmount;
    }

    uint256 public constant FIRST_UNLOCK_BP = 1500; //15%
    uint256 public constant PURCHASE_PERIOD = 7593990 seconds;
    uint256 public constant VESTING_PERIOD = 180 days;
    uint256 public constant UNLOCK_PERIOD = 365 days;
    uint256 public constant BP = 10000;
    uint256 public constant BONUS = 500; //5%
    uint8 public constant pictoTokenDecimals = 18;
    address public immutable pictoToken;
    uint256 public totalLockedAmount;
    uint256 public referrerFeeBps = 1500; //15%
    uint256 public endOfSale;
    uint256 public startUnlock;

    PaymentToken[] public paymentTokens;
    // user => Purchase[]
    mapping(address => Purchase[]) public purchases;
    mapping(address => bool) public isPaymentToken;
    mapping(address => UserInfo) public userInfo;
    mapping(address => address[]) public referrals;
    //  user => token => fee
    mapping(address => mapping(address => uint256)) public referralsFee;
    mapping(address => uint256) public totalReferralsFeeInfo;
    mapping(address => bool) public whitelisted;
    EnumerableSet.AddressSet private users;
    EnumerableSet.AddressSet private whitelistedReferrer;

    modifier correctID(uint256 _id) {
        require(_id < paymentTokens.length, "bad token id");
        _;
    }

    event BuyPictoTokens(address user, uint256 pictoTokenAmount, uint256 paymentAmount);
    event AddPaymentToken(address tokenAddress, uint256 price, uint256 minPurchasedAmount);
    event RemovePaymentToken(address tokenAddress);
    event ChangePaymentToken(address tokenAddress, uint256 price, uint256 minPurchasedAmount);
    event ChangeReferrerFee(uint256 referrerFeeBps);
    event WithdrawTokens(address user, uint256 amount);

    constructor(address _pictoToken, PaymentToken[] memory _paymentTokens) {
        pictoToken = _pictoToken;
        for (uint256 i; i < _paymentTokens.length; i++) {
            paymentTokens.push(_paymentTokens[i]);
            isPaymentToken[_paymentTokens[i].tokenAddress] = true;
        }
        endOfSale = block.timestamp + PURCHASE_PERIOD;
        startUnlock = endOfSale + VESTING_PERIOD;
    }

    function isSaleTime() public view returns (bool) {
        return endOfSale > block.timestamp;
    }

    function setEndOfSale(uint256 _endOfSale) external onlyOwner {
        require(isSaleTime(), "sale is over");
        require(_endOfSale > block.timestamp, "incorrect _endOfSale");
        endOfSale = _endOfSale;
    }

    function WhitelistReferrer(address _referrer, bool _status) external onlyOwner {
        whitelisted[_referrer] = _status;
        if (_status) {
            whitelistedReferrer.add(_referrer);
        } else {
            whitelistedReferrer.remove(_referrer);
        }
    }

    function addPaymentToken(PaymentToken calldata _paymentToken) external onlyOwner {
        require(isPaymentToken[_paymentToken.tokenAddress] == false, "token already exist");
        isPaymentToken[_paymentToken.tokenAddress] = true;
        paymentTokens.push(_paymentToken);
        emit AddPaymentToken(
            _paymentToken.tokenAddress,
            _paymentToken.price,
            _paymentToken.minPurchasedAmount
        );
    }

    function removePaymentToken(
        uint256 _paymentTokenID
    ) external onlyOwner correctID(_paymentTokenID) {
        address tokenAddress = paymentTokens[_paymentTokenID].tokenAddress;
        paymentTokens[_paymentTokenID] = paymentTokens[paymentTokens.length - 1];
        paymentTokens.pop();
        isPaymentToken[tokenAddress] = false;
        emit RemovePaymentToken(tokenAddress);
    }

    function changePaymentToken(
        uint256 _paymentTokenID,
        uint256 _price,
        uint256 _minPurchasedAmount
    ) external onlyOwner correctID(_paymentTokenID) {
        PaymentToken storage paymentInfo = paymentTokens[_paymentTokenID];
        paymentInfo.price = _price;
        paymentInfo.minPurchasedAmount = _minPurchasedAmount;
        emit ChangePaymentToken(paymentInfo.tokenAddress, _price, _minPurchasedAmount);
    }

    function changeReferrerFee(uint256 _referrerFeeBps) external onlyOwner {
        require(_referrerFeeBps <= BP, "incorrect _referrerFeeBps");
        referrerFeeBps = _referrerFeeBps;
        emit ChangeReferrerFee(_referrerFeeBps);
    }

    function withdrawPictoTokens(address _token, uint256 _amount, address _to) external onlyOwner {
        require(_amount <= availablePictoTokens(), "_amount exceeds free balance");
        _pay(_token, address(this), _to, _amount);
    }

    function availablePictoTokens() public view returns (uint256) {
        return IERC20(pictoToken).balanceOf(address(this)) - totalLockedAmount;
    }

    function totalUsers() external view returns (uint256) {
        return users.length();
    }

    function userAtIndex(uint256 _index) external view returns (address) {
        return users.at(_index);
    }

    function userExists(address _user) external view returns (bool) {
        return users.contains(_user);
    }

    function getUsers() external view returns (address[] memory _users) {
        _users = users.values();
    }

    function getWhitelistedReferrer()
        external
        view
        returns (address[] memory _whitelistedReferrer)
    {
        _whitelistedReferrer = whitelistedReferrer.values();
    }

    function getUsersPurchases(address _user) external view returns (Purchase[] memory) {
        return purchases[_user];
    }

    function getUsersInfoInRange(
        uint256 _start,
        uint256 _end
    ) external view returns (UserInfo[] memory info) {
        require(_start < _end, "incorrect range");
        require(_end <= users.length(), "incorrect range");
        info = new UserInfo[](_end - _start);
        for (uint256 i = _start; i < _end; i++) {
            info[i - _start] = userInfo[users.at(i)];
        }
    }

    /// @notice This function provides the balance of referral fees for the specified tokens.
    /// @dev Fetches referral fee balances from the `referralsFee` mapping for the caller's address.
    /// @param tokens An array of token addresses for which to retrieve the referral fee balances.
    /// @return balances An array of uint256 values, each representing the referral fee balance of the corresponding token in the input array.
    function getReferralFeeBalance(
        address[] calldata tokens
    ) external view returns (uint256[] memory balances) {
        mapping(address => uint256) storage fee = referralsFee[msg.sender];
        balances = new uint256[](tokens.length);

        for (uint256 i = 0; i < tokens.length; i++) {
            balances[i] = fee[tokens[i]];
        }
    }

    /// @notice Retrieves information about the referrals associated with a given referrer.
    /// @dev Iterates over the array of a specified referrer's referrals to calculate the total purchased amount and aggregates respective data into ReferralInfo structs.
    /// @param referrer The address of the referrer whose referral information is being queried.
    /// @return totalFeeInPictoToken The sum of all referral fees for the referrer in PictoToken.
    /// @return totalPurchasedAmount The total amount of purchases made by all referrals linked to the referrer.
    /// @return referralsInfo An array of ReferralInfo structs containing detailed information on each referral linked to the referrer.
    function getReferralsInfo(
        address referrer
    )
        external
        view
        returns (
            uint256 totalFeeInPictoToken,
            uint256 totalPurchasedAmount,
            ReferralInfo[] memory referralsInfo
        )
    {
        address[] memory allReferrals = referrals[referrer];
        referralsInfo = new ReferralInfo[](allReferrals.length);
        for (uint256 i = 0; i < allReferrals.length; i++) {
            address user = allReferrals[i];
            uint256 userPurchasedAmount = userInfo[user].totalPurchasedAmount;
            referralsInfo[i] = ReferralInfo(user, userPurchasedAmount);
            totalPurchasedAmount += userPurchasedAmount;
        }
        totalFeeInPictoToken = totalReferralsFeeInfo[referrer];
    }

    /// @notice Calculates the amount of Picto tokens that have been unlocked for a given user.
    /// @dev The calculation is based on the vesting period and the time elapsed since the end of the sale.
    ///      Returns 0 if the sale is still ongoing.
    /// @param _user The address of the user whose unlocked amount is to be calculated.
    /// @return unlockedAmount The amount of unlocked Picto tokens available for `_user`.
    /// @custom:algorithm The unlocked amount is calculated as the total purchased amount
    ///                   proportionate to the time passed since the end of the sale,
    ///                   capped at the total purchased amount, and subtracting the amount already withdrawn.
    function calculateUnlockedAmount(address _user) public view returns (uint256 unlockedAmount) {
        UserInfo memory user = userInfo[_user];

        uint256 firstUnlockAmt = (user.totalPurchasedAmount * FIRST_UNLOCK_BP) / BP;

        uint256 totalUnlocked = firstUnlockAmt + block.timestamp > startUnlock
            ? ((user.totalPurchasedAmount - firstUnlockAmt) * (block.timestamp - startUnlock)) /
                UNLOCK_PERIOD
            : 0;
        if (totalUnlocked > user.totalPurchasedAmount) {
            totalUnlocked = user.totalPurchasedAmount;
        }
        if (totalUnlocked > user.totalWithdrawnAmount) {
            unlockedAmount = totalUnlocked - user.totalWithdrawnAmount;
        }
    }

    /// @notice Buys Picto tokens with a specified payment token
    /// @dev Requires the sale to be active and enforces minimum purchase requirements
    /// @param _paymentTokenID The identifier of the payment token being used for the purchase
    /// @param _pictoTokenAmount The amount of Picto tokens the user wishes to buy
    /// @param _referrer The address of the referrer, if applicable
    /// @custom:modifier correctID Ensures the payment token ID is valid
    function buyPictoTokens(
        uint256 _paymentTokenID,
        uint256 _pictoTokenAmount,
        address _referrer
    ) external correctID(_paymentTokenID) {
        require(isSaleTime(), "sale is over");
        PaymentToken memory paymentInfo = paymentTokens[_paymentTokenID];

        require(
            _pictoTokenAmount > paymentInfo.minPurchasedAmount,
            "_pictoTokenAmount is too small"
        );

        uint256 ptWithBonus = (_pictoTokenAmount * (BP + BONUS)) / BP;
        require((ptWithBonus) <= availablePictoTokens(), "_pictoTokenAmount exceeds free balance");

        UserInfo storage user = userInfo[msg.sender];

        if (user.referrer == address(0)) {
            require(whitelisted[_referrer], "invalid referrer");
            referrals[_referrer].push(msg.sender);
            user.referrer = _referrer;
        }

        user.totalPurchasedAmount += ptWithBonus;
        totalLockedAmount += ptWithBonus;
        totalReferralsFeeInfo[user.referrer] += (_pictoTokenAmount * referrerFeeBps) / BP;

        users.add(msg.sender);

        uint256 payableAmount = (_pictoTokenAmount * paymentInfo.price) / 10 ** pictoTokenDecimals;
        require(payableAmount > 0, "payableAmount is zero");
        uint256 referrerFee = (payableAmount * referrerFeeBps) / BP;
        referralsFee[user.referrer][paymentInfo.tokenAddress] += referrerFee;
        purchases[msg.sender].push(
            Purchase(paymentInfo.tokenAddress, block.timestamp, _pictoTokenAmount, payableAmount)
        );
        _pay(paymentInfo.tokenAddress, msg.sender, address(this), payableAmount);
        _pay(paymentInfo.tokenAddress, address(this), owner(), payableAmount - referrerFee);

        emit BuyPictoTokens(msg.sender, _pictoTokenAmount, payableAmount);
    }

    /// @notice Allows a user to withdraw their referral fees for the specified tokens.
    /// @dev Iterates through the provided list of tokens, checks and resets the referral fee balance, then pays the fee to the caller.
    /// @param tokens An array of token addresses for which the referral fees are to be withdrawn by the caller.
    function withdrawReferralFee(address[] calldata tokens) external {
        mapping(address => uint256) storage feeMap = referralsFee[msg.sender];
        for (uint256 i = 0; i < tokens.length; i++) {
            address token = tokens[i];
            uint256 fee = feeMap[token];
            if (fee == 0) continue;
            feeMap[token] = 0;
            _pay(token, address(this), msg.sender, fee);
        }
    }

    /// @notice Withdraws unlocked Picto tokens to the caller's address.
    /// @dev Requires the sale to have ended and that the user has unlocked tokens available for withdrawal.
    /// @custom:requirement The sale must be concluded for withdrawals to proceed.
    /// @custom:requirement The user must have a non-zero amount of locked Picto tokens.
    /// @custom:requirement There must be non-zero unlocked tokens to withdraw.
    function withdrawUnlockedPictoTokens() external {
        require(!isSaleTime(), "sale is not over");
        UserInfo storage user = userInfo[msg.sender];
        uint256 lockedAmount = user.totalPurchasedAmount - user.totalWithdrawnAmount;
        require(lockedAmount > 0, "you don't have tokens");
        uint256 unlockedAmount = calculateUnlockedAmount(msg.sender);
        require(unlockedAmount > 0, "unlocked iz zero");
        user.totalWithdrawnAmount += unlockedAmount;
        totalLockedAmount -= unlockedAmount;
        _pay(pictoToken, address(this), msg.sender, unlockedAmount);
        emit WithdrawTokens(msg.sender, unlockedAmount);
    }

    function _pay(address token, address payer, address recipient, uint256 value) private {
        if (value > 0) {
            if (payer == address(this)) {
                IERC20(token).safeTransfer(recipient, value);
            } else {
                IERC20(token).safeTransferFrom(payer, recipient, value);
            }
        }
    }
}

File 2 of 8 : 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 8 : 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 8 : 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 8 : 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 8 : 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 8 : 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 8 : EnumerableSet.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}

Settings
{
  "evmVersion": "paris",
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_pictoToken","type":"address"},{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"minPurchasedAmount","type":"uint256"}],"internalType":"struct PictoTokenSale.PaymentToken[]","name":"_paymentTokens","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minPurchasedAmount","type":"uint256"}],"name":"AddPaymentToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"pictoTokenAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"name":"BuyPictoTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"minPurchasedAmount","type":"uint256"}],"name":"ChangePaymentToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"referrerFeeBps","type":"uint256"}],"name":"ChangeReferrerFee","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":"tokenAddress","type":"address"}],"name":"RemovePaymentToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawTokens","type":"event"},{"inputs":[],"name":"BONUS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FIRST_UNLOCK_BP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PURCHASE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNLOCK_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VESTING_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"WhitelistReferrer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"minPurchasedAmount","type":"uint256"}],"internalType":"struct PictoTokenSale.PaymentToken","name":"_paymentToken","type":"tuple"}],"name":"addPaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availablePictoTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paymentTokenID","type":"uint256"},{"internalType":"uint256","name":"_pictoTokenAmount","type":"uint256"},{"internalType":"address","name":"_referrer","type":"address"}],"name":"buyPictoTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"calculateUnlockedAmount","outputs":[{"internalType":"uint256","name":"unlockedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paymentTokenID","type":"uint256"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_minPurchasedAmount","type":"uint256"}],"name":"changePaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_referrerFeeBps","type":"uint256"}],"name":"changeReferrerFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endOfSale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"getReferralFeeBalance","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"referrer","type":"address"}],"name":"getReferralsInfo","outputs":[{"internalType":"uint256","name":"totalFeeInPictoToken","type":"uint256"},{"internalType":"uint256","name":"totalPurchasedAmount","type":"uint256"},{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"purchasedAmount","type":"uint256"}],"internalType":"struct PictoTokenSale.ReferralInfo[]","name":"referralsInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getUsers","outputs":[{"internalType":"address[]","name":"_users","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"getUsersInfoInRange","outputs":[{"components":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"totalPurchasedAmount","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawnAmount","type":"uint256"}],"internalType":"struct PictoTokenSale.UserInfo[]","name":"info","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUsersPurchases","outputs":[{"components":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"pictoTokenAmount","type":"uint256"},{"internalType":"uint256","name":"payableAmount","type":"uint256"}],"internalType":"struct PictoTokenSale.Purchase[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedReferrer","outputs":[{"internalType":"address[]","name":"_whitelistedReferrer","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPaymentToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSaleTime","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"paymentTokens","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"minPurchasedAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pictoToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pictoTokenDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"purchases","outputs":[{"internalType":"address","name":"paymentToken","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"pictoTokenAmount","type":"uint256"},{"internalType":"uint256","name":"payableAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"referrals","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"referralsFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referrerFeeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_paymentTokenID","type":"uint256"}],"name":"removePaymentToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_endOfSale","type":"uint256"}],"name":"setEndOfSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startUnlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalReferralsFeeInfo","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalUsers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"userAtIndex","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"userExists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"address","name":"referrer","type":"address"},{"internalType":"uint256","name":"totalPurchasedAmount","type":"uint256"},{"internalType":"uint256","name":"totalWithdrawnAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawPictoTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"withdrawReferralFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawUnlockedPictoTokens","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a06040526105dc6002553480156200001757600080fd5b5060405162002d2638038062002d268339810160408190526200003a9162000236565b620000453362000155565b6001600160a01b03821660805260005b81518110156200012457600582828151811062000076576200007662000337565b6020908102919091018101518254600180820185556000948552838520835160039093020180546001600160a01b0319166001600160a01b03909316929092178255928201518184015560409091015160029091015583519091600791859085908110620000e857620000e862000337565b602090810291909101810151516001600160a01b03168252810191909152604001600020805460ff191691151591909117905560010162000055565b50620001346273e006426200034d565b6003819055620001499062ed4e00906200034d565b60045550620003759050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620001bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620001fd57620001fd620001c2565b60405290565b604051601f8201601f191681016001600160401b03811182821017156200022e576200022e620001c2565b604052919050565b60008060408084860312156200024b57600080fd5b6200025684620001a5565b602085810151919450906001600160401b03808211156200027657600080fd5b818701915087601f8301126200028b57600080fd5b815181811115620002a057620002a0620001c2565b620002b0848260051b0162000203565b8181528481019250606091820284018501918a831115620002d057600080fd5b938501935b82851015620003265780858c031215620002ef5760008081fd5b620002f9620001d8565b6200030486620001a5565b81528587015187820152878601518882015284529384019392850192620002d5565b508096505050505050509250929050565b634e487b7160e01b600052603260045260246000fd5b808201808211156200036f57634e487b7160e01b600052601160045260246000fd5b92915050565b6080516129876200039f6000396000818161050a015281816110e5015261183e01526129876000f3fe608060405234801561001057600080fd5b50600436106102fe5760003560e01c80637baf5b841161019c578063b8450a14116100ee578063de66084111610097578063eb06980f11610071578063eb06980f146106d6578063efd422fc146106e9578063f2fde38b146106f357600080fd5b8063de66084114610690578063e626048f146106a3578063e697b5d8146106c357600080fd5b8063cd7e6662116100c8578063cd7e66621461062f578063d00d8efe1461065a578063d936547e1461066d57600080fd5b8063b8450a14146105f4578063bd4b114714610607578063bff1f9e11461062757600080fd5b8063a07c163311610150578063b064231c1161012a578063b064231c146105c3578063b0c09387146105cc578063b4ca95ee146105ec57600080fd5b8063a07c16331461059d578063aaa1d528146105a6578063ae6ebfdd146105b957600080fd5b80638da5cb5b116101815780638da5cb5b14610560578063930eaddc146105715780639cfdbd5e1461059457600080fd5b80637baf5b84146105445780637f83ea6d1461054d57600080fd5b80633197ed2411610255578063537229611161020957806372cbf7fa116101e357806372cbf7fa146104e957806374f4783e146104fc578063760e05ea1461050557600080fd5b806353722961146104c657806366f8dddd146104d9578063715018a6146104e157600080fd5b8063414cda761161023a578063414cda76146104605780634b8624c41461048057806352d3f8491461048957600080fd5b80633197ed2414610445578063410ad9851461045857600080fd5b80630e666e49116102b757806320119ca41161029157806320119ca41461040d57806323f5a18114610420578063259a28cf1461043a57600080fd5b80630e666e491461037957806316c30d751461039c5780631959a002146103af57600080fd5b806305a9f274116102e857806305a9f2741461033957806308c1aa89146103425780630d9a46581461035757600080fd5b8062ce8e3e146103035780630197d97214610321575b600080fd5b61030b610706565b6040516103189190612300565b60405180910390f35b61032b62ed4e0081565b604051908152602001610318565b61032b60015481565b610355610350366004612362565b610717565b005b61036a61036536600461239b565b610c16565b604051610318939291906123b8565b61038c61038736600461239b565b610dba565b6040519015158152602001610318565b6103556103aa366004612424565b610dcd565b6103e86103bd36600461239b565b6008602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b039094168452602084019290925290820152606001610318565b61035561041b366004612499565b610e6f565b610428601281565b60405160ff9091168152602001610318565b61032b6301e1338081565b610355610453366004612499565b61100c565b61032b6110a8565b61047361046e3660046124b2565b61115a565b60405161031891906124d4565b61032b6101f481565b61049c610497366004612536565b611318565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610318565b6103556104d4366004612570565b611368565b61030b6113b8565b6103556113c4565b6103556104f73660046125a9565b6113d8565b61032b60035481565b61052c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610318565b61032b60045481565b61032b61055b36600461239b565b611443565b6000546001600160a01b031661052c565b61038c61057f36600461239b565b60076020526000908152604090205460ff1681565b61032b61271081565b61032b60025481565b6103556105b43660046125e0565b611532565b600354421061038c565b61032b6105dc81565b6105df6105da366004612424565b611605565b604051610318919061260c565b6103556116df565b610355610602366004612644565b61189b565b61032b61061536600461239b565b600b6020526000908152604090205481565b61032b6119fe565b61032b61063d36600461265c565b600a60209081526000928352604080842090915290825290205481565b610355610668366004612499565b611a0a565b61038c61067b36600461239b565b600c6020526000908152604090205460ff1681565b6103e861069e366004612499565b611a99565b6106b66106b136600461239b565b611ad6565b604051610318919061268a565b61052c6106d1366004612536565b611b76565b61052c6106e4366004612499565b611bae565b61032b6273e00681565b61035561070136600461239b565b611bbb565b6060610712600d611c4b565b905090565b6005548390811061075e5760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b60448201526064015b60405180910390fd5b600354421061079e5760405162461bcd60e51b815260206004820152600c60248201526b39b0b6329034b99037bb32b960a11b6044820152606401610755565b6000600585815481106107b3576107b36126ea565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915084116108455760405162461bcd60e51b815260206004820152601e60248201527f5f706963746f546f6b656e416d6f756e7420697320746f6f20736d616c6c00006044820152606401610755565b60006127106108566101f482612716565b6108609087612729565b61086a9190612740565b90506108746110a8565b8111156108e95760405162461bcd60e51b815260206004820152602660248201527f5f706963746f546f6b656e416d6f756e7420657863656564732066726565206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610755565b33600090815260086020526040902080546001600160a01b03166109b1576001600160a01b0385166000908152600c602052604090205460ff1661096f5760405162461bcd60e51b815260206004820152601060248201527f696e76616c6964207265666572726572000000000000000000000000000000006044820152606401610755565b6001600160a01b03851660008181526009602090815260408220805460018101825590835291200180546001600160a01b031990811633179091558254161781555b818160010160008282546109c59190612716565b9250508190555081600160008282546109de9190612716565b9091555050600254612710906109f49088612729565b6109fe9190612740565b81546001600160a01b03166000908152600b602052604081208054909190610a27908490612716565b90915550610a389050600d33611c5f565b506000610a476012600a612846565b6020850151610a569089612729565b610a609190612740565b905060008111610ab25760405162461bcd60e51b815260206004820152601560248201527f70617961626c65416d6f756e74206973207a65726f00000000000000000000006044820152606401610755565b600061271060025483610ac59190612729565b610acf9190612740565b83546001600160a01b039081166000908152600a602090815260408083208a51909416835292905290812080549293508392909190610b0f908490612716565b909155505033600081815260066020908152604080832081516080810183528a516001600160a01b039081168252428286019081529382018f8152606083018a8152845460018082018755958952969097209251600490960290920180546001600160a01b0319169590911694909417845591519083015551600282015590516003909101558551610ba2913085611c74565b8451610bca9030610bbb6000546001600160a01b031690565b610bc58587612855565b611c74565b60408051338152602081018a90529081018390527fa90ad7c4cec58f64bc292e38a622c9d322c7924030799b9a2f7c6baca77d0ed69060600160405180910390a1505050505050505050565b6001600160a01b038116600090815260096020908152604080832080548251818502810185019093528083528493606093859390929091830182828015610c8657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c68575b50505050509050805167ffffffffffffffff811115610ca757610ca7612868565b604051908082528060200260200182016040528015610cec57816020015b6040805180820190915260008082526020820152815260200190600190039081610cc55790505b50915060005b8151811015610d97576000828281518110610d0f57610d0f6126ea565b60200260200101519050600060086000836001600160a01b03166001600160a01b031681526020019081526020016000206001015490506040518060400160405280836001600160a01b0316815260200182815250858481518110610d7657610d766126ea565b6020908102919091010152610d8b8187612716565b95505050600101610cf2565b50506001600160a01b039093166000908152600b60205260409020549390929150565b6000610dc7600d83611cb8565b92915050565b336000908152600a60205260408120905b82811015610e69576000848483818110610dfa57610dfa6126ea565b9050602002016020810190610e0f919061239b565b6001600160a01b038116600090815260208590526040812054919250819003610e39575050610e61565b6001600160a01b038216600090815260208590526040812055610e5e82303384611c74565b50505b600101610dde565b50505050565b610e77611cda565b60055481908110610eb95760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b6044820152606401610755565b600060058381548110610ece57610ece6126ea565b6000918252602090912060039091020154600580546001600160a01b03909216925090610efd90600190612855565b81548110610f0d57610f0d6126ea565b906000526020600020906003020160058481548110610f2e57610f2e6126ea565b60009182526020909120825460039092020180546001600160a01b0319166001600160a01b03909216919091178155600180830154908201556002918201549101556005805480610f8157610f8161287e565b600082815260208082206003600019949094019384020180546001600160a01b031916815560018101839055600201829055919092556001600160a01b03831680835260078252604092839020805460ff1916905591519182527f2c14abe14e78325d28e41bb9a1e9c245d31ebd41e6fcb558a3b8f274f7bec4ca91015b60405180910390a1505050565b611014611cda565b60035442106110545760405162461bcd60e51b815260206004820152600c60248201526b39b0b6329034b99037bb32b960a11b6044820152606401610755565b4281116110a35760405162461bcd60e51b815260206004820152601460248201527f696e636f7272656374205f656e644f6653616c650000000000000000000000006044820152606401610755565b600355565b6001546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111509190612894565b6107129190612855565b60608183106111ab5760405162461bcd60e51b815260206004820152600f60248201527f696e636f72726563742072616e676500000000000000000000000000000000006044820152606401610755565b6111b5600d611d34565b8211156112045760405162461bcd60e51b815260206004820152600f60248201527f696e636f72726563742072616e676500000000000000000000000000000000006044820152606401610755565b61120e8383612855565b67ffffffffffffffff81111561122657611226612868565b60405190808252806020026020018201604052801561128457816020015b611271604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b8152602001906001900390816112445790505b509050825b8281101561131157600860006112a0600d84611d3e565b6001600160a01b039081168252602080830193909352604091820160002082516060810184528154909216825260018101549382019390935260029092015490820152826112ee8684612855565b815181106112fe576112fe6126ea565b6020908102919091010152600101611289565b5092915050565b6006602052816000526040600020818154811061133457600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169450925084565b611370611cda565b6001600160a01b0382166000908152600c60205260409020805460ff191682158015919091179091556113ad576113a8600f83611c5f565b505050565b6113a8600f83611d4a565b6060610712600f611c4b565b6113cc611cda565b6113d66000611d5f565b565b6113e0611cda565b6113e86110a8565b8211156114375760405162461bcd60e51b815260206004820152601c60248201527f5f616d6f756e74206578636565647320667265652062616c616e6365000000006044820152606401610755565b6113a883308385611c74565b6001600160a01b03808216600090815260086020908152604080832081516060810183528154909516855260018101549285018390526002015490840152909190829061271090611497906105dc90612729565b6114a19190612740565b9050600060045442836114b49190612716565b116114c05760006114f7565b6301e13380600454426114d39190612855565b8385602001516114e39190612855565b6114ed9190612729565b6114f79190612740565b9050826020015181111561150c575060208201515b826040015181111561152a5760408301516115279082612855565b93505b505050919050565b61153a611cda565b6005548390811061157c5760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b6044820152606401610755565b600060058581548110611591576115916126ea565b600091825260209182902060039091020160018101869055600281018590558054604080516001600160a01b03909216825292810187905291820185905291507f99647f486fbb58c698cedffebd644b1913c7c66dcb5cc57e18d65c67ad9f99039060600160405180910390a15050505050565b336000908152600a602052604090206060908267ffffffffffffffff81111561163057611630612868565b604051908082528060200260200182016040528015611659578160200160208202803683370190505b50915060005b838110156116d75781600086868481811061167c5761167c6126ea565b9050602002016020810190611691919061239b565b6001600160a01b03166001600160a01b03168152602001908152602001600020548382815181106116c4576116c46126ea565b602090810291909101015260010161165f565b505092915050565b6003544210156117315760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206f766572000000000000000000000000000000006044820152606401610755565b336000908152600860205260408120600281015460018201549192916117579190612855565b9050600081116117a95760405162461bcd60e51b815260206004820152601560248201527f796f7520646f6e2774206861766520746f6b656e7300000000000000000000006044820152606401610755565b60006117b433611443565b9050600081116118065760405162461bcd60e51b815260206004820152601060248201527f756e6c6f636b656420697a207a65726f000000000000000000000000000000006044820152606401610755565b8083600201600082825461181a9190612716565b9250508190555080600160008282546118339190612855565b9091555061186590507f0000000000000000000000000000000000000000000000000000000000000000303384611c74565b60408051338152602081018390527f680f2e4f4032ebf1774e8cdbaddcb1b617a5a606411c8ca96257ada338d3833c9101610fff565b6118a3611cda565b600760006118b4602084018461239b565b6001600160a01b0316815260208101919091526040016000205460ff161561191e5760405162461bcd60e51b815260206004820152601360248201527f746f6b656e20616c7265616479206578697374000000000000000000000000006044820152606401610755565b600160076000611931602085018561239b565b6001600160a01b0316815260208101919091526040016000908120805492151560ff199093169290921790915560058054600181018255915281906003027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00161199b82826128ad565b507fdd36649896a0ea2327ec0f4024c8f190f3622b92d9716fc831dead4d14dd634990506119cc602083018361239b565b604080516001600160a01b0390921682526020808501359083015280840135908201526060015b60405180910390a150565b6000610712600d611d34565b611a12611cda565b612710811115611a645760405162461bcd60e51b815260206004820152601960248201527f696e636f7272656374205f7265666572726572466565427073000000000000006044820152606401610755565b60028190556040518181527f30edc703e39bfcf8f3d626d2fe02034c2fd2bf646dddf4ad70d6556010e85ebe906020016119f3565b60058181548110611aa957600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116925083565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b82821015611b6b576000848152602090819020604080516080810182526004860290920180546001600160a01b03168352600180820154848601526002820154928401929092526003015460608301529083529092019101611b0e565b505050509050919050565b60096020528160005260406000208181548110611b9257600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000610dc7600d83611d3e565b611bc3611cda565b6001600160a01b038116611c3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610755565b611c4881611d5f565b50565b60606000611c5883611daf565b9392505050565b6000611c58836001600160a01b038416611e0b565b8015610e6957306001600160a01b03841603611ca357611c9e6001600160a01b0385168383611e5a565b610e69565b610e696001600160a01b038516848484611f03565b6001600160a01b03811660009081526001830160205260408120541515611c58565b6000546001600160a01b031633146113d65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b6000610dc7825490565b6000611c588383611f54565b6000611c58836001600160a01b038416611f7e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611dff57602002820191906000526020600020905b815481526020019060010190808311611deb575b50505050509050919050565b6000818152600183016020526040812054611e5257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dc7565b506000610dc7565b6040516001600160a01b0383166024820152604481018290526113a89084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612071565b6040516001600160a01b0380851660248301528316604482015260648101829052610e699085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611e9f565b6000826000018281548110611f6b57611f6b6126ea565b9060005260206000200154905092915050565b60008181526001830160205260408120548015612067576000611fa2600183612855565b8554909150600090611fb690600190612855565b905081811461201b576000866000018281548110611fd657611fd66126ea565b9060005260206000200154905080876000018481548110611ff957611ff96126ea565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061202c5761202c61287e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dc7565b6000915050610dc7565b60006120c6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121599092919063ffffffff16565b90508051600014806120e75750808060200190518101906120e791906128ea565b6113a85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610755565b60606121688484600085612170565b949350505050565b6060824710156121e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610755565b600080866001600160a01b03168587604051612204919061292b565b60006040518083038185875af1925050503d8060008114612241576040519150601f19603f3d011682016040523d82523d6000602084013e612246565b606091505b509150915061225787838387612262565b979650505050505050565b606083156122d15782516000036122ca576001600160a01b0385163b6122ca5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610755565b5081612168565b61216883838151156122e65781518083602001fd5b8060405162461bcd60e51b81526004016107559190612947565b6020808252825182820181905260009190848201906040850190845b818110156123415783516001600160a01b03168352928401929184019160010161231c565b50909695505050505050565b6001600160a01b0381168114611c4857600080fd5b60008060006060848603121561237757600080fd5b833592506020840135915060408401356123908161234d565b809150509250925092565b6000602082840312156123ad57600080fd5b8135611c588161234d565b600060608201858352602085602085015260406060604086015282865180855260808701915060208801945060005b8181101561241557855180516001600160a01b031684528501518584015294840194918301916001016123e7565b50909998505050505050505050565b6000806020838503121561243757600080fd5b823567ffffffffffffffff8082111561244f57600080fd5b818501915085601f83011261246357600080fd5b81358181111561247257600080fd5b8660208260051b850101111561248757600080fd5b60209290920196919550909350505050565b6000602082840312156124ab57600080fd5b5035919050565b600080604083850312156124c557600080fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b8281101561252957815180516001600160a01b03168552868101518786015285015185850152606090930192908501906001016124f1565b5091979650505050505050565b6000806040838503121561254957600080fd5b82356125548161234d565b946020939093013593505050565b8015158114611c4857600080fd5b6000806040838503121561258357600080fd5b823561258e8161234d565b9150602083013561259e81612562565b809150509250929050565b6000806000606084860312156125be57600080fd5b83356125c98161234d565b92506020840135915060408401356123908161234d565b6000806000606084860312156125f557600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b8181101561234157835183529284019291840191600101612628565b60006060828403121561265657600080fd5b50919050565b6000806040838503121561266f57600080fd5b823561267a8161234d565b9150602083013561259e8161234d565b602080825282518282018190526000919060409081850190868401855b8281101561252957815180516001600160a01b031685528681015187860152858101518686015260609081015190850152608090930192908501906001016126a7565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610dc757610dc7612700565b8082028115828204841417610dc757610dc7612700565b60008261275d57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561279d57816000190482111561278357612783612700565b8085161561279057918102915b93841c9390800290612767565b509250929050565b6000826127b457506001610dc7565b816127c157506000610dc7565b81600181146127d757600281146127e1576127fd565b6001915050610dc7565b60ff8411156127f2576127f2612700565b50506001821b610dc7565b5060208310610133831016604e8410600b8410161715612820575081810a610dc7565b61282a8383612762565b806000190482111561283e5761283e612700565b029392505050565b6000611c5860ff8416836127a5565b81810381811115610dc757610dc7612700565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000602082840312156128a657600080fd5b5051919050565b81356128b88161234d565b6001600160a01b0381166001600160a01b03198354161782555060208201356001820155604082013560028201555050565b6000602082840312156128fc57600080fd5b8151611c5881612562565b60005b8381101561292257818101518382015260200161290a565b50506000910152565b6000825161293d818460208701612907565b9190910192915050565b6020815260008251806020840152612966816040850160208701612907565b601f01601f1916919091016040019291505056fea164736f6c6343000817000a00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000232800000000000000000000000000000000000000000000025a5419af66253c0000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102fe5760003560e01c80637baf5b841161019c578063b8450a14116100ee578063de66084111610097578063eb06980f11610071578063eb06980f146106d6578063efd422fc146106e9578063f2fde38b146106f357600080fd5b8063de66084114610690578063e626048f146106a3578063e697b5d8146106c357600080fd5b8063cd7e6662116100c8578063cd7e66621461062f578063d00d8efe1461065a578063d936547e1461066d57600080fd5b8063b8450a14146105f4578063bd4b114714610607578063bff1f9e11461062757600080fd5b8063a07c163311610150578063b064231c1161012a578063b064231c146105c3578063b0c09387146105cc578063b4ca95ee146105ec57600080fd5b8063a07c16331461059d578063aaa1d528146105a6578063ae6ebfdd146105b957600080fd5b80638da5cb5b116101815780638da5cb5b14610560578063930eaddc146105715780639cfdbd5e1461059457600080fd5b80637baf5b84146105445780637f83ea6d1461054d57600080fd5b80633197ed2411610255578063537229611161020957806372cbf7fa116101e357806372cbf7fa146104e957806374f4783e146104fc578063760e05ea1461050557600080fd5b806353722961146104c657806366f8dddd146104d9578063715018a6146104e157600080fd5b8063414cda761161023a578063414cda76146104605780634b8624c41461048057806352d3f8491461048957600080fd5b80633197ed2414610445578063410ad9851461045857600080fd5b80630e666e49116102b757806320119ca41161029157806320119ca41461040d57806323f5a18114610420578063259a28cf1461043a57600080fd5b80630e666e491461037957806316c30d751461039c5780631959a002146103af57600080fd5b806305a9f274116102e857806305a9f2741461033957806308c1aa89146103425780630d9a46581461035757600080fd5b8062ce8e3e146103035780630197d97214610321575b600080fd5b61030b610706565b6040516103189190612300565b60405180910390f35b61032b62ed4e0081565b604051908152602001610318565b61032b60015481565b610355610350366004612362565b610717565b005b61036a61036536600461239b565b610c16565b604051610318939291906123b8565b61038c61038736600461239b565b610dba565b6040519015158152602001610318565b6103556103aa366004612424565b610dcd565b6103e86103bd36600461239b565b6008602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b039094168452602084019290925290820152606001610318565b61035561041b366004612499565b610e6f565b610428601281565b60405160ff9091168152602001610318565b61032b6301e1338081565b610355610453366004612499565b61100c565b61032b6110a8565b61047361046e3660046124b2565b61115a565b60405161031891906124d4565b61032b6101f481565b61049c610497366004612536565b611318565b604080516001600160a01b0390951685526020850193909352918301526060820152608001610318565b6103556104d4366004612570565b611368565b61030b6113b8565b6103556113c4565b6103556104f73660046125a9565b6113d8565b61032b60035481565b61052c7f00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb481565b6040516001600160a01b039091168152602001610318565b61032b60045481565b61032b61055b36600461239b565b611443565b6000546001600160a01b031661052c565b61038c61057f36600461239b565b60076020526000908152604090205460ff1681565b61032b61271081565b61032b60025481565b6103556105b43660046125e0565b611532565b600354421061038c565b61032b6105dc81565b6105df6105da366004612424565b611605565b604051610318919061260c565b6103556116df565b610355610602366004612644565b61189b565b61032b61061536600461239b565b600b6020526000908152604090205481565b61032b6119fe565b61032b61063d36600461265c565b600a60209081526000928352604080842090915290825290205481565b610355610668366004612499565b611a0a565b61038c61067b36600461239b565b600c6020526000908152604090205460ff1681565b6103e861069e366004612499565b611a99565b6106b66106b136600461239b565b611ad6565b604051610318919061268a565b61052c6106d1366004612536565b611b76565b61052c6106e4366004612499565b611bae565b61032b6273e00681565b61035561070136600461239b565b611bbb565b6060610712600d611c4b565b905090565b6005548390811061075e5760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b60448201526064015b60405180910390fd5b600354421061079e5760405162461bcd60e51b815260206004820152600c60248201526b39b0b6329034b99037bb32b960a11b6044820152606401610755565b6000600585815481106107b3576107b36126ea565b600091825260209182902060408051606081018252600390930290910180546001600160a01b03168352600181015493830193909352600290920154918101829052915084116108455760405162461bcd60e51b815260206004820152601e60248201527f5f706963746f546f6b656e416d6f756e7420697320746f6f20736d616c6c00006044820152606401610755565b60006127106108566101f482612716565b6108609087612729565b61086a9190612740565b90506108746110a8565b8111156108e95760405162461bcd60e51b815260206004820152602660248201527f5f706963746f546f6b656e416d6f756e7420657863656564732066726565206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610755565b33600090815260086020526040902080546001600160a01b03166109b1576001600160a01b0385166000908152600c602052604090205460ff1661096f5760405162461bcd60e51b815260206004820152601060248201527f696e76616c6964207265666572726572000000000000000000000000000000006044820152606401610755565b6001600160a01b03851660008181526009602090815260408220805460018101825590835291200180546001600160a01b031990811633179091558254161781555b818160010160008282546109c59190612716565b9250508190555081600160008282546109de9190612716565b9091555050600254612710906109f49088612729565b6109fe9190612740565b81546001600160a01b03166000908152600b602052604081208054909190610a27908490612716565b90915550610a389050600d33611c5f565b506000610a476012600a612846565b6020850151610a569089612729565b610a609190612740565b905060008111610ab25760405162461bcd60e51b815260206004820152601560248201527f70617961626c65416d6f756e74206973207a65726f00000000000000000000006044820152606401610755565b600061271060025483610ac59190612729565b610acf9190612740565b83546001600160a01b039081166000908152600a602090815260408083208a51909416835292905290812080549293508392909190610b0f908490612716565b909155505033600081815260066020908152604080832081516080810183528a516001600160a01b039081168252428286019081529382018f8152606083018a8152845460018082018755958952969097209251600490960290920180546001600160a01b0319169590911694909417845591519083015551600282015590516003909101558551610ba2913085611c74565b8451610bca9030610bbb6000546001600160a01b031690565b610bc58587612855565b611c74565b60408051338152602081018a90529081018390527fa90ad7c4cec58f64bc292e38a622c9d322c7924030799b9a2f7c6baca77d0ed69060600160405180910390a1505050505050505050565b6001600160a01b038116600090815260096020908152604080832080548251818502810185019093528083528493606093859390929091830182828015610c8657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c68575b50505050509050805167ffffffffffffffff811115610ca757610ca7612868565b604051908082528060200260200182016040528015610cec57816020015b6040805180820190915260008082526020820152815260200190600190039081610cc55790505b50915060005b8151811015610d97576000828281518110610d0f57610d0f6126ea565b60200260200101519050600060086000836001600160a01b03166001600160a01b031681526020019081526020016000206001015490506040518060400160405280836001600160a01b0316815260200182815250858481518110610d7657610d766126ea565b6020908102919091010152610d8b8187612716565b95505050600101610cf2565b50506001600160a01b039093166000908152600b60205260409020549390929150565b6000610dc7600d83611cb8565b92915050565b336000908152600a60205260408120905b82811015610e69576000848483818110610dfa57610dfa6126ea565b9050602002016020810190610e0f919061239b565b6001600160a01b038116600090815260208590526040812054919250819003610e39575050610e61565b6001600160a01b038216600090815260208590526040812055610e5e82303384611c74565b50505b600101610dde565b50505050565b610e77611cda565b60055481908110610eb95760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b6044820152606401610755565b600060058381548110610ece57610ece6126ea565b6000918252602090912060039091020154600580546001600160a01b03909216925090610efd90600190612855565b81548110610f0d57610f0d6126ea565b906000526020600020906003020160058481548110610f2e57610f2e6126ea565b60009182526020909120825460039092020180546001600160a01b0319166001600160a01b03909216919091178155600180830154908201556002918201549101556005805480610f8157610f8161287e565b600082815260208082206003600019949094019384020180546001600160a01b031916815560018101839055600201829055919092556001600160a01b03831680835260078252604092839020805460ff1916905591519182527f2c14abe14e78325d28e41bb9a1e9c245d31ebd41e6fcb558a3b8f274f7bec4ca91015b60405180910390a1505050565b611014611cda565b60035442106110545760405162461bcd60e51b815260206004820152600c60248201526b39b0b6329034b99037bb32b960a11b6044820152606401610755565b4281116110a35760405162461bcd60e51b815260206004820152601460248201527f696e636f7272656374205f656e644f6653616c650000000000000000000000006044820152606401610755565b600355565b6001546040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152600091906001600160a01b037f00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb416906370a0823190602401602060405180830381865afa15801561112c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111509190612894565b6107129190612855565b60608183106111ab5760405162461bcd60e51b815260206004820152600f60248201527f696e636f72726563742072616e676500000000000000000000000000000000006044820152606401610755565b6111b5600d611d34565b8211156112045760405162461bcd60e51b815260206004820152600f60248201527f696e636f72726563742072616e676500000000000000000000000000000000006044820152606401610755565b61120e8383612855565b67ffffffffffffffff81111561122657611226612868565b60405190808252806020026020018201604052801561128457816020015b611271604051806060016040528060006001600160a01b0316815260200160008152602001600081525090565b8152602001906001900390816112445790505b509050825b8281101561131157600860006112a0600d84611d3e565b6001600160a01b039081168252602080830193909352604091820160002082516060810184528154909216825260018101549382019390935260029092015490820152826112ee8684612855565b815181106112fe576112fe6126ea565b6020908102919091010152600101611289565b5092915050565b6006602052816000526040600020818154811061133457600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b039092169450925084565b611370611cda565b6001600160a01b0382166000908152600c60205260409020805460ff191682158015919091179091556113ad576113a8600f83611c5f565b505050565b6113a8600f83611d4a565b6060610712600f611c4b565b6113cc611cda565b6113d66000611d5f565b565b6113e0611cda565b6113e86110a8565b8211156114375760405162461bcd60e51b815260206004820152601c60248201527f5f616d6f756e74206578636565647320667265652062616c616e6365000000006044820152606401610755565b6113a883308385611c74565b6001600160a01b03808216600090815260086020908152604080832081516060810183528154909516855260018101549285018390526002015490840152909190829061271090611497906105dc90612729565b6114a19190612740565b9050600060045442836114b49190612716565b116114c05760006114f7565b6301e13380600454426114d39190612855565b8385602001516114e39190612855565b6114ed9190612729565b6114f79190612740565b9050826020015181111561150c575060208201515b826040015181111561152a5760408301516115279082612855565b93505b505050919050565b61153a611cda565b6005548390811061157c5760405162461bcd60e51b815260206004820152600c60248201526b189859081d1bdad95b881a5960a21b6044820152606401610755565b600060058581548110611591576115916126ea565b600091825260209182902060039091020160018101869055600281018590558054604080516001600160a01b03909216825292810187905291820185905291507f99647f486fbb58c698cedffebd644b1913c7c66dcb5cc57e18d65c67ad9f99039060600160405180910390a15050505050565b336000908152600a602052604090206060908267ffffffffffffffff81111561163057611630612868565b604051908082528060200260200182016040528015611659578160200160208202803683370190505b50915060005b838110156116d75781600086868481811061167c5761167c6126ea565b9050602002016020810190611691919061239b565b6001600160a01b03166001600160a01b03168152602001908152602001600020548382815181106116c4576116c46126ea565b602090810291909101015260010161165f565b505092915050565b6003544210156117315760405162461bcd60e51b815260206004820152601060248201527f73616c65206973206e6f74206f766572000000000000000000000000000000006044820152606401610755565b336000908152600860205260408120600281015460018201549192916117579190612855565b9050600081116117a95760405162461bcd60e51b815260206004820152601560248201527f796f7520646f6e2774206861766520746f6b656e7300000000000000000000006044820152606401610755565b60006117b433611443565b9050600081116118065760405162461bcd60e51b815260206004820152601060248201527f756e6c6f636b656420697a207a65726f000000000000000000000000000000006044820152606401610755565b8083600201600082825461181a9190612716565b9250508190555080600160008282546118339190612855565b9091555061186590507f00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb4303384611c74565b60408051338152602081018390527f680f2e4f4032ebf1774e8cdbaddcb1b617a5a606411c8ca96257ada338d3833c9101610fff565b6118a3611cda565b600760006118b4602084018461239b565b6001600160a01b0316815260208101919091526040016000205460ff161561191e5760405162461bcd60e51b815260206004820152601360248201527f746f6b656e20616c7265616479206578697374000000000000000000000000006044820152606401610755565b600160076000611931602085018561239b565b6001600160a01b0316815260208101919091526040016000908120805492151560ff199093169290921790915560058054600181018255915281906003027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00161199b82826128ad565b507fdd36649896a0ea2327ec0f4024c8f190f3622b92d9716fc831dead4d14dd634990506119cc602083018361239b565b604080516001600160a01b0390921682526020808501359083015280840135908201526060015b60405180910390a150565b6000610712600d611d34565b611a12611cda565b612710811115611a645760405162461bcd60e51b815260206004820152601960248201527f696e636f7272656374205f7265666572726572466565427073000000000000006044820152606401610755565b60028190556040518181527f30edc703e39bfcf8f3d626d2fe02034c2fd2bf646dddf4ad70d6556010e85ebe906020016119f3565b60058181548110611aa957600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b03909116925083565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b82821015611b6b576000848152602090819020604080516080810182526004860290920180546001600160a01b03168352600180820154848601526002820154928401929092526003015460608301529083529092019101611b0e565b505050509050919050565b60096020528160005260406000208181548110611b9257600080fd5b6000918252602090912001546001600160a01b03169150829050565b6000610dc7600d83611d3e565b611bc3611cda565b6001600160a01b038116611c3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610755565b611c4881611d5f565b50565b60606000611c5883611daf565b9392505050565b6000611c58836001600160a01b038416611e0b565b8015610e6957306001600160a01b03841603611ca357611c9e6001600160a01b0385168383611e5a565b610e69565b610e696001600160a01b038516848484611f03565b6001600160a01b03811660009081526001830160205260408120541515611c58565b6000546001600160a01b031633146113d65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610755565b6000610dc7825490565b6000611c588383611f54565b6000611c58836001600160a01b038416611f7e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611dff57602002820191906000526020600020905b815481526020019060010190808311611deb575b50505050509050919050565b6000818152600183016020526040812054611e5257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dc7565b506000610dc7565b6040516001600160a01b0383166024820152604481018290526113a89084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152612071565b6040516001600160a01b0380851660248301528316604482015260648101829052610e699085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401611e9f565b6000826000018281548110611f6b57611f6b6126ea565b9060005260206000200154905092915050565b60008181526001830160205260408120548015612067576000611fa2600183612855565b8554909150600090611fb690600190612855565b905081811461201b576000866000018281548110611fd657611fd66126ea565b9060005260206000200154905080876000018481548110611ff957611ff96126ea565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061202c5761202c61287e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610dc7565b6000915050610dc7565b60006120c6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166121599092919063ffffffff16565b90508051600014806120e75750808060200190518101906120e791906128ea565b6113a85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610755565b60606121688484600085612170565b949350505050565b6060824710156121e85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610755565b600080866001600160a01b03168587604051612204919061292b565b60006040518083038185875af1925050503d8060008114612241576040519150601f19603f3d011682016040523d82523d6000602084013e612246565b606091505b509150915061225787838387612262565b979650505050505050565b606083156122d15782516000036122ca576001600160a01b0385163b6122ca5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610755565b5081612168565b61216883838151156122e65781518083602001fd5b8060405162461bcd60e51b81526004016107559190612947565b6020808252825182820181905260009190848201906040850190845b818110156123415783516001600160a01b03168352928401929184019160010161231c565b50909695505050505050565b6001600160a01b0381168114611c4857600080fd5b60008060006060848603121561237757600080fd5b833592506020840135915060408401356123908161234d565b809150509250925092565b6000602082840312156123ad57600080fd5b8135611c588161234d565b600060608201858352602085602085015260406060604086015282865180855260808701915060208801945060005b8181101561241557855180516001600160a01b031684528501518584015294840194918301916001016123e7565b50909998505050505050505050565b6000806020838503121561243757600080fd5b823567ffffffffffffffff8082111561244f57600080fd5b818501915085601f83011261246357600080fd5b81358181111561247257600080fd5b8660208260051b850101111561248757600080fd5b60209290920196919550909350505050565b6000602082840312156124ab57600080fd5b5035919050565b600080604083850312156124c557600080fd5b50508035926020909101359150565b602080825282518282018190526000919060409081850190868401855b8281101561252957815180516001600160a01b03168552868101518786015285015185850152606090930192908501906001016124f1565b5091979650505050505050565b6000806040838503121561254957600080fd5b82356125548161234d565b946020939093013593505050565b8015158114611c4857600080fd5b6000806040838503121561258357600080fd5b823561258e8161234d565b9150602083013561259e81612562565b809150509250929050565b6000806000606084860312156125be57600080fd5b83356125c98161234d565b92506020840135915060408401356123908161234d565b6000806000606084860312156125f557600080fd5b505081359360208301359350604090920135919050565b6020808252825182820181905260009190848201906040850190845b8181101561234157835183529284019291840191600101612628565b60006060828403121561265657600080fd5b50919050565b6000806040838503121561266f57600080fd5b823561267a8161234d565b9150602083013561259e8161234d565b602080825282518282018190526000919060409081850190868401855b8281101561252957815180516001600160a01b031685528681015187860152858101518686015260609081015190850152608090930192908501906001016126a7565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610dc757610dc7612700565b8082028115828204841417610dc757610dc7612700565b60008261275d57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b8085111561279d57816000190482111561278357612783612700565b8085161561279057918102915b93841c9390800290612767565b509250929050565b6000826127b457506001610dc7565b816127c157506000610dc7565b81600181146127d757600281146127e1576127fd565b6001915050610dc7565b60ff8411156127f2576127f2612700565b50506001821b610dc7565b5060208310610133831016604e8410600b8410161715612820575081810a610dc7565b61282a8383612762565b806000190482111561283e5761283e612700565b029392505050565b6000611c5860ff8416836127a5565b81810381811115610dc757610dc7612700565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000602082840312156128a657600080fd5b5051919050565b81356128b88161234d565b6001600160a01b0381166001600160a01b03198354161782555060208201356001820155604082013560028201555050565b6000602082840312156128fc57600080fd5b8151611c5881612562565b60005b8381101561292257818101518382015260200161290a565b50506000910152565b6000825161293d818460208701612907565b9190910192915050565b6020815260008251806020840152612966816040850160208701612907565b601f01601f1916919091016040019291505056fea164736f6c6343000817000a

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

00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000232800000000000000000000000000000000000000000000025a5419af66253c0000

-----Decoded View---------------
Arg [0] : _pictoToken (address): 0x98A01a0F1ECE58a79B745020aA9096B2B07Bcdb4
Arg [1] : _paymentTokens (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000098a01a0f1ece58a79b745020aa9096b2b07bcdb4
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [3] : 000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7
Arg [4] : 0000000000000000000000000000000000000000000000000000000000002328
Arg [5] : 00000000000000000000000000000000000000000000025a5419af66253c0000


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.