ETH Price: $2,010.22 (-2.61%)

Contract

0x107AC627918445a0122d25A834F3f00229cb1Dbe
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw210952402024-11-01 20:38:59145 days ago1730493539IN
0x107AC627...229cb1Dbe
0 ETH0.000434237.24578195
Deposit180672952023-09-05 2:27:47568 days ago1693880867IN
0x107AC627...229cb1Dbe
0 ETH0.0005751610
Deposit180638642023-09-04 14:58:59569 days ago1693839539IN
0x107AC627...229cb1Dbe
0 ETH0.0019198219.83347341
Withdraw180565902023-09-03 14:34:23570 days ago1693751663IN
0x107AC627...229cb1Dbe
0 ETH0.0006558315.31283591
Withdraw180433262023-09-01 17:54:59572 days ago1693590899IN
0x107AC627...229cb1Dbe
0 ETH0.0023741239.61556788
Renew Locking180394712023-09-01 4:59:11572 days ago1693544351IN
0x107AC627...229cb1Dbe
0 ETH0.000332311.02778679
Renew Locking180394692023-09-01 4:58:47572 days ago1693544327IN
0x107AC627...229cb1Dbe
0 ETH0.0003473811.56549916
Deposit178731722023-08-08 22:27:11595 days ago1691533631IN
0x107AC627...229cb1Dbe
0 ETH0.0015829727.52811338
Deposit178731612023-08-08 22:24:59595 days ago1691533499IN
0x107AC627...229cb1Dbe
0 ETH0.0024726425.54461178
Renew Locking178519932023-08-05 23:16:47598 days ago1691277407IN
0x107AC627...229cb1Dbe
0 ETH0.0003547211.81
Deposit178485032023-08-05 11:35:23599 days ago1691235323IN
0x107AC627...229cb1Dbe
0 ETH0.0012879514
Transfer178102962023-07-31 3:26:23604 days ago1690773983IN
0x107AC627...229cb1Dbe
0.42353436 ETH0.0003227415.36869517
Transfer178102942023-07-31 3:25:59604 days ago1690773959IN
0x107AC627...229cb1Dbe
0.012 ETH0.0003342415.91643159
Transfer178102892023-07-31 3:24:59604 days ago1690773899IN
0x107AC627...229cb1Dbe
0.01 ETH0.0003078314.65900123
Transfer178102862023-07-31 3:24:23604 days ago1690773863IN
0x107AC627...229cb1Dbe
0.01 ETH0.0003182715.15592421
Deposit177796422023-07-26 20:28:47609 days ago1690403327IN
0x107AC627...229cb1Dbe
0 ETH0.0036303937.50527305
Withdraw177734672023-07-25 23:45:47609 days ago1690328747IN
0x107AC627...229cb1Dbe
0 ETH0.0009796222.87297686
Renew Locking177566612023-07-23 15:19:23612 days ago1690125563IN
0x107AC627...229cb1Dbe
0 ETH0.0007682425.49526139
Renew Locking177566582023-07-23 15:18:47612 days ago1690125527IN
0x107AC627...229cb1Dbe
0 ETH0.000675622.49316009
Renew Locking177107182023-07-17 4:51:11618 days ago1689569471IN
0x107AC627...229cb1Dbe
0 ETH0.0004170313.88460532
Withdraw177097312023-07-17 1:32:23618 days ago1689557543IN
0x107AC627...229cb1Dbe
0 ETH0.0007859513.11479937
Withdraw177093802023-07-17 0:21:35618 days ago1689553295IN
0x107AC627...229cb1Dbe
0 ETH0.0011270118.80584152
Renew Locking177064462023-07-16 14:29:23619 days ago1689517763IN
0x107AC627...229cb1Dbe
0 ETH0.0005705718.99632485
Renew Locking177053772023-07-16 10:52:35619 days ago1689504755IN
0x107AC627...229cb1Dbe
0 ETH0.0004529615.03227261
Renew Locking177053702023-07-16 10:51:11619 days ago1689504671IN
0x107AC627...229cb1Dbe
0 ETH0.0004558515.17687555
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Vault

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 6 : Vault.sol
pragma solidity ^0.8.11;

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

error InvalidLockingDuration();
error ZeroAddressToken();
error InvalidAmount();
error NoDeposit();
error TokensLocked();
error CannotExtendLocking();
error InvalidUnlockingTimestamp();
error InvalidAccount();
error NeedsLockingRenewal();
error CannotRecoverLockableToken();
error NoTokensToRecover();

/**
 * @title Vault
 * @dev Vault contract
 * @author Federico Luzzi - <[email protected]>
 * SPDX-License-Identifier: GPL-3.0
 */
contract Vault is Ownable {
    using SafeERC20 for IERC20;

    struct Deposit {
        uint256 amount;
        uint256 unlockingTimestamp;
    }

    uint256 public lockingDuration;
    mapping(address => Deposit) public userDeposit;
    address public token;

    event LockingDurationUpdated(uint256 duration);
    event UnlockingTimestampUpdated(address user, uint256 unlockingTimestamp);
    event Deposited(address user, uint256 amount, uint256 unlockingTimestamp);
    event Withdrawn(address user, uint256 amount);
    event LockingRenewed(address user, uint256 unlockingTimestamp);
    event ERC20Recovered(address token, uint256 amount);

    constructor(address _token, uint256 _lockingDuration) {
        if (_token == address(0)) revert ZeroAddressToken();
        if (_lockingDuration == 0) revert InvalidLockingDuration();
        token = _token;
        lockingDuration = _lockingDuration;
    }

    function updateLockingDuration(uint256 _duration) external onlyOwner {
        if (_duration == 0) revert InvalidLockingDuration();
        lockingDuration = _duration;
        emit LockingDurationUpdated(_duration);
    }

    function updateUnlockingTimestamp(
        address _account,
        uint256 _unlockingTimestamp
    ) external onlyOwner {
        if (_unlockingTimestamp < block.timestamp)
            revert InvalidUnlockingTimestamp();
        Deposit storage _deposit = userDeposit[_account];
        if (_deposit.amount == 0) revert InvalidAccount();
        if (_unlockingTimestamp > _deposit.unlockingTimestamp)
            revert CannotExtendLocking();
        _deposit.unlockingTimestamp = _unlockingTimestamp;
        emit UnlockingTimestampUpdated(_account, _unlockingTimestamp);
    }

    function recoverERC20(address _tokenToRecover) external onlyOwner {
        if (_tokenToRecover == token) revert CannotRecoverLockableToken();
        uint256 _tokenBalance = IERC20(_tokenToRecover).balanceOf(
            address(this)
        );
        if (_tokenBalance == 0) revert NoTokensToRecover();
        IERC20(_tokenToRecover).safeTransfer(owner(), _tokenBalance);
        emit ERC20Recovered(_tokenToRecover, _tokenBalance);
    }

    function deposit(uint256 _amount) external {
        if (_amount == 0) revert InvalidAmount();
        Deposit storage _deposit = userDeposit[msg.sender];
        _deposit.amount += _amount;
        if (_deposit.unlockingTimestamp == 0)
            _deposit.unlockingTimestamp = block.timestamp + lockingDuration;
        IERC20(token).safeTransferFrom(msg.sender, address(this), _amount);
        emit Deposited(msg.sender, _amount, _deposit.unlockingTimestamp);
    }

    function withdraw(uint256 _amount) external {
        if (_amount == 0) revert InvalidAmount();
        Deposit storage _deposit = userDeposit[msg.sender];
        if (_deposit.unlockingTimestamp > block.timestamp)
            revert TokensLocked();
        _deposit.amount -= _amount;
        if(_deposit.amount == 0) _deposit.unlockingTimestamp = 0;
        IERC20(token).safeTransfer(msg.sender, _amount);
        emit Withdrawn(msg.sender, _amount);
    }

    function renewLocking() external {
        Deposit storage _deposit = userDeposit[msg.sender];
        if (_deposit.unlockingTimestamp == 0) revert NoDeposit();
        uint256 _unlockingTimestamp = (
            _deposit.unlockingTimestamp > block.timestamp
                ? _deposit.unlockingTimestamp
                : block.timestamp
        ) + lockingDuration;
        _deposit.unlockingTimestamp = _unlockingTimestamp;
        emit LockingRenewed(msg.sender, _unlockingTimestamp);
    }

    function renewedUnlockingTimestamp(address _account)
        external
        view
        returns (uint256)
    {
        Deposit storage _deposit = userDeposit[_account];
        if (_deposit.unlockingTimestamp == 0) revert NoDeposit();
        return
            (
                _deposit.unlockingTimestamp > block.timestamp
                    ? _deposit.unlockingTimestamp
                    : block.timestamp
            ) + lockingDuration;
    }
}

File 2 of 6 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.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));
        }
    }

    /**
     * @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 3 of 6 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @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);
}

File 4 of 6 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 5 of 6 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 6 of 6 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_lockingDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotExtendLocking","type":"error"},{"inputs":[],"name":"CannotRecoverLockableToken","type":"error"},{"inputs":[],"name":"InvalidAccount","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidLockingDuration","type":"error"},{"inputs":[],"name":"InvalidUnlockingTimestamp","type":"error"},{"inputs":[],"name":"NoDeposit","type":"error"},{"inputs":[],"name":"NoTokensToRecover","type":"error"},{"inputs":[],"name":"TokensLocked","type":"error"},{"inputs":[],"name":"ZeroAddressToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unlockingTimestamp","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"duration","type":"uint256"}],"name":"LockingDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"unlockingTimestamp","type":"uint256"}],"name":"LockingRenewed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"unlockingTimestamp","type":"uint256"}],"name":"UnlockingTimestampUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockingDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenToRecover","type":"address"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renewLocking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"renewedUnlockingTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"updateLockingDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_unlockingTimestamp","type":"uint256"}],"name":"updateUnlockingTimestamp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userDeposit","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockingTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051610e7d380380610e7d83398101604081905261002f916100f6565b610038336100a6565b6001600160a01b03821661005f576040516314f28f2b60e01b815260040160405180910390fd5b8061007d57604051635bf6323f60e11b815260040160405180910390fd5b600380546001600160a01b0319166001600160a01b039390931692909217909155600155610130565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806040838503121561010957600080fd5b82516001600160a01b038116811461012057600080fd5b6020939093015192949293505050565b610d3e8061013f6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c97f9b8c1161008c578063db7abe4711610066578063db7abe47146101af578063eb4eb8f6146101c2578063f2fde38b146101d5578063fc0c546a146101e857600080fd5b8063c97f9b8c14610149578063cea8c7461461015c578063d1260edd1461017357600080fd5b80632e1a7d4d146100d4578063715018a6146100e9578063788c38bc146100f15780638da5cb5b146100f95780639e8c708e14610123578063b6b55f2514610136575b600080fd5b6100e76100e2366004610b5e565b6101fb565b005b6100e76102c9565b6100e7610308565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100e7610131366004610b93565b61039f565b6100e7610144366004610b5e565b6104e8565b6100e7610157366004610bae565b6105a6565b61016560015481565b60405190815260200161011a565b61019a610181366004610b93565b6002602052600090815260409020805460019091015482565b6040805192835260208301919091520161011a565b6100e76101bd366004610b5e565b61069b565b6101656101d0366004610b93565b61071e565b6100e76101e3366004610b93565b610783565b600354610106906001600160a01b031681565b806102195760405163162908e360e11b815260040160405180910390fd5b336000908152600260205260409020600181015442101561024d5760405163de1af48d60e01b815260040160405180910390fd5b818160000160008282546102619190610bee565b9091555050805461027457600060018201555b60035461028b906001600160a01b0316338461081e565b60408051338152602081018490527f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d591015b60405180910390a15050565b6000546001600160a01b031633146102fc5760405162461bcd60e51b81526004016102f390610c05565b60405180910390fd5b6103066000610886565b565b336000908152600260205260409020600181015461033957604051633a6a68b160e01b815260040160405180910390fd5b60006001544283600101541161034f5742610355565b82600101545b61035f9190610c3a565b6001830181905560408051338152602081018390529192507fdb131f00fa145c46f5c29742d645f5731269f269e98773ad9e7daf84b832376b91016102bd565b6000546001600160a01b031633146103c95760405162461bcd60e51b81526004016102f390610c05565b6003546001600160a01b03828116911614156103f85760405163d1b140fd60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561043f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104639190610c52565b90508061048357604051635e4f582160e11b815260040160405180910390fd5b6104a96104986000546001600160a01b031690565b6001600160a01b038416908361081e565b604080516001600160a01b0384168152602081018390527f505b28e6941631badc363841ecbf8e1214b9379c643936458e87be718e15799991016102bd565b806105065760405163162908e360e11b815260040160405180910390fd5b336000908152600260205260408120805490918391839190610529908490610c3a565b9091555050600181015461054a576001546105449042610c3a565b60018201555b600354610562906001600160a01b03163330856108d6565b60018101546040805133815260208101859052908101919091527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca906060016102bd565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016102f390610c05565b428110156105f157604051636875f10560e01b815260040160405180910390fd5b6001600160a01b0382166000908152600260205260409020805461062857604051630da30f6560e31b815260040160405180910390fd5b806001015482111561064d57604051632068822160e01b815260040160405180910390fd5b60018101829055604080516001600160a01b0385168152602081018490527fcdc46afc5de860a660b7c9e89500b6ea2b8e015cb38844218a0caebf7bb9eaed910160405180910390a1505050565b6000546001600160a01b031633146106c55760405162461bcd60e51b81526004016102f390610c05565b806106e357604051635bf6323f60e11b815260040160405180910390fd5b60018190556040518181527fee2f50b6f6ec874efb7282b78f6127650f594682e5cbd90f32de4f80b34b47229060200160405180910390a150565b6001600160a01b0381166000908152600260205260408120600181015461075857604051633a6a68b160e01b815260040160405180910390fd5b6001544282600101541161076c5742610772565b81600101545b61077c9190610c3a565b9392505050565b6000546001600160a01b031633146107ad5760405162461bcd60e51b81526004016102f390610c05565b6001600160a01b0381166108125760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f3565b61081b81610886565b50565b6040516001600160a01b03831660248201526044810182905261088190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610914565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261090e9085906323b872dd60e01b9060840161084a565b50505050565b6000610969826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109e69092919063ffffffff16565b80519091501561088157808060200190518101906109879190610c6b565b6108815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102f3565b60606109f584846000856109fd565b949350505050565b606082471015610a5e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102f3565b843b610aac5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f3565b600080866001600160a01b03168587604051610ac89190610cb9565b60006040518083038185875af1925050503d8060008114610b05576040519150601f19603f3d011682016040523d82523d6000602084013e610b0a565b606091505b5091509150610b1a828286610b25565b979650505050505050565b60608315610b3457508161077c565b825115610b445782518084602001fd5b8160405162461bcd60e51b81526004016102f39190610cd5565b600060208284031215610b7057600080fd5b5035919050565b80356001600160a01b0381168114610b8e57600080fd5b919050565b600060208284031215610ba557600080fd5b61077c82610b77565b60008060408385031215610bc157600080fd5b610bca83610b77565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c0057610c00610bd8565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610c4d57610c4d610bd8565b500190565b600060208284031215610c6457600080fd5b5051919050565b600060208284031215610c7d57600080fd5b8151801515811461077c57600080fd5b60005b83811015610ca8578181015183820152602001610c90565b8381111561090e5750506000910152565b60008251610ccb818460208701610c8d565b9190910192915050565b6020815260008251806020840152610cf4816040850160208701610c8d565b601f01601f1916919091016040019291505056fea264697066735822122001fcc662c909c1095394f91814d91dcfbbab323ac2728ae808e75c081607b8d164736f6c634300080b0033000000000000000000000000d9b312d77bc7bed9b9cecb56636300bed4fe5ce90000000000000000000000000000000000000000000000000000000001e18558

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063c97f9b8c1161008c578063db7abe4711610066578063db7abe47146101af578063eb4eb8f6146101c2578063f2fde38b146101d5578063fc0c546a146101e857600080fd5b8063c97f9b8c14610149578063cea8c7461461015c578063d1260edd1461017357600080fd5b80632e1a7d4d146100d4578063715018a6146100e9578063788c38bc146100f15780638da5cb5b146100f95780639e8c708e14610123578063b6b55f2514610136575b600080fd5b6100e76100e2366004610b5e565b6101fb565b005b6100e76102c9565b6100e7610308565b6000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100e7610131366004610b93565b61039f565b6100e7610144366004610b5e565b6104e8565b6100e7610157366004610bae565b6105a6565b61016560015481565b60405190815260200161011a565b61019a610181366004610b93565b6002602052600090815260409020805460019091015482565b6040805192835260208301919091520161011a565b6100e76101bd366004610b5e565b61069b565b6101656101d0366004610b93565b61071e565b6100e76101e3366004610b93565b610783565b600354610106906001600160a01b031681565b806102195760405163162908e360e11b815260040160405180910390fd5b336000908152600260205260409020600181015442101561024d5760405163de1af48d60e01b815260040160405180910390fd5b818160000160008282546102619190610bee565b9091555050805461027457600060018201555b60035461028b906001600160a01b0316338461081e565b60408051338152602081018490527f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d591015b60405180910390a15050565b6000546001600160a01b031633146102fc5760405162461bcd60e51b81526004016102f390610c05565b60405180910390fd5b6103066000610886565b565b336000908152600260205260409020600181015461033957604051633a6a68b160e01b815260040160405180910390fd5b60006001544283600101541161034f5742610355565b82600101545b61035f9190610c3a565b6001830181905560408051338152602081018390529192507fdb131f00fa145c46f5c29742d645f5731269f269e98773ad9e7daf84b832376b91016102bd565b6000546001600160a01b031633146103c95760405162461bcd60e51b81526004016102f390610c05565b6003546001600160a01b03828116911614156103f85760405163d1b140fd60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561043f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104639190610c52565b90508061048357604051635e4f582160e11b815260040160405180910390fd5b6104a96104986000546001600160a01b031690565b6001600160a01b038416908361081e565b604080516001600160a01b0384168152602081018390527f505b28e6941631badc363841ecbf8e1214b9379c643936458e87be718e15799991016102bd565b806105065760405163162908e360e11b815260040160405180910390fd5b336000908152600260205260408120805490918391839190610529908490610c3a565b9091555050600181015461054a576001546105449042610c3a565b60018201555b600354610562906001600160a01b03163330856108d6565b60018101546040805133815260208101859052908101919091527f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca906060016102bd565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016102f390610c05565b428110156105f157604051636875f10560e01b815260040160405180910390fd5b6001600160a01b0382166000908152600260205260409020805461062857604051630da30f6560e31b815260040160405180910390fd5b806001015482111561064d57604051632068822160e01b815260040160405180910390fd5b60018101829055604080516001600160a01b0385168152602081018490527fcdc46afc5de860a660b7c9e89500b6ea2b8e015cb38844218a0caebf7bb9eaed910160405180910390a1505050565b6000546001600160a01b031633146106c55760405162461bcd60e51b81526004016102f390610c05565b806106e357604051635bf6323f60e11b815260040160405180910390fd5b60018190556040518181527fee2f50b6f6ec874efb7282b78f6127650f594682e5cbd90f32de4f80b34b47229060200160405180910390a150565b6001600160a01b0381166000908152600260205260408120600181015461075857604051633a6a68b160e01b815260040160405180910390fd5b6001544282600101541161076c5742610772565b81600101545b61077c9190610c3a565b9392505050565b6000546001600160a01b031633146107ad5760405162461bcd60e51b81526004016102f390610c05565b6001600160a01b0381166108125760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f3565b61081b81610886565b50565b6040516001600160a01b03831660248201526044810182905261088190849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610914565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b038085166024830152831660448201526064810182905261090e9085906323b872dd60e01b9060840161084a565b50505050565b6000610969826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166109e69092919063ffffffff16565b80519091501561088157808060200190518101906109879190610c6b565b6108815760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102f3565b60606109f584846000856109fd565b949350505050565b606082471015610a5e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016102f3565b843b610aac5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f3565b600080866001600160a01b03168587604051610ac89190610cb9565b60006040518083038185875af1925050503d8060008114610b05576040519150601f19603f3d011682016040523d82523d6000602084013e610b0a565b606091505b5091509150610b1a828286610b25565b979650505050505050565b60608315610b3457508161077c565b825115610b445782518084602001fd5b8160405162461bcd60e51b81526004016102f39190610cd5565b600060208284031215610b7057600080fd5b5035919050565b80356001600160a01b0381168114610b8e57600080fd5b919050565b600060208284031215610ba557600080fd5b61077c82610b77565b60008060408385031215610bc157600080fd5b610bca83610b77565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c0057610c00610bd8565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610c4d57610c4d610bd8565b500190565b600060208284031215610c6457600080fd5b5051919050565b600060208284031215610c7d57600080fd5b8151801515811461077c57600080fd5b60005b83811015610ca8578181015183820152602001610c90565b8381111561090e5750506000910152565b60008251610ccb818460208701610c8d565b9190910192915050565b6020815260008251806020840152610cf4816040850160208701610c8d565b601f01601f1916919091016040019291505056fea264697066735822122001fcc662c909c1095394f91814d91dcfbbab323ac2728ae808e75c081607b8d164736f6c634300080b0033

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

000000000000000000000000d9b312d77bc7bed9b9cecb56636300bed4fe5ce90000000000000000000000000000000000000000000000000000000001e18558

-----Decoded View---------------
Arg [0] : _token (address): 0xd9b312D77Bc7BEd9B9CecB56636300bED4Fe5Ce9
Arg [1] : _lockingDuration (uint256): 31556952

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000d9b312d77bc7bed9b9cecb56636300bed4fe5ce9
Arg [1] : 0000000000000000000000000000000000000000000000000000000001e18558


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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