ETH Price: $3,328.40 (+2.97%)
Gas: 3.09 Gwei
 

Overview

Max Total Supply

17,972,383.932063310986452004 vINDX

Holders

501

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
5,042.01680672268907563 vINDX

Value
$0.00
0x6b44dcc00ad79e4be7df8b8833a4687bc93c34c3
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xDAA1108C...90e6bC603
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
TokenVesting

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion
File 1 of 18 : TokenVesting.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "./utils/RecoverableFunds.sol";
import "./utils/SellableToken.sol";
import "./utils/TgeTimestamp.sol";
import "./utils/NonTransferableToken.sol";
import "./interface/ITokenVesting.sol";

/**
 * @title TokenVesting
 * @dev Abstract contract to manage token vesting schedules for multiple allocations and users.
 * Inherits from Ownable2Step, SellableToken, TgeTimestamp, NonTransferableToken and RecoverableFunds.
 */
contract TokenVesting is
    Ownable2Step,
    SellableToken,
    TgeTimestamp,
    NonTransferableToken,
    RecoverableFunds,
    ITokenVesting
{
    using SafeERC20 for IERC20;
    using Strings for uint256;

    /**
     * @dev Constant denominator for calculating percentages.
     * 10000 represents 100.00%. 1 represents 0.01%.
     */
    uint256 private constant DENOMINATOR = 10_000;

    /**
     * @dev The status of automatic supply of tokens.
     * When set to true, tokens will be automatically supplied based on certain conditions.
     * This can occur when allocating tokens or when claiming tokens.
     */
    bool private _autoSupply;

    /**
     * @dev The status of automatic supply of tokens upon claim.
     * When set to true, tokens will be automatically supplied when a claim is made.
     */
    bool private _autoSupplyOnClaim;

    /**
     * @dev The address from which tokens will be automatically supplied.
     * This address is used as the source for token transfers during automatic supply.
     */
    address private _autoSupplyFrom;

    /**
     * @dev Flag indicating whether tokens should be automatically claimed upon purchase.
     * If set to true and the Token Generation Event (TGE) has passed, tokens will be
     * immediately issued to the buyer if there is no vesting schedule.
     */
    bool private _autoClaimAfterTge;

    /// @dev List of allowed allocation IDs.
    bytes32[] private _allocationIds;

    /// @dev Mapping to check if an allocation ID exists in the allowed allocation IDs list.
    mapping(bytes32 allocationId => bool) private _allocationIdExist;

    /// @dev Total amount of tokens reserved across all allocations.
    uint256 private _totalReserved;

    /// @dev Total amount of tokens vested across all allocations.
    uint256 private _totalVested;

    /// @dev Total amount of tokens claimed by all users.
    uint256 private _totalClaimed;

    /**
     * @dev Struct to store vesting data for each allocation.
     * @param reserved The total amount of tokens reserved for this allocation.
     * @param vested Total amount of tokens vested.
     * @param claimed Total amount of tokens claimed.
     * @param lockup The lock-up period before vesting starts.
     * @param cliff The cliff period during which tokens cannot be claimed.
     * @param vesting The total vesting period over which tokens are gradually unlocked.
     * @param tgeUnlock The percentage of tokens unlocked immediately after the Token Generation Event (TGE). 1/10000 = 0.01%.
     * @param unlockDelay The delay between successive unlocks after the cliff period.
     */
    struct VestingData {
        uint256 reserved; // Total amount of tokens reserved.
        uint256 vested; // Total amount of tokens vested.
        uint256 claimed; // Total amount of tokens claimed.
        uint256 lockup; // Lock-up period for vesting.
        uint256 cliff; // Cliff period for vesting.
        uint256 vesting; // Vesting time.
        uint256 tgeUnlock; // Initial unlock percentage after TGE. 1/10000 = 0.01%.
        uint256 unlockDelay; // Delay between successive unlocks.
    }

    /**
     * @dev Struct to store vesting schedule parameters for an allocation.
     * @param allocationId The ID of the allocation.
     * @param reserved The total amount of tokens reserved for this allocation.
     * @param lockup The lock-up period before vesting starts.
     * @param cliff The cliff period during which tokens cannot be claimed.
     * @param vesting The total vesting period over which tokens are gradually unlocked.
     * @param tgeUnlock The percentage of tokens unlocked immediately after the Token Generation Event (TGE).
     * @param unlockDelay The delay between successive unlocks after the cliff period.
     */
    struct VestingSchedule {
        bytes32 allocationId;
        uint256 reserved;
        uint256 lockup;
        uint256 cliff;
        uint256 vesting;
        uint256 tgeUnlock;
        uint256 unlockDelay;
    }

    /// @dev Mapping to store vesting data for each allocation by its ID.
    mapping(bytes32 allocationId => VestingData) private _vesting;

    /**
     * @dev Struct to store vesting data for each user.
     * @param vested The amount of tokens vested in that allocation.
     * @param claimed The amount of tokens claimed by the user in that allocation.
     */
    struct UserVestingData {
        uint256 vested; // User vested tokens at each allocation.
        uint256 claimed; // User claimed tokens at each allocation.
    }

    /// @dev Mapping to store vesting data for each user by their address.
    mapping(address user => mapping(bytes32 allocationId => UserVestingData))
        private _userVesting;

    /// @dev Address of the TokenSale contract.
    address private _tokenSale;

    /// @dev Flag indicating if the TokenSale address is frozen.
    bool private _tokenSaleFrozen;

    /**
     * @dev Emitted when the auto supply settings are updated.
     * @param autoSupply The new status of the auto supply.
     * @param autoSupplyOnClaim The new status of the auto supply upon claim.
     * @param autoSupplyFrom The new address from which the tokens will be supplied.
     */
    event AutoSupplyUpdated(
        bool autoSupply,
        bool autoSupplyOnClaim,
        address autoSupplyFrom
    );

    /**
     * @dev Emitted when the auto-claim status is updated.
     * @param status The new status of auto-claim.
     */
    event AutoClaimAfterTgeUpdated(bool status);

    /**
     * @dev Emitted when a vesting allocation is updated.
     * @param allocationId The ID of the allocation that was updated.
     * @param reserved The updated total amount of tokens reserved for this allocation.
     * @param lockup The updated lock-up period before vesting starts, in seconds.
     * @param cliff The updated cliff period during which tokens cannot be claimed, in seconds.
     * @param vesting The updated total vesting period over which tokens are gradually unlocked, in seconds.
     * @param tgeUnlock The updated percentage of tokens unlocked immediately after the Token Generation Event (TGE), expressed in basis points (1/10000 = 0.01%).
     * @param unlockDelay The updated delay between successive unlocks after the cliff period, in seconds.
     */
    event AllocationUpdated(
        bytes32 indexed allocationId,
        uint256 reserved,
        uint256 lockup,
        uint256 cliff,
        uint256 vesting,
        uint256 tgeUnlock,
        uint256 unlockDelay
    );

    /**
     * @dev Emitted when a vesting allocation is deleted.
     * @param allocationId The ID of the allocation that was deleted.
     */
    event AllocationDeleted(bytes32 indexed allocationId);

    /**
     * @dev Emitted when tokens are supplied to the contract for vesting.
     * @param amount The amount of tokens that were supplied.
     */
    event TokensSupplied(uint256 amount);

    /**
     * @dev Emitted when tokens are vested for a user at a specific allocation.
     * @param user The address of the user whose tokens are vested.
     * @param allocationId The ID of the allocation in which tokens are vested.
     * @param amount The amount of tokens vested.
     */
    event VestingAccrued(
        address indexed user,
        bytes32 indexed allocationId,
        uint256 amount
    );

    /**
     * @dev Emitted when a user claims vested tokens.
     * @param user The address of the user who claims the tokens.
     * @param allocationId The ID of the allocation from which tokens are claimed.
     * @param amount The amount of tokens claimed.
     */
    event VestingClaimed(
        address indexed user,
        bytes32 indexed allocationId,
        uint256 amount
    );

    /**
     * @dev Emitted when the TokenSale address is changed.
     * @param tokenSale The new TokenSale address.
     */
    event TokenSaleUpdated(address tokenSale);

    /// @dev Emitted when the TokenSale is frozen.
    event TokenSaleFrozen();

    /// @dev Error thrown when an allocation is not exist.
    error AllocationNotFound(bytes32 allocationId);

    /**
     * @dev Error that is thrown when the new reserved amount is less than the already vested amount for a given allocation.
     * @param allocationId The ID of the allocation that has this issue.
     */
    error ReservedLessThanVested(bytes32 allocationId);

    /**
     * @dev Error that is thrown when the vested amount exceeds the reserved amount for a given allocation.
     * @param allocationId The ID of the allocation that exceeded its reserved amount.
     */
    error AllocationExceeded(bytes32 allocationId);

    /// @dev Error indicating that the allocation has already been used.
    error AllocationAlreadyUsed();

    /// @dev Error indicating that the TGE unlock percentage exceeds the maximum allowed value.
    error TgeUnlockExceedsMaximum();

    /// @dev Error thrown when the TokenSale address is zero.
    error TokenSaleIsZero();

    /// @dev Error thrown when the TokenSale is frozen and an update is attempted.
    error TokenSaleIsFrozen();

    /// @dev Error to be thrown when an unauthorized account tries to call a restricted function.
    error UnauthorizedAccount();

    /// @dev Error indicating that there is a mismatch between the provided parameters.
    error ParametersMismatch();

    /// @dev Error indicating an invalid token amount.
    error InvalidTokenAmount();

    /**
     * @dev Constructor for the TokenVesting contract.
     * @param sellableToken The address of the token that will be sold.
     * @param sellableTokenDecimals The number of decimals of the sellable token.
     * @param vestedTokenName The name of the vested token.
     * @param vestedTokenSymbol The symbol of the vested token.
     */
    constructor(
        address sellableToken,
        uint8 sellableTokenDecimals,
        string memory vestedTokenName,
        string memory vestedTokenSymbol
    )
        Ownable(_msgSender())
        TgeTimestamp(0)
        SellableToken(sellableToken, sellableTokenDecimals)
        NonTransferableToken(vestedTokenName, vestedTokenSymbol)
    {
        _setAutoClaimAfterTge(false);
    }

    /**
     * @dev Modifier to check if the allocation ID exists.
     * Reverts if the allocation does not exist.
     * @param allocationId The ID of the allocation to check.
     */
    modifier allocationIdExists(bytes32 allocationId) {
        _checkAllocationIdExistence(allocationId);
        _;
    }

    /// @dev Modifier to restrict access to only the TokenSale contract.
    modifier onlyTokenSale() {
        if (_tokenSale == address(0)) {
            revert TokenSaleIsZero();
        }
        if (_tokenSale != _msgSender()) {
            revert UnauthorizedAccount();
        }
        _;
    }

    /**
     * @notice Returns the total supply of tokens that users have not yet received from vesting.
     * @dev This function overrides the ERC20 totalSupply function to reflect the total amount of vested tokens
     * that are still locked and have not been claimed by users.
     * @return The total amount of unclaimed vested tokens.
     */
    function totalSupply() public view override returns (uint256) {
        return _totalVested - _totalClaimed;
    }

    /**
     * @notice Returns the balance of tokens that a user has not yet received from vesting.
     * @dev This function overrides the ERC20 balanceOf function to reflect the amount of vested tokens
     * that are still locked and have not been claimed by the user.
     * @param user The address of the user.
     * @return The amount of unclaimed vested tokens for the user.
     */
    function balanceOf(address user) public view override returns (uint256) {
        uint256 vested;
        uint256 claimed;

        bytes32[] memory allocationIds = _getAllocationIds();
        uint256 totalAllocations = allocationIds.length;
        for (uint256 i = 0; i < totalAllocations; i++) {
            bytes32 allocationId = allocationIds[i];
            UserVestingData memory vestingData = _getUserVesting(
                user,
                allocationId
            );
            vested += vestingData.vested;
            claimed += vestingData.claimed;
        }
        return vested - claimed;
    }

    /**
     * @notice Returns the number of decimals used to get the user representation of vested tokens.
     * @dev This function overrides the ERC20 decimals function to return the number of decimals
     * of the vested token, which is the same as the sellable token's decimals.
     * @return The number of decimals of the vested token.
     */
    function decimals() public view virtual override returns (uint8) {
        return _getSellableTokenDecimals();
    }

    /**
     * @notice Returns the recoverable funds for a specific token.
     * @dev Overrides the getRecoverableFunds function from RecoverableFunds contract.
     * If the token is a payment token, it calculates the balance excluding deposits and unclaimed raised funds.
     * If the token is the sellable token, it calculates the balance excluding the total unclaimed amount.
     * @param token The address of the token.
     * @return The amount of recoverable funds.
     */
    function getRecoverableFunds(
        address token
    ) public view override returns (uint256) {
        address sellableToken = _getSellableToken();
        if (token == sellableToken) {
            uint256 accountedFunds = _totalVested - _totalClaimed;
            uint256 balance = IERC20(token).balanceOf(address(this));
            if (accountedFunds > balance) {
                return 0;
            }
            return balance - accountedFunds;
        } else {
            return super.getRecoverableFunds(token);
        }
    }

    /**
     * @notice Returns the current auto supply status and the address from which tokens are supplied.
     * @dev This function can be called externally to get the current status and address for automatic token supply.
     * @return autoSupply The current status of the auto supply (if autoSupplyOnClaim is false, then for allocating; if autoSupplyOnClaim is true, then for claiming).
     * @return autoSupplyOnClaim The current status of the auto supply upon claim (true if enabled, false if disabled).
     * @return autoSupplyFrom The address from which the tokens will be supplied.
     */
    function getAutoSupply()
        external
        view
        returns (
            bool autoSupply,
            bool autoSupplyOnClaim,
            address autoSupplyFrom
        )
    {
        autoSupply = _autoSupply;
        autoSupplyOnClaim = _autoSupplyOnClaim;
        autoSupplyFrom = _autoSupplyFrom;
    }

    /**
     * @notice Returns the allocation ID for a given allocation name.
     * @dev This function computes the keccak-256 hash of the given allocation name, subtracts 1, and returns it as bytes32.
     * @param allocationName The name of the allocation.
     * @return The ID of the allocation.
     */
    function computeAllocationId(
        string memory allocationName
    ) external pure returns (bytes32) {
        return _computeAllocationId(allocationName);
    }

    /**
     * @notice Verifies if a specified allocation ID exists in the allowed allocation IDs list.
     * @param allocationId The ID of the allocation to verify.
     * @return bool True if the allocation exists, false otherwise.
     */
    function isAllocationIdExist(
        bytes32 allocationId
    ) external view returns (bool) {
        return _isAllocationIdExist(allocationId);
    }

    /**
     * @notice Retrieves the list of all allowed allocation IDs.
     * @return bytes32[] List of allowed allocation IDs.
     */
    function getAllocationIds() external view returns (bytes32[] memory) {
        return _getAllocationIds();
    }

    /**
     * @notice Returns the vesting parameters for a specific allocation.
     * @dev This function retrieves the vesting details such as lockup period, cliff period, total vesting duration,
     * TGE unlock percentage, and unlock delay for the specified allocation.
     * @param allocationId The ID of the vesting allocation to retrieve.
     * @return reserved The total amount of tokens reserved for this allocation.
     * @return vested Total amount of tokens vested.
     * @return claimed Total amount of tokens claimed.
     * @return lockup The lock-up period before vesting starts.
     * @return cliff The cliff period during which tokens cannot be claimed.
     * @return vesting The total vesting period over which tokens are gradually unlocked.
     * @return tgeUnlock The percentage of tokens unlocked immediately after the Token Generation Event (TGE).
     * @return unlockDelay The delay between successive unlocks after the cliff period.
     */
    function getVesting(
        bytes32 allocationId
    )
        external
        view
        returns (
            uint256 reserved,
            uint256 vested,
            uint256 claimed,
            uint256 lockup,
            uint256 cliff,
            uint256 vesting,
            uint256 tgeUnlock,
            uint256 unlockDelay
        )
    {
        VestingData memory vestingData = _getVesting(allocationId);

        reserved = vestingData.reserved;
        vested = vestingData.vested;
        claimed = vestingData.claimed;
        lockup = vestingData.lockup;
        cliff = vestingData.cliff;
        vesting = vestingData.vesting;
        tgeUnlock = vestingData.tgeUnlock;
        unlockDelay = vestingData.unlockDelay;
    }

    /**
     * @notice Returns the vesting data for all allocations.
     * @return allocationIds An array of allocation IDs.
     * @return vestings An array of vesting data for all allocations.
     */
    function getVestings()
        external
        view
        returns (bytes32[] memory allocationIds, VestingData[] memory vestings)
    {
        allocationIds = _getAllocationIds();
        uint256 totalAllocations = allocationIds.length;
        vestings = new VestingData[](totalAllocations);
        for (uint256 i = 0; i < totalAllocations; i++) {
            bytes32 allocationId = allocationIds[i];
            vestings[i] = _getVesting(allocationId);
        }
    }

    /**
     * @notice Returns the overall state of vesting at a given time.
     * @param atTime The timestamp at which to check the state.
     * @return tge The TGE (Token Generation Event) timestamp.
     * @return autoClaimAfterTge The status of the auto-claim feature.
     * @return tokenSale The address of the TokenSale contract.
     * @return tokenSaleFrozen The status indicating if the TokenSale address is frozen.
     * @return totalReserved The total number of tokens reserved across all allocations.
     * @return totalVested The total number of tokens vested.
     * @return totalClaimed The total number of tokens claimed.
     * @return totalUnlocked The total number of tokens unlocked.
     * @return reserved An array of reserved tokens for each allocation.
     * @return vested An array of vested tokens for each allocation.
     * @return claimed An array of claimed tokens for each allocation.
     * @return unlocked An array of unlocked tokens for each allocation.
     * @return allocationIds An array of allocation IDs.
     */
    function getState(
        uint256 atTime
    )
        external
        view
        returns (
            uint256 tge,
            bool autoClaimAfterTge,
            address tokenSale,
            bool tokenSaleFrozen,
            uint256 totalReserved,
            uint256 totalVested,
            uint256 totalClaimed,
            uint256 totalUnlocked,
            uint256[] memory reserved,
            uint256[] memory vested,
            uint256[] memory claimed,
            uint256[] memory unlocked,
            bytes32[] memory allocationIds
        )
    {
        if (atTime == 0) {
            atTime = block.timestamp;
        }

        tge = _getTgeTimestamp();
        autoClaimAfterTge = _autoClaimAfterTge;
        tokenSale = _tokenSale;
        tokenSaleFrozen = _tokenSaleFrozen;

        totalReserved = _totalReserved;

        allocationIds = _getAllocationIds();
        (
            totalVested,
            totalClaimed,
            totalUnlocked,
            reserved,
            vested,
            claimed,
            unlocked
        ) = _calculateVestingStateAtTime(allocationIds, atTime);
    }

    /**
     * @notice Returns the vesting data for a specific user.
     * @dev This function retrieves the vesting details such as the total vested tokens, claimed tokens, unlocked tokens,
     * and allocation details for the specified user at a given time.
     * @param user The address of the user.
     * @param atTime The timestamp at which to check the user's vesting state.
     * @return totalVested The amount of vested tokens.
     * @return totalClaimed The amount of claimed tokens.
     * @return totalUnlocked The total number of tokens unlocked.
     * @return vested An array of vested tokens for each allocation.
     * @return claimed An array of claimed tokens for each allocation.
     * @return unlocked An array of unlocked tokens for each allocation.
     * @return allocationIds An array of allocation IDs.
     */
    function getUserState(
        address user,
        uint256 atTime
    )
        external
        view
        returns (
            uint256 totalVested,
            uint256 totalClaimed,
            uint256 totalUnlocked,
            uint256[] memory vested,
            uint256[] memory claimed,
            uint256[] memory unlocked,
            bytes32[] memory allocationIds
        )
    {
        if (atTime == 0) {
            atTime = block.timestamp;
        }

        allocationIds = _getAllocationIds();
        (
            totalVested,
            totalClaimed,
            totalUnlocked,
            vested,
            claimed,
            unlocked
        ) = _calculateUserVestingStateAtTime(allocationIds, user, atTime);
    }

    /**
     * @notice Shows the amount of tokens required to be supplied for vesting.
     * @dev This function can be called externally to get the current required supply of tokens for vesting.
     * It calculates the total supply of tokens required for vesting by subtracting the total claimed tokens from the total vested tokens,
     * and adjusting it based on the current token balance of the contract.
     * @return uint256 The amount of tokens required for vesting.
     */
    function getRequiredTokensSupply() external view returns (uint256) {
        return _calculateRequiredTokensSupply();
    }

    /**
     * @notice Allows the caller to claim their vested tokens.
     * @dev This function can only be called if the TGE (Token Generation Event) has passed.
     */
    function claim() external whenTgePassed {
        _claim(_msgSender());
    }

    /**
     * @notice Allows the owner to force claim vested tokens for multiple users.
     * @dev This function can only be called if the TGE (Token Generation Event) has passed.
     * Can only be called by the contract owner.
     * @param users An array of addresses for which to force claim vested tokens.
     */
    function claimForced(
        address[] memory users
    ) external whenTgePassed onlyOwner {
        for (uint256 i = 0; i < users.length; i++) {
            _claim(users[i]);
        }
    }

    /**
     * @notice Sets the vesting parameters for a specific allocation.
     * @dev Can only be called by the contract owner.
     * WARNING: This function is not synchronized with the sales stages.
     * Ensures that the vesting parameters are set in accordance with the sales strategy.
     * Ensures that the TGE unlock percentage does not exceed the maximum allowed value.
     * @param allocationId The ID of the allocation to set the vesting parameters.
     * @param reserved The total amount of tokens reserved for this allocation.
     * @param lockup The lock-up period before vesting starts.
     * @param cliff The cliff period during which tokens cannot be claimed.
     * @param vesting The total vesting period over which tokens are gradually unlocked.
     * @param tgeUnlock The percentage of tokens unlocked immediately after the Token Generation Event (TGE).
     * @param unlockDelay The delay between successive unlocks after the cliff period.
     */
    function setVestingSchedule(
        bytes32 allocationId,
        uint256 reserved,
        uint256 lockup,
        uint256 cliff,
        uint256 vesting,
        uint256 tgeUnlock,
        uint256 unlockDelay
    ) external onlyOwner {
        _setVestingSchedule(
            allocationId,
            reserved,
            lockup,
            cliff,
            vesting,
            tgeUnlock,
            unlockDelay
        );
    }

    /**
     * @notice Sets the vesting parameters for multiple allocations at once.
     * @dev Can only be called by the contract owner.
     * WARNING: This function is not synchronized with the sales stages.
     * Ensures that the vesting parameters are set in accordance with the sales strategy.
     * Ensures that the TGE unlock percentage does not exceed the maximum allowed value.
     * @param schedules An array of VestingSchedule structs containing the vesting parameters for each allocation.
     */
    function setVestingScheduleBatch(
        VestingSchedule[] calldata schedules
    ) external onlyOwner {
        for (uint256 i = 0; i < schedules.length; i++) {
            _setVestingSchedule(
                schedules[i].allocationId,
                schedules[i].reserved,
                schedules[i].lockup,
                schedules[i].cliff,
                schedules[i].vesting,
                schedules[i].tgeUnlock,
                schedules[i].unlockDelay
            );
        }
    }

    /**
     * @notice Removes the vesting parameters for a specific allocation.
     * @dev Can only be called by the contract owner.
     * WARNING: This function is not synchronized with the sales stages. Ensure that the removal is in line with the sales strategy.
     * @param allocationId The ID of the allocation to remove.
     */
    function removeAllocation(bytes32 allocationId) external onlyOwner {
        _removeAllocation(allocationId);
    }

    /**
     * @notice Allows the owner to set the auto-claim status.
     * @dev Can only be called by the contract owner.
     * @param status The new status of auto-claim.
     */
    function setAutoClaimAfterTge(bool status) external onlyOwner {
        _setAutoClaimAfterTge(status);
    }

    /**
     * @notice Allows the owner to set the name and symbol of the vested token.
     * @dev Can only be called by the contract owner.
     * It sets the name and symbol of the vested token by calling a private function from the NonTransferableToken contract.
     * @param name_ The new name of the vested token.
     * @param symbol_ The new symbol of the vested token.
     */
    function setVestedTokenNameSymbol(
        string memory name_,
        string memory symbol_
    ) external onlyOwner {
        _setNonTransferableTokenNameSymbol(name_, symbol_);
    }

    /**
     * @notice Sets a new TokenSale address.
     * @dev Can only be called by the contract owner.
     * Emits a TokenSaleUpdated event.
     * @param tokenSale The address of the TokenSale.
     */
    function setTokenSale(address tokenSale) external onlyOwner {
        if (_tokenSaleFrozen) {
            revert TokenSaleIsFrozen();
        }
        _tokenSale = tokenSale;
        emit TokenSaleUpdated(tokenSale);
    }

    /**
     * @notice Freezes the TokenSale, preventing further changes.
     * @dev Can only be called by the contract owner.
     * Emits a TokenSaleFrozen event.
     */
    function freezeTokenSale() external onlyOwner {
        if (_tokenSale == address(0)) {
            revert TokenSaleIsZero();
        }
        if (_tokenSaleFrozen) {
            revert TokenSaleIsFrozen();
        }

        _tokenSaleFrozen = true;
        emit TokenSaleFrozen();
    }

    /**
     * @notice Sets the auto supply status and the address from which the tokens will be supplied.
     * @dev Can only be called by the contract owner.
     * It updates the auto supply status, the auto supply status upon claim, and the address from which the tokens will be automatically supplied.
     * @param autoSupply The new status of the auto supply (if autoSupplyOnClaim is false, then for allocating; if autoSupplyOnClaim is true, then for claiming).
     * @param autoSupplyOnClaim The new status of the auto supply upon claim (true if enabled, false if disabled).
     * @param autoSupplyFrom The address from which the tokens will be supplied.
     */
    function setAutoSupply(
        bool autoSupply,
        bool autoSupplyOnClaim,
        address autoSupplyFrom
    ) external onlyOwner {
        _autoSupply = autoSupply;
        _autoSupplyOnClaim = autoSupplyOnClaim;
        _autoSupplyFrom = autoSupplyFrom;
        emit AutoSupplyUpdated(autoSupply, autoSupplyOnClaim, autoSupplyFrom);
    }
    /**
     * @notice Supplies tokens based on the total vested and claimed tokens.
     * @dev Can only be called by the contract owner.
     * It calculates the total supply of tokens required for vesting by subtracting the total claimed tokens from the total vested tokens
     * and adjusts it based on the current token balance of the contract.
     * The tokens are supplied from the address specified in `_autoSupplyFrom`.
     * @param supplyAmount The amount of tokens to supply. If zero or greater than the required amount, the required amount will be supplied.
     */
    function supplyTokens(uint256 supplyAmount) external onlyOwner {
        _supplyTokensFrom(_autoSupplyFrom, supplyAmount, false);
    }

    /**
     * @notice Supplies reserved tokens based on the total reserved and claimed tokens.
     * @dev Can only be called by the contract owner.
     * It calculates the total supply of reserved tokens required for vesting by subtracting the total claimed tokens from the total reserved tokens
     * and adjusts it based on the current token balance of the contract.
     * The tokens are supplied from the address specified in `_autoSupplyFrom`.
     * @param supplyAmount The amount of tokens to supply. If zero or greater than the required amount, the required amount will be supplied.
     */
    function supplyReservedTokens(uint256 supplyAmount) external onlyOwner {
        _supplyTokensFrom(_autoSupplyFrom, supplyAmount, true);
    }

    /**
     * @notice Handles the purchase of tokens for a specific user during a token sale stage.
     * @dev This function is called by the TokenSale contract when tokens are purchased.
     * It verifies the allocation exists and increases the vested amount for the user.
     * @param user The address of the user purchasing tokens.
     * @param stageId The ID of the sale stage.
     * @param tokensToBuy The amount of tokens being purchased.
     * @return bool Returns true if this is successfully processed.
     */
    function onTokensPurchase(
        address user,
        uint256 stageId,
        uint256 tokensToBuy
    ) external override onlyTokenSale returns (bool) {
        if (_isAutoSupplyOnAllocatingApplicable()) {
            _supplyTokensFrom(_autoSupplyFrom, tokensToBuy, false);
        }

        _increaseUserAllocationVested(
            user,
            _computeAllocationId(stageId.toString()),
            tokensToBuy
        );
        return true;
    }

    /**
     * @notice Allocates tokens to a user's vesting allocation.
     * @dev Can only be called by the contract owner.
     * This function adds a specified amount of tokens to the vesting schedule for a given user.
     * @param user The address of the user.
     * @param allocationId The ID of the allocation.
     * @param amount The amount of tokens to add to the vesting allocation.
     * @return bool Returns true if this is successfully processed.
     */
    function allocateTokens(
        address user,
        bytes32 allocationId,
        uint256 amount
    ) external onlyOwner returns (bool) {
        _increaseUserAllocationVested(user, allocationId, amount);

        if (_isAutoSupplyOnAllocatingApplicable()) {
            _supplyTokensFrom(_autoSupplyFrom, amount, false);
        }
        return true;
    }

    /**
     * @notice Allocates tokens to multiple users' vesting allocations.
     * @dev Can only be called by the contract owner.
     * This function adds a specified amount of tokens to the vesting schedule for each user and allocation pair in the list.
     * @param allocationIds An array of allocation IDs.
     * @param users The addresses of the users.
     * @param amounts The amounts of tokens to add to the vesting allocation for each user.
     * @return bool Returns true if this is successfully processed.
     */
    function allocateTokensBatch(
        bytes32[] calldata allocationIds,
        address[] calldata users,
        uint256[] calldata amounts
    ) external onlyOwner returns (bool) {
        uint256 total = allocationIds.length;
        if (users.length != total || amounts.length != total) {
            revert ParametersMismatch();
        }

        uint256 supplyAmount;
        for (uint256 i = 0; i < total; i++) {
            _increaseUserAllocationVested(
                users[i],
                allocationIds[i],
                amounts[i]
            );
            supplyAmount += amounts[i];
        }

        if (_isAutoSupplyOnAllocatingApplicable()) {
            _supplyTokensFrom(_autoSupplyFrom, supplyAmount, false);
        }
        return true;
    }

    /**
     * @dev Private function to calculate the total supply of tokens required for vesting.
     * This function calculates the difference between the total vested tokens and the total claimed tokens,
     * and adjusts it based on the current token balance of the contract.
     * @return uint256 The amount of tokens required for vesting.
     */
    function _calculateRequiredTokensSupply()
        private
        view
        whenSellableTokenIsNotZero
        returns (uint256)
    {
        uint256 requiredSupply = _totalVested - _totalClaimed;

        uint256 balance = IERC20(_getSellableToken()).balanceOf(address(this));
        if (balance >= requiredSupply) {
            return 0;
        } else {
            return requiredSupply - balance;
        }
    }

    /**
     * @dev Private function to calculate the total supply of tokens required for vesting.
     * This function calculates the difference between the total reserved tokens and the total claimed tokens,
     * and adjusts it based on the current token balance of the contract.
     * @return uint256 The amount of tokens required for vesting.
     */
    function _calculateReservedTokensSupply()
        private
        view
        whenSellableTokenIsNotZero
        returns (uint256)
    {
        uint256 requiredSupply = _totalReserved - _totalClaimed;

        uint256 balance = IERC20(_getSellableToken()).balanceOf(address(this));
        if (balance >= requiredSupply) {
            return 0;
        } else {
            return requiredSupply - balance;
        }
    }

    /**
     * @dev Checks if auto supply is applicable for allocating by verifying that auto supply is enabled, auto supply on claim is disabled, and the auto supply address is set.
     * This function ensures that the auto supply is enabled, auto supply on claim is disabled, and the address from which tokens should be supplied is not the zero address.
     * @return bool Returns true if auto supply is applicable for allocating and the address is set, otherwise returns false.
     */
    function _isAutoSupplyOnAllocatingApplicable() private view returns (bool) {
        if (
            _autoSupply && !_autoSupplyOnClaim && _autoSupplyFrom != address(0)
        ) {
            return true;
        }
        return false;
    }

    /**
     * @dev Checks if auto supply is applicable for claiming by verifying that auto supply is enabled, auto supply on claim is enabled, and the auto supply address is set.
     * This function ensures that the auto supply is enabled, auto supply on claim is enabled, and the address from which tokens should be supplied is not the zero address.
     * @return bool Returns true if auto supply is applicable for claiming and the address is set, otherwise returns false.
     */
    function _isAutoSupplyOnClaimingApplicable() private view returns (bool) {
        if (
            _autoSupply && _autoSupplyOnClaim && _autoSupplyFrom != address(0)
        ) {
            return true;
        }
        return false;
    }

    /**
     * @dev Private function to supply tokens from a specified address.
     * This function handles the actual transfer of tokens from the specified address to the contract.
     * It calculates the required supply and performs the transfer.
     * @param from The address from which the tokens will be transferred.
     * @param supplyAmount The amount of tokens to supply.
     * @param isSupplyReserved Indicates whether the supply is for reserved tokens.
     */
    function _supplyTokensFrom(
        address from,
        uint256 supplyAmount,
        bool isSupplyReserved
    ) private {
        uint256 requiredSupply;
        if (isSupplyReserved) {
            requiredSupply = _calculateReservedTokensSupply();
        } else {
            requiredSupply = _calculateRequiredTokensSupply();
        }

        if (requiredSupply == 0) {
            return;
        }

        if (supplyAmount == 0 || supplyAmount > requiredSupply) {
            supplyAmount = requiredSupply;
        }

        IERC20 _token = IERC20(_getSellableToken());
        uint256 before = _token.balanceOf(address(this));
        // If the SellableToken is mintable, then mint here in the transferFrom function.
        _token.safeTransferFrom(from, address(this), supplyAmount);

        uint256 delta = _token.balanceOf(address(this)) - before;
        // Check and prohibition of tax tokens.
        if (delta != supplyAmount) {
            revert InvalidTokenAmount();
        }
        emit TokensSupplied(supplyAmount);
    }

    /**
     * @dev Private function to get the vesting data for a specific allocation.
     * @param allocationId The ID of the allocation.
     * @return The vesting data for the specified allocation.
     */
    function _getVesting(
        bytes32 allocationId
    ) private view returns (VestingData memory) {
        return _vesting[allocationId];
    }

    /**
     * @dev Private function to get the amount of vested tokens for a user at a specific allocation.
     * @param user The address of the user.
     * @param allocationId The ID of the vesting allocation.
     * @return The vesting data for the specified user and allocation.
     */
    function _getUserVesting(
        address user,
        bytes32 allocationId
    ) private view returns (UserVestingData memory) {
        return _userVesting[user][allocationId];
    }

    /**
     * @dev Private function to increase the vested tokens for a user at a specific allocation.
     * Mints non-transferable tokens to the user.
     * Emits a VestingAccrued event.
     * Reverts with an AllocationExceeded error if the vested amount exceeds the reserved amount.
     * @param user The address of the user.
     * @param allocationId The ID of the allocation.
     * @param amount The amount of tokens to vest.
     */
    function _increaseUserAllocationVested(
        address user,
        bytes32 allocationId,
        uint256 amount
    ) private allocationIdExists(allocationId) {
        _totalVested += amount;

        // Check if vested tokens exceed reserved tokens.
        _vesting[allocationId].vested += amount;
        if (_vesting[allocationId].vested > _vesting[allocationId].reserved) {
            revert AllocationExceeded(allocationId);
        }

        _userVesting[user][allocationId].vested += amount;
        _mintNonTransferableToken(user, amount);
        emit VestingAccrued(user, allocationId, amount);

        if (_autoClaimAfterTge && _isTgePassed()) {
            _claim(user);
        }
    }

    /**
     * @dev Private function to increase the total claimed tokens and update the user's claimed tokens.
     * Burns the corresponding amount of non-transferable tokens from the user's balance.
     * Emits a VestingClaimed event.
     * @param user The address of the user whose claimed tokens are being increased.
     * @param allocationId The ID of the allocation.
     * @param _token The sellable token used for transfer.
     * @param amount The amount of tokens to be marked as claimed.
     */
    function _claimAllocation(
        address user,
        bytes32 allocationId,
        IERC20 _token,
        uint256 amount
    ) private {
        _totalClaimed += amount;
        _vesting[allocationId].claimed += amount;

        _userVesting[user][allocationId].claimed += amount;
        _burnNonTransferableToken(user, amount);

        _token.safeTransfer(user, amount);
        emit VestingClaimed(user, allocationId, amount);
    }

    /**
     * @dev Private function to claim vested tokens for a user.
     * Transfers the claimable tokens to the user and updates the claimed tokens.
     * @param user The address of the user claiming the tokens.
     */
    function _claim(address user) private whenSellableTokenIsNotZero {
        bytes32[] memory allocationIds = _getAllocationIds();
        (
            ,
            uint256 totalClaimed,
            uint256 totalUnlocked,
            ,
            uint256[] memory claimed,
            uint256[] memory unlocked
        ) = _calculateUserVestingStateAtTime(
                allocationIds,
                user,
                block.timestamp
            );

        uint256 totalClaimable;
        if (totalUnlocked > totalClaimed) {
            totalClaimable = totalUnlocked - totalClaimed;
        }

        if (totalClaimable > 0) {
            if (_isAutoSupplyOnClaimingApplicable()) {
                _supplyTokensFrom(_autoSupplyFrom, totalClaimable, false);
            }

            IERC20 _token = IERC20(_getSellableToken());
            uint256 totalAllocations = allocationIds.length;
            for (uint256 i = 0; i < totalAllocations; i++) {
                uint256 claimable;
                if (unlocked[i] > claimed[i]) {
                    claimable = unlocked[i] - claimed[i];
                }

                if (claimable > 0) {
                    _claimAllocation(user, allocationIds[i], _token, claimable);
                }
            }
        }
    }

    /**
     * @dev Private function to calculate the unlocked vested tokens for a user at a specific time.
     * @param allocationIds An array of allocation IDs.
     * @param user The address of the user.
     * @param atTime The specific time to check for unlocked tokens.
     * @return totalVested The total amount of vested tokens.
     * @return totalClaimed The total amount of claimed tokens.
     * @return totalUnlocked The amount of unlocked vested tokens.
     * @return vested Array of vested tokens for each allocation.
     * @return claimed Array of claimed tokens for each allocation.
     * @return unlocked Array of unlocked vested tokens for each allocation.
     */
    function _calculateUserVestingStateAtTime(
        bytes32[] memory allocationIds,
        address user,
        uint256 atTime
    )
        private
        view
        returns (
            uint256 totalVested,
            uint256 totalClaimed,
            uint256 totalUnlocked,
            uint256[] memory vested,
            uint256[] memory claimed,
            uint256[] memory unlocked
        )
    {
        uint256 totalAllocations = allocationIds.length;
        vested = new uint256[](totalAllocations);
        claimed = new uint256[](totalAllocations);
        unlocked = new uint256[](totalAllocations);

        for (uint256 i = 0; i < totalAllocations; i++) {
            bytes32 allocationId = allocationIds[i];
            VestingData memory vd = _getVesting(allocationId);
            UserVestingData memory uvd = _getUserVesting(user, allocationId);

            if (uvd.vested == 0) {
                // The user does not have any tokens to vest in this allocation.
                continue;
            }
            totalVested += uvd.vested;
            totalClaimed += uvd.claimed;
            vested[i] = uvd.vested;
            claimed[i] = uvd.claimed;

            uint256 unlockedAtTime = _calculateUserUnlockedAtTime(
                vd,
                uvd,
                atTime
            );
            totalUnlocked += unlockedAtTime;
            unlocked[i] = unlockedAtTime;
        }
    }

    /**
     * @dev Private function to calculate the total amount of unlocked tokens for a user at a specific time based on vesting data.
     * @param vd The vesting data associated with the allocation.
     * @param uvd The user's vesting data for the allocation.
     * @param atTime The specific time to check for unlocked tokens.
     * @return totalUnlocked The total amount of unlocked tokens at the specified time.
     */
    function _calculateUserUnlockedAtTime(
        VestingData memory vd,
        UserVestingData memory uvd,
        uint256 atTime
    ) private view returns (uint256 totalUnlocked) {
        uint256 tge = _getTgeTimestamp();
        if (tge == 0 || atTime < tge) {
            // The TGE event has not yet occurred. Then unlocked is 0.
            return totalUnlocked;
        }

        uint256 tgeUnlocked = (uvd.vested * vd.tgeUnlock) / DENOMINATOR;
        uint256 restVested = uvd.vested - tgeUnlocked;
        totalUnlocked += tgeUnlocked;

        uint256 vestingStartTime = tge + vd.lockup;
        if (atTime < vestingStartTime) {
            // Unlocking tokens from vesting has not yet begun.
            return totalUnlocked;
        }

        uint256 cliffEndTime = vestingStartTime + vd.cliff;
        if (atTime < cliffEndTime) {
            // Unlocking of tokens has already begun, but the claim is impossible until the end of the cliff period.
            return totalUnlocked;
        }

        uint256 vestingEndTime = vestingStartTime + vd.vesting;
        if (atTime >= vestingEndTime) {
            // Vesting is done. The entire amount is available for claim.
            return uvd.vested;
        }

        if (atTime >= cliffEndTime) {
            uint256 passedTime = atTime - vestingStartTime;
            if (vd.unlockDelay > 0) {
                // Fix if the interval between claims is specified.
                uint256 unlocks = passedTime / vd.unlockDelay;
                passedTime = unlocks * vd.unlockDelay;
            }
            uint256 unlockedAtTime = (restVested * passedTime) / vd.vesting;
            totalUnlocked += unlockedAtTime;
        }
    }

    /**
     * @dev Private function to calculate the unlocked vested tokens for all allocations at a specific time.
     * @param allocationIds An array of allocation IDs.
     * @param atTime The specific time to check for unlocked tokens.
     * @return totalVested The total amount of vested tokens across all allocations.
     * @return totalClaimed The total amount of claimed tokens across all allocations.
     * @return totalUnlocked The amount of unlocked vested tokens at the specified time.
     * @return reserved Array of reserved tokens for each allocation.
     * @return vested Array of vested tokens for each allocation.
     * @return claimed Array of claimed tokens for each allocation.
     * @return unlocked Array of unlocked vested tokens for each allocation.
     */
    function _calculateVestingStateAtTime(
        bytes32[] memory allocationIds,
        uint256 atTime
    )
        private
        view
        returns (
            uint256 totalVested,
            uint256 totalClaimed,
            uint256 totalUnlocked,
            uint256[] memory reserved,
            uint256[] memory vested,
            uint256[] memory claimed,
            uint256[] memory unlocked
        )
    {
        uint256 totalAllocations = allocationIds.length;
        reserved = new uint256[](totalAllocations);
        vested = new uint256[](totalAllocations);
        claimed = new uint256[](totalAllocations);
        unlocked = new uint256[](totalAllocations);

        for (uint256 i = 0; i < totalAllocations; i++) {
            bytes32 allocationId = allocationIds[i];
            VestingData memory vd = _getVesting(allocationId);

            reserved[i] = vd.reserved;

            if (vd.vested == 0) {
                // Does not have any tokens to vest in this allocation.
                continue;
            }
            totalVested += vd.vested;
            totalClaimed += vd.claimed;
            vested[i] = vd.vested;
            claimed[i] = vd.claimed;

            uint256 unlockedAtTime = _calculateUnlockedAtTime(vd, atTime);
            totalUnlocked += unlockedAtTime;
            unlocked[i] = unlockedAtTime;
        }
    }

    /**
     * @dev Private function to calculate the total amount of unlocked tokens for a specific allocation at a specific time.
     * @param vd The vesting data associated with the allocation.
     * @param atTime The specific time to check for unlocked tokens.
     * @return totalUnlocked The total amount of unlocked tokens at the specified time.
     */
    function _calculateUnlockedAtTime(
        VestingData memory vd,
        uint256 atTime
    ) private view returns (uint256 totalUnlocked) {
        uint256 tge = _getTgeTimestamp();
        if (tge == 0 || atTime < tge) {
            // The TGE event has not yet occurred. Then unlocked is 0.
            return totalUnlocked;
        }

        uint256 tgeUnlocked = (vd.vested * vd.tgeUnlock) / DENOMINATOR;
        uint256 restVested = vd.vested - tgeUnlocked;
        totalUnlocked += tgeUnlocked;

        uint256 vestingStartTime = tge + vd.lockup;
        if (atTime < vestingStartTime) {
            // Unlocking tokens from vesting has not yet begun.
            return totalUnlocked;
        }

        uint256 cliffEndTime = vestingStartTime + vd.cliff;
        if (atTime < cliffEndTime) {
            // Unlocking of tokens has already begun, but the claim is impossible until the end of the cliff period.
            return totalUnlocked;
        }

        uint256 vestingEndTime = vestingStartTime + vd.vesting;
        if (atTime >= vestingEndTime) {
            // Vesting is done. The entire amount is available for claim.
            return vd.vested;
        }

        if (atTime >= cliffEndTime) {
            uint256 passedTime = atTime - vestingStartTime;
            if (vd.unlockDelay > 0) {
                // Fix if the interval between claims is specified.
                uint256 unlocks = passedTime / vd.unlockDelay;
                passedTime = unlocks * vd.unlockDelay;
            }
            uint256 unlockedAtTime = (restVested * passedTime) / vd.vesting;
            totalUnlocked += unlockedAtTime;
        }
    }

    /**
     * @dev Private function to set the vesting parameters for a specific allocation.
     * WARNING: This function is not synchronized with the sales stages.
     * Ensures that the vesting parameters are set in accordance with the sales strategy.
     * Ensures that the TGE unlock percentage does not exceed the maximum allowed value.
     * Emits an AllocationUpdated event.
     * @param allocationId The ID of the allocation to set the vesting parameters.
     * @param reserved The total amount of tokens reserved for this allocation.
     * @param lockup The lock-up period before vesting starts.
     * @param cliff The cliff period during which tokens cannot be claimed.
     * @param vesting The total vesting period over which tokens are gradually unlocked.
     * @param tgeUnlock The percentage of tokens unlocked immediately after the Token Generation Event (TGE).
     * @param unlockDelay The delay between successive unlocks after the cliff period.
     */
    function _setVestingSchedule(
        bytes32 allocationId,
        uint256 reserved,
        uint256 lockup,
        uint256 cliff,
        uint256 vesting,
        uint256 tgeUnlock,
        uint256 unlockDelay
    ) private {
        if (tgeUnlock > DENOMINATOR) {
            revert TgeUnlockExceedsMaximum();
        }

        if (!_isAllocationIdExist(allocationId)) {
            _allocationIds.push(allocationId);
            _allocationIdExist[allocationId] = true;
        }

        VestingData storage vestingData = _vesting[allocationId];

        if (vestingData.vested > reserved) {
            revert ReservedLessThanVested(allocationId);
        }
        _totalReserved = _totalReserved - vestingData.reserved + reserved;
        vestingData.reserved = reserved;

        vestingData.lockup = lockup;
        vestingData.cliff = cliff;
        vestingData.vesting = vesting;
        vestingData.tgeUnlock = tgeUnlock;
        vestingData.unlockDelay = unlockDelay;

        emit AllocationUpdated(
            allocationId,
            reserved,
            lockup,
            cliff,
            vesting,
            tgeUnlock,
            unlockDelay
        );
    }

    /**
     * @dev Private function to remove the vesting parameters for a specific allocation.
     * WARNING: This function is not synchronized with the sales stages. Ensure that the vesting parameters are removed in accordance with the sales strategy.
     * Emits an AllocationDeleted event.
     * @param allocationId The ID of the allocation to remove the vesting parameters for.
     */
    function _removeAllocation(bytes32 allocationId) private {
        VestingData memory vestingData = _getVesting(allocationId);
        if (vestingData.vested > 0) {
            revert AllocationAlreadyUsed();
        }

        bytes32[] memory allocationIds = _getAllocationIds();
        uint256 index = _findAllocationIndex(allocationId, allocationIds);
        uint256 lastIndex = allocationIds.length - 1;
        bytes32 lastAllocationId = _allocationIds[lastIndex];

        _allocationIds[index] = lastAllocationId; // Move the last allocation ID to the index being removed.
        _allocationIds.pop(); // Remove the last element.

        delete _vesting[allocationId];
        delete _allocationIdExist[allocationId];
        emit AllocationDeleted(allocationId);
    }

    /**
     * @dev Private function to compute the allocation ID for a given allocation name.
     * This function computes the keccak-256 hash of the given allocation name, subtracts 1, and returns it as bytes32.
     * @param allocationName The name of the allocation.
     * @return allocationId The computed ID of the allocation.
     */
    function _computeAllocationId(
        string memory allocationName
    ) private pure returns (bytes32 allocationId) {
        return
            bytes32(
                abi.encode(uint256(keccak256(abi.encode(allocationName))) - 1)
            );
    }

    /**
     * @dev Checks if a given allocation ID exists in the allowed allocation IDs list.
     * This function is used internally to verify if a specific allocation ID is present in the contract's allocation list.
     * @param allocationId The ID of the allocation to check.
     * @return bool Returns true if the allocation exists, false otherwise.
     */
    function _isAllocationIdExist(
        bytes32 allocationId
    ) private view returns (bool) {
        return _allocationIdExist[allocationId];
    }

    /**
     * @dev Checks if a given allocation ID exists in the allowed allocation IDs list and reverts if it does not exist.
     * This function is used internally to ensure that an allocation ID is valid before proceeding with further logic.
     * If the allocation does not exist, it reverts with a custom error `AllocationNotFound`.
     * @param allocationId The ID of the allocation to check.
     */
    function _checkAllocationIdExistence(bytes32 allocationId) private view {
        if (!_isAllocationIdExist(allocationId)) {
            revert AllocationNotFound(allocationId);
        }
    }

    /**
     * @dev Internal function to retrieve the list of all allowed allocation IDs.
     * @return bytes32[] List of allowed allocation IDs.
     */
    function _getAllocationIds() private view returns (bytes32[] memory) {
        return _allocationIds;
    }

    /**
     * @dev Internal function to get the total number of vesting allocations.
     * @return The total number of vesting allocations.
     */
    function _getTotalAllocations() private view returns (uint256) {
        return _allocationIds.length;
    }

    /**
     * @dev Finds the index of a given allocation in an array of allocation IDs.
     * This function searches for a specific allocation ID within an array of allocation IDs and returns its index.
     * If the allocation does not exist, it reverts with a custom error `AllocationNotFound`.
     * @param allocationId The allocation ID to find.
     * @param allocationIds An array of allocation IDs.
     * @return uint256 The index of the found allocation.
     */
    function _findAllocationIndex(
        bytes32 allocationId,
        bytes32[] memory allocationIds
    ) private pure returns (uint256) {
        for (uint256 i = 0; i < allocationIds.length; i++) {
            if (allocationIds[i] == allocationId) {
                return i;
            }
        }
        revert AllocationNotFound(allocationId);
    }

    /**
     * @dev Private function to set the auto-claim status.
     * Emits an AutoClaimAfterTgeUpdated event.
     * @param status The new status of auto-claim.
     */
    function _setAutoClaimAfterTge(bool status) private {
        _autoClaimAfterTge = status;
        emit AutoClaimAfterTgeUpdated(status);
    }
}

File 2 of 18 : TgeTimestamp.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

import "@openzeppelin/contracts/access/Ownable2Step.sol";

/**
 * @title TgeTimestamp
 * @dev Abstract contract to manage the Token Generation Event (TGE) timestamp.
 * Allows setting, freezing, and checking the TGE timestamp.
 * Inherits from Ownable2Step.
 */
abstract contract TgeTimestamp is Ownable2Step {
    /// @dev Timestamp of the Token Generation Event (TGE).
    uint256 private _tgeTimestamp;

    /// @dev Flag to indicate if the TGE timestamp is frozen.
    bool private _tgeTimestampFrozen;

    /// @dev Event emitted when the TGE timestamp is changed.
    event TgeTimestampUpdated(uint256 tgeTimestamp);

    /// @dev Event emitted when the TGE timestamp is frozen.
    event TgeTimestampFrozen();

    /// @dev Error indicating that the TGE has not yet passed.
    error TgeTimestampNotPassed();

    /// @dev Error indicating that the TGE has already passed.
    error TgeTimestampPassed();

    /// @dev Error indicating that the TGE timestamp is zero.
    error TgeTimestampIsZero();

    /// @dev Error indicating that the TGE timestamp is frozen and cannot be changed.
    error TgeTimestampIsFrozen();

    /// @dev Error indicating that the provided timestamp has already passed.
    error TimeAlreadyPassed();

    /**
     * @dev Sets the initial value for the TGE timestamp.
     * @param tgeTimestamp The initial TGE timestamp.
     */
    constructor(uint256 tgeTimestamp) {
        _setTgeTimestamp(tgeTimestamp);
    }

    /// @dev Modifier to make a function callable only when the TGE has passed.
    modifier whenTgePassed() {
        if (!_isTgePassed()) {
            revert TgeTimestampNotPassed();
        }
        _;
    }

    /**
     * @notice Returns the TGE timestamp details.
     * @return isFrozen Boolean indicating if the TGE timestamp is frozen.
     * @return tge The TGE timestamp.
     */
    function getTge() external view returns (bool isFrozen, uint256 tge) {
        isFrozen = _isTgeTimestampFrozen();
        tge = _getTgeTimestamp();
    }

    /**
     * @notice Sets the TGE timestamp.
     * @dev Can only be called by the contract owner and if the TGE timestamp is not frozen and has not passed.
     * @param newTgeTimestamp The new TGE timestamp.
     */
    function setTgeTimestamp(uint256 newTgeTimestamp) external onlyOwner {
        uint256 currentTge = _getTgeTimestamp();
        if (currentTge > 0 && block.timestamp >= currentTge) {
            revert TgeTimestampPassed();
        }

        if (block.timestamp > newTgeTimestamp) {
            revert TimeAlreadyPassed();
        }

        if (_isTgeTimestampFrozen()) {
            revert TgeTimestampIsFrozen();
        }

        _setTgeTimestamp(newTgeTimestamp);
    }

    /**
     * @notice Freezes the TGE timestamp, preventing any future changes.
     * @dev Can only be called by the contract owner and if the TGE timestamp is not frozen and is not zero.
     */
    function freezeTgeTimestamp() external onlyOwner {
        if (_getTgeTimestamp() == 0) {
            revert TgeTimestampIsZero();
        }
        if (_tgeTimestampFrozen) {
            revert TgeTimestampIsFrozen();
        }

        _tgeTimestampFrozen = true;
        emit TgeTimestampFrozen();
    }

    /**
     * @dev Internal function to get the TGE timestamp.
     * @return uint256 The TGE timestamp.
     */
    function _getTgeTimestamp() internal view returns (uint256) {
        return _tgeTimestamp;
    }

    /**
     * @dev Internal function to check if the Token Generation Event (TGE) has passed.
     * @return Returns true if the TGE has passed, false otherwise.
     */
    function _isTgePassed() internal view returns (bool) {
        uint256 tge = _getTgeTimestamp();
        if (tge == 0 || block.timestamp < tge) {
            return false;
        }
        return true;
    }

    /**
     * @dev Private function to check if the TGE timestamp is frozen.
     * @return bool True if the TGE timestamp is frozen, false otherwise.
     */
    function _isTgeTimestampFrozen() private view returns (bool) {
        return _tgeTimestampFrozen;
    }

    /**
     * @dev Private function to set the TGE (Token Generation Event) timestamp
     * Emits a TgeTimestampUpdated event.
     * @param tgeTimestamp The new TGE timestamp.
     */
    function _setTgeTimestamp(uint256 tgeTimestamp) private {
        _tgeTimestamp = tgeTimestamp;
        emit TgeTimestampUpdated(tgeTimestamp);
    }
}

File 3 of 18 : SellableToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

import "@openzeppelin/contracts/access/Ownable2Step.sol";

/**
 * @title SellableToken
 * @dev Abstract contract to manage a sellable token address and its decimals. Allows setting and freezing the sellable token.
 * Inherits from Ownable2Step.
 */
abstract contract SellableToken is Ownable2Step {
    /// @dev Indicates whether the sellable token is frozen.
    bool private _sellableTokenFrozen;

    /// @dev Address of the sellable token.
    address private _sellableToken;

    /// @dev Number of decimals of the sellable token.
    uint8 private _sellableTokenDecimals;

    /// @dev Event emitted when the sellable token is updated.
    event SellableTokenUpdated(address token, uint8 decimals);

    /// @dev Event emitted when the sellable token is frozen.
    event SellableTokenFrozen();

    /// @dev Error thrown when the sellable token address is zero.
    error SellableTokenIsZero();

    /// @dev Error thrown when the sellable token decimals is zero.
    error SellableTokenDecimalsIsZero();

    /// @dev Error thrown when the sellable token is frozen.
    error SellableTokenIsFrozen();

    /**
     * @dev Sets the initial values for the sellable token and its decimals.
     * @param token The address of the sellable token.
     * @param decimals The number of decimals of the sellable token. Must be greater than 0.
     */
    constructor(address token, uint8 decimals) {
        _setSellableToken(token, decimals);
    }

    /// @dev Modifier to check if the sellable token address is not zero.
    modifier whenSellableTokenIsNotZero() {
        if (_getSellableToken() == address(0)) {
            revert SellableTokenIsZero();
        }
        _;
    }

    /**
     * @notice Gets the sellable token details.
     * @return isFrozen Boolean indicating if the sellable token is frozen.
     * @return token The address of the sellable token.
     * @return decimals The number of decimals of the sellable token.
     */
    function getSellableToken()
        external
        view
        returns (bool isFrozen, address token, uint8 decimals)
    {
        isFrozen = _isSellableTokenFrozen();
        token = _getSellableToken();
        decimals = _getSellableTokenDecimals();
    }

    /**
     * @notice Sets the sellable token and its decimals.
     * @dev Can only be called by the contract owner and if the sellable token is not frozen.
     * @param token The address of the sellable token.
     * @param decimals The number of decimals of the sellable token. Must be greater than 0.
     */
    function setSellableToken(
        address token,
        uint8 decimals
    ) external onlyOwner {
        if (_isSellableTokenFrozen()) {
            revert SellableTokenIsFrozen();
        }
        _setSellableToken(token, decimals);
    }

    /**
     * @notice Freezes the sellable token, preventing further changes to its address or decimals.
     * @dev Can only be called by the contract owner and only if the sellable token is not already frozen.
     * This action is irreversible. Once the sellable token is frozen, it cannot be unfrozen.
     * Emits a SellableTokenFrozen event upon successful freezing of the sellable token.
     */
    function freezeSellableToken()
        external
        whenSellableTokenIsNotZero
        onlyOwner
    {
        if (_sellableTokenFrozen) {
            revert SellableTokenIsFrozen();
        }

        _sellableTokenFrozen = true;
        emit SellableTokenFrozen();
    }

    /**
     * @dev Internal function to get the address of the sellable token.
     * @return The address of the sellable token.
     */
    function _getSellableToken() internal view returns (address) {
        return _sellableToken;
    }

    /**
     * @dev Internal function to get the number of decimals of the sellable token.
     * @return The number of decimals of the sellable token.
     */
    function _getSellableTokenDecimals() internal view returns (uint8) {
        return _sellableTokenDecimals;
    }

    /**
     * @dev Private function to check if the sellable token is frozen.
     * @return Boolean indicating if the sellable token is frozen.
     */
    function _isSellableTokenFrozen() private view returns (bool) {
        return _sellableTokenFrozen;
    }

    /**
     * @dev Private function to set the sellable token and its decimals.
     * Emits a SellableTokenUpdated event.
     * @param token The address of the sellable token.
     * @param decimals The number of decimals of the sellable token. Must be greater than 0.
     */
    function _setSellableToken(address token, uint8 decimals) private {
        if (decimals == 0) {
            revert SellableTokenDecimalsIsZero();
        }

        _sellableToken = token;
        _sellableTokenDecimals = decimals;
        emit SellableTokenUpdated(token, decimals);
    }
}

File 4 of 18 : RecoverableFunds.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";

import "@openzeppelin/contracts/access/Ownable2Step.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

/**
 * @title RecoverableFunds
 * @dev Abstract contract that allows the owner to recover accidentally sent ERC20 tokens
 * and native coins (ETH) that are not part of the project's tracked funds.
 * Ensures the amount to be recovered does not exceed the recoverable balance.
 * Inherits from Ownable2Step and ReentrancyGuard.
 */
abstract contract RecoverableFunds is Ownable2Step, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using Address for address payable;

    /**
     * @dev Emitted when funds are recovered.
     * @param user The address that received the recovered funds.
     * @param token The address of the recovered ERC20 token or address(0) for ETH.
     * @param amount The amount of ERC20 tokens or ETH recovered.
     */
    event FundsRecovered(
        address indexed user,
        address indexed token,
        uint256 amount
    );

    /// @dev Error to indicate that the amount to be recovered exceeds the recoverable balance.
    error AmountExceedsRecoverableFunds();

    /// @dev Error to indicate that the recipient address is zero.
    error RecipientIsZeroAddress();

    /**
     * @notice Returns the recoverable amount of a specific token or ETH.
     * @dev If the `token` is the zero address, it returns the balance of the contract in ETH.
     * Otherwise, it returns the balance of the specified ERC20 token held by the contract.
     * This function is designed to be overridden in derived contracts if needed.
     * @param token The address of the ERC20 token or the zero address for ETH.
     * @return The recoverable amount of the specified token or ETH.
     */
    function getRecoverableFunds(
        address token
    ) public view virtual returns (uint256) {
        if (token == address(0)) return address(this).balance;
        else return IERC20(token).balanceOf(address(this));
    }

    /**
     * @notice Allows the owner to recover ERC20 tokens and native coins (ETH) accidentally sent to the contract.
     * @dev Can only be called by the contract owner.
     * Ensures the amount to be recovered does not exceed the recoverable balance.
     * Emits a FundsRecovered event.
     * @param user The address to receive recovered funds from the contract.
     * @param token The address of the ERC20 token to recover or address(0) to recover ETH.
     * @param amount The amount of ERC20 tokens or ETH to recover.
     * @return Returns true if the recovery was successful.
     */
    function recoverFunds(
        address user,
        address token,
        uint256 amount
    ) external onlyOwner nonReentrant returns (bool) {
        if (user == address(0)) {
            revert RecipientIsZeroAddress();
        }

        uint256 recoverableAmount = getRecoverableFunds(token);
        if (amount > recoverableAmount) {
            revert AmountExceedsRecoverableFunds();
        }

        _transferRecoverableFundsTo(user, token, amount);
        emit FundsRecovered(user, token, amount);
        return true;
    }

    /**
     * @dev Private function to handle the transfer of recovered funds.
     * @param user The address to receive the recovered funds.
     * @param token The address of the ERC20 token to recover or address(0) to recover ETH.
     * @param amount The amount of ERC20 tokens or ETH to recover.
     */
    function _transferRecoverableFundsTo(
        address user,
        address token,
        uint256 amount
    ) private {
        if (token == address(0)) {
            payable(user).sendValue(amount);
        } else {
            IERC20(token).safeTransfer(user, amount);
        }
    }
}

File 5 of 18 : NonTransferableToken.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

/**
 * @title NonTransferableToken
 * @dev @dev Abstract contract. Implementation of the {IERC20} and {IERC20Metadata} interfaces to display non-transferable tokens.
 */
abstract contract NonTransferableToken is IERC20, IERC20Metadata {
    string private _name;
    string private _symbol;

    /// @dev Event emitted when the token metadata is updated.
    event NonTransferableTokenMetadataUpdated(string name, string symbol);

    /// @dev Indicates that a function can't be used.
    error NonTransferableTokenUnusedFunction();

    /**
     * @dev Sets the values for {name} and {symbol}.
     * @param name_ The name of the token.
     * @param symbol_ The symbol of the token.
     */
    constructor(string memory name_, string memory symbol_) {
        _setNonTransferableTokenNameSymbol(name_, symbol_);
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20Metadata-name}.
     * @return The name of the token.
     */
    function name() external view returns (string memory) {
        return _name;
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20Metadata-symbol}.
     * @return The symbol of the token.
     */
    function symbol() external view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20Metadata-decimals}.
     * @return The number of decimals used to get its user representation.
     */
    function decimals() public view virtual returns (uint8) {
        return 18; // Placeholder, should be overridden in derived contracts.
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-totalSupply}.
     * @return The total supply of the token.
     */
    function totalSupply() public view virtual returns (uint256) {
        return 0; // Placeholder, should be overridden in derived contracts.
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-balanceOf}.
     * @return The balance of the specified user.
     */
    function balanceOf(address) public view virtual returns (uint256) {
        return 0; // Placeholder, should be overridden in derived contracts.
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-transfer}.
     * @return Always reverts with NonTransferableTokenUnusedFunction.
     */
    function transfer(address, uint256) external pure returns (bool) {
        revert NonTransferableTokenUnusedFunction();
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-allowance}.
     * @return Always return 0.
     */
    function allowance(address, address) external pure returns (uint256) {
        return 0;
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-approve}.
     * @return Always reverts with NonTransferableTokenUnusedFunction.
     */
    function approve(address, uint256) external pure returns (bool) {
        revert NonTransferableTokenUnusedFunction();
    }

    /**
     * @dev Imitation of ERC20 function. See {IERC20-transferFrom}.
     * @return Always reverts with NonTransferableTokenUnusedFunction.
     */
    function transferFrom(
        address,
        address,
        uint256
    ) external pure returns (bool) {
        revert NonTransferableTokenUnusedFunction();
    }

    /**
     * @dev Private function to emit Transfer event.
     * @param from The address of the sender.
     * @param to The address of the recipient.
     * @param amount The amount of tokens being transferred.
     */
    function _updateNonTransferableToken(
        address from,
        address to,
        uint256 amount
    ) private {
        emit Transfer(from, to, amount);
    }

    /**
     * @dev Internal function to simulate the minting of new tokens. Emits a Transfer event.
     * @param user The address to receive the minted tokens.
     * @param amount The amount of tokens to mint.
     */
    function _mintNonTransferableToken(address user, uint256 amount) internal {
        _updateNonTransferableToken(address(0), user, amount);
    }

    /**
     * @dev Internal function to simulate the burning of tokens. Emits a Transfer event.
     * @param user The address whose tokens are being burned.
     * @param amount The amount of tokens to burn.
     */
    function _burnNonTransferableToken(address user, uint256 amount) internal {
        _updateNonTransferableToken(user, address(0), amount);
    }

    /**
     * @dev Allows to change the token metadata.
     * Emits a NonTransferableTokenMetadataUpdated event.
     * @param name_ The new name of the token.
     * @param symbol_ The new symbol of the token.
     */
    function _setNonTransferableTokenNameSymbol(
        string memory name_,
        string memory symbol_
    ) internal {
        _name = name_;
        _symbol = symbol_;
        emit NonTransferableTokenMetadataUpdated(name_, symbol_);
    }
}

File 6 of 18 : ITokenVesting.sol
// SPDX-License-Identifier: GPL-3.0-or-later
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity 0.8.20;

interface ITokenVesting {
    /**
     * @notice Handles the purchase of tokens for a specific user during a token sale stage.
     * @dev This function is called by the TokenSale contract when tokens are purchased.
     * It verifies the allocation exists and increases the vested amount for the user.
     * @param user The address of the user purchasing tokens.
     * @param stageId The ID of the sale stage.
     * @param tokensToBuy The amount of tokens being purchased.
     * @return bool Returns true if the purchase is successfully processed.
     */
    function onTokensPurchase(
        address user,
        uint256 stageId,
        uint256 tokensToBuy
    ) external returns (bool);
}

File 7 of 18 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

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

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

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

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

File 8 of 18 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

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

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

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

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

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

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

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

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

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

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

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

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 9 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

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

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

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

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

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

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

File 10 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

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

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

File 11 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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 12 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @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 or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * 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.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @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`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) 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 FailedInnerCall();
        }
    }
}

File 13 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../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 An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @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.encodeCall(token.transfer, (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.encodeCall(token.transferFrom, (from, to, 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);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @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.encodeCall(token.approve, (spender, value));

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

    /**
     * @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);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @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(token).code.length > 0;
    }
}

File 14 of 18 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @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 15 of 18 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 16 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @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 value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

File 17 of 18 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

File 18 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"sellableToken","type":"address"},{"internalType":"uint8","name":"sellableTokenDecimals","type":"uint8"},{"internalType":"string","name":"vestedTokenName","type":"string"},{"internalType":"string","name":"vestedTokenSymbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AllocationAlreadyUsed","type":"error"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"AllocationExceeded","type":"error"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"AllocationNotFound","type":"error"},{"inputs":[],"name":"AmountExceedsRecoverableFunds","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidTokenAmount","type":"error"},{"inputs":[],"name":"NonTransferableTokenUnusedFunction","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ParametersMismatch","type":"error"},{"inputs":[],"name":"RecipientIsZeroAddress","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"ReservedLessThanVested","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SellableTokenDecimalsIsZero","type":"error"},{"inputs":[],"name":"SellableTokenIsFrozen","type":"error"},{"inputs":[],"name":"SellableTokenIsZero","type":"error"},{"inputs":[],"name":"TgeTimestampIsFrozen","type":"error"},{"inputs":[],"name":"TgeTimestampIsZero","type":"error"},{"inputs":[],"name":"TgeTimestampNotPassed","type":"error"},{"inputs":[],"name":"TgeTimestampPassed","type":"error"},{"inputs":[],"name":"TgeUnlockExceedsMaximum","type":"error"},{"inputs":[],"name":"TimeAlreadyPassed","type":"error"},{"inputs":[],"name":"TokenSaleIsFrozen","type":"error"},{"inputs":[],"name":"TokenSaleIsZero","type":"error"},{"inputs":[],"name":"UnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"AllocationDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"reserved","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockup","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cliff","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vesting","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tgeUnlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockDelay","type":"uint256"}],"name":"AllocationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"AutoClaimAfterTgeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"autoSupply","type":"bool"},{"indexed":false,"internalType":"bool","name":"autoSupplyOnClaim","type":"bool"},{"indexed":false,"internalType":"address","name":"autoSupplyFrom","type":"address"}],"name":"AutoSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FundsRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"}],"name":"NonTransferableTokenMetadataUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":[],"name":"SellableTokenFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"SellableTokenUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"TgeTimestampFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tgeTimestamp","type":"uint256"}],"name":"TgeTimestampUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"TokenSaleFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenSale","type":"address"}],"name":"TokenSaleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensSupplied","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"VestingAccrued","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"VestingClaimed","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"allocateTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"allocationIds","type":"bytes32[]"},{"internalType":"address[]","name":"users","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"allocateTokensBatch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users","type":"address[]"}],"name":"claimForced","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"allocationName","type":"string"}],"name":"computeAllocationId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"freezeSellableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeTgeTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"freezeTokenSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAllocationIds","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAutoSupply","outputs":[{"internalType":"bool","name":"autoSupply","type":"bool"},{"internalType":"bool","name":"autoSupplyOnClaim","type":"bool"},{"internalType":"address","name":"autoSupplyFrom","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"getRecoverableFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRequiredTokensSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSellableToken","outputs":[{"internalType":"bool","name":"isFrozen","type":"bool"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"atTime","type":"uint256"}],"name":"getState","outputs":[{"internalType":"uint256","name":"tge","type":"uint256"},{"internalType":"bool","name":"autoClaimAfterTge","type":"bool"},{"internalType":"address","name":"tokenSale","type":"address"},{"internalType":"bool","name":"tokenSaleFrozen","type":"bool"},{"internalType":"uint256","name":"totalReserved","type":"uint256"},{"internalType":"uint256","name":"totalVested","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"uint256","name":"totalUnlocked","type":"uint256"},{"internalType":"uint256[]","name":"reserved","type":"uint256[]"},{"internalType":"uint256[]","name":"vested","type":"uint256[]"},{"internalType":"uint256[]","name":"claimed","type":"uint256[]"},{"internalType":"uint256[]","name":"unlocked","type":"uint256[]"},{"internalType":"bytes32[]","name":"allocationIds","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTge","outputs":[{"internalType":"bool","name":"isFrozen","type":"bool"},{"internalType":"uint256","name":"tge","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"atTime","type":"uint256"}],"name":"getUserState","outputs":[{"internalType":"uint256","name":"totalVested","type":"uint256"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"uint256","name":"totalUnlocked","type":"uint256"},{"internalType":"uint256[]","name":"vested","type":"uint256[]"},{"internalType":"uint256[]","name":"claimed","type":"uint256[]"},{"internalType":"uint256[]","name":"unlocked","type":"uint256[]"},{"internalType":"bytes32[]","name":"allocationIds","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"getVesting","outputs":[{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"vested","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"lockup","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"vesting","type":"uint256"},{"internalType":"uint256","name":"tgeUnlock","type":"uint256"},{"internalType":"uint256","name":"unlockDelay","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVestings","outputs":[{"internalType":"bytes32[]","name":"allocationIds","type":"bytes32[]"},{"components":[{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"vested","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"lockup","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"vesting","type":"uint256"},{"internalType":"uint256","name":"tgeUnlock","type":"uint256"},{"internalType":"uint256","name":"unlockDelay","type":"uint256"}],"internalType":"struct TokenVesting.VestingData[]","name":"vestings","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"isAllocationIdExist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"stageId","type":"uint256"},{"internalType":"uint256","name":"tokensToBuy","type":"uint256"}],"name":"onTokensPurchase","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"recoverFunds","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"}],"name":"removeAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"setAutoClaimAfterTge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoSupply","type":"bool"},{"internalType":"bool","name":"autoSupplyOnClaim","type":"bool"},{"internalType":"address","name":"autoSupplyFrom","type":"address"}],"name":"setAutoSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"setSellableToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newTgeTimestamp","type":"uint256"}],"name":"setTgeTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenSale","type":"address"}],"name":"setTokenSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"setVestedTokenNameSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"lockup","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"vesting","type":"uint256"},{"internalType":"uint256","name":"tgeUnlock","type":"uint256"},{"internalType":"uint256","name":"unlockDelay","type":"uint256"}],"name":"setVestingSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"allocationId","type":"bytes32"},{"internalType":"uint256","name":"reserved","type":"uint256"},{"internalType":"uint256","name":"lockup","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"vesting","type":"uint256"},{"internalType":"uint256","name":"tgeUnlock","type":"uint256"},{"internalType":"uint256","name":"unlockDelay","type":"uint256"}],"internalType":"struct TokenVesting.VestingSchedule[]","name":"schedules","type":"tuple[]"}],"name":"setVestingScheduleBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"supplyAmount","type":"uint256"}],"name":"supplyReservedTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"supplyAmount","type":"uint256"}],"name":"supplyTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801562000010575f80fd5b5060405162003eb938038062003eb983398101604081905262000033916200034d565b81815f868633806200005e57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6200006981620000ad565b50620000768282620000cb565b50620000849050816200015d565b5062000091828262000199565b50506001600755620000a35f620001ea565b505050506200059d565b600180546001600160a01b0319169055620000c88162000238565b50565b8060ff165f03620000ef57604051638bd9be8160e01b815260040160405180910390fd5b600280546001600160a01b0384166001600160a81b03199091168117600160a01b60ff8516908102919091179092556040805191825260208201929092527fc9cbf5af9e78df9093a676978e83f2a04e258ad3b0d8fa81cb44b357c657606a91015b60405180910390a15050565b60038190556040518181527f6de97eb9b2c91c4ed87da2828a7611ff87b192b8ca8a23833fa9fa4347eb3971906020015b60405180910390a150565b6005620001a7838262000477565b506006620001b6828262000477565b507f747848b12b97bee94e04890126462b58ce70550d943de0dea8702fb4484352dc8282604051620001519291906200056c565b60088054821515600160b01b0260ff60b01b199091161790556040517ff3acf3314d01b12d4c4389b535183114d53a183bea98bba7cd9cf15e0579e574906200018e90831515815260200190565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b634e487b7160e01b5f52604160045260245ffd5b5f5b83811015620002b75781810151838201526020016200029d565b50505f910152565b5f82601f830112620002cf575f80fd5b81516001600160401b0380821115620002ec57620002ec62000287565b604051601f8301601f19908116603f0116810190828211818310171562000317576200031762000287565b8160405283815286602085880101111562000330575f80fd5b620003438460208301602089016200029b565b9695505050505050565b5f805f806080858703121562000361575f80fd5b84516001600160a01b038116811462000378575f80fd5b602086015190945060ff811681146200038f575f80fd5b60408601519093506001600160401b0380821115620003ac575f80fd5b620003ba88838901620002bf565b93506060870151915080821115620003d0575f80fd5b50620003df87828801620002bf565b91505092959194509250565b600181811c908216806200040057607f821691505b6020821081036200041f57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111562000472575f81815260208120601f850160051c810160208610156200044d5750805b601f850160051c820191505b818110156200046e5782815560010162000459565b5050505b505050565b81516001600160401b0381111562000493576200049362000287565b620004ab81620004a48454620003eb565b8462000425565b602080601f831160018114620004e1575f8415620004c95750858301515b5f19600386901b1c1916600185901b1785556200046e565b5f85815260208120601f198616915b828110156200051157888601518255948401946001909101908401620004f0565b50858210156200052f57878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b5f8151808452620005588160208601602086016200029b565b601f01601f19169290920160200192915050565b604081525f6200058060408301856200053f565b82810360208401526200059481856200053f565b95945050505050565b61390e80620005ab5f395ff3fe608060405234801561000f575f80fd5b5060043610610281575f3560e01c80638da5cb5b11610156578063bf0f55b3116100ca578063e30c397811610084578063e30c397814610607578063f2fde38b14610618578063f3e960ca1461062b578063f44097861461063e578063fd5eddf314610651578063febb066a14610664575f80fd5b8063bf0f55b31461053b578063c62917691461054e578063d279792d14610561578063d9b51fce14610574578063db4bea00146105a4578063dd62ed3e146105f2575f80fd5b8063a9059cbb1161011b578063a9059cbb146102a3578063ade11a1d146104e6578063b3c1c00d146104f9578063b6444da914610501578063b8887ec114610509578063bc9b00b21461051c575f80fd5b80638da5cb5b1461046e5780638ef6af37146104925780638f6518ae146104a557806395d89b41146104b8578063a289b3ae146104c0575f80fd5b80634e71d92d116101f8578063715018a6116101b2578063715018a6146103ec57806372319cb3146103f4578063775dca2d1461040757806379ba50971461041a578063870d21b91461042257806388338f021461045b575f80fd5b80634e71d92d1461038d5780635ce60c6a146103955780635d3590d5146103a8578063626a9b26146103bb5780636a278077146103d157806370a08231146103d9575f80fd5b80632b1c2fd2116102495780632b1c2fd2146102f4578063313ce5671461030957806334d578c814610328578063378b070a1461033b578063387e45121461034e57806344c9af2814610361575f80fd5b806306fdde0314610285578063095ea7b3146102a357806318160ddd146102c657806323b872dd146102dc57806323eaa8e9146102ea575b5f80fd5b61028d610677565b60405161029a9190612f11565b60405180910390f35b6102b66102b1366004612f39565b610707565b604051901515815260200161029a565b6102ce610721565b60405190815260200161029a565b6102b66102b1366004612f61565b6102f2610737565b005b6102fc6107d0565b60405161029a9190612fd3565b600254600160a01b900460ff1660405160ff909116815260200161029a565b6102f2610336366004613029565b6107da565b6102b66103493660046130d0565b61084a565b6102ce61035c366004613100565b610893565b61037461036f366004613119565b610974565b60405161029a9d9c9b9a99989796959493929190613130565b6102f2610a05565b6102f26103a33660046131e9565b610a35565b6102b66103b6366004612f61565b610a72565b6103c3610b3e565b60405161029a929190613223565b6102f2610c09565b6102ce6103e7366004613100565b610c8e565b6102f2610d1e565b6102f2610402366004613119565b610d2f565b6102b6610415366004613119565b610d58565b6102f2610d70565b6008546040805160ff8084161515825261010084041615156020820152620100009092046001600160a01b03169082015260600161029a565b6102f26104693660046132c0565b610db6565b5f546001600160a01b03165b6040516001600160a01b03909116815260200161029a565b6102f26104a036600461332e565b610eaa565b6102f26104b3366004613382565b610eca565b61028d610edb565b6104d36104ce366004612f39565b610eea565b60405161029a979695949392919061339d565b6102f26104f4366004613119565b610f2a565b6102f2610f3b565b6102ce610fe5565b6102ce610517366004613474565b610fee565b610524610ff8565b60408051921515835260208301919091520161029a565b6102b66105493660046134f4565b611017565b6102f261055c366004613586565b61112c565b6102b661056f3660046130d0565b6111c0565b61057c61125b565b6040805193151584526001600160a01b03909216602084015260ff169082015260600161029a565b6105b76105b2366004613119565b61129d565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c083015260e08201526101000161029a565b6102ce6106003660046135ca565b5f92915050565b6001546001600160a01b031661047a565b6102f2610626366004613100565b6112f4565b6102f2610639366004613100565b611364565b6102f261064c3660046135fb565b6113ec565b6102f261065f366004613119565b6113fe565b6102f2610672366004613119565b611423565b6060600580546106869061365a565b80601f01602080910402602001604051908101604052809291908181526020018280546106b29061365a565b80156106fd5780601f106106d4576101008083540402835291602001916106fd565b820191905f5260205f20905b8154815290600101906020018083116106e057829003601f168201915b5050505050905090565b5f60405163fcbca50d60e01b815260040160405180910390fd5b5f600d54600c5461073291906136a0565b905090565b61073f6114b2565b6010546001600160a01b03166107685760405163244ae88d60e21b815260040160405180910390fd5b601054600160a01b900460ff16156107935760405163267f2a4d60e01b815260040160405180910390fd5b6010805460ff60a01b1916600160a01b1790556040517f83ce2e1115b4c119eafc8683693f7b2d2547a1c0d55d069ec8284a391dc678fb905f90a1565b60606107326114de565b6107e2611533565b6107ff576040516378ac935160e11b815260040160405180910390fd5b6108076114b2565b5f5b815181101561084657610834828281518110610827576108276136b3565b6020026020010151611560565b8061083e816136c7565b915050610809565b5050565b5f6108536114b2565b61085e8484846116ec565b61086661181e565b1561088857600854610888906201000090046001600160a01b0316835f611866565b5060015b9392505050565b5f806108a76002546001600160a01b031690565b9050806001600160a01b0316836001600160a01b031603610965575f600d54600c546108d391906136a0565b6040516370a0823160e01b81523060048201529091505f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561091a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061093e91906136df565b90508082111561095257505f949350505050565b61095c82826136a0565b95945050505050565b61088c83611a10565b50919050565b5f805f805f805f8060608060608060608d5f0361098f57429d505b600354600854601054600b54929f5060ff600160b01b90920482169e506001600160a01b0381169d50600160a01b9004169a5098506109cc6114de565b90506109d8818f611a91565b809850819950829a50839b50849c50859d50869e505050505050505091939597999b9d90929496989a9c50565b610a0d611533565b610a2a576040516378ac935160e11b815260040160405180910390fd5b610a3333611560565b565b610a3d6114b2565b600154600160a01b900460ff1615610a68576040516303ed52c560e41b815260040160405180910390fd5b6108468282611cdb565b5f610a7b6114b2565b610a83611d6c565b6001600160a01b038416610aaa576040516311d000e160e31b815260040160405180910390fd5b5f610ab484610893565b905080831115610ad7576040516305d632b960e41b815260040160405180910390fd5b610ae2858585611d96565b836001600160a01b0316856001600160a01b03167f13e06184555481b6d2cb327155e8d2e1d0b1f0252a7fe6621e32cf998814883585604051610b2791815260200190565b60405180910390a3600191505061088c6001600755565b606080610b496114de565b8051909250806001600160401b03811115610b6657610b66612fe5565b604051908082528060200260200182016040528015610b9f57816020015b610b8c612e87565b815260200190600190039081610b845790505b5091505f5b81811015610c03575f848281518110610bbf57610bbf6136b3565b60200260200101519050610bd281611dcb565b848381518110610be457610be46136b3565b6020026020010181905250508080610bfb906136c7565b915050610ba4565b50509091565b610c116114b2565b6003545f03610c33576040516314820df960e31b815260040160405180910390fd5b60045460ff1615610c575760405163580470f360e01b815260040160405180910390fd5b6004805460ff191660011790556040517fa9face7abb12e88f4172e5dcf0d6b240dbb29e02cb155a6b614a2afcc285007a905f90a1565b5f805f80610c9a6114de565b80519091505f5b81811015610d09575f838281518110610cbc57610cbc6136b3565b602002602001015190505f610cd18983611e40565b8051909150610ce090886136f6565b9650806020015186610cf291906136f6565b955050508080610d01906136c7565b915050610ca1565b50610d1483856136a0565b9695505050505050565b610d266114b2565b610a335f611e8b565b610d376114b2565b600854610d55906201000090046001600160a01b0316826001611866565b50565b5f818152600a602052604081205460ff165b92915050565b60015433906001600160a01b03168114610dad5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610d5581611e8b565b610dbe6114b2565b5f5b81811015610ea557610e93838383818110610ddd57610ddd6136b3565b905060e002015f0135848484818110610df857610df86136b3565b905060e0020160200135858585818110610e1457610e146136b3565b905060e0020160400135868686818110610e3057610e306136b3565b905060e0020160600135878787818110610e4c57610e4c6136b3565b905060e0020160800135888888818110610e6857610e686136b3565b905060e0020160a00135898989818110610e8457610e846136b3565b905060e0020160c00135611ea4565b80610e9d816136c7565b915050610dc0565b505050565b610eb26114b2565b610ec187878787878787611ea4565b50505050505050565b610ed26114b2565b610d5581612000565b6060600680546106869061365a565b5f805f606080606080875f03610efe574297505b610f066114de565b9050610f13818a8a61204d565b949e939d50919b5099509750909550909350915050565b610f326114b2565b610d558161223a565b5f610f4e6002546001600160a01b031690565b6001600160a01b031603610f755760405163488afa1b60e01b815260040160405180910390fd5b610f7d6114b2565b600154600160a01b900460ff1615610fa8576040516303ed52c560e41b815260040160405180910390fd5b6001805460ff60a01b1916600160a01b1790556040517f9efd8729cc972ca7884de34bbf48c2823c0d69fda2946916c65311c81c4c52c3905f90a1565b5f610732612378565b5f610d6a82612463565b5f8061100660045460ff1690565b915061101160035490565b90509091565b5f6110206114b2565b8584811415806110305750828114155b1561104e576040516328e7033560e01b815260040160405180910390fd5b5f805b828110156110f2576110ba88888381811061106e5761106e6136b3565b90506020020160208101906110839190613100565b8b8b84818110611095576110956136b3565b905060200201358888858181106110ae576110ae6136b3565b905060200201356116ec565b8585828181106110cc576110cc6136b3565b90506020020135826110de91906136f6565b9150806110ea816136c7565b915050611051565b506110fb61181e565b1561111d5760085461111d906201000090046001600160a01b0316825f611866565b50600198975050505050505050565b6111346114b2565b600880546001600160a01b03831662010000810262010000600160b01b0319861515610100810261ff00198a151590811661ffff19909716969096171791909116919091179093556040805192835260208301939093528183015290517f50b79656a78699922c8e6b849547e537405150f0f9201355537f858f793118969181900360600190a1505050565b6010545f906001600160a01b03166111eb5760405163244ae88d60e21b815260040160405180910390fd5b6010546001600160a01b03163314611216576040516354bff84560e11b815260040160405180910390fd5b61121e61181e565b1561124057600854611240906201000090046001600160a01b0316835f611866565b61088884611255611250866124c3565b612463565b846116ec565b5f805f61127260015460ff600160a01b9091041690565b92506112866002546001600160a01b031690565b600254909250600160a01b900460ff169050909192565b5f805f805f805f805f6112af8a611dcb565b9050805f01519850806020015197508060400151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6112fc6114b2565b600180546001600160a01b0383166001600160a01b0319909116811790915561132c5f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61136c6114b2565b601054600160a01b900460ff16156113975760405163267f2a4d60e01b815260040160405180910390fd5b601080546001600160a01b0319166001600160a01b0383169081179091556040519081527f26eb89b286b88bc18cc22adf8329bb32f84b5f1ad41e2a73c2e41e2414c8af1b906020015b60405180910390a150565b6113f46114b2565b6108468282612552565b6114066114b2565b600854610d55906201000090046001600160a01b0316825f611866565b61142b6114b2565b5f61143560035490565b90505f811180156114465750804210155b1561146457604051634a11eab560e11b815260040160405180910390fd5b8142111561148557604051639cf1fc4360e01b815260040160405180910390fd5b60045460ff16156114a95760405163580470f360e01b815260040160405180910390fd5b6108468261259d565b5f546001600160a01b03163314610a335760405163118cdaa760e01b8152336004820152602401610da4565b606060098054806020026020016040519081016040528092919081815260200182805480156106fd57602002820191905f5260205f20905b815481526020019060010190808311611516575050505050905090565b5f8061153e60035490565b905080158061154c57508042105b15611558575f91505090565b600191505090565b5f6115736002546001600160a01b031690565b6001600160a01b03160361159a5760405163488afa1b60e01b815260040160405180910390fd5b5f6115a36114de565b90505f805f806115b485874261204d565b955095505094509450505f848411156115d4576115d185856136a0565b90505b8015610ec1576115e26125d2565b1561160457600854611604906201000090046001600160a01b0316825f611866565b5f6116176002546001600160a01b031690565b87519091505f5b818110156116e0575f868281518110611639576116396136b3565b6020026020010151868381518110611653576116536136b3565b602002602001015111156116a257868281518110611673576116736136b3565b602002602001015186838151811061168d5761168d6136b3565b602002602001015161169f91906136a0565b90505b80156116cd576116cd8b8b84815181106116be576116be6136b3565b60200260200101518684612610565b50806116d8816136c7565b91505061161e565b50505050505050505050565b816116f6816126ee565b81600c5f82825461170791906136f6565b90915550505f838152600e60205260408120600101805484929061172c9084906136f6565b90915550505f838152600e60205260409020805460019091015411156117685760405163740d40df60e11b815260048101849052602401610da4565b6001600160a01b0384165f908152600f602090815260408083208684529091528120805484929061179a9084906136f6565b909155506117aa9050848361271f565b82846001600160a01b03167f442efa2766c5ddd5b30bb99d040f10fc109f18c0165a7156fda6d650116d25e4846040516117e691815260200190565b60405180910390a3600854600160b01b900460ff16801561180a575061180a611533565b156118185761181884611560565b50505050565b6008545f9060ff16801561183a5750600854610100900460ff16155b801561185657506008546201000090046001600160a01b031615155b156118615750600190565b505f90565b5f811561187c5761187561272a565b9050611887565b611884612378565b90505b805f036118945750505050565b8215806118a057508083115b156118a9578092505b5f6118bc6002546001600160a01b031690565b6040516370a0823160e01b81523060048201529091505f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611903573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061192791906136df565b905061193e6001600160a01b038316873088612776565b6040516370a0823160e01b81523060048201525f9082906001600160a01b038516906370a0823190602401602060405180830381865afa158015611984573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119a891906136df565b6119b291906136a0565b90508581146119d457604051632160733960e01b815260040160405180910390fd5b6040518681527fac3d9837a679b12a12c0a3b0d0c20e8bf132403b05d76f80de8f4aec36297ed39060200160405180910390a150505050505050565b5f6001600160a01b038216611a26575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015611a68573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d6a91906136df565b919050565b5f805f6060806060805f89519050806001600160401b03811115611ab757611ab7612fe5565b604051908082528060200260200182016040528015611ae0578160200160208202803683370190505b509450806001600160401b03811115611afb57611afb612fe5565b604051908082528060200260200182016040528015611b24578160200160208202803683370190505b509350806001600160401b03811115611b3f57611b3f612fe5565b604051908082528060200260200182016040528015611b68578160200160208202803683370190505b509250806001600160401b03811115611b8357611b83612fe5565b604051908082528060200260200182016040528015611bac578160200160208202803683370190505b5091505f5b81811015611ccd575f8b8281518110611bcc57611bcc6136b3565b602002602001015190505f611be082611dcb565b9050805f0151888481518110611bf857611bf86136b3565b60200260200101818152505080602001515f03611c16575050611cbb565b6020810151611c25908c6136f6565b9a5080604001518a611c3791906136f6565b99508060200151878481518110611c5057611c506136b3565b6020026020010181815250508060400151868481518110611c7357611c736136b3565b6020026020010181815250505f611c8a828e6127dd565b9050611c96818b6136f6565b995080868581518110611cab57611cab6136b3565b6020026020010181815250505050505b80611cc5816136c7565b915050611bb1565b505092959891949750929550565b8060ff165f03611cfe57604051638bd9be8160e01b815260040160405180910390fd5b600280546001600160a01b0384166001600160a81b03199091168117600160a01b60ff8516908102919091179092556040805191825260208201929092527fc9cbf5af9e78df9093a676978e83f2a04e258ad3b0d8fa81cb44b357c657606a91015b60405180910390a15050565b600260075403611d8f57604051633ee5aeb560e01b815260040160405180910390fd5b6002600755565b6001600160a01b038216611db757610ea56001600160a01b03841682612937565b610ea56001600160a01b03831684836129ca565b611dd3612e87565b505f908152600e6020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e082015290565b6040805180820182525f80825260209182018190526001600160a01b03949094168452600f815281842092845291825291829020825180840190935280548352600101549082015290565b600180546001600160a01b0319169055610d55816129fb565b612710821115611ec757604051635e19109b60e11b815260040160405180910390fd5b5f878152600a602052604090205460ff16611f26576009805460018181019092557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018890555f888152600a60205260409020805460ff191690911790555b5f878152600e602052604090206001810154871015611f5b5760405163e5dc5dd160e01b815260048101899052602401610da4565b8054600b548891611f6b916136a0565b611f7591906136f6565b600b5586815560038101869055600481018590556005810184905560068101839055600781018290556040805188815260208101889052908101869052606081018590526080810184905260a0810183905288907f9808fccf72b3838467b4d6e05a69ed49015c751a41dd7a2b5a2873d670dc604b9060c00160405180910390a25050505050505050565b60088054821515600160b01b0260ff60b01b199091161790556040517ff3acf3314d01b12d4c4389b535183114d53a183bea98bba7cd9cf15e0579e574906113e190831515815260200190565b5f805f60608060605f89519050806001600160401b0381111561207257612072612fe5565b60405190808252806020026020018201604052801561209b578160200160208202803683370190505b509350806001600160401b038111156120b6576120b6612fe5565b6040519080825280602002602001820160405280156120df578160200160208202803683370190505b509250806001600160401b038111156120fa576120fa612fe5565b604051908082528060200260200182016040528015612123578160200160208202803683370190505b5091505f5b8181101561222c575f8b8281518110612143576121436136b3565b602002602001015190505f61215782611dcb565b90505f6121648d84611e40565b80519091505f036121775750505061221a565b8051612183908c6136f6565b9a5080602001518a61219591906136f6565b9950805f01518885815181106121ad576121ad6136b3565b60200260200101818152505080602001518785815181106121d0576121d06136b3565b6020026020010181815250505f6121e883838f612a4a565b90506121f4818b6136f6565b995080878681518110612209576122096136b3565b602002602001018181525050505050505b80612224816136c7565b915050612128565b505093975093979195509350565b5f61224482611dcb565b60208101519091501561226a57604051630b264bd160e11b815260040160405180910390fd5b5f6122736114de565b90505f6122808483612ba1565b90505f6001835161229191906136a0565b90505f600982815481106122a7576122a76136b3565b905f5260205f200154905080600984815481106122c6576122c66136b3565b5f9182526020909120015560098054806122e2576122e2613709565b5f828152602080822083015f19908101839055909201909255878252600e81526040808320838155600181018490556002810184905560038101849055600481018490556005810184905560068101849055600701839055600a909152808220805460ff191690555187917f942d33c1dfdb36d99cd34b1cd5b7e23475f8ad367770b9df46cc203d6475aa6891a2505050505050565b5f8061238c6002546001600160a01b031690565b6001600160a01b0316036123b35760405163488afa1b60e01b815260040160405180910390fd5b5f600d54600c546123c491906136a0565b90505f6123d96002546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561241d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061244191906136df565b9050818110612452575f9250505090565b61245c81836136a0565b9250505090565b5f6001826040516020016124779190612f11565b604051602081830303815290604052805190602001205f1c61249991906136a0565b6040516020016124ab91815260200190565b604051602081830303815290604052610d6a9061371d565b60605f6124cf83612c03565b60010190505f816001600160401b038111156124ed576124ed612fe5565b6040519080825280601f01601f191660200182016040528015612517576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461252157509392505050565b600561255e838261378d565b50600661256b828261378d565b507f747848b12b97bee94e04890126462b58ce70550d943de0dea8702fb4484352dc8282604051611d60929190613848565b60038190556040518181527f6de97eb9b2c91c4ed87da2828a7611ff87b192b8ca8a23833fa9fa4347eb3971906020016113e1565b6008545f9060ff16801561183a5750600854610100900460ff16801561185657506008546201000090046001600160a01b0316156118615750600190565b80600d5f82825461262191906136f6565b90915550505f838152600e6020526040812060020180548392906126469084906136f6565b90915550506001600160a01b0384165f908152600f60209081526040808320868452909152812060010180548392906126809084906136f6565b9091555061269090508482612cda565b6126a46001600160a01b03831685836129ca565b82846001600160a01b03167fe689ace1e68655b05d496b4d3ee7f7e5ba602cb088fe9835988349b6aff1b309836040516126e091815260200190565b60405180910390a350505050565b5f818152600a602052604090205460ff16610d555760405163fd05076760e01b815260048101829052602401610da4565b6108465f8383612ce1565b5f8061273e6002546001600160a01b031690565b6001600160a01b0316036127655760405163488afa1b60e01b815260040160405180910390fd5b5f600d54600b546123c491906136a0565b6040516001600160a01b0384811660248301528381166044830152606482018390526118189186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612d33565b5f806127e860035490565b90508015806127f657508083105b156128015750610d6a565b5f6127108560c001518660200151612819919061386c565b6128239190613883565b90505f81866020015161283691906136a0565b905061284282856136f6565b93505f86606001518461285591906136f6565b9050808610156128685750505050610d6a565b5f87608001518261287991906136f6565b90508087101561288d575050505050610d6a565b5f8860a001518361289e91906136f6565b90508088106128b95788602001519650505050505050610d6a565b81881061292b575f6128cb848a6136a0565b60e08b0151909150156128ff575f8a60e00151826128e99190613883565b90508a60e00151816128fb919061386c565b9150505b60a08a01515f90612910838861386c565b61291a9190613883565b9050612926818a6136f6565b985050505b50505050505092915050565b8047101561295a5760405163cd78605960e01b8152306004820152602401610da4565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f81146129a3576040519150601f19603f3d011682016040523d82523d5f602084013e6129a8565b606091505b5050905080610ea557604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b03838116602483015260448201839052610ea591859182169063a9059cbb906064016127ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f80612a5560035490565b9050801580612a6357508083105b15612a6e575061088c565b5f6127108660c00151865f0151612a85919061386c565b612a8f9190613883565b90505f81865f0151612aa191906136a0565b9050612aad82856136f6565b93505f876060015184612ac091906136f6565b905080861015612ad3575050505061088c565b5f886080015182612ae491906136f6565b905080871015612af857505050505061088c565b5f8960a0015183612b0991906136f6565b9050808810612b225750508651945061088c9350505050565b818810612b94575f612b34848a6136a0565b60e08c015190915015612b68575f8b60e0015182612b529190613883565b90508b60e0015181612b64919061386c565b9150505b60a08b01515f90612b79838861386c565b612b839190613883565b9050612b8f818a6136f6565b985050505b5050505050509392505050565b5f805b8251811015612be65783838281518110612bc057612bc06136b3565b602002602001015103612bd4579050610d6a565b80612bde816136c7565b915050612ba4565b5060405163fd05076760e01b815260048101849052602401610da4565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612c415772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c6d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c8b57662386f26fc10000830492506010015b6305f5e1008310612ca3576305f5e100830492506008015b6127108310612cb757612710830492506004015b60648310612cc9576064830492506002015b600a8310610d6a5760010192915050565b610846825f835b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612d2691815260200190565b60405180910390a3505050565b5f612d476001600160a01b03841683612d94565b905080515f14158015612d6b575080806020019051810190612d6991906138a2565b155b15610ea557604051635274afe760e01b81526001600160a01b0384166004820152602401610da4565b606061088c83835f845f80856001600160a01b03168486604051612db891906138bd565b5f6040518083038185875af1925050503d805f8114612df2576040519150601f19603f3d011682016040523d82523d5f602084013e612df7565b606091505b5091509150610d14868383606082612e1757612e1282612e5e565b61088c565b8151158015612e2e57506001600160a01b0384163b155b15612e5757604051639996b31560e01b81526001600160a01b0385166004820152602401610da4565b508061088c565b805115612e6e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518061010001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f5b83811015612ede578181015183820152602001612ec6565b50505f910152565b5f8151808452612efd816020860160208601612ec4565b601f01601f19169290920160200192915050565b602081525f61088c6020830184612ee6565b80356001600160a01b0381168114611a8c575f80fd5b5f8060408385031215612f4a575f80fd5b612f5383612f23565b946020939093013593505050565b5f805f60608486031215612f73575f80fd5b612f7c84612f23565b9250612f8a60208501612f23565b9150604084013590509250925092565b5f8151808452602080850194508084015f5b83811015612fc857815187529582019590820190600101612fac565b509495945050505050565b602081525f61088c6020830184612f9a565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561302157613021612fe5565b604052919050565b5f602080838503121561303a575f80fd5b82356001600160401b0380821115613050575f80fd5b818501915085601f830112613063575f80fd5b81358181111561307557613075612fe5565b8060051b9150613086848301612ff9565b818152918301840191848101908884111561309f575f80fd5b938501935b838510156130c4576130b585612f23565b825293850193908501906130a4565b98975050505050505050565b5f805f606084860312156130e2575f80fd5b6130eb84612f23565b95602085013595506040909401359392505050565b5f60208284031215613110575f80fd5b61088c82612f23565b5f60208284031215613129575f80fd5b5035919050565b8d81528c151560208201526001600160a01b038c1660408201528a151560608201528960808201528860a08201528760c08201528660e08201526101a06101008201525f6131826101a0830188612f9a565b8281036101208401526131958188612f9a565b90508281036101408401526131aa8187612f9a565b90508281036101608401526131bf8186612f9a565b90508281036101808401526131d48185612f9a565b9150509e9d5050505050505050505050505050565b5f80604083850312156131fa575f80fd5b61320383612f23565b9150602083013560ff81168114613218575f80fd5b809150509250929050565b5f604080835261323581840186612f9a565b8381036020858101919091528551808352868201928201905f5b818110156132b25784518051845284810151858501528681015187850152606080820151908501526080808201519085015260a0808201519085015260c0808201519085015260e09081015190840152938301936101009092019160010161324f565b509098975050505050505050565b5f80602083850312156132d1575f80fd5b82356001600160401b03808211156132e7575f80fd5b818501915085601f8301126132fa575f80fd5b813581811115613308575f80fd5b86602060e08302850101111561331c575f80fd5b60209290920196919550909350505050565b5f805f805f805f60e0888a031215613344575f80fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b8015158114610d55575f80fd5b5f60208284031215613392575f80fd5b813561088c81613375565b87815286602082015285604082015260e060608201525f6133c160e0830187612f9a565b82810360808401526133d38187612f9a565b905082810360a08401526133e78186612f9a565b905082810360c08401526133fb8185612f9a565b9a9950505050505050505050565b5f82601f830112613418575f80fd5b81356001600160401b0381111561343157613431612fe5565b613444601f8201601f1916602001612ff9565b818152846020838601011115613458575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215613484575f80fd5b81356001600160401b03811115613499575f80fd5b6134a584828501613409565b949350505050565b5f8083601f8401126134bd575f80fd5b5081356001600160401b038111156134d3575f80fd5b6020830191508360208260051b85010111156134ed575f80fd5b9250929050565b5f805f805f8060608789031215613509575f80fd5b86356001600160401b038082111561351f575f80fd5b61352b8a838b016134ad565b90985096506020890135915080821115613543575f80fd5b61354f8a838b016134ad565b90965094506040890135915080821115613567575f80fd5b5061357489828a016134ad565b979a9699509497509295939492505050565b5f805f60608486031215613598575f80fd5b83356135a381613375565b925060208401356135b381613375565b91506135c160408501612f23565b90509250925092565b5f80604083850312156135db575f80fd5b6135e483612f23565b91506135f260208401612f23565b90509250929050565b5f806040838503121561360c575f80fd5b82356001600160401b0380821115613622575f80fd5b61362e86838701613409565b93506020850135915080821115613643575f80fd5b5061365085828601613409565b9150509250929050565b600181811c9082168061366e57607f821691505b60208210810361096e57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d6a57610d6a61368c565b634e487b7160e01b5f52603260045260245ffd5b5f600182016136d8576136d861368c565b5060010190565b5f602082840312156136ef575f80fd5b5051919050565b80820180821115610d6a57610d6a61368c565b634e487b7160e01b5f52603160045260245ffd5b8051602080830151919081101561096e575f1960209190910360031b1b16919050565b601f821115610ea5575f81815260208120601f850160051c810160208610156137665750805b601f850160051c820191505b8181101561378557828155600101613772565b505050505050565b81516001600160401b038111156137a6576137a6612fe5565b6137ba816137b4845461365a565b84613740565b602080601f8311600181146137ed575f84156137d65750858301515b5f19600386901b1c1916600185901b178555613785565b5f85815260208120601f198616915b8281101561381b578886015182559484019460019091019084016137fc565b508582101561383857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b604081525f61385a6040830185612ee6565b828103602084015261095c8185612ee6565b8082028115828204841417610d6a57610d6a61368c565b5f8261389d57634e487b7160e01b5f52601260045260245ffd5b500490565b5f602082840312156138b2575f80fd5b815161088c81613375565b5f82516138ce818460208701612ec4565b919091019291505056fea2646970667358221220e6e1097ca746d584df629a3f8ad702eec40ebc91a3c7420b1cf26a4e223b74b364736f6c63430008140033000000000000000000000000b25766a96a90c251c328b73965d6931ea9a469550000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000874657374494e4458000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000574494e4458000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610281575f3560e01c80638da5cb5b11610156578063bf0f55b3116100ca578063e30c397811610084578063e30c397814610607578063f2fde38b14610618578063f3e960ca1461062b578063f44097861461063e578063fd5eddf314610651578063febb066a14610664575f80fd5b8063bf0f55b31461053b578063c62917691461054e578063d279792d14610561578063d9b51fce14610574578063db4bea00146105a4578063dd62ed3e146105f2575f80fd5b8063a9059cbb1161011b578063a9059cbb146102a3578063ade11a1d146104e6578063b3c1c00d146104f9578063b6444da914610501578063b8887ec114610509578063bc9b00b21461051c575f80fd5b80638da5cb5b1461046e5780638ef6af37146104925780638f6518ae146104a557806395d89b41146104b8578063a289b3ae146104c0575f80fd5b80634e71d92d116101f8578063715018a6116101b2578063715018a6146103ec57806372319cb3146103f4578063775dca2d1461040757806379ba50971461041a578063870d21b91461042257806388338f021461045b575f80fd5b80634e71d92d1461038d5780635ce60c6a146103955780635d3590d5146103a8578063626a9b26146103bb5780636a278077146103d157806370a08231146103d9575f80fd5b80632b1c2fd2116102495780632b1c2fd2146102f4578063313ce5671461030957806334d578c814610328578063378b070a1461033b578063387e45121461034e57806344c9af2814610361575f80fd5b806306fdde0314610285578063095ea7b3146102a357806318160ddd146102c657806323b872dd146102dc57806323eaa8e9146102ea575b5f80fd5b61028d610677565b60405161029a9190612f11565b60405180910390f35b6102b66102b1366004612f39565b610707565b604051901515815260200161029a565b6102ce610721565b60405190815260200161029a565b6102b66102b1366004612f61565b6102f2610737565b005b6102fc6107d0565b60405161029a9190612fd3565b600254600160a01b900460ff1660405160ff909116815260200161029a565b6102f2610336366004613029565b6107da565b6102b66103493660046130d0565b61084a565b6102ce61035c366004613100565b610893565b61037461036f366004613119565b610974565b60405161029a9d9c9b9a99989796959493929190613130565b6102f2610a05565b6102f26103a33660046131e9565b610a35565b6102b66103b6366004612f61565b610a72565b6103c3610b3e565b60405161029a929190613223565b6102f2610c09565b6102ce6103e7366004613100565b610c8e565b6102f2610d1e565b6102f2610402366004613119565b610d2f565b6102b6610415366004613119565b610d58565b6102f2610d70565b6008546040805160ff8084161515825261010084041615156020820152620100009092046001600160a01b03169082015260600161029a565b6102f26104693660046132c0565b610db6565b5f546001600160a01b03165b6040516001600160a01b03909116815260200161029a565b6102f26104a036600461332e565b610eaa565b6102f26104b3366004613382565b610eca565b61028d610edb565b6104d36104ce366004612f39565b610eea565b60405161029a979695949392919061339d565b6102f26104f4366004613119565b610f2a565b6102f2610f3b565b6102ce610fe5565b6102ce610517366004613474565b610fee565b610524610ff8565b60408051921515835260208301919091520161029a565b6102b66105493660046134f4565b611017565b6102f261055c366004613586565b61112c565b6102b661056f3660046130d0565b6111c0565b61057c61125b565b6040805193151584526001600160a01b03909216602084015260ff169082015260600161029a565b6105b76105b2366004613119565b61129d565b604080519889526020890197909752958701949094526060860192909252608085015260a084015260c083015260e08201526101000161029a565b6102ce6106003660046135ca565b5f92915050565b6001546001600160a01b031661047a565b6102f2610626366004613100565b6112f4565b6102f2610639366004613100565b611364565b6102f261064c3660046135fb565b6113ec565b6102f261065f366004613119565b6113fe565b6102f2610672366004613119565b611423565b6060600580546106869061365a565b80601f01602080910402602001604051908101604052809291908181526020018280546106b29061365a565b80156106fd5780601f106106d4576101008083540402835291602001916106fd565b820191905f5260205f20905b8154815290600101906020018083116106e057829003601f168201915b5050505050905090565b5f60405163fcbca50d60e01b815260040160405180910390fd5b5f600d54600c5461073291906136a0565b905090565b61073f6114b2565b6010546001600160a01b03166107685760405163244ae88d60e21b815260040160405180910390fd5b601054600160a01b900460ff16156107935760405163267f2a4d60e01b815260040160405180910390fd5b6010805460ff60a01b1916600160a01b1790556040517f83ce2e1115b4c119eafc8683693f7b2d2547a1c0d55d069ec8284a391dc678fb905f90a1565b60606107326114de565b6107e2611533565b6107ff576040516378ac935160e11b815260040160405180910390fd5b6108076114b2565b5f5b815181101561084657610834828281518110610827576108276136b3565b6020026020010151611560565b8061083e816136c7565b915050610809565b5050565b5f6108536114b2565b61085e8484846116ec565b61086661181e565b1561088857600854610888906201000090046001600160a01b0316835f611866565b5060015b9392505050565b5f806108a76002546001600160a01b031690565b9050806001600160a01b0316836001600160a01b031603610965575f600d54600c546108d391906136a0565b6040516370a0823160e01b81523060048201529091505f906001600160a01b038616906370a0823190602401602060405180830381865afa15801561091a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061093e91906136df565b90508082111561095257505f949350505050565b61095c82826136a0565b95945050505050565b61088c83611a10565b50919050565b5f805f805f805f8060608060608060608d5f0361098f57429d505b600354600854601054600b54929f5060ff600160b01b90920482169e506001600160a01b0381169d50600160a01b9004169a5098506109cc6114de565b90506109d8818f611a91565b809850819950829a50839b50849c50859d50869e505050505050505091939597999b9d90929496989a9c50565b610a0d611533565b610a2a576040516378ac935160e11b815260040160405180910390fd5b610a3333611560565b565b610a3d6114b2565b600154600160a01b900460ff1615610a68576040516303ed52c560e41b815260040160405180910390fd5b6108468282611cdb565b5f610a7b6114b2565b610a83611d6c565b6001600160a01b038416610aaa576040516311d000e160e31b815260040160405180910390fd5b5f610ab484610893565b905080831115610ad7576040516305d632b960e41b815260040160405180910390fd5b610ae2858585611d96565b836001600160a01b0316856001600160a01b03167f13e06184555481b6d2cb327155e8d2e1d0b1f0252a7fe6621e32cf998814883585604051610b2791815260200190565b60405180910390a3600191505061088c6001600755565b606080610b496114de565b8051909250806001600160401b03811115610b6657610b66612fe5565b604051908082528060200260200182016040528015610b9f57816020015b610b8c612e87565b815260200190600190039081610b845790505b5091505f5b81811015610c03575f848281518110610bbf57610bbf6136b3565b60200260200101519050610bd281611dcb565b848381518110610be457610be46136b3565b6020026020010181905250508080610bfb906136c7565b915050610ba4565b50509091565b610c116114b2565b6003545f03610c33576040516314820df960e31b815260040160405180910390fd5b60045460ff1615610c575760405163580470f360e01b815260040160405180910390fd5b6004805460ff191660011790556040517fa9face7abb12e88f4172e5dcf0d6b240dbb29e02cb155a6b614a2afcc285007a905f90a1565b5f805f80610c9a6114de565b80519091505f5b81811015610d09575f838281518110610cbc57610cbc6136b3565b602002602001015190505f610cd18983611e40565b8051909150610ce090886136f6565b9650806020015186610cf291906136f6565b955050508080610d01906136c7565b915050610ca1565b50610d1483856136a0565b9695505050505050565b610d266114b2565b610a335f611e8b565b610d376114b2565b600854610d55906201000090046001600160a01b0316826001611866565b50565b5f818152600a602052604081205460ff165b92915050565b60015433906001600160a01b03168114610dad5760405163118cdaa760e01b81526001600160a01b03821660048201526024015b60405180910390fd5b610d5581611e8b565b610dbe6114b2565b5f5b81811015610ea557610e93838383818110610ddd57610ddd6136b3565b905060e002015f0135848484818110610df857610df86136b3565b905060e0020160200135858585818110610e1457610e146136b3565b905060e0020160400135868686818110610e3057610e306136b3565b905060e0020160600135878787818110610e4c57610e4c6136b3565b905060e0020160800135888888818110610e6857610e686136b3565b905060e0020160a00135898989818110610e8457610e846136b3565b905060e0020160c00135611ea4565b80610e9d816136c7565b915050610dc0565b505050565b610eb26114b2565b610ec187878787878787611ea4565b50505050505050565b610ed26114b2565b610d5581612000565b6060600680546106869061365a565b5f805f606080606080875f03610efe574297505b610f066114de565b9050610f13818a8a61204d565b949e939d50919b5099509750909550909350915050565b610f326114b2565b610d558161223a565b5f610f4e6002546001600160a01b031690565b6001600160a01b031603610f755760405163488afa1b60e01b815260040160405180910390fd5b610f7d6114b2565b600154600160a01b900460ff1615610fa8576040516303ed52c560e41b815260040160405180910390fd5b6001805460ff60a01b1916600160a01b1790556040517f9efd8729cc972ca7884de34bbf48c2823c0d69fda2946916c65311c81c4c52c3905f90a1565b5f610732612378565b5f610d6a82612463565b5f8061100660045460ff1690565b915061101160035490565b90509091565b5f6110206114b2565b8584811415806110305750828114155b1561104e576040516328e7033560e01b815260040160405180910390fd5b5f805b828110156110f2576110ba88888381811061106e5761106e6136b3565b90506020020160208101906110839190613100565b8b8b84818110611095576110956136b3565b905060200201358888858181106110ae576110ae6136b3565b905060200201356116ec565b8585828181106110cc576110cc6136b3565b90506020020135826110de91906136f6565b9150806110ea816136c7565b915050611051565b506110fb61181e565b1561111d5760085461111d906201000090046001600160a01b0316825f611866565b50600198975050505050505050565b6111346114b2565b600880546001600160a01b03831662010000810262010000600160b01b0319861515610100810261ff00198a151590811661ffff19909716969096171791909116919091179093556040805192835260208301939093528183015290517f50b79656a78699922c8e6b849547e537405150f0f9201355537f858f793118969181900360600190a1505050565b6010545f906001600160a01b03166111eb5760405163244ae88d60e21b815260040160405180910390fd5b6010546001600160a01b03163314611216576040516354bff84560e11b815260040160405180910390fd5b61121e61181e565b1561124057600854611240906201000090046001600160a01b0316835f611866565b61088884611255611250866124c3565b612463565b846116ec565b5f805f61127260015460ff600160a01b9091041690565b92506112866002546001600160a01b031690565b600254909250600160a01b900460ff169050909192565b5f805f805f805f805f6112af8a611dcb565b9050805f01519850806020015197508060400151965080606001519550806080015194508060a0015193508060c0015192508060e00151915050919395975091939597565b6112fc6114b2565b600180546001600160a01b0383166001600160a01b0319909116811790915561132c5f546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b61136c6114b2565b601054600160a01b900460ff16156113975760405163267f2a4d60e01b815260040160405180910390fd5b601080546001600160a01b0319166001600160a01b0383169081179091556040519081527f26eb89b286b88bc18cc22adf8329bb32f84b5f1ad41e2a73c2e41e2414c8af1b906020015b60405180910390a150565b6113f46114b2565b6108468282612552565b6114066114b2565b600854610d55906201000090046001600160a01b0316825f611866565b61142b6114b2565b5f61143560035490565b90505f811180156114465750804210155b1561146457604051634a11eab560e11b815260040160405180910390fd5b8142111561148557604051639cf1fc4360e01b815260040160405180910390fd5b60045460ff16156114a95760405163580470f360e01b815260040160405180910390fd5b6108468261259d565b5f546001600160a01b03163314610a335760405163118cdaa760e01b8152336004820152602401610da4565b606060098054806020026020016040519081016040528092919081815260200182805480156106fd57602002820191905f5260205f20905b815481526020019060010190808311611516575050505050905090565b5f8061153e60035490565b905080158061154c57508042105b15611558575f91505090565b600191505090565b5f6115736002546001600160a01b031690565b6001600160a01b03160361159a5760405163488afa1b60e01b815260040160405180910390fd5b5f6115a36114de565b90505f805f806115b485874261204d565b955095505094509450505f848411156115d4576115d185856136a0565b90505b8015610ec1576115e26125d2565b1561160457600854611604906201000090046001600160a01b0316825f611866565b5f6116176002546001600160a01b031690565b87519091505f5b818110156116e0575f868281518110611639576116396136b3565b6020026020010151868381518110611653576116536136b3565b602002602001015111156116a257868281518110611673576116736136b3565b602002602001015186838151811061168d5761168d6136b3565b602002602001015161169f91906136a0565b90505b80156116cd576116cd8b8b84815181106116be576116be6136b3565b60200260200101518684612610565b50806116d8816136c7565b91505061161e565b50505050505050505050565b816116f6816126ee565b81600c5f82825461170791906136f6565b90915550505f838152600e60205260408120600101805484929061172c9084906136f6565b90915550505f838152600e60205260409020805460019091015411156117685760405163740d40df60e11b815260048101849052602401610da4565b6001600160a01b0384165f908152600f602090815260408083208684529091528120805484929061179a9084906136f6565b909155506117aa9050848361271f565b82846001600160a01b03167f442efa2766c5ddd5b30bb99d040f10fc109f18c0165a7156fda6d650116d25e4846040516117e691815260200190565b60405180910390a3600854600160b01b900460ff16801561180a575061180a611533565b156118185761181884611560565b50505050565b6008545f9060ff16801561183a5750600854610100900460ff16155b801561185657506008546201000090046001600160a01b031615155b156118615750600190565b505f90565b5f811561187c5761187561272a565b9050611887565b611884612378565b90505b805f036118945750505050565b8215806118a057508083115b156118a9578092505b5f6118bc6002546001600160a01b031690565b6040516370a0823160e01b81523060048201529091505f906001600160a01b038316906370a0823190602401602060405180830381865afa158015611903573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061192791906136df565b905061193e6001600160a01b038316873088612776565b6040516370a0823160e01b81523060048201525f9082906001600160a01b038516906370a0823190602401602060405180830381865afa158015611984573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119a891906136df565b6119b291906136a0565b90508581146119d457604051632160733960e01b815260040160405180910390fd5b6040518681527fac3d9837a679b12a12c0a3b0d0c20e8bf132403b05d76f80de8f4aec36297ed39060200160405180910390a150505050505050565b5f6001600160a01b038216611a26575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa158015611a68573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d6a91906136df565b919050565b5f805f6060806060805f89519050806001600160401b03811115611ab757611ab7612fe5565b604051908082528060200260200182016040528015611ae0578160200160208202803683370190505b509450806001600160401b03811115611afb57611afb612fe5565b604051908082528060200260200182016040528015611b24578160200160208202803683370190505b509350806001600160401b03811115611b3f57611b3f612fe5565b604051908082528060200260200182016040528015611b68578160200160208202803683370190505b509250806001600160401b03811115611b8357611b83612fe5565b604051908082528060200260200182016040528015611bac578160200160208202803683370190505b5091505f5b81811015611ccd575f8b8281518110611bcc57611bcc6136b3565b602002602001015190505f611be082611dcb565b9050805f0151888481518110611bf857611bf86136b3565b60200260200101818152505080602001515f03611c16575050611cbb565b6020810151611c25908c6136f6565b9a5080604001518a611c3791906136f6565b99508060200151878481518110611c5057611c506136b3565b6020026020010181815250508060400151868481518110611c7357611c736136b3565b6020026020010181815250505f611c8a828e6127dd565b9050611c96818b6136f6565b995080868581518110611cab57611cab6136b3565b6020026020010181815250505050505b80611cc5816136c7565b915050611bb1565b505092959891949750929550565b8060ff165f03611cfe57604051638bd9be8160e01b815260040160405180910390fd5b600280546001600160a01b0384166001600160a81b03199091168117600160a01b60ff8516908102919091179092556040805191825260208201929092527fc9cbf5af9e78df9093a676978e83f2a04e258ad3b0d8fa81cb44b357c657606a91015b60405180910390a15050565b600260075403611d8f57604051633ee5aeb560e01b815260040160405180910390fd5b6002600755565b6001600160a01b038216611db757610ea56001600160a01b03841682612937565b610ea56001600160a01b03831684836129ca565b611dd3612e87565b505f908152600e6020908152604091829020825161010081018452815481526001820154928101929092526002810154928201929092526003820154606082015260048201546080820152600582015460a0820152600682015460c082015260079091015460e082015290565b6040805180820182525f80825260209182018190526001600160a01b03949094168452600f815281842092845291825291829020825180840190935280548352600101549082015290565b600180546001600160a01b0319169055610d55816129fb565b612710821115611ec757604051635e19109b60e11b815260040160405180910390fd5b5f878152600a602052604090205460ff16611f26576009805460018181019092557f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af018890555f888152600a60205260409020805460ff191690911790555b5f878152600e602052604090206001810154871015611f5b5760405163e5dc5dd160e01b815260048101899052602401610da4565b8054600b548891611f6b916136a0565b611f7591906136f6565b600b5586815560038101869055600481018590556005810184905560068101839055600781018290556040805188815260208101889052908101869052606081018590526080810184905260a0810183905288907f9808fccf72b3838467b4d6e05a69ed49015c751a41dd7a2b5a2873d670dc604b9060c00160405180910390a25050505050505050565b60088054821515600160b01b0260ff60b01b199091161790556040517ff3acf3314d01b12d4c4389b535183114d53a183bea98bba7cd9cf15e0579e574906113e190831515815260200190565b5f805f60608060605f89519050806001600160401b0381111561207257612072612fe5565b60405190808252806020026020018201604052801561209b578160200160208202803683370190505b509350806001600160401b038111156120b6576120b6612fe5565b6040519080825280602002602001820160405280156120df578160200160208202803683370190505b509250806001600160401b038111156120fa576120fa612fe5565b604051908082528060200260200182016040528015612123578160200160208202803683370190505b5091505f5b8181101561222c575f8b8281518110612143576121436136b3565b602002602001015190505f61215782611dcb565b90505f6121648d84611e40565b80519091505f036121775750505061221a565b8051612183908c6136f6565b9a5080602001518a61219591906136f6565b9950805f01518885815181106121ad576121ad6136b3565b60200260200101818152505080602001518785815181106121d0576121d06136b3565b6020026020010181815250505f6121e883838f612a4a565b90506121f4818b6136f6565b995080878681518110612209576122096136b3565b602002602001018181525050505050505b80612224816136c7565b915050612128565b505093975093979195509350565b5f61224482611dcb565b60208101519091501561226a57604051630b264bd160e11b815260040160405180910390fd5b5f6122736114de565b90505f6122808483612ba1565b90505f6001835161229191906136a0565b90505f600982815481106122a7576122a76136b3565b905f5260205f200154905080600984815481106122c6576122c66136b3565b5f9182526020909120015560098054806122e2576122e2613709565b5f828152602080822083015f19908101839055909201909255878252600e81526040808320838155600181018490556002810184905560038101849055600481018490556005810184905560068101849055600701839055600a909152808220805460ff191690555187917f942d33c1dfdb36d99cd34b1cd5b7e23475f8ad367770b9df46cc203d6475aa6891a2505050505050565b5f8061238c6002546001600160a01b031690565b6001600160a01b0316036123b35760405163488afa1b60e01b815260040160405180910390fd5b5f600d54600c546123c491906136a0565b90505f6123d96002546001600160a01b031690565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa15801561241d573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061244191906136df565b9050818110612452575f9250505090565b61245c81836136a0565b9250505090565b5f6001826040516020016124779190612f11565b604051602081830303815290604052805190602001205f1c61249991906136a0565b6040516020016124ab91815260200190565b604051602081830303815290604052610d6a9061371d565b60605f6124cf83612c03565b60010190505f816001600160401b038111156124ed576124ed612fe5565b6040519080825280601f01601f191660200182016040528015612517576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461252157509392505050565b600561255e838261378d565b50600661256b828261378d565b507f747848b12b97bee94e04890126462b58ce70550d943de0dea8702fb4484352dc8282604051611d60929190613848565b60038190556040518181527f6de97eb9b2c91c4ed87da2828a7611ff87b192b8ca8a23833fa9fa4347eb3971906020016113e1565b6008545f9060ff16801561183a5750600854610100900460ff16801561185657506008546201000090046001600160a01b0316156118615750600190565b80600d5f82825461262191906136f6565b90915550505f838152600e6020526040812060020180548392906126469084906136f6565b90915550506001600160a01b0384165f908152600f60209081526040808320868452909152812060010180548392906126809084906136f6565b9091555061269090508482612cda565b6126a46001600160a01b03831685836129ca565b82846001600160a01b03167fe689ace1e68655b05d496b4d3ee7f7e5ba602cb088fe9835988349b6aff1b309836040516126e091815260200190565b60405180910390a350505050565b5f818152600a602052604090205460ff16610d555760405163fd05076760e01b815260048101829052602401610da4565b6108465f8383612ce1565b5f8061273e6002546001600160a01b031690565b6001600160a01b0316036127655760405163488afa1b60e01b815260040160405180910390fd5b5f600d54600b546123c491906136a0565b6040516001600160a01b0384811660248301528381166044830152606482018390526118189186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050612d33565b5f806127e860035490565b90508015806127f657508083105b156128015750610d6a565b5f6127108560c001518660200151612819919061386c565b6128239190613883565b90505f81866020015161283691906136a0565b905061284282856136f6565b93505f86606001518461285591906136f6565b9050808610156128685750505050610d6a565b5f87608001518261287991906136f6565b90508087101561288d575050505050610d6a565b5f8860a001518361289e91906136f6565b90508088106128b95788602001519650505050505050610d6a565b81881061292b575f6128cb848a6136a0565b60e08b0151909150156128ff575f8a60e00151826128e99190613883565b90508a60e00151816128fb919061386c565b9150505b60a08a01515f90612910838861386c565b61291a9190613883565b9050612926818a6136f6565b985050505b50505050505092915050565b8047101561295a5760405163cd78605960e01b8152306004820152602401610da4565b5f826001600160a01b0316826040515f6040518083038185875af1925050503d805f81146129a3576040519150601f19603f3d011682016040523d82523d5f602084013e6129a8565b606091505b5050905080610ea557604051630a12f52160e11b815260040160405180910390fd5b6040516001600160a01b03838116602483015260448201839052610ea591859182169063a9059cbb906064016127ab565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f80612a5560035490565b9050801580612a6357508083105b15612a6e575061088c565b5f6127108660c00151865f0151612a85919061386c565b612a8f9190613883565b90505f81865f0151612aa191906136a0565b9050612aad82856136f6565b93505f876060015184612ac091906136f6565b905080861015612ad3575050505061088c565b5f886080015182612ae491906136f6565b905080871015612af857505050505061088c565b5f8960a0015183612b0991906136f6565b9050808810612b225750508651945061088c9350505050565b818810612b94575f612b34848a6136a0565b60e08c015190915015612b68575f8b60e0015182612b529190613883565b90508b60e0015181612b64919061386c565b9150505b60a08b01515f90612b79838861386c565b612b839190613883565b9050612b8f818a6136f6565b985050505b5050505050509392505050565b5f805b8251811015612be65783838281518110612bc057612bc06136b3565b602002602001015103612bd4579050610d6a565b80612bde816136c7565b915050612ba4565b5060405163fd05076760e01b815260048101849052602401610da4565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612c415772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c6d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c8b57662386f26fc10000830492506010015b6305f5e1008310612ca3576305f5e100830492506008015b6127108310612cb757612710830492506004015b60648310612cc9576064830492506002015b600a8310610d6a5760010192915050565b610846825f835b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612d2691815260200190565b60405180910390a3505050565b5f612d476001600160a01b03841683612d94565b905080515f14158015612d6b575080806020019051810190612d6991906138a2565b155b15610ea557604051635274afe760e01b81526001600160a01b0384166004820152602401610da4565b606061088c83835f845f80856001600160a01b03168486604051612db891906138bd565b5f6040518083038185875af1925050503d805f8114612df2576040519150601f19603f3d011682016040523d82523d5f602084013e612df7565b606091505b5091509150610d14868383606082612e1757612e1282612e5e565b61088c565b8151158015612e2e57506001600160a01b0384163b155b15612e5757604051639996b31560e01b81526001600160a01b0385166004820152602401610da4565b508061088c565b805115612e6e5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518061010001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81526020015f81525090565b5f5b83811015612ede578181015183820152602001612ec6565b50505f910152565b5f8151808452612efd816020860160208601612ec4565b601f01601f19169290920160200192915050565b602081525f61088c6020830184612ee6565b80356001600160a01b0381168114611a8c575f80fd5b5f8060408385031215612f4a575f80fd5b612f5383612f23565b946020939093013593505050565b5f805f60608486031215612f73575f80fd5b612f7c84612f23565b9250612f8a60208501612f23565b9150604084013590509250925092565b5f8151808452602080850194508084015f5b83811015612fc857815187529582019590820190600101612fac565b509495945050505050565b602081525f61088c6020830184612f9a565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561302157613021612fe5565b604052919050565b5f602080838503121561303a575f80fd5b82356001600160401b0380821115613050575f80fd5b818501915085601f830112613063575f80fd5b81358181111561307557613075612fe5565b8060051b9150613086848301612ff9565b818152918301840191848101908884111561309f575f80fd5b938501935b838510156130c4576130b585612f23565b825293850193908501906130a4565b98975050505050505050565b5f805f606084860312156130e2575f80fd5b6130eb84612f23565b95602085013595506040909401359392505050565b5f60208284031215613110575f80fd5b61088c82612f23565b5f60208284031215613129575f80fd5b5035919050565b8d81528c151560208201526001600160a01b038c1660408201528a151560608201528960808201528860a08201528760c08201528660e08201526101a06101008201525f6131826101a0830188612f9a565b8281036101208401526131958188612f9a565b90508281036101408401526131aa8187612f9a565b90508281036101608401526131bf8186612f9a565b90508281036101808401526131d48185612f9a565b9150509e9d5050505050505050505050505050565b5f80604083850312156131fa575f80fd5b61320383612f23565b9150602083013560ff81168114613218575f80fd5b809150509250929050565b5f604080835261323581840186612f9a565b8381036020858101919091528551808352868201928201905f5b818110156132b25784518051845284810151858501528681015187850152606080820151908501526080808201519085015260a0808201519085015260c0808201519085015260e09081015190840152938301936101009092019160010161324f565b509098975050505050505050565b5f80602083850312156132d1575f80fd5b82356001600160401b03808211156132e7575f80fd5b818501915085601f8301126132fa575f80fd5b813581811115613308575f80fd5b86602060e08302850101111561331c575f80fd5b60209290920196919550909350505050565b5f805f805f805f60e0888a031215613344575f80fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b8015158114610d55575f80fd5b5f60208284031215613392575f80fd5b813561088c81613375565b87815286602082015285604082015260e060608201525f6133c160e0830187612f9a565b82810360808401526133d38187612f9a565b905082810360a08401526133e78186612f9a565b905082810360c08401526133fb8185612f9a565b9a9950505050505050505050565b5f82601f830112613418575f80fd5b81356001600160401b0381111561343157613431612fe5565b613444601f8201601f1916602001612ff9565b818152846020838601011115613458575f80fd5b816020850160208301375f918101602001919091529392505050565b5f60208284031215613484575f80fd5b81356001600160401b03811115613499575f80fd5b6134a584828501613409565b949350505050565b5f8083601f8401126134bd575f80fd5b5081356001600160401b038111156134d3575f80fd5b6020830191508360208260051b85010111156134ed575f80fd5b9250929050565b5f805f805f8060608789031215613509575f80fd5b86356001600160401b038082111561351f575f80fd5b61352b8a838b016134ad565b90985096506020890135915080821115613543575f80fd5b61354f8a838b016134ad565b90965094506040890135915080821115613567575f80fd5b5061357489828a016134ad565b979a9699509497509295939492505050565b5f805f60608486031215613598575f80fd5b83356135a381613375565b925060208401356135b381613375565b91506135c160408501612f23565b90509250925092565b5f80604083850312156135db575f80fd5b6135e483612f23565b91506135f260208401612f23565b90509250929050565b5f806040838503121561360c575f80fd5b82356001600160401b0380821115613622575f80fd5b61362e86838701613409565b93506020850135915080821115613643575f80fd5b5061365085828601613409565b9150509250929050565b600181811c9082168061366e57607f821691505b60208210810361096e57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b81810381811115610d6a57610d6a61368c565b634e487b7160e01b5f52603260045260245ffd5b5f600182016136d8576136d861368c565b5060010190565b5f602082840312156136ef575f80fd5b5051919050565b80820180821115610d6a57610d6a61368c565b634e487b7160e01b5f52603160045260245ffd5b8051602080830151919081101561096e575f1960209190910360031b1b16919050565b601f821115610ea5575f81815260208120601f850160051c810160208610156137665750805b601f850160051c820191505b8181101561378557828155600101613772565b505050505050565b81516001600160401b038111156137a6576137a6612fe5565b6137ba816137b4845461365a565b84613740565b602080601f8311600181146137ed575f84156137d65750858301515b5f19600386901b1c1916600185901b178555613785565b5f85815260208120601f198616915b8281101561381b578886015182559484019460019091019084016137fc565b508582101561383857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b604081525f61385a6040830185612ee6565b828103602084015261095c8185612ee6565b8082028115828204841417610d6a57610d6a61368c565b5f8261389d57634e487b7160e01b5f52601260045260245ffd5b500490565b5f602082840312156138b2575f80fd5b815161088c81613375565b5f82516138ce818460208701612ec4565b919091019291505056fea2646970667358221220e6e1097ca746d584df629a3f8ad702eec40ebc91a3c7420b1cf26a4e223b74b364736f6c63430008140033

Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.