ETH Price: $1,644.50 (+1.27%)
Gas: 0.37 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim222708002025-04-15 0:26:355 hrs ago1744676795IN
Truflation: TRUF Vesting
0 ETH0.000091830.92208937
Claim222657462025-04-14 7:30:2321 hrs ago1744615823IN
Truflation: TRUF Vesting
0 ETH0.000079980.96971472
Claim222644572025-04-14 3:11:5926 hrs ago1744600319IN
Truflation: TRUF Vesting
0 ETH0.000092970.93365707
Claim222601392025-04-13 12:45:5940 hrs ago1744548359IN
Truflation: TRUF Vesting
0 ETH0.000065980.8
Claim222580082025-04-13 5:38:1147 hrs ago1744522691IN
Truflation: TRUF Vesting
0 ETH0.000081820.99210088
Claim222539252025-04-12 15:57:352 days ago1744473455IN
Truflation: TRUF Vesting
0 ETH0.000187991.88785366
Claim222535902025-04-12 14:50:232 days ago1744469423IN
Truflation: TRUF Vesting
0 ETH0.000378074.58452375
Claim222520632025-04-12 9:44:232 days ago1744451063IN
Truflation: TRUF Vesting
0 ETH0.000092810.93190914
Claim222513242025-04-12 7:16:112 days ago1744442171IN
Truflation: TRUF Vesting
0 ETH0.000077970.94539138
Claim222512332025-04-12 6:57:592 days ago1744441079IN
Truflation: TRUF Vesting
0 ETH0.000078270.94906704
Claim222482562025-04-11 21:01:473 days ago1744405307IN
Truflation: TRUF Vesting
0 ETH0.000049490.6
Claim222475912025-04-11 18:48:113 days ago1744397291IN
Truflation: TRUF Vesting
0 ETH0.000212892.2594602
Claim222475912025-04-11 18:48:113 days ago1744397291IN
Truflation: TRUF Vesting
0 ETH0.000189022.29181017
Claim222414982025-04-10 22:25:114 days ago1744323911IN
Truflation: TRUF Vesting
0 ETH0.000098590.99005949
Claim222387502025-04-10 13:12:354 days ago1744290755IN
Truflation: TRUF Vesting
0 ETH0.0018210522.07550297
Claim222386962025-04-10 13:01:474 days ago1744290107IN
Truflation: TRUF Vesting
0 ETH0.000500496.06810652
Claim222374422025-04-10 8:50:354 days ago1744275035IN
Truflation: TRUF Vesting
0 ETH0.000092091.11645689
Claim222359042025-04-10 3:42:235 days ago1744256543IN
Truflation: TRUF Vesting
0 ETH0.000109551.1
Claim222352362025-04-10 1:28:475 days ago1744248527IN
Truflation: TRUF Vesting
0 ETH0.000104261.04689071
Claim222346702025-04-09 23:35:235 days ago1744241723IN
Truflation: TRUF Vesting
0 ETH0.000103961.04406322
Claim222344792025-04-09 22:57:115 days ago1744239431IN
Truflation: TRUF Vesting
0 ETH0.000105051.27369461
Claim222336882025-04-09 20:17:595 days ago1744229879IN
Truflation: TRUF Vesting
0 ETH0.000322453.2381782
Claim222322572025-04-09 15:31:235 days ago1744212683IN
Truflation: TRUF Vesting
0 ETH0.000108951.32114537
Claim222321562025-04-09 15:10:595 days ago1744211459IN
Truflation: TRUF Vesting
0 ETH0.000132341.60432697
Claim222320042025-04-09 14:40:115 days ago1744209611IN
Truflation: TRUF Vesting
0 ETH0.000100932.4109152
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TrufVesting

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 9 : TrufVesting.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.25;

import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IVotingEscrow} from "../interfaces/IVotingEscrow.sol";

/**
 * @title TRUF vesting contract
 * @author Ryuhei Matsuda
 * @notice Admin registers vesting information for users,
 *      and users could claim or lock vesting to veTRUF to get voting power and TRUF staking rewards
 */
contract TrufVesting is Ownable2Step {
    using SafeERC20 for IERC20;

    error ZeroAddress();
    error ZeroAmount();
    error Forbidden(address sender);
    error InvalidTimestamp();
    error InvalidAmount();
    error InvalidVestingCategory(uint256 id);
    error InvalidEmissions();
    error InvalidVestingInfo(uint256 categoryIdx, uint256 id);
    error InvalidUserVesting();
    error ClaimAmountExceed();
    error UserVestingAlreadySet(uint256 categoryIdx, uint256 vestingId, address user);
    error UserVestingDoesNotExists(uint256 categoryIdx, uint256 vestingId, address user);
    error MaxAllocationExceed();
    error AlreadyVested(uint256 categoryIdx, uint256 vestingId, address user);
    error LockExist();
    error LockDoesNotExist();
    error InvalidInitialReleasePct();
    error InvalidInitialReleasePeriod();
    error InvalidCliff();
    error InvalidPeriod();
    error InvalidUnit();
    error Initialized();

    /// @dev Emitted when vesting category is set
    event VestingCategorySet(uint256 indexed id, string category, uint256 maxAllocation, bool adminClaimable);

    /// @dev Emitted when emission schedule is set
    event EmissionScheduleSet(uint256 indexed categoryId, uint256[] emissions);

    /// @dev Emitted when vesting info is set
    event VestingInfoSet(uint256 indexed categoryId, uint256 indexed id, VestingInfo info);

    /// @dev Emitted when user vesting info is set
    event UserVestingSet(
        uint256 indexed categoryId, uint256 indexed vestingId, address indexed user, uint256 amount, uint64 startTime
    );

    /// @dev Emitted when user vesting is migrated using the migrator contract.
    event UserVestingMigrated(
        uint256 indexed categoryId,
        uint256 indexed vestingId,
        address indexed user,
        uint256 amount,
        uint256 claimed,
        uint256 locked,
        uint64 startTime
    );

    /// @dev Emitted when admin migrates user's vesting to another address
    event MigrateUser(
        uint256 indexed categoryId, uint256 indexed vestingId, address prevUser, address newUser, uint256 newLockupId
    );

    /// @dev Emitted when admin cancel user's vesting
    event CancelVesting(
        uint256 indexed categoryId, uint256 indexed vestingId, address indexed user, bool giveUnclaimed
    );

    /// @dev Emitted when admin has been set
    event AdminSet(address indexed admin, bool indexed flag);

    /// @dev Emitted when user claimed vested TRUF tokens
    event Claimed(uint256 indexed categoryId, uint256 indexed vestingId, address indexed user, uint256 amount);

    /// @dev Emitted when veTRUF token has been set
    event VeTrufSet(address indexed veTRUF);

    /// @dev Emitted when user stakes vesting to veTRUF
    event Staked(
        uint256 indexed categoryId,
        uint256 indexed vestingId,
        address indexed user,
        uint256 amount,
        uint256 start,
        uint256 duration,
        uint256 lockupId
    );

    /// @dev Emitted when user extended veTRUF staking period or increased amount
    event ExtendedStaking(
        uint256 indexed categoryId, uint256 indexed vestingId, address indexed user, uint256 amount, uint256 duration
    );

    /// @dev Emitted when user unstakes from veTRUF
    event Unstaked(uint256 indexed categoryId, uint256 indexed vestingId, address indexed user, uint256 amount);

    /// @dev Vesting Category struct
    struct VestingCategory {
        string category; // Category name
        uint256 maxAllocation; // Maximum allocation for this category
        uint256 allocated; // Current allocated amount
        bool adminClaimable; // Allow admin to claim if value is true
        uint256 totalClaimed; // Total claimed amount
    }

    /// @dev Vesting info struct
    struct VestingInfo {
        uint64 initialReleasePct; // Initial Release percentage
        uint64 initialReleasePeriod; // Initial release period after TGE
        uint64 cliff; // Cliff period
        uint64 period; // Total period
        uint64 unit; // The period to claim. ex. monthly or 6 monthly
    }

    /// @dev User vesting info struct
    struct UserVesting {
        uint256 amount; // Total vesting amount
        uint256 claimed; // Total claimed amount
        uint256 locked; // Locked amount at VotingEscrow
        uint64 startTime; // Vesting start time
    }

    uint256 public constant DENOMINATOR = 1e18;
    uint64 public constant ONE_MONTH = 30 days;

    /// @dev Is category initialized
    mapping(uint256 => bool) public isInitialized;

    /// @dev TRUF token address
    IERC20 public immutable trufToken;

    /// @dev TRUF Migration contract address
    address public immutable trufMigrator;

    /// @dev veTRUF token address
    IVotingEscrow public veTRUF;

    /// @dev TGE timestamp
    uint64 public immutable tgeTime;

    /// @dev Vesting categories
    VestingCategory[] public categories;

    // @dev Emission schedule per category. x index item of array indicates emission limit on x+1 months after TGE time.
    mapping(uint256 => uint256[]) public emissionSchedule;

    /// @dev Vesting info per category
    mapping(uint256 => VestingInfo[]) public vestingInfos;

    /// @dev User vesting information (category => info => user address => user vesting)
    mapping(uint256 => mapping(uint256 => mapping(address => UserVesting))) public userVestings;

    /// @dev Vesting lockup ids (category => info => user address => lockup id)
    mapping(uint256 => mapping(uint256 => mapping(address => uint256))) public lockupIds;

    /// @dev True if account has admin permission
    mapping(address => bool) public isAdmin;

    modifier onlyAdmin() {
        if (!isAdmin[msg.sender] && msg.sender != owner()) {
            revert Forbidden(msg.sender);
        }
        _;
    }

    /**
     * @notice TRUF Vesting constructor
     * @param _trufToken TRUF token address
     */
    constructor(IERC20 _trufToken, address _trufMigrator, uint64 _tgeTime) {
        if (address(_trufToken) == address(0)) revert ZeroAddress();

        trufToken = _trufToken;
        trufMigrator = _trufMigrator;
        tgeTime = _tgeTime;
    }

    /**
     * @notice Calculate claimable amount (total vested amount - previously claimed amount - locked amount)
     * @param categoryId Vesting category id
     * @param vestingId Vesting id
     * @param user user address
     * @return claimableAmount Claimable amount
     */
    function claimable(uint256 categoryId, uint256 vestingId, address user)
        public
        view
        returns (uint256 claimableAmount)
    {
        if (isInitialized[categoryId] == false) revert Initialized();

        UserVesting memory userVesting = userVestings[categoryId][vestingId][user];

        VestingInfo memory info = vestingInfos[categoryId][vestingId];

        uint64 startTime = userVesting.startTime + info.initialReleasePeriod;

        if (startTime > block.timestamp) {
            return 0;
        }

        uint256 totalAmount = userVesting.amount;

        uint256 initialRelease = (totalAmount * info.initialReleasePct) / DENOMINATOR;

        startTime += info.cliff;

        uint256 vestedAmount;

        if (startTime > block.timestamp) {
            vestedAmount = initialRelease;
        } else {
            uint64 timeElapsed = ((uint64(block.timestamp) - startTime) / info.unit) * info.unit;

            vestedAmount = ((totalAmount - initialRelease) * timeElapsed) / info.period + initialRelease;
        }

        uint256 maxClaimable = userVesting.amount - userVesting.locked;
        if (vestedAmount > maxClaimable) {
            vestedAmount = maxClaimable;
        }
        if (vestedAmount <= userVesting.claimed) {
            return 0;
        }

        claimableAmount = vestedAmount - userVesting.claimed;
        uint256 emissionLeft = getEmission(categoryId) - categories[categoryId].totalClaimed;

        if (claimableAmount > emissionLeft) {
            claimableAmount = emissionLeft;
        }
    }

    /**
     * @notice Claim available amount
     * @dev Owner is able to claim for admin claimable categories.
     * @param user user account(For non-admin claimable categories, it must be msg.sender)
     * @param categoryId category id
     * @param vestingId vesting id
     * @param claimAmount token amount to claim
     */
    function claim(address user, uint256 categoryId, uint256 vestingId, uint256 claimAmount) public {
        if (isInitialized[categoryId] == false) revert Initialized();

        if (user != msg.sender && (!categories[categoryId].adminClaimable || !isAdmin[msg.sender])) {
            revert Forbidden(msg.sender);
        }

        uint256 claimableAmount = claimable(categoryId, vestingId, user);
        if (claimAmount == type(uint256).max) {
            claimAmount = claimableAmount;
        } else if (claimAmount > claimableAmount) {
            revert ClaimAmountExceed();
        }
        if (claimAmount == 0) {
            revert ZeroAmount();
        }

        categories[categoryId].totalClaimed += claimAmount;
        userVestings[categoryId][vestingId][user].claimed += claimAmount;
        trufToken.safeTransfer(user, claimAmount);

        emit Claimed(categoryId, vestingId, user, claimAmount);
    }

    /**
     * @notice Stake vesting to veTRUF to get voting power and get staking TRUF rewards
     * @param categoryId category id
     * @param vestingId vesting id
     * @param amount amount to stake
     * @param duration lock period in seconds
     */
    function stake(uint256 categoryId, uint256 vestingId, uint256 amount, uint256 duration) external {
        _stake(msg.sender, categoryId, vestingId, amount, block.timestamp, duration);
    }

    /**
     * @notice Extend veTRUF staking period and increase amount
     * @param categoryId category id
     * @param vestingId vesting id
     * @param amount token amount to increase
     * @param duration lock period from now
     */
    function extendStaking(uint256 categoryId, uint256 vestingId, uint256 amount, uint256 duration) external {
        if (isInitialized[categoryId] == false) revert Initialized();

        uint256 lockupId = lockupIds[categoryId][vestingId][msg.sender];
        if (lockupId == 0) {
            revert LockDoesNotExist();
        }

        if (amount != 0) {
            UserVesting storage userVesting = userVestings[categoryId][vestingId][msg.sender];

            if (amount > userVesting.amount - userVesting.claimed - userVesting.locked) {
                revert InvalidAmount();
            }

            userVesting.locked += amount;

            trufToken.safeIncreaseAllowance(address(veTRUF), amount);
        }
        veTRUF.extendVestingLock(msg.sender, lockupId - 1, amount, duration);

        emit ExtendedStaking(categoryId, vestingId, msg.sender, amount, duration);
    }

    /**
     * @notice Unstake vesting from veTRUF
     * @param categoryId category id
     * @param vestingId vesting id
     */
    function unstake(uint256 categoryId, uint256 vestingId) external {
        if (isInitialized[categoryId] == false) revert Initialized();

        uint256 lockupId = lockupIds[categoryId][vestingId][msg.sender];
        if (lockupId == 0) {
            revert LockDoesNotExist();
        }

        uint256 amount = veTRUF.unstakeVesting(msg.sender, lockupId - 1, false);

        UserVesting storage userVesting = userVestings[categoryId][vestingId][msg.sender];

        userVesting.locked -= amount;
        delete lockupIds[categoryId][vestingId][msg.sender];

        emit Unstaked(categoryId, vestingId, msg.sender, amount);
    }

    /**
     * @notice Migrate owner of vesting. Used when user lost his private key
     * @dev Only admin can migrate users vesting
     * @param categoryId Category id
     * @param vestingId Vesting id
     * @param prevUser previous user address
     * @param newUser new user address
     */
    function migrateUser(uint256 categoryId, uint256 vestingId, address prevUser, address newUser) external onlyAdmin {
        if (newUser == address(0)) {
            revert ZeroAddress();
        }

        UserVesting storage prevVesting = userVestings[categoryId][vestingId][prevUser];
        UserVesting storage newVesting = userVestings[categoryId][vestingId][newUser];

        if (newVesting.amount != 0) {
            revert UserVestingAlreadySet(categoryId, vestingId, newUser);
        }
        if (prevVesting.amount == 0) {
            revert UserVestingDoesNotExists(categoryId, vestingId, prevUser);
        }

        newVesting.amount = prevVesting.amount;
        newVesting.claimed = prevVesting.claimed;
        newVesting.startTime = prevVesting.startTime;

        uint256 lockupId = lockupIds[categoryId][vestingId][prevUser];
        uint256 newLockupId;

        if (lockupId != 0) {
            newLockupId = veTRUF.migrateVestingLock(prevUser, newUser, lockupId - 1) + 1;
            lockupIds[categoryId][vestingId][newUser] = newLockupId;
            delete lockupIds[categoryId][vestingId][prevUser];

            newVesting.locked = prevVesting.locked;
        }
        delete userVestings[categoryId][vestingId][prevUser];

        emit MigrateUser(categoryId, vestingId, prevUser, newUser, newLockupId);
    }

    /**
     * @notice Cancel vesting and force cancel from voting escrow
     * @dev Only admin can cancel users vesting
     * @param categoryId Category id
     * @param vestingId Vesting id
     * @param user user address
     * @param giveUnclaimed Send currently vested, but unclaimed amount to use or not
     */
    function cancelVesting(uint256 categoryId, uint256 vestingId, address user, bool giveUnclaimed)
        external
        onlyAdmin
    {
        UserVesting storage userVesting = userVestings[categoryId][vestingId][user];

        if (userVesting.amount == 0) {
            revert UserVestingDoesNotExists(categoryId, vestingId, user);
        }

        VestingInfo memory vestingInfo = vestingInfos[categoryId][vestingId];
        if (
            userVesting.startTime + vestingInfo.initialReleasePeriod + vestingInfo.cliff + vestingInfo.period
                <= block.timestamp
        ) {
            revert AlreadyVested(categoryId, vestingId, user);
        }

        uint256 lockupId = lockupIds[categoryId][vestingId][user];

        if (lockupId != 0) {
            veTRUF.unstakeVesting(user, lockupId - 1, true);
            delete lockupIds[categoryId][vestingId][user];
            userVesting.locked = 0;
        }

        VestingCategory storage category = categories[categoryId];

        uint256 claimableAmount = claimable(categoryId, vestingId, user);

        uint256 unvested = userVesting.amount - (userVesting.claimed + (giveUnclaimed ? claimableAmount : 0));

        delete userVestings[categoryId][vestingId][user];

        category.allocated -= unvested;

        if (giveUnclaimed && claimableAmount != 0) {
            trufToken.safeTransfer(user, claimableAmount);

            category.totalClaimed += claimableAmount;
            emit Claimed(categoryId, vestingId, user, claimableAmount);
        }

        emit CancelVesting(categoryId, vestingId, user, giveUnclaimed);
    }

    /**
     * @notice Add a new vesting category
     * @dev Only admin can add a vesting category
     * @param category new vesting category
     * @param maxAllocation Max allocation amount for this category
     * @param adminClaimable Admin claimable flag
     */
    function setVestingCategory(string calldata category, uint256 maxAllocation, bool adminClaimable)
        public
        onlyOwner
    {
        if (maxAllocation == 0) {
            revert ZeroAmount();
        }

        uint256 id = categories.length;
        categories.push(VestingCategory(category, maxAllocation, 0, adminClaimable, 0));

        emit VestingCategorySet(id, category, maxAllocation, adminClaimable);
    }

    /**
     * @notice Set emission schedule
     * @dev Only admin can set emission schedule
     * @param categoryId category id
     * @param emissions Emission schedule
     */
    function setEmissionSchedule(uint256 categoryId, uint256[] memory emissions) public onlyOwner {
        if (isInitialized[categoryId]) {
            revert Initialized();
        }

        uint256 maxAllocation = categories[categoryId].maxAllocation;

        if (emissions.length == 0 || emissions[emissions.length - 1] != maxAllocation) {
            revert InvalidEmissions();
        }

        delete emissionSchedule[categoryId];
        emissionSchedule[categoryId] = emissions;

        emit EmissionScheduleSet(categoryId, emissions);
    }

    /**
     * @notice Add or modify vesting information
     * @dev Only admin can set vesting info
     * @param categoryIdx category id
     * @param id id to modify or uint256.max to add new info
     * @param info new vesting info
     */
    function setVestingInfo(uint256 categoryIdx, uint256 id, VestingInfo calldata info) public onlyAdmin {
        if (info.initialReleasePct > DENOMINATOR) {
            revert InvalidInitialReleasePct();
        } else if (info.initialReleasePeriod > info.period) {
            revert InvalidInitialReleasePeriod();
        } else if (info.cliff > 365 days) {
            revert InvalidCliff();
        } else if (info.period > 8 * 365 days) {
            revert InvalidPeriod();
        } else if (info.period % info.unit != 0) {
            revert InvalidUnit();
        }
        if (id == type(uint256).max) {
            id = vestingInfos[categoryIdx].length;
            vestingInfos[categoryIdx].push(info);
        } else {
            vestingInfos[categoryIdx][id] = info;
        }

        emit VestingInfoSet(categoryIdx, id, info);
    }

    /**
     * @notice Migrate vesting from old contracts.
     * @param categoryId category id
     * @param vestingId vesting id
     * @param user user address
     * @param amount vesting amount
     * @param claimed vesting claimed amount
     * @param locked vesting locked amount, 0 if no staking
     * @param vestingStartTime zero to start from TGE or non-zero to set up custom start time
     * @param stakingStartTime timestamp where the staking began, 0 if no staking
     * @param stakingDuration duration of the staking, 0 if no staking
     */
    function migrate(
        uint256 categoryId,
        uint256 vestingId,
        address user,
        uint256 amount,
        uint256 claimed,
        uint256 locked,
        uint64 vestingStartTime,
        uint256 stakingStartTime,
        uint256 stakingDuration
    ) public {
        if (msg.sender != trufMigrator) {
            revert();
        }
        if (user == address(0)) {
            revert ZeroAddress();
        }
        if (amount == 0) {
            revert ZeroAmount();
        }
        if (categoryId >= categories.length) {
            revert InvalidVestingCategory(categoryId);
        }
        if (vestingId >= vestingInfos[categoryId].length) {
            revert InvalidVestingInfo(categoryId, vestingId);
        }
        if (isInitialized[categoryId]) {
            trufToken.safeTransferFrom(msg.sender, address(this), amount - claimed);
        } else if (locked > 0) {
            revert Initialized();
        }

        VestingCategory storage category = categories[categoryId];
        UserVesting storage userVesting = userVestings[categoryId][vestingId][user];

        if (amount < claimed + locked) {
            revert InvalidUserVesting();
        }

        category.allocated += amount;
        category.totalClaimed += claimed;
        if (category.allocated > category.maxAllocation) {
            revert MaxAllocationExceed();
        }

        if (vestingStartTime != 0 && vestingStartTime < tgeTime) revert InvalidTimestamp();

        userVesting.amount += amount;
        userVesting.claimed += claimed;
        userVesting.startTime = vestingStartTime == 0 ? tgeTime : vestingStartTime;

        emit UserVestingMigrated(categoryId, vestingId, user, amount, claimed, locked, userVesting.startTime);

        if (locked > 0) {
            _stake(user, categoryId, vestingId, locked, stakingStartTime, stakingDuration);
        }
    }

    /**
     * @notice Set user vesting amount
     * @dev Only admin can set user vesting
     * @dev It will be failed if it exceeds max allocation
     * @param categoryId category id
     * @param vestingId vesting id
     * @param user user address
     * @param startTime zero to start from TGE or non-zero to set up custom start time
     * @param amount vesting amount
     */
    function setUserVesting(uint256 categoryId, uint256 vestingId, address user, uint64 startTime, uint256 amount)
        public
        onlyAdmin
    {
        if (user == address(0)) {
            revert ZeroAddress();
        }
        if (amount == 0) {
            revert ZeroAmount();
        }
        if (categoryId >= categories.length) {
            revert InvalidVestingCategory(categoryId);
        }
        if (vestingId >= vestingInfos[categoryId].length) {
            revert InvalidVestingInfo(categoryId, vestingId);
        }

        VestingCategory storage category = categories[categoryId];
        UserVesting storage userVesting = userVestings[categoryId][vestingId][user];

        category.allocated += amount;
        category.allocated -= userVesting.amount;
        if (category.allocated > category.maxAllocation) {
            revert MaxAllocationExceed();
        }

        if (amount < userVesting.claimed + userVesting.locked) {
            revert InvalidUserVesting();
        }
        if (startTime != 0 && startTime < tgeTime) revert InvalidTimestamp();

        userVesting.amount = amount;
        userVesting.startTime = startTime == 0 ? tgeTime : startTime;

        emit UserVestingSet(categoryId, vestingId, user, amount, userVesting.startTime);
    }

    /**
     * @notice Set veTRUF token
     * @dev Only admin can set veTRUF
     * @param _veTRUF veTRUF token address
     */
    function setVeTruf(address _veTRUF) external onlyOwner {
        if (_veTRUF == address(0)) {
            revert ZeroAddress();
        }
        veTRUF = IVotingEscrow(_veTRUF);

        emit VeTrufSet(_veTRUF);
    }

    /**
     * @notice Set admin
     * @dev Only owner can set
     * @param _admin admin address
     * @param _flag true to set, false to remove
     */
    function setAdmin(address _admin, bool _flag) external onlyOwner {
        isAdmin[_admin] = _flag;

        emit AdminSet(_admin, _flag);
    }

    /**
     * @notice Initialize category by transferring TRUF tokens
     * @param _categoryId category to initialize
     */
    function initialize(uint256 _categoryId) external {
        if (isInitialized[_categoryId]) {
            revert Initialized();
        }

        isInitialized[_categoryId] = true;

        // Categories ID 0 and 7 have already been initialized previously and will be handled in `migrate` function.
        if (_categoryId != 0 && _categoryId != 7) {
            trufToken.safeTransferFrom(msg.sender, address(this), categories[_categoryId].maxAllocation);
        }
    }

    /**
     * @notice Multicall several functions in single transaction
     * @dev Could be for setting vesting categories, vesting info, and user vesting in single transaction at once
     * @param payloads list of payloads
     */
    function multicall(bytes[] calldata payloads) external {
        uint256 len = payloads.length;
        for (uint256 i; i < len;) {
            (bool success, bytes memory result) = address(this).delegatecall(payloads[i]);
            if (!success) {
                if (result.length < 68) revert();
                assembly {
                    result := add(result, 0x04)
                }
                revert(abi.decode(result, (string)));
            }

            unchecked {
                i += 1;
            }
        }
    }

    /**
     * @return emissions returns emission schedule of category
     */
    function getEmissionSchedule(uint256 categoryId) external view returns (uint256[] memory emissions) {
        emissions = emissionSchedule[categoryId];
    }

    /**
     * @return emissionLimit returns current emission limit of category
     */
    function getEmission(uint256 categoryId) public view returns (uint256 emissionLimit) {
        uint64 _tgeTime = tgeTime;

        if (block.timestamp >= _tgeTime) {
            uint256 maxAllocation = categories[categoryId].maxAllocation;

            if (emissionSchedule[categoryId].length == 0) {
                return maxAllocation;
            }
            uint64 elapsedTime = uint64(block.timestamp) - _tgeTime + ONE_MONTH;
            uint64 elapsedMonth = elapsedTime / ONE_MONTH;

            if (elapsedMonth >= emissionSchedule[categoryId].length) {
                return maxAllocation;
            }

            uint256 lastMonthEmission = elapsedMonth == 0 ? 0 : emissionSchedule[categoryId][elapsedMonth - 1];
            uint256 thisMonthEmission = emissionSchedule[categoryId][elapsedMonth];

            uint64 elapsedTimeOfLastMonth = elapsedTime % ONE_MONTH;
            emissionLimit =
                (thisMonthEmission - lastMonthEmission) * elapsedTimeOfLastMonth / ONE_MONTH + lastMonthEmission;
            if (emissionLimit > maxAllocation) {
                emissionLimit = maxAllocation;
            }
        }
    }

    /**
     * @notice Stake vesting to veTRUF to get voting power and get staking TRUF rewards
     * @param user user address
     * @param categoryId category id
     * @param vestingId vesting id
     * @param amount amount to stake
     * @param start lock start timestamp
     * @param duration lock period in seconds
     */
    function _stake(
        address user,
        uint256 categoryId,
        uint256 vestingId,
        uint256 amount,
        uint256 start,
        uint256 duration
    ) internal {
        if (isInitialized[categoryId] == false) revert Initialized();

        if (amount == 0) {
            revert ZeroAmount();
        }
        if (lockupIds[categoryId][vestingId][user] != 0) {
            revert LockExist();
        }

        UserVesting storage userVesting = userVestings[categoryId][vestingId][user];

        if (amount > userVesting.amount - userVesting.claimed - userVesting.locked) {
            revert InvalidAmount();
        }

        userVesting.locked += amount;

        trufToken.safeIncreaseAllowance(address(veTRUF), amount);
        uint256 lockupId = veTRUF.stakeVesting(amount, duration, user, start) + 1;
        lockupIds[categoryId][vestingId][user] = lockupId;

        emit Staked(categoryId, vestingId, user, amount, start, duration, lockupId);
    }
}

File 2 of 9 : Ownable2Step.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.0;

import "./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.
 *
 * By default, the owner account will be the one that deploys the contract. 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();
        require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner");
        _transferOwnership(sender);
    }
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
        }
    }

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

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

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

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

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

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

File 5 of 9 : IVotingEscrow.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.25;

interface IVotingEscrow {
    /// @dev Lockup struct
    struct Lockup {
        uint128 amount; // Locked amount
        uint128 duration; // Lock duration in seconds
        uint128 end; // Lock end timestamp in seconds
        uint256 points; // veTRUF points
        bool isVesting; // True if locked from vesting
    }

    function stakeVesting(uint256 amount, uint256 duration, address to, uint256 startTime) external returns (uint256 lockupId);

    function unstakeVesting(address user, uint256 lockupId, bool force) external returns (uint256 amount);

    function migrateVestingLock(address oldUser, address newUser, uint256 lockupId)
        external
        returns (uint256 newLockupId);

    function extendVestingLock(address user, uint256 lockupId, uint256 amount, uint256 duration) external;

    // Events
    /// Emitted when user staked TRUF or vesting
    event Stake(
        address indexed user, bool indexed isVesting, uint256 lockupId, uint256 amount, uint256 start, uint256 end, uint256 points
    );

    /// Emitted when user unstaked
    event Unstake(
        address indexed user, bool indexed isVesting, uint256 lockupId, uint256 amount, uint256 end, uint256 points
    );

    /// Emitted when lockup migrated to another user (for vesting only)
    event Migrated(address indexed oldUser, address indexed newUser, uint256 oldLockupId, uint256 newLockupId);

    /// Emitted when lockup cancelled (for vesting only)
    event Cancelled(address indexed user, uint256 lockupId, uint256 amount, uint256 points);
}

File 6 of 9 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

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

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

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

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

File 7 of 9 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
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].
     */
    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 8 of 9 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@uniswap/v2-periphery/=lib/uniswap-v2-periphery/contracts/",
    "murky/src/=lib/murky/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20","name":"_trufToken","type":"address"},{"internalType":"address","name":"_trufMigrator","type":"address"},{"internalType":"uint64","name":"_tgeTime","type":"uint64"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"categoryIdx","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"AlreadyVested","type":"error"},{"inputs":[],"name":"ClaimAmountExceed","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"Forbidden","type":"error"},{"inputs":[],"name":"Initialized","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCliff","type":"error"},{"inputs":[],"name":"InvalidEmissions","type":"error"},{"inputs":[],"name":"InvalidInitialReleasePct","type":"error"},{"inputs":[],"name":"InvalidInitialReleasePeriod","type":"error"},{"inputs":[],"name":"InvalidPeriod","type":"error"},{"inputs":[],"name":"InvalidTimestamp","type":"error"},{"inputs":[],"name":"InvalidUnit","type":"error"},{"inputs":[],"name":"InvalidUserVesting","type":"error"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"InvalidVestingCategory","type":"error"},{"inputs":[{"internalType":"uint256","name":"categoryIdx","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"InvalidVestingInfo","type":"error"},{"inputs":[],"name":"LockDoesNotExist","type":"error"},{"inputs":[],"name":"LockExist","type":"error"},{"inputs":[],"name":"MaxAllocationExceed","type":"error"},{"inputs":[{"internalType":"uint256","name":"categoryIdx","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"UserVestingAlreadySet","type":"error"},{"inputs":[{"internalType":"uint256","name":"categoryIdx","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"UserVestingDoesNotExists","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":true,"internalType":"bool","name":"flag","type":"bool"}],"name":"AdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"giveUnclaimed","type":"bool"}],"name":"CancelVesting","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"emissions","type":"uint256[]"}],"name":"EmissionScheduleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"ExtendedStaking","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":false,"internalType":"address","name":"prevUser","type":"address"},{"indexed":false,"internalType":"address","name":"newUser","type":"address"},{"indexed":false,"internalType":"uint256","name":"newLockupId","type":"uint256"}],"name":"MigrateUser","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":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockupId","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Unstaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimed","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"locked","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"startTime","type":"uint64"}],"name":"UserVestingMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"vestingId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"startTime","type":"uint64"}],"name":"UserVestingSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"veTRUF","type":"address"}],"name":"VeTrufSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"category","type":"string"},{"indexed":false,"internalType":"uint256","name":"maxAllocation","type":"uint256"},{"indexed":false,"internalType":"bool","name":"adminClaimable","type":"bool"}],"name":"VestingCategorySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"categoryId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint64","name":"initialReleasePct","type":"uint64"},{"internalType":"uint64","name":"initialReleasePeriod","type":"uint64"},{"internalType":"uint64","name":"cliff","type":"uint64"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint64","name":"unit","type":"uint64"}],"indexed":false,"internalType":"struct TrufVesting.VestingInfo","name":"info","type":"tuple"}],"name":"VestingInfoSet","type":"event"},{"inputs":[],"name":"DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_MONTH","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"bool","name":"giveUnclaimed","type":"bool"}],"name":"cancelVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"categories","outputs":[{"internalType":"string","name":"category","type":"string"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"},{"internalType":"uint256","name":"allocated","type":"uint256"},{"internalType":"bool","name":"adminClaimable","type":"bool"},{"internalType":"uint256","name":"totalClaimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"uint256","name":"claimAmount","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"claimableAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"emissionSchedule","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"extendStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"}],"name":"getEmission","outputs":[{"internalType":"uint256","name":"emissionLimit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"}],"name":"getEmissionSchedule","outputs":[{"internalType":"uint256[]","name":"emissions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_categoryId","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"lockupIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint64","name":"vestingStartTime","type":"uint64"},{"internalType":"uint256","name":"stakingStartTime","type":"uint256"},{"internalType":"uint256","name":"stakingDuration","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"prevUser","type":"address"},{"internalType":"address","name":"newUser","type":"address"}],"name":"migrateUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"payloads","type":"bytes[]"}],"name":"multicall","outputs":[],"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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"},{"internalType":"bool","name":"_flag","type":"bool"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256[]","name":"emissions","type":"uint256[]"}],"name":"setEmissionSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint64","name":"startTime","type":"uint64"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setUserVesting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_veTRUF","type":"address"}],"name":"setVeTruf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"category","type":"string"},{"internalType":"uint256","name":"maxAllocation","type":"uint256"},{"internalType":"bool","name":"adminClaimable","type":"bool"}],"name":"setVestingCategory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryIdx","type":"uint256"},{"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint64","name":"initialReleasePct","type":"uint64"},{"internalType":"uint64","name":"initialReleasePeriod","type":"uint64"},{"internalType":"uint64","name":"cliff","type":"uint64"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint64","name":"unit","type":"uint64"}],"internalType":"struct TrufVesting.VestingInfo","name":"info","type":"tuple"}],"name":"setVestingInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tgeTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"trufMigrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trufToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"categoryId","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userVestings","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"},{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint64","name":"startTime","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veTRUF","outputs":[{"internalType":"contract IVotingEscrow","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"vestingInfos","outputs":[{"internalType":"uint64","name":"initialReleasePct","type":"uint64"},{"internalType":"uint64","name":"initialReleasePeriod","type":"uint64"},{"internalType":"uint64","name":"cliff","type":"uint64"},{"internalType":"uint64","name":"period","type":"uint64"},{"internalType":"uint64","name":"unit","type":"uint64"}],"stateMutability":"view","type":"function"}]

60e060405234801561001057600080fd5b50604051613d62380380613d6283398101604081905261002f91610104565b61003833610083565b6001600160a01b03831661005f5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b03928316608052911660a0526001600160401b031660c05261015d565b600180546001600160a01b031916905561009c8161009f565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461009c57600080fd5b60008060006060848603121561011957600080fd5b8351610124816100ef565b6020850151909350610135816100ef565b60408501519092506001600160401b038116811461015257600080fd5b809150509250925092565b60805160a05160c051613b826101e06000396000818161037f0152818161081d015281816108890152818161092101528181611d9a0152611e370152600081816103df0152611b6501526000818161026001528181610e640152818161152701528181611c64015281816125130152818161280c0152612a880152613b826000f3fe608060405234801561001057600080fd5b506004361061021b5760003560e01c80638da5cb5b11610125578063d2673bbf116100ad578063ef15259f1161007c578063ef15259f14610598578063efc07c55146105ab578063f01e59d2146105f8578063f2fde38b1461060b578063fe4b84df1461061e57600080fd5b8063d2673bbf14610520578063d82fdf1c14610533578063d9a845d814610564578063e30c39781461058757600080fd5b8063b0ae4416116100f4578063b0ae4416146104b0578063c40552ac146104c3578063c6cdbe5e146104d6578063ce2fbd97146104fa578063ce93a8821461050d57600080fd5b80638da5cb5b1461046a578063918f86741461047b5780639e2c8a5b1461048a578063ac9650d81461049d57600080fd5b80634b0bddd2116101a857806377b1f7131161017757806377b1f71314610409578063784815661461041c57806379ba50971461042f5780638358a04814610437578063866d50071461044a57600080fd5b80634b0bddd2146103b45780634dcb2546146103c757806353126a8b146103da578063715018a61461040157600080fd5b806324d7806c116101ef57806324d7806c146102bc57806326f73a2e146102ef5780632d80e288146103675780633163e3a81461037a578063339f2b90146103a157600080fd5b8062b03e051461022057806303e7b4e91461023557806312c5422a1461025b57806320988cef1461029a575b600080fd5b61023361022e366004612fdd565b610631565b005b61024861024336600461302d565b61091d565b6040519081526020015b60405180910390f35b6102827f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610252565b6102a462278d0081565b6040516001600160401b039091168152602001610252565b6102df6102ca366004613046565b60096020526000908152604090205460ff1681565b6040519015158152602001610252565b61033e6102fd366004613061565b60076020908152600093845260408085208252928452828420905282529020805460018201546002830154600390930154919290916001600160401b031684565b604080519485526020850193909352918301526001600160401b03166060820152608001610252565b6102336103753660046130a4565b610adc565b6102a47f000000000000000000000000000000000000000000000000000000000000000081565b6102336103af366004613132565b610f3f565b6102336103c23660046131e3565b611068565b6102486103d5366004613061565b6110c4565b6102827f000000000000000000000000000000000000000000000000000000000000000081565b61023361137b565b61023361041736600461321a565b61138f565b600354610282906001600160a01b031681565b61023361159a565b610233610445366004613253565b611614565b61045d61045836600461302d565b611878565b6040516102529190613294565b6000546001600160a01b0316610282565b610248670de0b6b3a764000081565b6102336104983660046132d8565b6118da565b6102336104ab3660046132fa565b611a7c565b6102336104be36600461336e565b611b5a565b6102336104d13660046133e9565b611ef2565b6104e96104e436600461302d565b612020565b6040516102529594939291906134b8565b6102336105083660046134ef565b6120f5565b61023361051b366004613535565b6123fe565b61023361052e366004613535565b61240c565b610248610541366004613061565b600860209081526000938452604080852082529284528284209052825290205481565b6102df61057236600461302d565b60026020526000908152604090205460ff1681565b6001546001600160a01b0316610282565b6102336105a6366004613046565b612603565b6105be6105b93660046132d8565b61267c565b604080516001600160401b03968716815294861660208601529285169284019290925283166060830152909116608082015260a001610252565b6102486106063660046132d8565b6126e0565b610233610619366004613046565b612711565b61023361062c36600461302d565b612782565b3360009081526009602052604090205460ff1615801561065c57506000546001600160a01b03163314155b156106815760405163a59d7f4d60e01b81523360048201526024015b60405180910390fd5b6001600160a01b0383166106a85760405163d92e233d60e01b815260040160405180910390fd5b806000036106c957604051631f2a200560e01b815260040160405180910390fd5b60045485106106ee57604051630ef78d7d60e41b815260048101869052602401610678565b6000858152600660205260409020548410610726576040516366ee880560e01b81526004810186905260248101859052604401610678565b60006004868154811061073b5761073b613567565b600091825260208083208984526007825260408085208a865283528085206001600160a01b038a16865290925290832060059290920201600281018054919450919285929161078b908490613593565b909155505080546002830180546000906107a69084906135ac565b90915550506001820154600283015411156107d45760405163a4052f5760e01b815260040160405180910390fd5b806002015481600101546107e89190613593565b83101561080857604051630c07527360e31b815260040160405180910390fd5b6001600160401b0384161580159061085157507f00000000000000000000000000000000000000000000000000000000000000006001600160401b0316846001600160401b0316105b1561086f5760405163b7d0949760e01b815260040160405180910390fd5b8281556001600160401b0384161561088757836108a9565b7f00000000000000000000000000000000000000000000000000000000000000005b60038201805467ffffffffffffffff19166001600160401b039290921691821790556040805185815260208101929092526001600160a01b0387169188918a917f6efec3f1cc0e7e3f8127f9dff5d9ef4dd3c09342d44eec43e8160944f8e6366a910160405180910390a450505050505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160401b0381164210610ad65760006004848154811061096557610965613567565b600091825260208083206005928302016001015487845291905260408220549092509003610994579392505050565b600062278d006109a484426135bf565b6109ae91906135e6565b905060006109bf62278d008361361c565b6000878152600560205260409020549091506001600160401b038216106109ea575090949350505050565b60006001600160401b03821615610a3d576000878152600560205260409020610a146001846135bf565b6001600160401b031681548110610a2d57610a2d613567565b9060005260206000200154610a40565b60005b6000888152600560205260408120805492935090916001600160401b038516908110610a6e57610a6e613567565b60009182526020822001549150610a8862278d0086613642565b90508262278d006001600160401b038316610aa383866135ac565b610aad9190613668565b610ab7919061367f565b610ac19190613593565b975085881115610acf578597505b5050505050505b50919050565b3360009081526009602052604090205460ff16158015610b0757506000546001600160a01b03163314155b15610b275760405163a59d7f4d60e01b8152336004820152602401610678565b600084815260076020908152604080832086845282528083206001600160a01b038616845290915281208054909103610b8f576040516001620dfdb360e01b0319815260048101869052602481018590526001600160a01b0384166044820152606401610678565b6000858152600660205260408120805486908110610baf57610baf613567565b60009182526020918290206040805160a081018252600290930290910180546001600160401b038082168552600160401b82048116958501869052600160801b82048116938501849052600160c01b90910481166060850181905260019092015481166080850152600387015493955042949193610c2e9291166135e6565b610c3891906135e6565b610c4291906135e6565b6001600160401b031611610c8257604051633b96c3a160e21b815260048101879052602481018690526001600160a01b0385166044820152606401610678565b600086815260086020908152604080832088845282528083206001600160a01b03881684529091529020548015610d7a576003546001600160a01b031663bb1405df86610cd06001856135ac565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152600160448201526064016020604051808303816000875af1158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d469190613693565b50600087815260086020908152604080832089845282528083206001600160a01b0389168452909152812081905560028401555b600060048881548110610d8f57610d8f613567565b906000526020600020906005020190506000610dac8989896110c4565b9050600086610dbc576000610dbe565b815b8660010154610dcd9190613593565b8654610dd991906135ac565b60008b81526007602090815260408083208d845282528083206001600160a01b038d16845290915281208181556001810182905560028082018390556003909101805467ffffffffffffffff19169055850180549293508392909190610e409084906135ac565b909155508790508015610e5257508115155b15610eec57610e8b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168984612844565b81836004016000828254610e9f9190613593565b92505081905550876001600160a01b0316898b7fb94bf7f9302edf52a596286915a69b4b0685574cffdedd0712e3c62f2550f0ba85604051610ee391815260200190565b60405180910390a45b876001600160a01b0316898b7f29ff2b9c3d0121132b158b2f2dd19d17c3cb466efdfdbaa1ba7ee2c50fcc41728a604051610f2b911515815260200190565b60405180910390a450505050505050505050565b610f476128ac565b60008281526002602052604090205460ff1615610f77576040516302ed543d60e51b815260040160405180910390fd5b600060048381548110610f8c57610f8c613567565b9060005260206000209060050201600101549050815160001480610fd65750808260018451610fbb91906135ac565b81518110610fcb57610fcb613567565b602002602001015114155b15610ff457604051632238b26160e01b815260040160405180910390fd5b600083815260056020526040812061100b91612f2e565b6000838152600560209081526040909120835161102a92850190612f4c565b50827f91d1473fd427151d93d77055a94438bae10b534c81a00beb2931d6f81d4ac6e48360405161105b9190613294565b60405180910390a2505050565b6110706128ac565b6001600160a01b038216600081815260096020526040808220805460ff191685151590811790915590519092917fe68d2c359a771606c400cf8b87000cf5864010363d6a736e98f5047b7bbe18e991a35050565b60008381526002602052604081205460ff16151581036110f7576040516302ed543d60e51b815260040160405180910390fd5b600084815260076020908152604080832086845282528083206001600160a01b038616845282528083208151608081018352815481526001820154818501526002820154818401526003909101546001600160401b031660608201528784526006909252822080549192918690811061117257611172613567565b600091825260208083206040805160a081018252600290940290910180546001600160401b038082168652600160401b82048116948601859052600160801b8204811693860193909352600160c01b9004821660608086019190915260019091015490911660808401528501519193506111eb916135e6565b905042816001600160401b0316111561120a5760009350505050611374565b82518251600090670de0b6b3a76400009061122e906001600160401b031684613668565b611238919061367f565b905083604001518361124a91906135e6565b9250600042846001600160401b031611156112665750806112d6565b60808501516000908061127987426135bf565b611283919061361c565b61128d91906136ac565b90508286606001516001600160401b0316826001600160401b031685876112b491906135ac565b6112be9190613668565b6112c8919061367f565b6112d29190613593565b9150505b604086015186516000916112e9916135ac565b9050808211156112f7578091505b86602001518211611312576000975050505050505050611374565b602087015161132190836135ac565b9750600060048c8154811061133857611338613567565b9060005260206000209060050201600401546113538d61091d565b61135d91906135ac565b90508089111561136b578098505b50505050505050505b9392505050565b6113836128ac565b61138d6000612906565b565b60008381526002602052604081205460ff16151590036113c2576040516302ed543d60e51b815260040160405180910390fd5b6001600160a01b038416331480159061141c5750600483815481106113e9576113e9613567565b600091825260209091206003600590920201015460ff16158061141c57503360009081526009602052604090205460ff16155b1561143c5760405163a59d7f4d60e01b8152336004820152602401610678565b60006114498484876110c4565b9050600019820361145c5780915061147d565b8082111561147d576040516333ade54560e11b815260040160405180910390fd5b8160000361149e57604051631f2a200560e01b815260040160405180910390fd5b81600485815481106114b2576114b2613567565b906000526020600020906005020160040160008282546114d29190613593565b9091555050600084815260076020908152604080832086845282528083206001600160a01b038916845290915281206001018054849290611514908490613593565b9091555061154e90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168684612844565b846001600160a01b031683857fb94bf7f9302edf52a596286915a69b4b0685574cffdedd0712e3c62f2550f0ba8560405161158b91815260200190565b60405180910390a45050505050565b60015433906001600160a01b031681146116085760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610678565b61161181612906565b50565b3360009081526009602052604090205460ff1615801561163f57506000546001600160a01b03163314155b1561165f5760405163a59d7f4d60e01b8152336004820152602401610678565b670de0b6b3a764000061167560208301836136d7565b6001600160401b0316111561169d57604051634b8ce6a360e11b815260040160405180910390fd5b6116ad60808201606083016136d7565b6001600160401b03166116c660408301602084016136d7565b6001600160401b031611156116ee5760405163799547e960e11b815260040160405180910390fd5b6301e1338061170360608301604084016136d7565b6001600160401b0316111561172b57604051630a15cca960e21b815260040160405180910390fd5b630f099c0061174060808301606084016136d7565b6001600160401b03161115611768576040516302e8f35960e31b815260040160405180910390fd5b61177860a08201608083016136d7565b61178860808301606084016136d7565b6117929190613642565b6001600160401b0316156117b95760405163265f13bd60e21b815260040160405180910390fd5b60001982036117fa576000838152600660209081526040822080546001810182559083529120909250819060028402016117f38282613701565b505061183a565b600083815260066020526040902080548291908490811061181d5761181d613567565b906000526020600020906002020181816118379190613701565b50505b81837f03d87beedebfab89b17c593a654fdae3e6a916f19fb66ab32ad3d9ab2db5fa708360405161186b919061380b565b60405180910390a3505050565b6000818152600560209081526040918290208054835181840281018401909452808452606093928301828280156118ce57602002820191906000526020600020905b8154815260200190600101908083116118ba575b50505050509050919050565b60008281526002602052604081205460ff161515900361190d576040516302ed543d60e51b815260040160405180910390fd5b600082815260086020908152604080832084845282528083203384529091528120549081900361195057604051630b58543560e11b815260040160405180910390fd5b6003546000906001600160a01b031663bb1405df336119706001866135ac565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152600060448201526064016020604051808303816000875af11580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e69190613693565b6000858152600760209081526040808320878452825280832033845290915281206002810180549394509092849290611a209084906135ac565b909155505060008581526008602090815260408083208784528252808320338085529083528184209390935551848152869188917fb904b5088e8442bdbf73b7777734a35451036f567f8487e489c62d6bbb401255910161158b565b8060005b81811015611b545760008030868685818110611a9e57611a9e613567565b9050602002810190611ab0919061388b565b604051611abe9291906138d8565b600060405180830381855af49150503d8060008114611af9576040519150601f19603f3d011682016040523d82523d6000602084013e611afe565b606091505b509150915081611b4a57604481511015611b1757600080fd5b60048101905080806020019051810190611b3191906138e8565b60405162461bcd60e51b8152600401610678919061397b565b5050600101611a80565b50505050565b336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611b8f57600080fd5b6001600160a01b038716611bb65760405163d92e233d60e01b815260040160405180910390fd5b85600003611bd757604051631f2a200560e01b815260040160405180910390fd5b6004548910611bfc57604051630ef78d7d60e41b8152600481018a9052602401610678565b6000898152600660205260409020548810611c34576040516366ee880560e01b8152600481018a905260248101899052604401610678565b60008981526002602052604090205460ff1615611c9157611c8c3330611c5a888a6135ac565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692919061291f565b611cb0565b8315611cb0576040516302ed543d60e51b815260040160405180910390fd5b600060048a81548110611cc557611cc5613567565b600091825260208083208d84526007825260408085208e865283528085206001600160a01b038e168652909252922060059091029091019150611d088688613593565b881015611d2857604051630c07527360e31b815260040160405180910390fd5b87826002016000828254611d3c9190613593565b9250508190555086826004016000828254611d579190613593565b9091555050600182015460028301541115611d855760405163a4052f5760e01b815260040160405180910390fd5b6001600160401b03851615801590611dce57507f00000000000000000000000000000000000000000000000000000000000000006001600160401b0316856001600160401b0316105b15611dec5760405163b7d0949760e01b815260040160405180910390fd5b87816000016000828254611e009190613593565b9250508190555086816001016000828254611e1b9190613593565b90915550506001600160401b03851615611e355784611e57565b7f00000000000000000000000000000000000000000000000000000000000000005b60038201805467ffffffffffffffff19166001600160401b03929092169182179055604080518a8152602081018a905290810188905260608101919091526001600160a01b038a16908b908d907f9424df0df19e6560e992c3539341056683e5520860331c4fc1afd5aea1d8c38d9060800160405180910390a48515611ee557611ee5898c8c898888612957565b5050505050505050505050565b611efa6128ac565b81600003611f1b57604051631f2a200560e01b815260040160405180910390fd5b600480546040805160c06020601f8901819004028201810190925260a08101878152929392909182919089908990819085018382808284376000920182905250938552505050602080830188905260408301829052861515606084015260809092018190528354600181018555938152208151919260050201908190611fa19082613a12565b50602082015160018201556040808301516002830155606083015160038301805460ff19169115159190911790556080909201516004909101555181907f2102d51f93820332058f58bd7e7142f0cfd8bbfb6109b57f14ee479f5a9adf3a90612011908890889088908890613ad1565b60405180910390a25050505050565b6004818154811061203057600080fd5b90600052602060002090600502016000915090508060000180546120539061398e565b80601f016020809104026020016040519081016040528092919081815260200182805461207f9061398e565b80156120cc5780601f106120a1576101008083540402835291602001916120cc565b820191906000526020600020905b8154815290600101906020018083116120af57829003601f168201915b5050506001840154600285015460038601546004909601549495919490935060ff909116915085565b3360009081526009602052604090205460ff1615801561212057506000546001600160a01b03163314155b156121405760405163a59d7f4d60e01b8152336004820152602401610678565b6001600160a01b0381166121675760405163d92e233d60e01b815260040160405180910390fd5b600084815260076020908152604080832086845282528083206001600160a01b038681168552925280832091841683529091208054156121d35760405163a4b28b6760e01b815260048101879052602481018690526001600160a01b0384166044820152606401610678565b8154600003612211576040516001620dfdb360e01b0319815260048101879052602481018690526001600160a01b0385166044820152606401610678565b8154815560018083015490820155600380830154908201805467ffffffffffffffff19166001600160401b03909216919091179055600086815260086020908152604080832088845282528083206001600160a01b038816845290915281205490811561235c576003546001600160a01b0316635512689287876122966001876135ac565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af11580156122ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230e9190613693565b612319906001613593565b60008981526008602090815260408083208b845282528083206001600160a01b038a81168552925280832084905590891682528120556002858101549085015590505b60008881526007602090815260408083208a845282528083206001600160a01b038a81168086529184528285208581556001810186905560028101959095556003909401805467ffffffffffffffff191690558151908152928816918301919091528101829052879089907f2c1c254c5f909c052d5ee899e1f47d0c63c05046d6ba71645f65884c72e92e0b9060600160405180910390a35050505050505050565b611b54338585854286612957565b60008481526002602052604081205460ff161515900361243f576040516302ed543d60e51b815260040160405180910390fd5b600084815260086020908152604080832086845282528083203384529091528120549081900361248257604051630b58543560e11b815260040160405180910390fd5b821561253e576000858152600760209081526040808320878452825280832033845290915290206002810154600182015482546124bf91906135ac565b6124c991906135ac565b8411156124e95760405163162908e360e11b815260040160405180910390fd5b838160020160008282546124fd9190613593565b909155505060035461253c906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686612bc8565b505b6003546001600160a01b031663e495087e3361255b6001856135ac565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044810186905260648101859052608401600060405180830381600087803b1580156125af57600080fd5b505af11580156125c3573d6000803e3d6000fd5b5050604080518681526020810186905233935087925088917fdee550df05d371dc88ce21066779b6d45b37523c79b367598954e70fc6ce852b910161158b565b61260b6128ac565b6001600160a01b0381166126325760405163d92e233d60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f2274320fe0c4e3ae6dcee56cccecc83bc6ae62bdc7690f7d4cf5026b5761e0e290600090a250565b6006602052816000526040600020818154811061269857600080fd5b6000918252602090912060029091020180546001909101546001600160401b038083169450600160401b830481169350600160801b8304811692600160c01b90048116911685565b600560205281600052604060002081815481106126fc57600080fd5b90600052602060002001600091509150505481565b6127196128ac565b600180546001600160a01b0383166001600160a01b0319909116811790915561274a6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60008181526002602052604090205460ff16156127b2576040516302ed543d60e51b815260040160405180910390fd5b6000818152600260205260409020805460ff1916600117905580158015906127db575080600714155b15611611576116113330600484815481106127f8576127f8613567565b9060005260206000209060050201600101547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661291f909392919063ffffffff16565b6040516001600160a01b0383166024820152604481018290526128a790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612c75565b505050565b6000546001600160a01b0316331461138d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610678565b600180546001600160a01b031916905561161181612d4a565b6040516001600160a01b0380851660248301528316604482015260648101829052611b549085906323b872dd60e01b90608401612870565b60008581526002602052604081205460ff161515900361298a576040516302ed543d60e51b815260040160405180910390fd5b826000036129ab57604051631f2a200560e01b815260040160405180910390fd5b600085815260086020908152604080832087845282528083206001600160a01b038a168452909152902054156129f457604051635ef6934f60e11b815260040160405180910390fd5b600085815260076020908152604080832087845282528083206001600160a01b038a1684529091529020600281015460018201548254612a3491906135ac565b612a3e91906135ac565b841115612a5e5760405163162908e360e11b815260040160405180910390fd5b83816002016000828254612a729190613593565b9091555050600354612ab1906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911686612bc8565b600354604051632ee3e04b60e21b815260048101869052602481018490526001600160a01b03898116604483015260648201869052600092169063bb8f812c906084016020604051808303816000875af1158015612b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b379190613693565b612b42906001613593565b60008881526008602090815260408083208a845282528083206001600160a01b038d1680855290835292819020849055805189815291820188905281018690526060810183905291925090879089907f280f94e3b44226d05446354141e5ef15a407490b548fba16821425d1e1841d1e9060800160405180910390a45050505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015612c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3c9190613693565b9050611b548463095ea7b360e01b85612c558686613593565b6040516001600160a01b0390921660248301526044820152606401612870565b6000612cca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d9a9092919063ffffffff16565b9050805160001480612ceb575080806020019051810190612ceb9190613b13565b6128a75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610678565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060612da98484600085612db1565b949350505050565b606082471015612e125760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610678565b600080866001600160a01b03168587604051612e2e9190613b30565b60006040518083038185875af1925050503d8060008114612e6b576040519150601f19603f3d011682016040523d82523d6000602084013e612e70565b606091505b5091509150612e8187838387612e8c565b979650505050505050565b60608315612efb578251600003612ef4576001600160a01b0385163b612ef45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610678565b5081612da9565b612da98383815115612f105781518083602001fd5b8060405162461bcd60e51b8152600401610678919061397b565b5050565b50805460008255906000526020600020908101906116119190612f97565b828054828255906000526020600020908101928215612f87579160200282015b82811115612f87578251825591602001919060010190612f6c565b50612f93929150612f97565b5090565b5b80821115612f935760008155600101612f98565b80356001600160a01b0381168114612fc357600080fd5b919050565b6001600160401b038116811461161157600080fd5b600080600080600060a08688031215612ff557600080fd5b853594506020860135935061300c60408701612fac565b9250606086013561301c81612fc8565b949793965091946080013592915050565b60006020828403121561303f57600080fd5b5035919050565b60006020828403121561305857600080fd5b61137482612fac565b60008060006060848603121561307657600080fd5b833592506020840135915061308d60408501612fac565b90509250925092565b801515811461161157600080fd5b600080600080608085870312156130ba57600080fd5b84359350602085013592506130d160408601612fac565b915060608501356130e181613096565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561312a5761312a6130ec565b604052919050565b6000806040838503121561314557600080fd5b823591506020808401356001600160401b038082111561316457600080fd5b818601915086601f83011261317857600080fd5b81358181111561318a5761318a6130ec565b8060051b915061319b848301613102565b81815291830184019184810190898411156131b557600080fd5b938501935b838510156131d3578435825293850193908501906131ba565b8096505050505050509250929050565b600080604083850312156131f657600080fd5b6131ff83612fac565b9150602083013561320f81613096565b809150509250929050565b6000806000806080858703121561323057600080fd5b61323985612fac565b966020860135965060408601359560600135945092505050565b600080600083850360e081121561326957600080fd5b843593506020850135925060a0603f198201121561328657600080fd5b506040840190509250925092565b6020808252825182820181905260009190848201906040850190845b818110156132cc578351835292840192918401916001016132b0565b50909695505050505050565b600080604083850312156132eb57600080fd5b50508035926020909101359150565b6000806020838503121561330d57600080fd5b82356001600160401b038082111561332457600080fd5b818501915085601f83011261333857600080fd5b81358181111561334757600080fd5b8660208260051b850101111561335c57600080fd5b60209290920196919550909350505050565b60008060008060008060008060006101208a8c03121561338d57600080fd5b8935985060208a013597506133a460408b01612fac565b965060608a0135955060808a0135945060a08a0135935060c08a01356133c981612fc8565b8093505060e08a013591506101008a013590509295985092959850929598565b600080600080606085870312156133ff57600080fd5b84356001600160401b038082111561341657600080fd5b818701915087601f83011261342a57600080fd5b81358181111561343957600080fd5b88602082850101111561344b57600080fd5b60209283019650945050850135915060408501356130e181613096565b60005b8381101561348357818101518382015260200161346b565b50506000910152565b600081518084526134a4816020860160208601613468565b601f01601f19169290920160200192915050565b60a0815260006134cb60a083018861348c565b60208301969096525060408101939093529015156060830152608090910152919050565b6000806000806080858703121561350557600080fd5b843593506020850135925061351c60408601612fac565b915061352a60608601612fac565b905092959194509250565b6000806000806080858703121561354b57600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156135a6576135a661357d565b92915050565b818103818111156135a6576135a661357d565b6001600160401b038281168282160390808211156135df576135df61357d565b5092915050565b6001600160401b038181168382160190808211156135df576135df61357d565b634e487b7160e01b600052601260045260246000fd5b60006001600160401b038084168061363657613636613606565b92169190910492915050565b60006001600160401b038084168061365c5761365c613606565b92169190910692915050565b80820281158282048414176135a6576135a661357d565b60008261368e5761368e613606565b500490565b6000602082840312156136a557600080fd5b5051919050565b6001600160401b038181168382160280821691908281146136cf576136cf61357d565b505092915050565b6000602082840312156136e957600080fd5b813561137481612fc8565b600081356135a681612fc8565b813561370c81612fc8565b815467ffffffffffffffff19166001600160401b03821617825550602082013561373581612fc8565b81546fffffffffffffffff0000000000000000604092831b166fffffffffffffffff0000000000000000198216811784559184013561377381612fc8565b67ffffffffffffffff60801b60809190911b1677ffffffffffffffffffffffffffffffff000000000000000019821683178117845560608501356137b681612fc8565b6001600160401b0360c01b8160c01b16846001600160401b03851617831717855550505050612f2a6137ea608084016136f4565b600183016001600160401b0382166001600160401b03198254161781555050565b60a08101823561381a81612fc8565b6001600160401b03908116835260208401359061383682612fc8565b908116602084015260408401359061384d82612fc8565b908116604084015260608401359061386482612fc8565b908116606084015260808401359061387b82612fc8565b8082166080850152505092915050565b6000808335601e198436030181126138a257600080fd5b8301803591506001600160401b038211156138bc57600080fd5b6020019150368190038213156138d157600080fd5b9250929050565b8183823760009101908152919050565b6000602082840312156138fa57600080fd5b81516001600160401b038082111561391157600080fd5b818401915084601f83011261392557600080fd5b815181811115613937576139376130ec565b61394a601f8201601f1916602001613102565b915080825285602082850101111561396157600080fd5b613972816020840160208601613468565b50949350505050565b602081526000611374602083018461348c565b600181811c908216806139a257607f821691505b602082108103610ad657634e487b7160e01b600052602260045260246000fd5b601f8211156128a7576000816000526020600020601f850160051c810160208610156139eb5750805b601f850160051c820191505b81811015613a0a578281556001016139f7565b505050505050565b81516001600160401b03811115613a2b57613a2b6130ec565b613a3f81613a39845461398e565b846139c2565b602080601f831160018114613a745760008415613a5c5750858301515b600019600386901b1c1916600185901b178555613a0a565b600085815260208120601f198616915b82811015613aa357888601518255948401946001909101908401613a84565b5085821015613ac15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081528360608201528385608083013760006080858301015260006080601f19601f8701168301019050836020830152821515604083015295945050505050565b600060208284031215613b2557600080fd5b815161137481613096565b60008251613b42818460208701613468565b919091019291505056fea26469706673582212200b819127e4aeea1239f4d293c01cda9d9219ac7b1fd0cceb0b046405b859402964736f6c63430008190033000000000000000000000000243c9be13faba09f945ccc565547293337da0ad7000000000000000000000000880d1bbb34261f5084c5eadf0d133942a96f1f490000000000000000000000000000000000000000000000000000000066659940

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061021b5760003560e01c80638da5cb5b11610125578063d2673bbf116100ad578063ef15259f1161007c578063ef15259f14610598578063efc07c55146105ab578063f01e59d2146105f8578063f2fde38b1461060b578063fe4b84df1461061e57600080fd5b8063d2673bbf14610520578063d82fdf1c14610533578063d9a845d814610564578063e30c39781461058757600080fd5b8063b0ae4416116100f4578063b0ae4416146104b0578063c40552ac146104c3578063c6cdbe5e146104d6578063ce2fbd97146104fa578063ce93a8821461050d57600080fd5b80638da5cb5b1461046a578063918f86741461047b5780639e2c8a5b1461048a578063ac9650d81461049d57600080fd5b80634b0bddd2116101a857806377b1f7131161017757806377b1f71314610409578063784815661461041c57806379ba50971461042f5780638358a04814610437578063866d50071461044a57600080fd5b80634b0bddd2146103b45780634dcb2546146103c757806353126a8b146103da578063715018a61461040157600080fd5b806324d7806c116101ef57806324d7806c146102bc57806326f73a2e146102ef5780632d80e288146103675780633163e3a81461037a578063339f2b90146103a157600080fd5b8062b03e051461022057806303e7b4e91461023557806312c5422a1461025b57806320988cef1461029a575b600080fd5b61023361022e366004612fdd565b610631565b005b61024861024336600461302d565b61091d565b6040519081526020015b60405180910390f35b6102827f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad781565b6040516001600160a01b039091168152602001610252565b6102a462278d0081565b6040516001600160401b039091168152602001610252565b6102df6102ca366004613046565b60096020526000908152604090205460ff1681565b6040519015158152602001610252565b61033e6102fd366004613061565b60076020908152600093845260408085208252928452828420905282529020805460018201546002830154600390930154919290916001600160401b031684565b604080519485526020850193909352918301526001600160401b03166060820152608001610252565b6102336103753660046130a4565b610adc565b6102a47f000000000000000000000000000000000000000000000000000000006665994081565b6102336103af366004613132565b610f3f565b6102336103c23660046131e3565b611068565b6102486103d5366004613061565b6110c4565b6102827f000000000000000000000000880d1bbb34261f5084c5eadf0d133942a96f1f4981565b61023361137b565b61023361041736600461321a565b61138f565b600354610282906001600160a01b031681565b61023361159a565b610233610445366004613253565b611614565b61045d61045836600461302d565b611878565b6040516102529190613294565b6000546001600160a01b0316610282565b610248670de0b6b3a764000081565b6102336104983660046132d8565b6118da565b6102336104ab3660046132fa565b611a7c565b6102336104be36600461336e565b611b5a565b6102336104d13660046133e9565b611ef2565b6104e96104e436600461302d565b612020565b6040516102529594939291906134b8565b6102336105083660046134ef565b6120f5565b61023361051b366004613535565b6123fe565b61023361052e366004613535565b61240c565b610248610541366004613061565b600860209081526000938452604080852082529284528284209052825290205481565b6102df61057236600461302d565b60026020526000908152604090205460ff1681565b6001546001600160a01b0316610282565b6102336105a6366004613046565b612603565b6105be6105b93660046132d8565b61267c565b604080516001600160401b03968716815294861660208601529285169284019290925283166060830152909116608082015260a001610252565b6102486106063660046132d8565b6126e0565b610233610619366004613046565b612711565b61023361062c36600461302d565b612782565b3360009081526009602052604090205460ff1615801561065c57506000546001600160a01b03163314155b156106815760405163a59d7f4d60e01b81523360048201526024015b60405180910390fd5b6001600160a01b0383166106a85760405163d92e233d60e01b815260040160405180910390fd5b806000036106c957604051631f2a200560e01b815260040160405180910390fd5b60045485106106ee57604051630ef78d7d60e41b815260048101869052602401610678565b6000858152600660205260409020548410610726576040516366ee880560e01b81526004810186905260248101859052604401610678565b60006004868154811061073b5761073b613567565b600091825260208083208984526007825260408085208a865283528085206001600160a01b038a16865290925290832060059290920201600281018054919450919285929161078b908490613593565b909155505080546002830180546000906107a69084906135ac565b90915550506001820154600283015411156107d45760405163a4052f5760e01b815260040160405180910390fd5b806002015481600101546107e89190613593565b83101561080857604051630c07527360e31b815260040160405180910390fd5b6001600160401b0384161580159061085157507f00000000000000000000000000000000000000000000000000000000666599406001600160401b0316846001600160401b0316105b1561086f5760405163b7d0949760e01b815260040160405180910390fd5b8281556001600160401b0384161561088757836108a9565b7f00000000000000000000000000000000000000000000000000000000666599405b60038201805467ffffffffffffffff19166001600160401b039290921691821790556040805185815260208101929092526001600160a01b0387169188918a917f6efec3f1cc0e7e3f8127f9dff5d9ef4dd3c09342d44eec43e8160944f8e6366a910160405180910390a450505050505050565b60007f00000000000000000000000000000000000000000000000000000000666599406001600160401b0381164210610ad65760006004848154811061096557610965613567565b600091825260208083206005928302016001015487845291905260408220549092509003610994579392505050565b600062278d006109a484426135bf565b6109ae91906135e6565b905060006109bf62278d008361361c565b6000878152600560205260409020549091506001600160401b038216106109ea575090949350505050565b60006001600160401b03821615610a3d576000878152600560205260409020610a146001846135bf565b6001600160401b031681548110610a2d57610a2d613567565b9060005260206000200154610a40565b60005b6000888152600560205260408120805492935090916001600160401b038516908110610a6e57610a6e613567565b60009182526020822001549150610a8862278d0086613642565b90508262278d006001600160401b038316610aa383866135ac565b610aad9190613668565b610ab7919061367f565b610ac19190613593565b975085881115610acf578597505b5050505050505b50919050565b3360009081526009602052604090205460ff16158015610b0757506000546001600160a01b03163314155b15610b275760405163a59d7f4d60e01b8152336004820152602401610678565b600084815260076020908152604080832086845282528083206001600160a01b038616845290915281208054909103610b8f576040516001620dfdb360e01b0319815260048101869052602481018590526001600160a01b0384166044820152606401610678565b6000858152600660205260408120805486908110610baf57610baf613567565b60009182526020918290206040805160a081018252600290930290910180546001600160401b038082168552600160401b82048116958501869052600160801b82048116938501849052600160c01b90910481166060850181905260019092015481166080850152600387015493955042949193610c2e9291166135e6565b610c3891906135e6565b610c4291906135e6565b6001600160401b031611610c8257604051633b96c3a160e21b815260048101879052602481018690526001600160a01b0385166044820152606401610678565b600086815260086020908152604080832088845282528083206001600160a01b03881684529091529020548015610d7a576003546001600160a01b031663bb1405df86610cd06001856135ac565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152600160448201526064016020604051808303816000875af1158015610d22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d469190613693565b50600087815260086020908152604080832089845282528083206001600160a01b0389168452909152812081905560028401555b600060048881548110610d8f57610d8f613567565b906000526020600020906005020190506000610dac8989896110c4565b9050600086610dbc576000610dbe565b815b8660010154610dcd9190613593565b8654610dd991906135ac565b60008b81526007602090815260408083208d845282528083206001600160a01b038d16845290915281208181556001810182905560028082018390556003909101805467ffffffffffffffff19169055850180549293508392909190610e409084906135ac565b909155508790508015610e5257508115155b15610eec57610e8b6001600160a01b037f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad7168984612844565b81836004016000828254610e9f9190613593565b92505081905550876001600160a01b0316898b7fb94bf7f9302edf52a596286915a69b4b0685574cffdedd0712e3c62f2550f0ba85604051610ee391815260200190565b60405180910390a45b876001600160a01b0316898b7f29ff2b9c3d0121132b158b2f2dd19d17c3cb466efdfdbaa1ba7ee2c50fcc41728a604051610f2b911515815260200190565b60405180910390a450505050505050505050565b610f476128ac565b60008281526002602052604090205460ff1615610f77576040516302ed543d60e51b815260040160405180910390fd5b600060048381548110610f8c57610f8c613567565b9060005260206000209060050201600101549050815160001480610fd65750808260018451610fbb91906135ac565b81518110610fcb57610fcb613567565b602002602001015114155b15610ff457604051632238b26160e01b815260040160405180910390fd5b600083815260056020526040812061100b91612f2e565b6000838152600560209081526040909120835161102a92850190612f4c565b50827f91d1473fd427151d93d77055a94438bae10b534c81a00beb2931d6f81d4ac6e48360405161105b9190613294565b60405180910390a2505050565b6110706128ac565b6001600160a01b038216600081815260096020526040808220805460ff191685151590811790915590519092917fe68d2c359a771606c400cf8b87000cf5864010363d6a736e98f5047b7bbe18e991a35050565b60008381526002602052604081205460ff16151581036110f7576040516302ed543d60e51b815260040160405180910390fd5b600084815260076020908152604080832086845282528083206001600160a01b038616845282528083208151608081018352815481526001820154818501526002820154818401526003909101546001600160401b031660608201528784526006909252822080549192918690811061117257611172613567565b600091825260208083206040805160a081018252600290940290910180546001600160401b038082168652600160401b82048116948601859052600160801b8204811693860193909352600160c01b9004821660608086019190915260019091015490911660808401528501519193506111eb916135e6565b905042816001600160401b0316111561120a5760009350505050611374565b82518251600090670de0b6b3a76400009061122e906001600160401b031684613668565b611238919061367f565b905083604001518361124a91906135e6565b9250600042846001600160401b031611156112665750806112d6565b60808501516000908061127987426135bf565b611283919061361c565b61128d91906136ac565b90508286606001516001600160401b0316826001600160401b031685876112b491906135ac565b6112be9190613668565b6112c8919061367f565b6112d29190613593565b9150505b604086015186516000916112e9916135ac565b9050808211156112f7578091505b86602001518211611312576000975050505050505050611374565b602087015161132190836135ac565b9750600060048c8154811061133857611338613567565b9060005260206000209060050201600401546113538d61091d565b61135d91906135ac565b90508089111561136b578098505b50505050505050505b9392505050565b6113836128ac565b61138d6000612906565b565b60008381526002602052604081205460ff16151590036113c2576040516302ed543d60e51b815260040160405180910390fd5b6001600160a01b038416331480159061141c5750600483815481106113e9576113e9613567565b600091825260209091206003600590920201015460ff16158061141c57503360009081526009602052604090205460ff16155b1561143c5760405163a59d7f4d60e01b8152336004820152602401610678565b60006114498484876110c4565b9050600019820361145c5780915061147d565b8082111561147d576040516333ade54560e11b815260040160405180910390fd5b8160000361149e57604051631f2a200560e01b815260040160405180910390fd5b81600485815481106114b2576114b2613567565b906000526020600020906005020160040160008282546114d29190613593565b9091555050600084815260076020908152604080832086845282528083206001600160a01b038916845290915281206001018054849290611514908490613593565b9091555061154e90506001600160a01b037f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad7168684612844565b846001600160a01b031683857fb94bf7f9302edf52a596286915a69b4b0685574cffdedd0712e3c62f2550f0ba8560405161158b91815260200190565b60405180910390a45050505050565b60015433906001600160a01b031681146116085760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b6064820152608401610678565b61161181612906565b50565b3360009081526009602052604090205460ff1615801561163f57506000546001600160a01b03163314155b1561165f5760405163a59d7f4d60e01b8152336004820152602401610678565b670de0b6b3a764000061167560208301836136d7565b6001600160401b0316111561169d57604051634b8ce6a360e11b815260040160405180910390fd5b6116ad60808201606083016136d7565b6001600160401b03166116c660408301602084016136d7565b6001600160401b031611156116ee5760405163799547e960e11b815260040160405180910390fd5b6301e1338061170360608301604084016136d7565b6001600160401b0316111561172b57604051630a15cca960e21b815260040160405180910390fd5b630f099c0061174060808301606084016136d7565b6001600160401b03161115611768576040516302e8f35960e31b815260040160405180910390fd5b61177860a08201608083016136d7565b61178860808301606084016136d7565b6117929190613642565b6001600160401b0316156117b95760405163265f13bd60e21b815260040160405180910390fd5b60001982036117fa576000838152600660209081526040822080546001810182559083529120909250819060028402016117f38282613701565b505061183a565b600083815260066020526040902080548291908490811061181d5761181d613567565b906000526020600020906002020181816118379190613701565b50505b81837f03d87beedebfab89b17c593a654fdae3e6a916f19fb66ab32ad3d9ab2db5fa708360405161186b919061380b565b60405180910390a3505050565b6000818152600560209081526040918290208054835181840281018401909452808452606093928301828280156118ce57602002820191906000526020600020905b8154815260200190600101908083116118ba575b50505050509050919050565b60008281526002602052604081205460ff161515900361190d576040516302ed543d60e51b815260040160405180910390fd5b600082815260086020908152604080832084845282528083203384529091528120549081900361195057604051630b58543560e11b815260040160405180910390fd5b6003546000906001600160a01b031663bb1405df336119706001866135ac565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152600060448201526064016020604051808303816000875af11580156119c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e69190613693565b6000858152600760209081526040808320878452825280832033845290915281206002810180549394509092849290611a209084906135ac565b909155505060008581526008602090815260408083208784528252808320338085529083528184209390935551848152869188917fb904b5088e8442bdbf73b7777734a35451036f567f8487e489c62d6bbb401255910161158b565b8060005b81811015611b545760008030868685818110611a9e57611a9e613567565b9050602002810190611ab0919061388b565b604051611abe9291906138d8565b600060405180830381855af49150503d8060008114611af9576040519150601f19603f3d011682016040523d82523d6000602084013e611afe565b606091505b509150915081611b4a57604481511015611b1757600080fd5b60048101905080806020019051810190611b3191906138e8565b60405162461bcd60e51b8152600401610678919061397b565b5050600101611a80565b50505050565b336001600160a01b037f000000000000000000000000880d1bbb34261f5084c5eadf0d133942a96f1f491614611b8f57600080fd5b6001600160a01b038716611bb65760405163d92e233d60e01b815260040160405180910390fd5b85600003611bd757604051631f2a200560e01b815260040160405180910390fd5b6004548910611bfc57604051630ef78d7d60e41b8152600481018a9052602401610678565b6000898152600660205260409020548810611c34576040516366ee880560e01b8152600481018a905260248101899052604401610678565b60008981526002602052604090205460ff1615611c9157611c8c3330611c5a888a6135ac565b6001600160a01b037f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad71692919061291f565b611cb0565b8315611cb0576040516302ed543d60e51b815260040160405180910390fd5b600060048a81548110611cc557611cc5613567565b600091825260208083208d84526007825260408085208e865283528085206001600160a01b038e168652909252922060059091029091019150611d088688613593565b881015611d2857604051630c07527360e31b815260040160405180910390fd5b87826002016000828254611d3c9190613593565b9250508190555086826004016000828254611d579190613593565b9091555050600182015460028301541115611d855760405163a4052f5760e01b815260040160405180910390fd5b6001600160401b03851615801590611dce57507f00000000000000000000000000000000000000000000000000000000666599406001600160401b0316856001600160401b0316105b15611dec5760405163b7d0949760e01b815260040160405180910390fd5b87816000016000828254611e009190613593565b9250508190555086816001016000828254611e1b9190613593565b90915550506001600160401b03851615611e355784611e57565b7f00000000000000000000000000000000000000000000000000000000666599405b60038201805467ffffffffffffffff19166001600160401b03929092169182179055604080518a8152602081018a905290810188905260608101919091526001600160a01b038a16908b908d907f9424df0df19e6560e992c3539341056683e5520860331c4fc1afd5aea1d8c38d9060800160405180910390a48515611ee557611ee5898c8c898888612957565b5050505050505050505050565b611efa6128ac565b81600003611f1b57604051631f2a200560e01b815260040160405180910390fd5b600480546040805160c06020601f8901819004028201810190925260a08101878152929392909182919089908990819085018382808284376000920182905250938552505050602080830188905260408301829052861515606084015260809092018190528354600181018555938152208151919260050201908190611fa19082613a12565b50602082015160018201556040808301516002830155606083015160038301805460ff19169115159190911790556080909201516004909101555181907f2102d51f93820332058f58bd7e7142f0cfd8bbfb6109b57f14ee479f5a9adf3a90612011908890889088908890613ad1565b60405180910390a25050505050565b6004818154811061203057600080fd5b90600052602060002090600502016000915090508060000180546120539061398e565b80601f016020809104026020016040519081016040528092919081815260200182805461207f9061398e565b80156120cc5780601f106120a1576101008083540402835291602001916120cc565b820191906000526020600020905b8154815290600101906020018083116120af57829003601f168201915b5050506001840154600285015460038601546004909601549495919490935060ff909116915085565b3360009081526009602052604090205460ff1615801561212057506000546001600160a01b03163314155b156121405760405163a59d7f4d60e01b8152336004820152602401610678565b6001600160a01b0381166121675760405163d92e233d60e01b815260040160405180910390fd5b600084815260076020908152604080832086845282528083206001600160a01b038681168552925280832091841683529091208054156121d35760405163a4b28b6760e01b815260048101879052602481018690526001600160a01b0384166044820152606401610678565b8154600003612211576040516001620dfdb360e01b0319815260048101879052602481018690526001600160a01b0385166044820152606401610678565b8154815560018083015490820155600380830154908201805467ffffffffffffffff19166001600160401b03909216919091179055600086815260086020908152604080832088845282528083206001600160a01b038816845290915281205490811561235c576003546001600160a01b0316635512689287876122966001876135ac565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015260448201526064016020604051808303816000875af11580156122ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230e9190613693565b612319906001613593565b60008981526008602090815260408083208b845282528083206001600160a01b038a81168552925280832084905590891682528120556002858101549085015590505b60008881526007602090815260408083208a845282528083206001600160a01b038a81168086529184528285208581556001810186905560028101959095556003909401805467ffffffffffffffff191690558151908152928816918301919091528101829052879089907f2c1c254c5f909c052d5ee899e1f47d0c63c05046d6ba71645f65884c72e92e0b9060600160405180910390a35050505050505050565b611b54338585854286612957565b60008481526002602052604081205460ff161515900361243f576040516302ed543d60e51b815260040160405180910390fd5b600084815260086020908152604080832086845282528083203384529091528120549081900361248257604051630b58543560e11b815260040160405180910390fd5b821561253e576000858152600760209081526040808320878452825280832033845290915290206002810154600182015482546124bf91906135ac565b6124c991906135ac565b8411156124e95760405163162908e360e11b815260040160405180910390fd5b838160020160008282546124fd9190613593565b909155505060035461253c906001600160a01b037f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad78116911686612bc8565b505b6003546001600160a01b031663e495087e3361255b6001856135ac565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044810186905260648101859052608401600060405180830381600087803b1580156125af57600080fd5b505af11580156125c3573d6000803e3d6000fd5b5050604080518681526020810186905233935087925088917fdee550df05d371dc88ce21066779b6d45b37523c79b367598954e70fc6ce852b910161158b565b61260b6128ac565b6001600160a01b0381166126325760405163d92e233d60e01b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b0383169081179091556040517f2274320fe0c4e3ae6dcee56cccecc83bc6ae62bdc7690f7d4cf5026b5761e0e290600090a250565b6006602052816000526040600020818154811061269857600080fd5b6000918252602090912060029091020180546001909101546001600160401b038083169450600160401b830481169350600160801b8304811692600160c01b90048116911685565b600560205281600052604060002081815481106126fc57600080fd5b90600052602060002001600091509150505481565b6127196128ac565b600180546001600160a01b0383166001600160a01b0319909116811790915561274a6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60008181526002602052604090205460ff16156127b2576040516302ed543d60e51b815260040160405180910390fd5b6000818152600260205260409020805460ff1916600117905580158015906127db575080600714155b15611611576116113330600484815481106127f8576127f8613567565b9060005260206000209060050201600101547f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad76001600160a01b031661291f909392919063ffffffff16565b6040516001600160a01b0383166024820152604481018290526128a790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612c75565b505050565b6000546001600160a01b0316331461138d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610678565b600180546001600160a01b031916905561161181612d4a565b6040516001600160a01b0380851660248301528316604482015260648101829052611b549085906323b872dd60e01b90608401612870565b60008581526002602052604081205460ff161515900361298a576040516302ed543d60e51b815260040160405180910390fd5b826000036129ab57604051631f2a200560e01b815260040160405180910390fd5b600085815260086020908152604080832087845282528083206001600160a01b038a168452909152902054156129f457604051635ef6934f60e11b815260040160405180910390fd5b600085815260076020908152604080832087845282528083206001600160a01b038a1684529091529020600281015460018201548254612a3491906135ac565b612a3e91906135ac565b841115612a5e5760405163162908e360e11b815260040160405180910390fd5b83816002016000828254612a729190613593565b9091555050600354612ab1906001600160a01b037f000000000000000000000000243c9be13faba09f945ccc565547293337da0ad78116911686612bc8565b600354604051632ee3e04b60e21b815260048101869052602481018490526001600160a01b03898116604483015260648201869052600092169063bb8f812c906084016020604051808303816000875af1158015612b13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b379190613693565b612b42906001613593565b60008881526008602090815260408083208a845282528083206001600160a01b038d1680855290835292819020849055805189815291820188905281018690526060810183905291925090879089907f280f94e3b44226d05446354141e5ef15a407490b548fba16821425d1e1841d1e9060800160405180910390a45050505050505050565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015612c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c3c9190613693565b9050611b548463095ea7b360e01b85612c558686613593565b6040516001600160a01b0390921660248301526044820152606401612870565b6000612cca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612d9a9092919063ffffffff16565b9050805160001480612ceb575080806020019051810190612ceb9190613b13565b6128a75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610678565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060612da98484600085612db1565b949350505050565b606082471015612e125760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610678565b600080866001600160a01b03168587604051612e2e9190613b30565b60006040518083038185875af1925050503d8060008114612e6b576040519150601f19603f3d011682016040523d82523d6000602084013e612e70565b606091505b5091509150612e8187838387612e8c565b979650505050505050565b60608315612efb578251600003612ef4576001600160a01b0385163b612ef45760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610678565b5081612da9565b612da98383815115612f105781518083602001fd5b8060405162461bcd60e51b8152600401610678919061397b565b5050565b50805460008255906000526020600020908101906116119190612f97565b828054828255906000526020600020908101928215612f87579160200282015b82811115612f87578251825591602001919060010190612f6c565b50612f93929150612f97565b5090565b5b80821115612f935760008155600101612f98565b80356001600160a01b0381168114612fc357600080fd5b919050565b6001600160401b038116811461161157600080fd5b600080600080600060a08688031215612ff557600080fd5b853594506020860135935061300c60408701612fac565b9250606086013561301c81612fc8565b949793965091946080013592915050565b60006020828403121561303f57600080fd5b5035919050565b60006020828403121561305857600080fd5b61137482612fac565b60008060006060848603121561307657600080fd5b833592506020840135915061308d60408501612fac565b90509250925092565b801515811461161157600080fd5b600080600080608085870312156130ba57600080fd5b84359350602085013592506130d160408601612fac565b915060608501356130e181613096565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561312a5761312a6130ec565b604052919050565b6000806040838503121561314557600080fd5b823591506020808401356001600160401b038082111561316457600080fd5b818601915086601f83011261317857600080fd5b81358181111561318a5761318a6130ec565b8060051b915061319b848301613102565b81815291830184019184810190898411156131b557600080fd5b938501935b838510156131d3578435825293850193908501906131ba565b8096505050505050509250929050565b600080604083850312156131f657600080fd5b6131ff83612fac565b9150602083013561320f81613096565b809150509250929050565b6000806000806080858703121561323057600080fd5b61323985612fac565b966020860135965060408601359560600135945092505050565b600080600083850360e081121561326957600080fd5b843593506020850135925060a0603f198201121561328657600080fd5b506040840190509250925092565b6020808252825182820181905260009190848201906040850190845b818110156132cc578351835292840192918401916001016132b0565b50909695505050505050565b600080604083850312156132eb57600080fd5b50508035926020909101359150565b6000806020838503121561330d57600080fd5b82356001600160401b038082111561332457600080fd5b818501915085601f83011261333857600080fd5b81358181111561334757600080fd5b8660208260051b850101111561335c57600080fd5b60209290920196919550909350505050565b60008060008060008060008060006101208a8c03121561338d57600080fd5b8935985060208a013597506133a460408b01612fac565b965060608a0135955060808a0135945060a08a0135935060c08a01356133c981612fc8565b8093505060e08a013591506101008a013590509295985092959850929598565b600080600080606085870312156133ff57600080fd5b84356001600160401b038082111561341657600080fd5b818701915087601f83011261342a57600080fd5b81358181111561343957600080fd5b88602082850101111561344b57600080fd5b60209283019650945050850135915060408501356130e181613096565b60005b8381101561348357818101518382015260200161346b565b50506000910152565b600081518084526134a4816020860160208601613468565b601f01601f19169290920160200192915050565b60a0815260006134cb60a083018861348c565b60208301969096525060408101939093529015156060830152608090910152919050565b6000806000806080858703121561350557600080fd5b843593506020850135925061351c60408601612fac565b915061352a60608601612fac565b905092959194509250565b6000806000806080858703121561354b57600080fd5b5050823594602084013594506040840135936060013592509050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b808201808211156135a6576135a661357d565b92915050565b818103818111156135a6576135a661357d565b6001600160401b038281168282160390808211156135df576135df61357d565b5092915050565b6001600160401b038181168382160190808211156135df576135df61357d565b634e487b7160e01b600052601260045260246000fd5b60006001600160401b038084168061363657613636613606565b92169190910492915050565b60006001600160401b038084168061365c5761365c613606565b92169190910692915050565b80820281158282048414176135a6576135a661357d565b60008261368e5761368e613606565b500490565b6000602082840312156136a557600080fd5b5051919050565b6001600160401b038181168382160280821691908281146136cf576136cf61357d565b505092915050565b6000602082840312156136e957600080fd5b813561137481612fc8565b600081356135a681612fc8565b813561370c81612fc8565b815467ffffffffffffffff19166001600160401b03821617825550602082013561373581612fc8565b81546fffffffffffffffff0000000000000000604092831b166fffffffffffffffff0000000000000000198216811784559184013561377381612fc8565b67ffffffffffffffff60801b60809190911b1677ffffffffffffffffffffffffffffffff000000000000000019821683178117845560608501356137b681612fc8565b6001600160401b0360c01b8160c01b16846001600160401b03851617831717855550505050612f2a6137ea608084016136f4565b600183016001600160401b0382166001600160401b03198254161781555050565b60a08101823561381a81612fc8565b6001600160401b03908116835260208401359061383682612fc8565b908116602084015260408401359061384d82612fc8565b908116604084015260608401359061386482612fc8565b908116606084015260808401359061387b82612fc8565b8082166080850152505092915050565b6000808335601e198436030181126138a257600080fd5b8301803591506001600160401b038211156138bc57600080fd5b6020019150368190038213156138d157600080fd5b9250929050565b8183823760009101908152919050565b6000602082840312156138fa57600080fd5b81516001600160401b038082111561391157600080fd5b818401915084601f83011261392557600080fd5b815181811115613937576139376130ec565b61394a601f8201601f1916602001613102565b915080825285602082850101111561396157600080fd5b613972816020840160208601613468565b50949350505050565b602081526000611374602083018461348c565b600181811c908216806139a257607f821691505b602082108103610ad657634e487b7160e01b600052602260045260246000fd5b601f8211156128a7576000816000526020600020601f850160051c810160208610156139eb5750805b601f850160051c820191505b81811015613a0a578281556001016139f7565b505050505050565b81516001600160401b03811115613a2b57613a2b6130ec565b613a3f81613a39845461398e565b846139c2565b602080601f831160018114613a745760008415613a5c5750858301515b600019600386901b1c1916600185901b178555613a0a565b600085815260208120601f198616915b82811015613aa357888601518255948401946001909101908401613a84565b5085821015613ac15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b606081528360608201528385608083013760006080858301015260006080601f19601f8701168301019050836020830152821515604083015295945050505050565b600060208284031215613b2557600080fd5b815161137481613096565b60008251613b42818460208701613468565b919091019291505056fea26469706673582212200b819127e4aeea1239f4d293c01cda9d9219ac7b1fd0cceb0b046405b859402964736f6c63430008190033

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

000000000000000000000000243c9be13faba09f945ccc565547293337da0ad7000000000000000000000000880d1bbb34261f5084c5eadf0d133942a96f1f490000000000000000000000000000000000000000000000000000000066659940

-----Decoded View---------------
Arg [0] : _trufToken (address): 0x243c9be13fAbA09F945ccc565547293337Da0Ad7
Arg [1] : _trufMigrator (address): 0x880D1bBb34261f5084C5EAdF0D133942a96F1f49
Arg [2] : _tgeTime (uint64): 1717934400

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000243c9be13faba09f945ccc565547293337da0ad7
Arg [1] : 000000000000000000000000880d1bbb34261f5084c5eadf0d133942a96f1f49
Arg [2] : 0000000000000000000000000000000000000000000000000000000066659940


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

OVERVIEW

This smart contract holds any vested tokens that have yet to be claimed.

Validator Index Block Amount
View All Withdrawals

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

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