BNB Price: $618.91 (+2.08%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Withdraw925221172026-04-14 16:55:543 mins ago1776185754IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925208882026-04-14 16:46:4012 mins ago1776185200IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925204242026-04-14 16:43:1115 mins ago1776184991IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925200292026-04-14 16:40:1318 mins ago1776184813IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925197162026-04-14 16:37:5221 mins ago1776184672IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925191032026-04-14 16:33:1625 mins ago1776184396IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925187512026-04-14 16:30:3728 mins ago1776184237IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925185802026-04-14 16:29:2029 mins ago1776184160IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925180312026-04-14 16:25:1333 mins ago1776183913IN
0xFD07b28C...8CF47dF50
0 BNB0.000005350.06565
Withdraw925179332026-04-14 16:24:2934 mins ago1776183869IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925175972026-04-14 16:21:5836 mins ago1776183718IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925173122026-04-14 16:19:4939 mins ago1776183589IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925173032026-04-14 16:19:4539 mins ago1776183585IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925171642026-04-14 16:18:4340 mins ago1776183523IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925170232026-04-14 16:17:3941 mins ago1776183459IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925168502026-04-14 16:16:2142 mins ago1776183381IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925167922026-04-14 16:15:5542 mins ago1776183355IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925165962026-04-14 16:14:2744 mins ago1776183267IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925165012026-04-14 16:13:4445 mins ago1776183224IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925162672026-04-14 16:11:5946 mins ago1776183119IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925161752026-04-14 16:11:1747 mins ago1776183077IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925161202026-04-14 16:10:5248 mins ago1776183052IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925160942026-04-14 16:10:4048 mins ago1776183040IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
Withdraw925160342026-04-14 16:10:1348 mins ago1776183013IN
0xFD07b28C...8CF47dF50
0 BNB0.000004230.06565
Withdraw925159642026-04-14 16:09:4249 mins ago1776182982IN
0xFD07b28C...8CF47dF50
0 BNB0.000004190.065
View all transactions

Latest 1 internal transaction

Parent Transaction Hash Block From To
770745032026-01-24 4:20:5680 days ago1769228456  Contract Creation0 BNB
Cross-Chain Transactions
Loading...
Loading

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

Contract Name:
TokenLock

Compiler Version
v0.8.30+commit.73712a01

Optimization Enabled:
Yes with 200 runs

Other Settings:
prague EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.30;

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

contract TokenLock {
    using SafeERC20 for IERC20;

    uint256 public UPGRADE_LOCK_DURATION;

    mapping(address => LockedToken) public upgradeLockedTokens;

    IERC20 public lockToken;
    address public oldLock;
    address public owner;
    address public locker;

    struct LockedToken {
        uint256 locked;
        uint256 lockTime;
        int256 unlocked;
    }

    event Locking(address indexed user, uint256 amount);
    event Withdraw(address indexed user, uint256 amount);

    constructor(address _lockToken) {
        lockToken = IERC20(_lockToken);
        UPGRADE_LOCK_DURATION = 360 days;
        owner = msg.sender;
        locker = msg.sender;
    }
    function locking(address account, uint256 _lock) external {
        require(msg.sender == locker, "only locker");
        lockToken.safeTransferFrom(msg.sender, address(this), _lock);
        LockedToken storage lt = upgradeLockedTokens[account];
        uint256 _now = block.timestamp;
        if (_now < lt.lockTime + UPGRADE_LOCK_DURATION) {
            uint256 amount = (lt.locked * (_now - lt.lockTime)) /
                UPGRADE_LOCK_DURATION;
            lt.locked = lt.locked - amount + _lock;
            lt.unlocked += int256(amount);
        } else {
            lt.unlocked += int256(lt.locked);
            lt.locked = _lock;
        }
        lt.lockTime = _now;

        emit Locking(account, _lock);
    }

    function withdraw() external {
        LockedToken storage lt = upgradeLockedTokens[msg.sender];
        int256 unlocked = lt.unlocked;
        uint256 _now = block.timestamp;

        if (_now < lt.lockTime + UPGRADE_LOCK_DURATION) {
            unlocked += int256(
                (lt.locked * (_now - lt.lockTime)) / UPGRADE_LOCK_DURATION
            );
        } else {
            unlocked += int256(lt.locked);
        }

        require(unlocked > 0, "no token available");

        lt.unlocked -= unlocked;

        lockToken.safeTransfer(msg.sender, uint256(unlocked));

        emit Withdraw(msg.sender, uint256(unlocked));
    }

    function available(address _account) public view returns (uint256) {
        LockedToken memory lt = upgradeLockedTokens[_account];
        int256 unlocked = lt.unlocked;
        uint256 _now = block.timestamp;

        if (_now < lt.lockTime + UPGRADE_LOCK_DURATION) {
            unlocked += int256(
                (lt.locked * (_now - lt.lockTime)) / UPGRADE_LOCK_DURATION
            );
        } else {
            unlocked += int256(lt.locked);
        }
        return uint256(unlocked);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.5.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

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

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

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

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        if (!_safeTransfer(token, to, value, true)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        if (!_safeTransferFrom(token, from, to, value, true)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
        return _safeTransfer(token, to, value, false);
    }

    /**
     * @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
     */
    function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
        return _safeTransferFrom(token, from, to, value, false);
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        if (!_safeApprove(token, spender, value, false)) {
            if (!_safeApprove(token, spender, 0, true)) revert SafeERC20FailedOperation(address(token));
            if (!_safeApprove(token, spender, value, true)) revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that relies on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Oppositely, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity `token.transfer(to, value)` call, 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 to The recipient of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeTransfer(IERC20 token, address to, uint256 value, bool bubble) private returns (bool success) {
        bytes4 selector = IERC20.transfer.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(to, shr(96, not(0))))
            mstore(0x24, value)
            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
        }
    }

    /**
     * @dev Imitates a Solidity `token.transferFrom(from, to, value)` call, 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 from The sender of the tokens
     * @param to The recipient of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value,
        bool bubble
    ) private returns (bool success) {
        bytes4 selector = IERC20.transferFrom.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(from, shr(96, not(0))))
            mstore(0x24, and(to, shr(96, not(0))))
            mstore(0x44, value)
            success := call(gas(), token, 0, 0x00, 0x64, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
            mstore(0x60, 0)
        }
    }

    /**
     * @dev Imitates a Solidity `token.approve(spender, value)` call, 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 spender The spender of the tokens
     * @param value The amount of token to transfer
     * @param bubble Behavior switch if the transfer call reverts: bubble the revert reason or return a false boolean.
     */
    function _safeApprove(IERC20 token, address spender, uint256 value, bool bubble) private returns (bool success) {
        bytes4 selector = IERC20.approve.selector;

        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(0x00, selector)
            mstore(0x04, and(spender, shr(96, not(0))))
            mstore(0x24, value)
            success := call(gas(), token, 0, 0x00, 0x44, 0x00, 0x20)
            // if call success and return is true, all is good.
            // otherwise (not success or return is not true), we need to perform further checks
            if iszero(and(success, eq(mload(0x00), 1))) {
                // if the call was a failure and bubble is enabled, bubble the error
                if and(iszero(success), bubble) {
                    returndatacopy(fmp, 0x00, returndatasize())
                    revert(fmp, returndatasize())
                }
                // if the return value is not true, then the call is only successful if:
                // - the token address has code
                // - the returndata is empty
                success := and(success, and(iszero(returndatasize()), gt(extcodesize(token), 0)))
            }
            mstore(0x40, fmp)
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

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

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

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

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

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

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

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1363.sol)

pragma solidity >=0.6.2;

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

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 5 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)

pragma solidity >=0.4.16;

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

File 6 of 7 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC165.sol)

pragma solidity >=0.4.16;

import {IERC165} from "../utils/introspection/IERC165.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "prague",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_lockToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Locking","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"UPGRADE_LOCK_DURATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"available","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"_lock","type":"uint256"}],"name":"locking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oldLock","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"upgradeLockedTokens","outputs":[{"internalType":"uint256","name":"locked","type":"uint256"},{"internalType":"uint256","name":"lockTime","type":"uint256"},{"internalType":"int256","name":"unlocked","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

0x6080604052348015600e575f5ffd5b506040516107fa3803806107fa833981016040819052602b91606b565b600280546001600160a01b039092166001600160a01b03199283161790556301da9c005f5560048054821633908117909155600580549092161790556096565b5f60208284031215607a575f5ffd5b81516001600160a01b0381168114608f575f5ffd5b9392505050565b610757806100a35f395ff3fe608060405234801561000f575f5ffd5b5060043610610090575f3560e01c80638da5cb5b116100635780638da5cb5b1461011f5780639bd250181461014a578063a72e4b231461015d578063bca7a9e214610165578063d7b96d4e14610178575f5ffd5b806310098ad51461009457806311ecde2c146100ba5780633ccfd60b146100cf5780636b1da066146100d7575b5f5ffd5b6100a76100a2366004610616565b61018b565b6040519081526020015b60405180910390f35b6100cd6100c8366004610636565b61022a565b005b6100cd610391565b6101046100e5366004610616565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100b1565b600454610132906001600160a01b031681565b6040516001600160a01b0390911681526020016100b1565b600354610132906001600160a01b031681565b6100a75f5481565b600254610132906001600160a01b031681565b600554610132906001600160a01b031681565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154815293810154928401839052600201549083018190528354909142916101d491610672565b811015610213575f5460208401516101ec908361068b565b84516101f8919061069e565b61020291906106b5565b61020c90836106d4565b9150610222565b825161021f90836106d4565b91505b509392505050565b6005546001600160a01b031633146102775760405162461bcd60e51b815260206004820152600b60248201526a37b7363c903637b1b5b2b960a91b60448201526064015b60405180910390fd5b60025461028f906001600160a01b03163330846104b6565b6001600160a01b0382165f908152600160208190526040822091549082015442916102b991610672565b811015610328575f805460018401546102d2908461068b565b84546102de919061069e565b6102e891906106b5565b90508381845f01546102fa919061068b565b6103049190610672565b83556002830180548291905f9061031c9084906106d4565b90915550610346915050565b81546002830180545f9061033d9084906106d4565b90915550508282555b600182018190556040518381526001600160a01b038516907f531120edf08e24fe8c5ae9076b200afcb0fec08623f81d325b7a5dd5fbf3f4b79060200160405180910390a250505050565b335f9081526001602081905260408220600281015492549181015490929142916103bb9190610672565b8110156103fa575f5460018401546103d3908361068b565b84546103df919061069e565b6103e991906106b5565b6103f390836106d4565b9150610409565b825461040690836106d4565b91505b5f821361044d5760405162461bcd60e51b81526020600482015260126024820152716e6f20746f6b656e20617661696c61626c6560701b604482015260640161026e565b81836002015f82825461046091906106fb565b909155505060025461047c906001600160a01b031633846104f2565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2505050565b6104c484848484600161052c565b6104ec57604051635274afe760e01b81526001600160a01b038516600482015260240161026e565b50505050565b6104ff8383836001610599565b61052757604051635274afe760e01b81526001600160a01b038416600482015260240161026e565b505050565b6040516323b872dd60e01b5f8181526001600160a01b038781166004528616602452604485905291602083606481808c5af1925060015f5114831661058857838315161561057c573d5f823e3d81fd5b5f883b113d1516831692505b604052505f60605295945050505050565b60405163a9059cbb60e01b5f8181526001600160a01b038616600452602485905291602083604481808b5af1925060015f511483166105ef5783831516156105e3573d5f823e3d81fd5b5f873b113d1516831692505b60405250949350505050565b80356001600160a01b0381168114610611575f5ffd5b919050565b5f60208284031215610626575f5ffd5b61062f826105fb565b9392505050565b5f5f60408385031215610647575f5ffd5b610650836105fb565b946020939093013593505050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156106855761068561065e565b92915050565b818103818111156106855761068561065e565b80820281158282048414176106855761068561065e565b5f826106cf57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018281125f8312801582168215821617156106f3576106f361065e565b505092915050565b8181035f83128015838313168383128216171561071a5761071a61065e565b509291505056fea2646970667358221220233523dd0e47abc56276c8347239365ebcc3960c581daaf11f978a3e9fcbb13064736f6c634300081e0033000000000000000000000000b47ce8344b0cc64ae85491c74076b583fe5b7940

Deployed Bytecode

0x608060405234801561000f575f5ffd5b5060043610610090575f3560e01c80638da5cb5b116100635780638da5cb5b1461011f5780639bd250181461014a578063a72e4b231461015d578063bca7a9e214610165578063d7b96d4e14610178575f5ffd5b806310098ad51461009457806311ecde2c146100ba5780633ccfd60b146100cf5780636b1da066146100d7575b5f5ffd5b6100a76100a2366004610616565b61018b565b6040519081526020015b60405180910390f35b6100cd6100c8366004610636565b61022a565b005b6100cd610391565b6101046100e5366004610616565b600160208190525f918252604090912080549181015460029091015483565b604080519384526020840192909252908201526060016100b1565b600454610132906001600160a01b031681565b6040516001600160a01b0390911681526020016100b1565b600354610132906001600160a01b031681565b6100a75f5481565b600254610132906001600160a01b031681565b600554610132906001600160a01b031681565b6001600160a01b0381165f90815260016020818152604080842081516060810183528154815293810154928401839052600201549083018190528354909142916101d491610672565b811015610213575f5460208401516101ec908361068b565b84516101f8919061069e565b61020291906106b5565b61020c90836106d4565b9150610222565b825161021f90836106d4565b91505b509392505050565b6005546001600160a01b031633146102775760405162461bcd60e51b815260206004820152600b60248201526a37b7363c903637b1b5b2b960a91b60448201526064015b60405180910390fd5b60025461028f906001600160a01b03163330846104b6565b6001600160a01b0382165f908152600160208190526040822091549082015442916102b991610672565b811015610328575f805460018401546102d2908461068b565b84546102de919061069e565b6102e891906106b5565b90508381845f01546102fa919061068b565b6103049190610672565b83556002830180548291905f9061031c9084906106d4565b90915550610346915050565b81546002830180545f9061033d9084906106d4565b90915550508282555b600182018190556040518381526001600160a01b038516907f531120edf08e24fe8c5ae9076b200afcb0fec08623f81d325b7a5dd5fbf3f4b79060200160405180910390a250505050565b335f9081526001602081905260408220600281015492549181015490929142916103bb9190610672565b8110156103fa575f5460018401546103d3908361068b565b84546103df919061069e565b6103e991906106b5565b6103f390836106d4565b9150610409565b825461040690836106d4565b91505b5f821361044d5760405162461bcd60e51b81526020600482015260126024820152716e6f20746f6b656e20617661696c61626c6560701b604482015260640161026e565b81836002015f82825461046091906106fb565b909155505060025461047c906001600160a01b031633846104f2565b60405182815233907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649060200160405180910390a2505050565b6104c484848484600161052c565b6104ec57604051635274afe760e01b81526001600160a01b038516600482015260240161026e565b50505050565b6104ff8383836001610599565b61052757604051635274afe760e01b81526001600160a01b038416600482015260240161026e565b505050565b6040516323b872dd60e01b5f8181526001600160a01b038781166004528616602452604485905291602083606481808c5af1925060015f5114831661058857838315161561057c573d5f823e3d81fd5b5f883b113d1516831692505b604052505f60605295945050505050565b60405163a9059cbb60e01b5f8181526001600160a01b038616600452602485905291602083604481808b5af1925060015f511483166105ef5783831516156105e3573d5f823e3d81fd5b5f873b113d1516831692505b60405250949350505050565b80356001600160a01b0381168114610611575f5ffd5b919050565b5f60208284031215610626575f5ffd5b61062f826105fb565b9392505050565b5f5f60408385031215610647575f5ffd5b610650836105fb565b946020939093013593505050565b634e487b7160e01b5f52601160045260245ffd5b808201808211156106855761068561065e565b92915050565b818103818111156106855761068561065e565b80820281158282048414176106855761068561065e565b5f826106cf57634e487b7160e01b5f52601260045260245ffd5b500490565b8082018281125f8312801582168215821617156106f3576106f361065e565b505092915050565b8181035f83128015838313168383128216171561071a5761071a61065e565b509291505056fea2646970667358221220233523dd0e47abc56276c8347239365ebcc3960c581daaf11f978a3e9fcbb13064736f6c634300081e0033

Block Transaction Gas Used Reward
view all blocks produced
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
View All Validatorset

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

Validator Index Block Amount
View All Withdrawals

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

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