Contract 0x550C5D2e99765A679cB3Ea7f189751141C103fb6

Contract Overview

Balance:
0 AVAX

AVAX Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6c69aae2f1bc1d2a224bda240ee1b4bb82c1c43a6a408ee5b56452fa4c8c79a1Create Release S...203523282022-09-27 18:24:431 day 15 hrs ago0xc07ee5f7e1c328611b48d722492a85fc4e330e58 IN  0x550c5d2e99765a679cb3ea7f189751141c103fb60 AVAX0.0031164795 26.5
0x4a8828afce2419bc133ec2af16b8e489f9b8598f175226425679635051084ba6Create Release S...203522512022-09-27 18:22:061 day 15 hrs ago0xc07ee5f7e1c328611b48d722492a85fc4e330e58 IN  0x550c5d2e99765a679cb3ea7f189751141c103fb60 AVAX0.003141837888 26.718353344
0x58cf7e6607ced5606104e6995a46fcedc6730eb92f02eebe6699a8494ddd1406Batch Fund Relea...203196602022-09-26 23:46:122 days 10 hrs ago0xc07ee5f7e1c328611b48d722492a85fc4e330e58 IN  0x550c5d2e99765a679cb3ea7f189751141c103fb60 AVAX0.01001464866 26.94
0x45a36c89903a3e913745381d91fa4e0dfefab48789e795f22660db9f4a4bca9fCreate Release S...203195372022-09-26 23:41:572 days 10 hrs ago0xc07ee5f7e1c328611b48d722492a85fc4e330e58 IN  0x550c5d2e99765a679cb3ea7f189751141c103fb60 AVAX0.0035696295 26.5
0x26caae8ff6fd6cbcffc721ea979309d3c210acdf26ab8e5e096459bd03bb6cb10x60e06040201854862022-09-23 18:03:195 days 16 hrs ago0x94e9c1aabd03d935da39764795c634088662ded6 IN  Create: TokenLockup0 AVAX0.06525852525
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TokenLockup

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 7 : TokenLockup.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";


/**
    @title A smart contract for unlocking tokens based on a release schedule
    @author By CoMakery, Inc., Upside, Republic
    @dev When deployed the contract is as a proxy for a single token that it creates release schedules for
        it implements the ERC20 token interface to integrate with wallets but it is not an independent token.
        The token must implement a burn function.
        Unit test can be found here: https://github.com/CoMakery/upside-evm/tree/main/test/token-lockup
*/
contract TokenLockup is ReentrancyGuard {
    using SafeERC20 for IERC20Metadata;

    IERC20Metadata immutable public token;
    string private _name;
    string private _symbol;

    struct ReleaseSchedule {
        uint256 releaseCount;
        uint256 delayUntilFirstReleaseInSeconds;
        uint256 initialReleasePortionInBips;
        uint256 periodBetweenReleasesInSeconds;
    }

    struct Timelock {
        uint256 scheduleId;
        uint256 commencementTimestamp;
        uint256 tokensTransferred;
        uint256 totalAmount;
        address[] cancelableBy; // not cancelable unless set at the time of funding
    }

    ReleaseSchedule[] public releaseSchedules;
    uint256 immutable public minTimelockAmount;
    uint256 immutable public maxReleaseDelay;
    uint256 private constant BIPS_PRECISION = 10_000;
    uint256 private constant MAX_TIMELOCKS = 10_000;

    mapping(address => Timelock[]) public timelocks;
    mapping(address => mapping(address => uint256)) internal _allowances;

    event Approval(address indexed from, address indexed spender, uint256 amount);
    event ScheduleCreated(address indexed from, uint256 indexed scheduleId);

    event ScheduleFunded(
        address indexed from,
        address indexed to,
        uint256 indexed scheduleId,
        uint256 amount,
        uint256 commencementTimestamp,
        uint256 timelockId,
        address[] cancelableBy
    );

    event TimelockCanceled(
        address indexed canceledBy,
        address indexed target,
        uint256 indexed timelockIndex,
        address relaimTokenTo,
        uint256 canceledAmount,
        uint256 paidAmount
    );

    /**
        @dev Configure deployment for a specific token with release schedule security parameters
        @param _token The address of the token that will be released on the lockup schedule
        @param name_ TokenLockup ERC20 interface name. Should be Distinct from token. Example: "Token Name Lockup"
        @param symbol_ TokenLockup ERC20 interface symbol. Should be distinct from token symbol. Example: "TKN LOCKUP"
        @dev The symbol should end with " Unlock" & be less than 11 characters for MetaMask "custom token" compatibility
    */
    constructor (
        address _token,
        string memory name_,
        string memory symbol_,
        uint256 _minTimelockAmount,
        uint256 _maxReleaseDelay
    ) ReentrancyGuard() {
        require( _token != address(0), "Zero token address");

        _name = name_;
        _symbol = symbol_;
        token = IERC20Metadata(_token);

        // Setup minimal fund payment for timelock
        if ( _minTimelockAmount == 0 ) {
            _minTimelockAmount = 100 * (10 ** IERC20Metadata(_token).decimals()); // 100 tokens
        }

        minTimelockAmount = _minTimelockAmount;

        maxReleaseDelay = _maxReleaseDelay;
    }

    /**
        @notice Create a release schedule template that can be used to generate many token timelocks
        @param releaseCount Total number of releases including any initial "cliff'
        @param delayUntilFirstReleaseInSeconds "cliff" or 0 for immediate release
        @param initialReleasePortionInBips Portion to release in 100ths of 1% (10000 BIPS per 100%)
        @param periodBetweenReleasesInSeconds After the delay and initial release
            the remaining tokens will be distributed evenly across the remaining number of releases (releaseCount - 1)
        @return unlockScheduleId The id used to refer to the release schedule at the time of funding the schedule
    */
    function createReleaseSchedule(
        uint256 releaseCount,
        uint256 delayUntilFirstReleaseInSeconds,
        uint256 initialReleasePortionInBips,
        uint256 periodBetweenReleasesInSeconds
    ) external returns (uint256 unlockScheduleId) {
        require(delayUntilFirstReleaseInSeconds <= maxReleaseDelay, "first release > max");
        require(releaseCount >= 1, "< 1 release");
        require(initialReleasePortionInBips <= BIPS_PRECISION, "release > 100%");

        if (releaseCount > 1) {
            require(periodBetweenReleasesInSeconds > 0, "period = 0");
            require(initialReleasePortionInBips < BIPS_PRECISION, "released = 100%");
        } else if (releaseCount == 1) {
            require(initialReleasePortionInBips == BIPS_PRECISION, "released < 100%");
            require(periodBetweenReleasesInSeconds == 0, "period > 0");
        }

        releaseSchedules.push(ReleaseSchedule(
                releaseCount,
                delayUntilFirstReleaseInSeconds,
                initialReleasePortionInBips,
                periodBetweenReleasesInSeconds
            ));

        unlockScheduleId = releaseSchedules.length - 1;
        emit ScheduleCreated(msg.sender, unlockScheduleId);

        return unlockScheduleId;
    }

    /**
        @notice Fund the programmatic release of tokens to a recipient.
            WARNING: this function IS CANCELABLE by cancelableBy.
            If canceled the tokens that are locked at the time of the cancellation will be returned to the funder
            and unlocked tokens will be transferred to the recipient.
        @param to recipient address that will have tokens unlocked on a release schedule
        @param amount of tokens to transfer in base units (the smallest unit without the decimal point)
        @param commencementTimestamp the time the release schedule will start
        @param scheduleId the id of the release schedule that will be used to release the tokens
        @param cancelableBy array of canceler addresses
        @return success Always returns true on completion so that a function calling it can revert if the required call did not succeed
    */
    function fundReleaseSchedule(
        address to,
        uint256 amount,
        uint256 commencementTimestamp, // unix timestamp
        uint256 scheduleId,
        address[] calldata cancelableBy
    ) public nonReentrant returns (bool success) {
        require(cancelableBy.length <= 10, "max 10 cancelableBy addressees");

        uint256 timelockId = _fund(to, amount, commencementTimestamp, scheduleId);

        if (cancelableBy.length > 0) {
            timelocks[to][timelockId].cancelableBy = cancelableBy;
        }

        emit ScheduleFunded(msg.sender, to, scheduleId, amount, commencementTimestamp, timelockId, cancelableBy);
        return true;
    }

    function _fund(
        address to,
        uint256 amount,
        uint256 commencementTimestamp, // unix timestamp
        uint256 scheduleId)
    internal returns (uint256) {
        require(timelocks[to].length <= MAX_TIMELOCKS, "Max timelocks exceeded");
        require(amount >= minTimelockAmount, "amount < min funding");
        require(to != address(0), "to 0 address");
        require(scheduleId < releaseSchedules.length, "bad scheduleId");
        require(amount >= releaseSchedules[scheduleId].releaseCount, "< 1 token per release");

        uint256 tokensBalance = token.balanceOf(address(this));
        // It will revert via ERC20 implementation if there's no allowance
        token.safeTransferFrom(msg.sender, address(this), amount);
        require( token.balanceOf(address(this)) - tokensBalance == amount, "amount transferred not equal to amount received");

        require(
            commencementTimestamp + releaseSchedules[scheduleId].delayUntilFirstReleaseInSeconds <=
            block.timestamp + maxReleaseDelay
        , "initial release out of range");

        Timelock memory timelock;
        timelock.scheduleId = scheduleId;
        timelock.commencementTimestamp = commencementTimestamp;
        timelock.totalAmount = amount;

        timelocks[to].push(timelock);
        return timelockCountOf(to) - 1;
    }

    /**
        @notice Cancel a cancelable timelock created by the fundReleaseSchedule function.
            WARNING: this function cannot cancel a release schedule created by fundReleaseSchedule
            If canceled the tokens that are locked at the time of the cancellation will be returned to the funder
            and unlocked tokens will be transferred to the recipient.
        @param target The address that would receive the tokens when released from the timelock.
        @param timelockIndex timelock index
        @param target The address that would receive the tokens when released from the timelock
        @param scheduleId require it matches expected
        @param commencementTimestamp require it matches expected
        @param totalAmount require it matches expected
        @param reclaimTokenTo reclaim token to
        @return success Always returns true on completion so that a function calling it can revert if the required call did not succeed
    */
    function cancelTimelock(
        address target,
        uint256 timelockIndex,
        uint256 scheduleId,
        uint256 commencementTimestamp,
        uint256 totalAmount,
        address reclaimTokenTo
    ) external nonReentrant returns (bool success) {
        require(timelockCountOf(target) > timelockIndex, "invalid timelock");
        require(reclaimTokenTo != address(0), "Invalid reclaimTokenTo");

        Timelock storage timelock = timelocks[target][timelockIndex];

        require(_canBeCanceled(timelock), "You are not allowed to cancel this timelock");
        require(timelock.scheduleId == scheduleId, "Expected scheduleId does not match");
        require(timelock.commencementTimestamp == commencementTimestamp, "Expected commencementTimestamp does not match");
        require(timelock.totalAmount == totalAmount, "Expected totalAmount does not match");

        uint256 canceledAmount = lockedBalanceOfTimelock(target, timelockIndex);

        require(canceledAmount > 0, "Timelock has no value left");

        uint256 paidAmount = unlockedBalanceOfTimelock(target, timelockIndex);
        
        token.safeTransfer(reclaimTokenTo, canceledAmount);
        
        if (paidAmount > 0) {
            token.safeTransfer(target, paidAmount);
        }

        emit TimelockCanceled(msg.sender, target, timelockIndex, reclaimTokenTo, canceledAmount, paidAmount);

        timelock.tokensTransferred = timelock.totalAmount;
        return true;
    }

    /**
     *  @notice Check if timelock can be cancelable by msg.sender
     */
    function _canBeCanceled(Timelock storage timelock) view private returns (bool) {
        uint256 len = timelock.cancelableBy.length;
        for (uint256 i = 0; i < len; i++) {
            if (msg.sender == timelock.cancelableBy[i]) {
                return true;
            }
        }
        return false;
    }

    /**
     *  @notice Batch version of fund cancelable release schedule
     *  @param to An array of recipient address that will have tokens unlocked on a release schedule
     *  @param amounts An array of amount of tokens to transfer in base units (the smallest unit without the decimal point)
     *  @param commencementTimestamps An array of the time the release schedule will start
     *  @param scheduleIds An array of the id of the release schedule that will be used to release the tokens
     *  @param cancelableBy An array of cancelables
     *  @return success Always returns true on completion so that a function calling it can revert if the required call did not succeed
     */
    function batchFundReleaseSchedule(
        address[] calldata to,
        uint[] calldata amounts,
        uint[] calldata commencementTimestamps,
        uint[] calldata scheduleIds,
        address[] calldata cancelableBy
    ) external returns (bool success) {
        require(to.length == amounts.length, "mismatched array length");
        require(to.length == commencementTimestamps.length, "mismatched array length");
        require(to.length == scheduleIds.length, "mismatched array length");

        for (uint256 i = 0; i < to.length; i++) {
            require(fundReleaseSchedule(
                    to[i],
                    amounts[i],
                    commencementTimestamps[i],
                    scheduleIds[i],
                    cancelableBy
                ), "Cannot release schedule");
        }

        return true;
    }

    /**
        @notice Get The total locked balance of an address for all timelocks
        @param who Address to calculate
        @return amount The total locked amount of tokens for all of the who address's timelocks
    */
    function lockedBalanceOf(address who) public view returns (uint256 amount) {
        uint256 len = timelockCountOf(who);
        for (uint256 i = 0; i < len; i++) {
            amount += lockedBalanceOfTimelock(who, i);
        }
        return amount;
    }
    /**
        @notice Get The total unlocked balance of an address for all timelocks
        @param who Address to calculate
        @return amount The total unlocked amount of tokens for all of the who address's timelocks
    */
    function unlockedBalanceOf(address who) public view returns (uint256 amount) {
        uint256 len = timelockCountOf(who);
        for (uint256 i = 0; i < len; i++) {
            amount += unlockedBalanceOfTimelock(who, i);
        }
        return amount;
    }

    /**
        @notice Get The locked balance for a specific address and specific timelock
        @param who The address to check
        @param timelockIndex Specific timelock belonging to the who address
        @return locked Balance of the timelock
    */
    function lockedBalanceOfTimelock(address who, uint256 timelockIndex) public view returns (uint256 locked) {
        Timelock memory timelock = timelockOf(who, timelockIndex);
        if (timelock.totalAmount <= timelock.tokensTransferred) {
            return 0;
        } else {
            return timelock.totalAmount - totalUnlockedToDateOfTimelock(who, timelockIndex);
        }
    }

    /**
        @notice Get the unlocked balance for a specific address and specific timelock
        @param who the address to check
        @param timelockIndex for a specific timelock belonging to the who address
        @return unlocked balance of the timelock
    */
    function unlockedBalanceOfTimelock(address who, uint256 timelockIndex) public view returns (uint256 unlocked) {
        Timelock memory timelock = timelockOf(who, timelockIndex);
        if (timelock.totalAmount <= timelock.tokensTransferred) {
            return 0;
        } else {
            return totalUnlockedToDateOfTimelock(who, timelockIndex) - timelock.tokensTransferred;
        }
    }

    /**
        @notice Check the total remaining balance of a timelock including the locked and unlocked portions
        @param who the address to check
        @param timelockIndex  Specific timelock belonging to the who address
        @return total remaining balance of a timelock
     */
    function balanceOfTimelock(address who, uint256 timelockIndex) external view returns (uint256) {
        Timelock memory timelock = timelockOf(who, timelockIndex);
        if (timelock.totalAmount <= timelock.tokensTransferred) {
            return 0;
        } else {
            return timelock.totalAmount - timelock.tokensTransferred; 
        }
    }

    /**
        @notice Gets the total locked and unlocked balance of a specific address's timelocks
        @param who The address to check
        @param timelockIndex The index of the timelock for the who address
        @return total Locked and unlocked amount for the specified timelock
    */
    function totalUnlockedToDateOfTimelock(address who, uint256 timelockIndex) public view returns (uint256 total) {
        Timelock memory _timelock = timelockOf(who, timelockIndex);

        return calculateUnlocked(
            _timelock.commencementTimestamp,
            block.timestamp,
            _timelock.totalAmount,
            _timelock.scheduleId
        );
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
    */
    function balanceOf(address who) external view returns (uint256) {
        return unlockedBalanceOf(who) + lockedBalanceOf(who);
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
    */
    function transfer(address to, uint256 value) external returns (bool) {
        return _transfer(msg.sender, to, value);
    }
    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
    */
    function transferFrom(address from, address to, uint256 value) external returns (bool) {
        require(_allowances[from][msg.sender] >= value, "value > allowance");
        _allowances[from][msg.sender] -= value;
        emit Approval(from, msg.sender, _allowances[from][msg.sender]);
        return _transfer(from, to, value);
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
        @dev Code from OpenZeppelin's contract/token/ERC20/ERC20.sol, modified
    */
    function approve(address spender, uint256 amount) external returns (bool) {
        _approve(msg.sender, spender, amount);
        return true;
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
        @dev Code from OpenZeppelin's contract/token/ERC20/ERC20.sol, modified
    */
    function allowance(address owner, address spender) external view returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
        @dev Code from OpenZeppelin's contract/token/ERC20/ERC20.sol, modified
    */
    function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
        _approve(msg.sender, spender, _allowances[msg.sender][spender] + addedValue);
        return true;
    }

    /**
        @notice ERC20 standard interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
        @dev Code from OpenZeppelin's contract/token/ERC20/ERC20.sol, modified
    */
    function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
        uint256 currentAllowance = _allowances[msg.sender][spender];
        require(currentAllowance >= subtractedValue, "decrease > allowance");
        _approve(msg.sender, spender, currentAllowance - subtractedValue);
        return true;
    }
    /**
        @notice ERC20 details interface function
            TokenLockup is a Proxy to an ERC20 token and not an independend token.
            this functionality is provided as a convenience function
            for interacting with the contract using the ERC20 token wallets interface.
         @dev this function returns the decimals of the token contract that the TokenLockup proxies
    */
    function decimals() external view returns (uint8) {
        return token.decimals();
    }

    /// @notice ERC20 standard interfaces function
    /// @return The name of the TokenLockup contract.
    ///     WARNING: this is different than the underlying token that the TokenLockup is a proxy for.
    function name() external view returns (string memory) {
        return _name;
    }

    /// @notice ERC20 standard interfaces function
    /// @return The symbol of the TokenLockup contract.
    ///     WARNING: this is different than the underlying token that the TokenLockup is a proxy for.
    function symbol() external view returns (string memory) {
        return _symbol;
    }
    /// @notice ERC20 standard interface function.
    /// @return Total of tokens for all timelocks and all addresses held by the TokenLockup smart contract.
    function totalSupply() external view returns (uint256) {
        return token.balanceOf(address(this));
    }

    function _transfer(address from, address to, uint256 value) internal nonReentrant returns (bool) {
        require(unlockedBalanceOf(from) >= value, "amount > unlocked");

        uint256 remainingTransfer = value;

        // transfer from unlocked tokens
        for (uint256 i = 0; i < timelockCountOf(from); i++) {
            uint256 _unlockedBalanceOfTimelock = unlockedBalanceOfTimelock(from, i);
            // if the timelock has no value left
            if (timelocks[from][i].tokensTransferred == timelocks[from][i].totalAmount) {
                continue;
            } else if (remainingTransfer > _unlockedBalanceOfTimelock) {
                // if the remainingTransfer is more than the unlocked balance use it all
                remainingTransfer -= _unlockedBalanceOfTimelock;
                timelocks[from][i].tokensTransferred += _unlockedBalanceOfTimelock;
            } else {
                // if the remainingTransfer is less than or equal to the unlocked balance
                // use part or all and exit the loop
                timelocks[from][i].tokensTransferred += remainingTransfer;
                remainingTransfer = 0;
                break;
            }
        }

        // should never have a remainingTransfer amount at this point
        require(remainingTransfer == 0, "bad transfer");

        token.safeTransfer(to, value);
        return true;
    }

    /**
        @notice transfers the unlocked token from an address's specific timelock
            It is typically more convenient to call transfer. But if the account has many timelocks the cost of gas
            for calling transfer may be too high. Calling transferTimelock from a specific timelock limits the transfer cost.
        @param to the address that the tokens will be transferred to
        @param value the number of token base units to me transferred to the to address
        @param timelockId the specific timelock of the function caller to transfer unlocked tokens from
        @return bool always true when completed
    */

    function transferTimelock(address to, uint256 value, uint256 timelockId) external nonReentrant returns (bool) {
        require(unlockedBalanceOfTimelock(msg.sender, timelockId) >= value, "amount > unlocked");
        timelocks[msg.sender][timelockId].tokensTransferred += value;
        token.safeTransfer(to, value);
        return true;
    }

    /**
        @notice calculates how many tokens would be released at a specified time for a scheduleId.
            This is independent of any specific address or address's timelock.
        @param commencedTimestamp the commencement time to use in the calculation for the scheduled
        @param currentTimestamp the timestamp to calculate unlocked tokens for
        @param amount the amount of tokens
        @param scheduleId the schedule id used to calculate the unlocked amount
        @return unlocked the total amount unlocked for the schedule given the other parameters
    */
    function calculateUnlocked(
        uint256 commencedTimestamp,
        uint256 currentTimestamp,
        uint256 amount,
        uint256 scheduleId
    ) public view returns (uint256 unlocked) {
        return calculateUnlocked(commencedTimestamp, currentTimestamp, amount, releaseSchedules[scheduleId]);
    }

    // Code from OpenZeppelin's contract/token/ERC20/ERC20.sol, modified
    function _approve(address owner, address spender, uint256 amount) internal {
        require(owner != address(0), "owner is 0 address");
        require(spender != address(0), "spender is 0 address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    // @notice the total number of schedules that have been created
    function scheduleCount() external view returns (uint256 count) {
        return releaseSchedules.length;
    }

    /**
        @notice Get the struct details for an address's specific timelock
        @param who Address to check
        @param index The index of the timelock for the who address
        @return timelock Struct with the attributes of the timelock
    */
    function timelockOf(address who, uint256 index) public view returns (Timelock memory timelock) {
        return timelocks[who][index];
    }

    // @notice returns the total count of timelocks for a specific address
    function timelockCountOf(address who) public view returns (uint256) {
        return timelocks[who].length;
    }

    /**
        @notice calculates how many tokens would be released at a specified time for a ReleaseSchedule struct.
            This is independent of any specific address or address's timelock.
        @param commencedTimestamp the commencement time to use in the calculation for the scheduled
        @param currentTimestamp the timestamp to calculate unlocked tokens for
        @param amount the amount of tokens
        @param releaseSchedule a ReleaseSchedule struct used to calculate the unlocked amount
        @return unlocked the total amount unlocked for the schedule given the other parameters
    */
    function calculateUnlocked(
        uint256 commencedTimestamp,
        uint256 currentTimestamp,
        uint256 amount,
        ReleaseSchedule memory releaseSchedule)
    public pure returns (uint256 unlocked) {
        return calculateUnlocked(
            commencedTimestamp,
            currentTimestamp,
            amount,
            releaseSchedule.releaseCount,
            releaseSchedule.delayUntilFirstReleaseInSeconds,
            releaseSchedule.initialReleasePortionInBips,
            releaseSchedule.periodBetweenReleasesInSeconds
        );
    }

    /**
        @notice The same functionality as above function with spread format of `releaseSchedule` arg
        @param commencedTimestamp the commencement time to use in the calculation for the scheduled
        @param currentTimestamp the timestamp to calculate unlocked tokens for
        @param amount the amount of tokens
        @param releaseCount Total number of releases including any initial "cliff'
        @param delayUntilFirstReleaseInSeconds "cliff" or 0 for immediate release
        @param initialReleasePortionInBips Portion to release in 100ths of 1% (10000 BIPS per 100%)
        @param periodBetweenReleasesInSeconds After the delay and initial release
        @return unlocked the total amount unlocked for the schedule given the other parameters
    */
    function calculateUnlocked(
        uint256 commencedTimestamp,
        uint256 currentTimestamp,
        uint256 amount,
        uint256 releaseCount,
        uint256 delayUntilFirstReleaseInSeconds,
        uint256 initialReleasePortionInBips,
        uint256 periodBetweenReleasesInSeconds
    ) public pure returns (uint256 unlocked) {
        if (commencedTimestamp > currentTimestamp) {
            return 0;
        }
        uint256 secondsElapsed;
        secondsElapsed = currentTimestamp - commencedTimestamp;

        // return the full amount if the total lockup period has expired
        // unlocked amounts in each period are truncated and round down remainders smaller than the smallest unit
        // unlocking the full amount unlocks any remainder amounts in the final unlock period
        // this is done first to reduce computation
        if (
            secondsElapsed >= delayUntilFirstReleaseInSeconds +
        (periodBetweenReleasesInSeconds * (releaseCount - 1))
        ) {
            return amount;
        }

        // unlock the initial release if the delay has elapsed
        if (secondsElapsed >= delayUntilFirstReleaseInSeconds) {
            unlocked = (amount * initialReleasePortionInBips) / BIPS_PRECISION;

            // if at least one period after the delay has passed
            uint256 diff;
            diff = secondsElapsed - delayUntilFirstReleaseInSeconds;
            if (diff >= periodBetweenReleasesInSeconds) {

                // calculate the number of additional periods that have passed (not including the initial release)
                // this discards any remainders (ie it truncates / rounds down)
                uint256 additionalUnlockedPeriods;
                additionalUnlockedPeriods = (secondsElapsed - delayUntilFirstReleaseInSeconds) / periodBetweenReleasesInSeconds;

                // calculate the amount of unlocked tokens for the additionalUnlockedPeriods
                // multiplication is applied before division to delay truncating to the smallest unit
                // this distributes unlocked tokens more evenly across unlock periods
                // than truncated division followed by multiplication
                unlocked += ((amount - unlocked) * additionalUnlockedPeriods) / (releaseCount - 1);
            }
        }

        return unlocked;
    }
}

File 2 of 7 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0-rc.1) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

File 3 of 7 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    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");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 7 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 5 of 7 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0-rc.1) (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
     * ====
     *
     * [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://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

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

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return 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 6 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 7 of 7 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"_minTimelockAmount","type":"uint256"},{"internalType":"uint256","name":"_maxReleaseDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"uint256","name":"scheduleId","type":"uint256"}],"name":"ScheduleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"scheduleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"commencementTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timelockId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"cancelableBy","type":"address[]"}],"name":"ScheduleFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"canceledBy","type":"address"},{"indexed":true,"internalType":"address","name":"target","type":"address"},{"indexed":true,"internalType":"uint256","name":"timelockIndex","type":"uint256"},{"indexed":false,"internalType":"address","name":"relaimTokenTo","type":"address"},{"indexed":false,"internalType":"uint256","name":"canceledAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paidAmount","type":"uint256"}],"name":"TimelockCanceled","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"timelockIndex","type":"uint256"}],"name":"balanceOfTimelock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"commencementTimestamps","type":"uint256[]"},{"internalType":"uint256[]","name":"scheduleIds","type":"uint256[]"},{"internalType":"address[]","name":"cancelableBy","type":"address[]"}],"name":"batchFundReleaseSchedule","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"commencedTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"components":[{"internalType":"uint256","name":"releaseCount","type":"uint256"},{"internalType":"uint256","name":"delayUntilFirstReleaseInSeconds","type":"uint256"},{"internalType":"uint256","name":"initialReleasePortionInBips","type":"uint256"},{"internalType":"uint256","name":"periodBetweenReleasesInSeconds","type":"uint256"}],"internalType":"struct TokenLockup.ReleaseSchedule","name":"releaseSchedule","type":"tuple"}],"name":"calculateUnlocked","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"commencedTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"releaseCount","type":"uint256"},{"internalType":"uint256","name":"delayUntilFirstReleaseInSeconds","type":"uint256"},{"internalType":"uint256","name":"initialReleasePortionInBips","type":"uint256"},{"internalType":"uint256","name":"periodBetweenReleasesInSeconds","type":"uint256"}],"name":"calculateUnlocked","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"commencedTimestamp","type":"uint256"},{"internalType":"uint256","name":"currentTimestamp","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"scheduleId","type":"uint256"}],"name":"calculateUnlocked","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"timelockIndex","type":"uint256"},{"internalType":"uint256","name":"scheduleId","type":"uint256"},{"internalType":"uint256","name":"commencementTimestamp","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"address","name":"reclaimTokenTo","type":"address"}],"name":"cancelTimelock","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"releaseCount","type":"uint256"},{"internalType":"uint256","name":"delayUntilFirstReleaseInSeconds","type":"uint256"},{"internalType":"uint256","name":"initialReleasePortionInBips","type":"uint256"},{"internalType":"uint256","name":"periodBetweenReleasesInSeconds","type":"uint256"}],"name":"createReleaseSchedule","outputs":[{"internalType":"uint256","name":"unlockScheduleId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"commencementTimestamp","type":"uint256"},{"internalType":"uint256","name":"scheduleId","type":"uint256"},{"internalType":"address[]","name":"cancelableBy","type":"address[]"}],"name":"fundReleaseSchedule","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"lockedBalanceOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"timelockIndex","type":"uint256"}],"name":"lockedBalanceOfTimelock","outputs":[{"internalType":"uint256","name":"locked","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxReleaseDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minTimelockAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"releaseSchedules","outputs":[{"internalType":"uint256","name":"releaseCount","type":"uint256"},{"internalType":"uint256","name":"delayUntilFirstReleaseInSeconds","type":"uint256"},{"internalType":"uint256","name":"initialReleasePortionInBips","type":"uint256"},{"internalType":"uint256","name":"periodBetweenReleasesInSeconds","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scheduleCount","outputs":[{"internalType":"uint256","name":"count","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"timelockCountOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"timelockOf","outputs":[{"components":[{"internalType":"uint256","name":"scheduleId","type":"uint256"},{"internalType":"uint256","name":"commencementTimestamp","type":"uint256"},{"internalType":"uint256","name":"tokensTransferred","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"address[]","name":"cancelableBy","type":"address[]"}],"internalType":"struct TokenLockup.Timelock","name":"timelock","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"timelocks","outputs":[{"internalType":"uint256","name":"scheduleId","type":"uint256"},{"internalType":"uint256","name":"commencementTimestamp","type":"uint256"},{"internalType":"uint256","name":"tokensTransferred","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"timelockIndex","type":"uint256"}],"name":"totalUnlockedToDateOfTimelock","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"timelockId","type":"uint256"}],"name":"transferTimelock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"unlockedBalanceOf","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"},{"internalType":"uint256","name":"timelockIndex","type":"uint256"}],"name":"unlockedBalanceOfTimelock","outputs":[{"internalType":"uint256","name":"unlocked","type":"uint256"}],"stateMutability":"view","type":"function"}]

60e06040523480156200001157600080fd5b506040516200324c3803806200324c8339810160408190526200003491620002cb565b60016000556001600160a01b038516620000895760405162461bcd60e51b81526020600482015260126024820152715a65726f20746f6b656e206164647265737360701b604482015260640160405180910390fd5b83516200009e90600190602087019062000172565b508251620000b490600290602086019062000172565b506001600160601b0319606086901b16608052816200015f57846001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156200010757600080fd5b505afa1580156200011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000142919062000364565b6200014f90600a620003d7565b6200015c90606462000498565b91505b60a09190915260c0525062000523915050565b8280546200018090620004ba565b90600052602060002090601f016020900481019282620001a45760008555620001ef565b82601f10620001bf57805160ff1916838001178555620001ef565b82800160010185558215620001ef579182015b82811115620001ef578251825591602001919060010190620001d2565b50620001fd92915062000201565b5090565b5b80821115620001fd576000815560010162000202565b600082601f83011262000229578081fd5b81516001600160401b03808211156200024657620002466200050d565b604051601f8301601f19908116603f011681019082821181831017156200027157620002716200050d565b816040528381526020925086838588010111156200028d578485fd5b8491505b83821015620002b0578582018301518183018401529082019062000291565b83821115620002c157848385830101525b9695505050505050565b600080600080600060a08688031215620002e3578081fd5b85516001600160a01b0381168114620002fa578182fd5b60208701519095506001600160401b038082111562000317578283fd5b6200032589838a0162000218565b955060408801519150808211156200033b578283fd5b506200034a8882890162000218565b606088015160809098015196999598509695949350505050565b60006020828403121562000376578081fd5b815160ff8116811462000387578182fd5b9392505050565b600181815b80851115620003cf578160001904821115620003b357620003b3620004f7565b80851615620003c157918102915b93841c939080029062000393565b509250929050565b60006200038760ff841683600082620003f35750600162000492565b81620004025750600062000492565b81600181146200041b5760028114620004265762000446565b600191505062000492565b60ff8411156200043a576200043a620004f7565b50506001821b62000492565b5060208310610133831016604e8410600b84101617156200046b575081810a62000492565b6200047783836200038e565b80600019048211156200048e576200048e620004f7565b0290505b92915050565b6000816000190483118215151615620004b557620004b5620004f7565b500290565b600181811c90821680620004cf57607f821691505b60208210811415620004f157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60805160601c60a05160c051612ca2620005aa6000396000818161027a01528181610a9c01526120f90152600081816102fc0152611db3015260008181610505015281816109220152818161095c01528181610a1101528181610f08015281816115e701528181611d1801528181611f3101528181611fc2015261200b0152612ca26000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c806382074ac21161011a578063a9b1f051116100ad578063b7ef81e11161007c578063b7ef81e114610499578063dd62ed3e146104a1578063ea612ae8146104da578063f7308d2c146104ed578063fc0c546a1461050057600080fd5b8063a9b1f05114610437578063ad061e251461044a578063b30bfa3d1461045d578063b7ed47851461048657600080fd5b806395d89b41116100e957806395d89b41146103f657806396305c89146103fe578063a457c2d714610411578063a9059cbb1461042457600080fd5b806382074ac21461039d57806384955c88146103bd5780638e4f11ff146103d057806390fc7e91146103e357600080fd5b806323b872dd11610192578063593557361161016157806359355736146103315780635f7c5377146103445780636aea0d2e1461035757806370a082311461038a57600080fd5b806323b872dd146102ca578063313ce567146102dd578063370de043146102f7578063395093511461031e57600080fd5b806314cf86eb116101ce57806314cf86eb1461027557806318160ddd1461029c57806321bb56d7146102a457806321fac8f1146102b757600080fd5b806306fdde0314610200578063095ea7b31461021e5780630c815103146102415780630f8ad1b414610262575b600080fd5b61020861053f565b6040516102159190612a12565b60405180910390f35b61023161022c36600461265d565b6105d1565b6040519015158152602001610215565b61025461024f36600461265d565b6105e8565b604051908152602001610215565b610231610270366004612727565b610617565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b6102546109f9565b6102546102b2366004612959565b610a98565b6102546102c536600461265d565b610dad565b6102316102d8366004612622565b610df6565b6102e5610f04565b60405160ff9091168152602001610215565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b61023161032c36600461265d565b610f97565b61025461033f3660046125d6565b610fd3565b6102546103523660046128b9565b611026565b61036a610365366004612889565b611050565b604080519485526020850193909352918301526060820152608001610215565b6102546103983660046125d6565b61108a565b6103b06103ab36600461265d565b6110a8565b6040516102159190612a7c565b6102546103cb3660046125d6565b6111bd565b6102316103de3660046126b8565b611209565b6102546103f136600461298a565b611339565b61020861141c565b61025461040c366004612959565b61142b565b61023161041f36600461265d565b61149a565b61023161043236600461265d565b61151e565b610231610445366004612686565b61152b565b61025461045836600461265d565b61161b565b61025461046b3660046125d6565b6001600160a01b031660009081526004602052604090205490565b61023161049436600461277e565b611657565b600354610254565b6102546104af3660046125f0565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b61036a6104e836600461265d565b6117e5565b6102546104fb36600461265d565b61182b565b6105277f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610215565b60606001805461054e90612c00565b80601f016020809104026020016040519081016040528092919081815260200182805461057a90612c00565b80156105c75780601f1061059c576101008083540402835291602001916105c7565b820191906000526020600020905b8154815290600101906020018083116105aa57829003601f168201915b5050505050905090565b60006105de33848461186c565b5060015b92915050565b6000806105f584846110a8565b905061060f8160200151428360600151846000015161142b565b949350505050565b6000610621611965565b85610641886001600160a01b031660009081526004602052604090205490565b116106865760405162461bcd60e51b815260206004820152601060248201526f696e76616c69642074696d656c6f636b60801b60448201526064015b60405180910390fd5b6001600160a01b0382166106d55760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964207265636c61696d546f6b656e546f60501b604482015260640161067d565b6001600160a01b038716600090815260046020526040812080548890811061070d57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050610726816119bf565b6107865760405162461bcd60e51b815260206004820152602b60248201527f596f7520617265206e6f7420616c6c6f77656420746f2063616e63656c20746860448201526a69732074696d656c6f636b60a81b606482015260840161067d565b805486146107e15760405162461bcd60e51b815260206004820152602260248201527f4578706563746564207363686564756c65496420646f6573206e6f74206d61746044820152610c6d60f31b606482015260840161067d565b8481600101541461084a5760405162461bcd60e51b815260206004820152602d60248201527f457870656374656420636f6d6d656e63656d656e7454696d657374616d70206460448201526c0decae640dcdee840dac2e8c6d609b1b606482015260840161067d565b838160030154146108a95760405162461bcd60e51b815260206004820152602360248201527f457870656374656420746f74616c416d6f756e7420646f6573206e6f74206d616044820152620e8c6d60eb1b606482015260840161067d565b60006108b5898961182b565b9050600081116109075760405162461bcd60e51b815260206004820152601a60248201527f54696d656c6f636b20686173206e6f2076616c7565206c656674000000000000604482015260640161067d565b60006109138a8a610dad565b90506109496001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168684611a36565b8015610983576109836001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168b83611a36565b604080516001600160a01b038781168252602082018590529181018390528a918c169033907f6945f4788d8a6b16089d616d1f7bb52372bfdbc43addd3386a7842db4199986a9060600160405180910390a4505060038101546002909101555060016109ef6001600055565b9695505050505050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610a5b57600080fd5b505afa158015610a6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9391906128a1565b905090565b60007f0000000000000000000000000000000000000000000000000000000000000000841115610b005760405162461bcd60e51b81526020600482015260136024820152720ccd2e4e6e840e4cad8cac2e6ca407c40dac2f606b1b604482015260640161067d565b6001851015610b3f5760405162461bcd60e51b815260206004820152600b60248201526a3c20312072656c6561736560a81b604482015260640161067d565b612710831115610b825760405162461bcd60e51b815260206004820152600e60248201526d72656c65617365203e203130302560901b604482015260640161067d565b6001851115610c105760008211610bc85760405162461bcd60e51b815260206004820152600a6024820152690706572696f64203d20360b41b604482015260640161067d565b6127108310610c0b5760405162461bcd60e51b815260206004820152600f60248201526e72656c6561736564203d203130302560881b604482015260640161067d565b610c97565b8460011415610c97576127108314610c5c5760405162461bcd60e51b815260206004820152600f60248201526e72656c6561736564203c203130302560881b604482015260640161067d565b8115610c975760405162461bcd60e51b815260206004820152600a6024820152690706572696f64203e20360b41b604482015260640161067d565b6040805160808101825286815260208101868152918101858152606082018581526003805460018082018355600083905294517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b60049092029182015594517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c86015591517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d850155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e909301929092559054610d759190612bbd565b604051909150819033907f9c52cb9bbb9b7fa6ddb26d1e82afc4e62c9ec50c0f3488c10bb8ad22d4edc4c390600090a3949350505050565b600080610dba84846110a8565b90508060400151816060015111610dd55760009150506105e2565b8060400151610de485856105e8565b610dee9190612bbd565b9150506105e2565b6001600160a01b0383166000908152600560209081526040808320338452909152812054821115610e5d5760405162461bcd60e51b815260206004820152601160248201527076616c7565203e20616c6c6f77616e636560781b604482015260640161067d565b6001600160a01b038416600090815260056020908152604080832033845290915281208054849290610e90908490612bbd565b90915550506001600160a01b038416600081815260056020908152604080832033808552908352928190205490519081529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3610efa848484611a9e565b90505b9392505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5f57600080fd5b505afa158015610f73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9391906129d5565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916105de918590610fce908690612b66565b61186c565b6001600160a01b03811660009081526004602052604081205460005b8181101561101f57611001848261182b565b61100b9084612b66565b92508061101781612c3b565b915050610fef565b5050919050565b60006110478585858560000151866020015187604001518860600151611339565b95945050505050565b6003818154811061106057600080fd5b60009182526020909120600490910201805460018201546002830154600390930154919350919084565b600061109582610fd3565b61109e836111bd565b6105e29190612b66565b6110da6040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b6001600160a01b038316600090815260046020526040902080548390811061111257634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482018054806020026020016040519081016040528092919081815260200182805480156111ac57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161118e575b505050505081525050905092915050565b6001600160a01b03811660009081526004602052604081205460005b8181101561101f576111eb8482610dad565b6111f59084612b66565b92508061120181612c3b565b9150506111d9565b6000611213611965565b600a8211156112645760405162461bcd60e51b815260206004820152601e60248201527f6d61782031302063616e63656c61626c65427920616464726573736565730000604482015260640161067d565b600061127288888888611d4e565b905082156112d6576001600160a01b0388166000908152600460205260409020805485918591849081106112b657634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160040191906112d49291906124a3565b505b84886001600160a01b0316336001600160a01b03167f8d92942330bb9e8e714a4f66aa3eefe27f66d05b8ae4b6f6889e5a64a16155be8a8a868a8a604051611322959493929190612b00565b60405180910390a460019150506109ef6001600055565b60008688111561134b57506000611411565b60006113578989612bbd565b9050611364600187612bbd565b61136e9084612b9e565b6113789086612b66565b81106113875786915050611411565b84811061140f5761271061139b8589612b9e565b6113a59190612b7e565b915060006113b38683612bbd565b905083811061140d576000846113c98885612bbd565b6113d39190612b7e565b90506113e0600189612bbd565b816113eb868c612bbd565b6113f59190612b9e565b6113ff9190612b7e565b6114099085612b66565b9350505b505b505b979650505050505050565b60606002805461054e90612c00565b60006110478585856003868154811061145457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201604051806080016040529081600082015481526020016001820154815260200160028201548152602001600382015481525050611026565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156115055760405162461bcd60e51b81526020600482015260146024820152736465637265617365203e20616c6c6f77616e636560601b604482015260640161067d565b6115143385610fce8685612bbd565b5060019392505050565b6000610efd338484611a9e565b6000611535611965565b826115403384610dad565b10156115825760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d080f881d5b9b1bd8dad959607a1b604482015260640161067d565b3360009081526004602052604090208054849190849081106115b457634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160020160008282546115d49190612b66565b9091555061160e90506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585611a36565b506001610efd6001600055565b60008061162884846110a8565b905080604001518160600151116116435760009150506105e2565b80604001518160600151610dee9190612bbd565b60008988146116785760405162461bcd60e51b815260040161067d90612a45565b8986146116975760405162461bcd60e51b815260040161067d90612a45565b8984146116b65760405162461bcd60e51b815260040161067d90612a45565b60005b8a8110156117d3576117758c8c838181106116e457634e487b7160e01b600052603260045260246000fd5b90506020020160208101906116f991906125d6565b8b8b8481811061171957634e487b7160e01b600052603260045260246000fd5b905060200201358a8a8581811061174057634e487b7160e01b600052603260045260246000fd5b9050602002013589898681811061176757634e487b7160e01b600052603260045260246000fd5b905060200201358888611209565b6117c15760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f742072656c65617365207363686564756c65000000000000000000604482015260640161067d565b806117cb81612c3b565b9150506116b9565b5060019b9a5050505050505050505050565b6004602052816000526040600020818154811061180157600080fd5b60009182526020909120600590910201805460018201546002830154600390930154919450925084565b60008061183884846110a8565b905080604001518160600151116118535760009150506105e2565b61185d84846105e8565b8160600151610dee9190612bbd565b6001600160a01b0383166118b75760405162461bcd60e51b81526020600482015260126024820152716f776e65722069732030206164647265737360701b604482015260640161067d565b6001600160a01b0382166119045760405162461bcd60e51b81526020600482015260146024820152737370656e6465722069732030206164647265737360601b604482015260640161067d565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600260005414156119b85760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161067d565b6002600055565b6004810154600090815b81811015611a2c578360040181815481106119f457634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b0316331415611a1a575060019392505050565b80611a2481612c3b565b9150506119c9565b5060009392505050565b6040516001600160a01b038316602482015260448101829052611a9990849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612283565b505050565b6000611aa8611965565b81611ab2856111bd565b1015611af45760405162461bcd60e51b8152602060048201526011602482015270185b5bdd5b9d080f881d5b9b1bd8dad959607a1b604482015260640161067d565b8160005b6001600160a01b038616600090815260046020526040902054811015611ccd576000611b248783610dad565b6001600160a01b038816600090815260046020526040902080549192509083908110611b6057634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016003015460046000896001600160a01b03166001600160a01b031681526020019081526020016000208381548110611bb657634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201541415611bd45750611cbb565b80831115611c4e57611be68184612bbd565b6001600160a01b03881660009081526004602052604090208054919450829184908110611c2357634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016002016000828254611c439190612b66565b90915550611cb99050565b6001600160a01b0387166000908152600460205260409020805484919084908110611c8957634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016002016000828254611ca99190612b66565b9091555060009350611ccd915050565b505b80611cc581612c3b565b915050611af8565b508015611d0b5760405162461bcd60e51b815260206004820152600c60248201526b3130b2103a3930b739b332b960a11b604482015260640161067d565b611d3f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168585611a36565b6001915050610efd6001600055565b6001600160a01b0384166000908152600460205260408120546127101015611db15760405162461bcd60e51b815260206004820152601660248201527513585e081d1a5b595b1bd8dadcc8195e18d95959195960521b604482015260640161067d565b7f0000000000000000000000000000000000000000000000000000000000000000841015611e185760405162461bcd60e51b8152602060048201526014602482015273616d6f756e74203c206d696e2066756e64696e6760601b604482015260640161067d565b6001600160a01b038516611e5d5760405162461bcd60e51b815260206004820152600c60248201526b746f2030206164647265737360a01b604482015260640161067d565b6003548210611e9f5760405162461bcd60e51b815260206004820152600e60248201526d189859081cd8da19591d5b19525960921b604482015260640161067d565b60038281548110611ec057634e487b7160e01b600052603260045260246000fd5b906000526020600020906004020160000154841015611f195760405162461bcd60e51b81526020600482015260156024820152743c203120746f6b656e207065722072656c6561736560581b604482015260640161067d565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015611f7b57600080fd5b505afa158015611f8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb391906128a1565b9050611fea6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333088612355565b6040516370a0823160e01b8152306004820152859082906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a082319060240160206040518083038186803b15801561204d57600080fd5b505afa158015612061573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061208591906128a1565b61208f9190612bbd565b146120f45760405162461bcd60e51b815260206004820152602f60248201527f616d6f756e74207472616e73666572726564206e6f7420657175616c20746f2060448201526e185b5bdd5b9d081c9958d95a5d9959608a1b606482015260840161067d565b61211e7f000000000000000000000000000000000000000000000000000000000000000042612b66565b6003848154811061213f57634e487b7160e01b600052603260045260246000fd5b9060005260206000209060040201600101548561215c9190612b66565b11156121aa5760405162461bcd60e51b815260206004820152601c60248201527f696e697469616c2072656c65617365206f7574206f662072616e676500000000604482015260640161067d565b6121dc6040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b8381526020808201868152606083018881526001600160a01b038a1660009081526004808552604080832080546001818101835591855293879020885160059095020193845594519483019490945592850151600282015590516003820155608084015180518594929361225593908501920190612506565b5050506001612279886001600160a01b031660009081526004602052604090205490565b6114119190612bbd565b60006122d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166123939092919063ffffffff16565b805190915015611a9957808060200190518101906122f69190612869565b611a995760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161067d565b6040516001600160a01b038085166024830152831660448201526064810182905261238d9085906323b872dd60e01b90608401611a62565b50505050565b6060610efa848460008585600080866001600160a01b031685876040516123ba91906129f6565b60006040518083038185875af1925050503d80600081146123f7576040519150601f19603f3d011682016040523d82523d6000602084013e6123fc565b606091505b5091509150611411878383876060831561247457825161246d576001600160a01b0385163b61246d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161067d565b508161060f565b61060f83838151156124895781518083602001fd5b8060405162461bcd60e51b815260040161067d9190612a12565b8280548282559060005260206000209081019282156124f6579160200282015b828111156124f65781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906124c3565b5061250292915061255b565b5090565b8280548282559060005260206000209081019282156124f6579160200282015b828111156124f657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612526565b5b80821115612502576000815560010161255c565b80356001600160a01b038116811461258757600080fd5b919050565b60008083601f84011261259d578182fd5b50813567ffffffffffffffff8111156125b4578182fd5b6020830191508360208260051b85010111156125cf57600080fd5b9250929050565b6000602082840312156125e7578081fd5b610efd82612570565b60008060408385031215612602578081fd5b61260b83612570565b915061261960208401612570565b90509250929050565b600080600060608486031215612636578081fd5b61263f84612570565b925061264d60208501612570565b9150604084013590509250925092565b6000806040838503121561266f578182fd5b61267883612570565b946020939093013593505050565b60008060006060848603121561269a578283fd5b6126a384612570565b95602085013595506040909401359392505050565b60008060008060008060a087890312156126d0578182fd5b6126d987612570565b9550602087013594506040870135935060608701359250608087013567ffffffffffffffff811115612709578283fd5b61271589828a0161258c565b979a9699509497509295939492505050565b60008060008060008060c0878903121561273f578182fd5b61274887612570565b95506020870135945060408701359350606087013592506080870135915061277260a08801612570565b90509295509295509295565b60008060008060008060008060008060a08b8d03121561279c578384fd5b8a3567ffffffffffffffff808211156127b3578586fd5b6127bf8e838f0161258c565b909c509a5060208d01359150808211156127d7578586fd5b6127e38e838f0161258c565b909a50985060408d01359150808211156127fb578586fd5b6128078e838f0161258c565b909850965060608d013591508082111561281f578586fd5b61282b8e838f0161258c565b909650945060808d0135915080821115612843578384fd5b506128508d828e0161258c565b915080935050809150509295989b9194979a5092959850565b60006020828403121561287a578081fd5b81518015158114610efd578182fd5b60006020828403121561289a578081fd5b5035919050565b6000602082840312156128b2578081fd5b5051919050565b60008060008084860360e08112156128cf578283fd5b8535945060208601359350604086013592506080605f19820112156128f2578182fd5b506040516080810181811067ffffffffffffffff8211171561292257634e487b7160e01b83526041600452602483fd5b8060405250606086013581526080860135602082015260a0860135604082015260c086013560608201528091505092959194509250565b6000806000806080858703121561296e578182fd5b5050823594602084013594506040840135936060013592509050565b600080600080600080600060e0888a0312156129a4578081fd5b505085359760208701359750604087013596606081013596506080810135955060a0810135945060c0013592509050565b6000602082840312156129e6578081fd5b815160ff81168114610efd578182fd5b60008251612a08818460208701612bd4565b9190910192915050565b6020815260008251806020840152612a31816040850160208701612bd4565b601f01601f19169190910160400192915050565b60208082526017908201527f6d69736d617463686564206172726179206c656e677468000000000000000000604082015260600190565b6000602080835260c083018451828501528185015160408501526040850151606085015260608501516080850152608085015160a08086015281815180845260e08701915084830193508592505b80831015612af55783516001600160a01b031682526020820191508484019350600183019250612aca565b509695505050505050565b60006080820187835260208781850152866040850152608060608501528185835260a085019050869250835b86811015612b58576001600160a01b03612b4585612570565b1682529282019290820190600101612b2c565b509998505050505050505050565b60008219821115612b7957612b79612c56565b500190565b600082612b9957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615612bb857612bb8612c56565b500290565b600082821015612bcf57612bcf612c56565b500390565b60005b83811015612bef578181015183820152602001612bd7565b8381111561238d5750506000910152565b600181811c90821680612c1457607f821691505b60208210811415612c3557634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612c4f57612c4f612c56565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220a823d6c9c0e50cfadf9a2d5dd60c7b86a695b284fc64c7560fe0633c98b19eea64736f6c63430008040033000000000000000000000000d738886f7bdf602ea898b9fc9aecd99b11d0ea1d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014ad3680000000000000000000000000000000000000000000000000000000000000001958595a31204c6f636b75707320616e642056657374696e677300000000000000000000000000000000000000000000000000000000000000000000000000000958595a314c4f434b530000000000000000000000000000000000000000000000

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

000000000000000000000000d738886f7bdf602ea898b9fc9aecd99b11d0ea1d00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014ad3680000000000000000000000000000000000000000000000000000000000000001958595a31204c6f636b75707320616e642056657374696e677300000000000000000000000000000000000000000000000000000000000000000000000000000958595a314c4f434b530000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _token (address): 0xd738886f7bdf602ea898b9fc9aecd99b11d0ea1d
Arg [1] : name_ (string): XYZ1 Lockups and Vestings
Arg [2] : symbol_ (string): XYZ1LOCKS
Arg [3] : _minTimelockAmount (uint256): 0
Arg [4] : _maxReleaseDelay (uint256): 346896000

-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000d738886f7bdf602ea898b9fc9aecd99b11d0ea1d
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000014ad3680
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [6] : 58595a31204c6f636b75707320616e642056657374696e677300000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000009
Arg [8] : 58595a314c4f434b530000000000000000000000000000000000000000000000


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.