ETH Price: $4,125.88 (+9.60%)

Contract

0x775c12CC03B3BBb87dB25e512b396BA7EAb09998
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Release166900962023-02-23 9:06:11962 days ago1677143171IN
0x775c12CC...7EAb09998
0 ETH0.0014685925.37625078

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ESGLocker

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 300 runs

Other Settings:
default evmVersion
File 1 of 2 : ESGLocker.sol
// SPDX-License-Identifier: MIT
// esg.academy
pragma solidity ^0.8.0;

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

contract ESGLocker {

    event TokenLockStart(address indexed beneficiary, address indexed token, uint256 startTime, uint256 lockTime);
    event Release(address indexed beneficiary, address indexed token, uint256 releaseTime, uint256 amount);

    IERC20 public immutable token;
    
    address public immutable beneficiary;
    uint256 public immutable lockTime;
    uint256 public immutable startTime;

    constructor(
        IERC20 token_,
        address beneficiary_,
        uint256 lockTime_
    ) {
        require(lockTime_ > 0, "TokenLock: lock time should greater than 0");
        token = token_;
        beneficiary = beneficiary_;
        lockTime = lockTime_;
        startTime = block.timestamp;

        emit TokenLockStart(beneficiary_, address(token_), block.timestamp, lockTime_);
    }

    function release() public {
        require(block.timestamp >= startTime+lockTime, "TokenLock: current time is before release time");

        uint256 amount = token.balanceOf(address(this));
        require(amount > 0, "TokenLock: no tokens to release");
        token.transfer(beneficiary, amount);

        emit Release(msg.sender, address(token), block.timestamp, amount);
    }
}

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

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"contract IERC20","name":"token_","type":"address"},{"internalType":"address","name":"beneficiary_","type":"address"},{"internalType":"uint256","name":"lockTime_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"releaseTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Release","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lockTime","type":"uint256"}],"name":"TokenLockStart","type":"event"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

61010060405234801561001157600080fd5b5060405161063138038061063183398101604081905261003091610113565b600081116100975760405162461bcd60e51b815260206004820152602a60248201527f546f6b656e4c6f636b3a206c6f636b2074696d652073686f756c6420677265616044820152690746572207468616e20360b41b606482015260840160405180910390fd5b6001600160a01b03838116608081905290831660a081905260c08390524260e081905260408051918252602082018590527fe5d7d4b5cb0219916a8be73968f7baf3c806fd018b0cc5598f5129436cf5c316910160405180910390a3505050610156565b6001600160a01b038116811461011057600080fd5b50565b60008060006060848603121561012857600080fd5b8351610133816100fb565b6020850151909350610144816100fb565b80925050604084015190509250925092565b60805160a05160c05160e05161047b6101b66000396000818160da015261015301526000818160610152610132015260008181609b01526102d601526000818161010b015281816101fa01528181610305015261038b015261047b6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630d6680871461005c57806338af3eed1461009657806378e97925146100d557806386d1a69f146100fc578063fc0c546a14610106575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100bd7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161008d565b6100837f000000000000000000000000000000000000000000000000000000000000000081565b61010461012d565b005b6100bd7f000000000000000000000000000000000000000000000000000000000000000081565b6101777f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006103dc565b4210156101e25760405162461bcd60e51b815260206004820152602e60248201527f546f6b656e4c6f636b3a2063757272656e742074696d65206973206265666f7260448201526d652072656c656173652074696d6560901b60648201526084015b60405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026d9190610403565b9050600081116102bf5760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e4c6f636b3a206e6f20746f6b656e7320746f2072656c656173650060448201526064016101d9565b60405163a9059cbb60e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af115801561034e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610372919061041c565b5060408051428152602081018390526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169133917f10b55f01b1cfe0feeb7d144f66162661602d8e73256499b6d8342aac37ff0679910160405180910390a350565b808201808211156103fd57634e487b7160e01b600052601160045260246000fd5b92915050565b60006020828403121561041557600080fd5b5051919050565b60006020828403121561042e57600080fd5b8151801515811461043e57600080fd5b939250505056fea26469706673582212209f6ee08694567ecf7b93418a6abf8e4888ea77025065f34187efd4e9078e482364736f6c6343000811003300000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a900000000000000000000000019aaecd4cb0e39515169cff740e48dd69de56bc400000000000000000000000000000000000000000000000000000000004f1f14

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630d6680871461005c57806338af3eed1461009657806378e97925146100d557806386d1a69f146100fc578063fc0c546a14610106575b600080fd5b6100837f00000000000000000000000000000000000000000000000000000000004f1f1481565b6040519081526020015b60405180910390f35b6100bd7f00000000000000000000000019aaecd4cb0e39515169cff740e48dd69de56bc481565b6040516001600160a01b03909116815260200161008d565b6100837f000000000000000000000000000000000000000000000000000000006396872f81565b61010461012d565b005b6100bd7f00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a981565b6101777f00000000000000000000000000000000000000000000000000000000004f1f147f000000000000000000000000000000000000000000000000000000006396872f6103dc565b4210156101e25760405162461bcd60e51b815260206004820152602e60248201527f546f6b656e4c6f636b3a2063757272656e742074696d65206973206265666f7260448201526d652072656c656173652074696d6560901b60648201526084015b60405180910390fd5b6040516370a0823160e01b81523060048201526000907f00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a96001600160a01b0316906370a0823190602401602060405180830381865afa158015610249573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061026d9190610403565b9050600081116102bf5760405162461bcd60e51b815260206004820152601f60248201527f546f6b656e4c6f636b3a206e6f20746f6b656e7320746f2072656c656173650060448201526064016101d9565b60405163a9059cbb60e01b81526001600160a01b037f00000000000000000000000019aaecd4cb0e39515169cff740e48dd69de56bc481166004830152602482018390527f00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a9169063a9059cbb906044016020604051808303816000875af115801561034e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610372919061041c565b5060408051428152602081018390526001600160a01b037f00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a9169133917f10b55f01b1cfe0feeb7d144f66162661602d8e73256499b6d8342aac37ff0679910160405180910390a350565b808201808211156103fd57634e487b7160e01b600052601160045260246000fd5b92915050565b60006020828403121561041557600080fd5b5051919050565b60006020828403121561042e57600080fd5b8151801515811461043e57600080fd5b939250505056fea26469706673582212209f6ee08694567ecf7b93418a6abf8e4888ea77025065f34187efd4e9078e482364736f6c63430008110033

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

00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a900000000000000000000000019aaecd4cb0e39515169cff740e48dd69de56bc400000000000000000000000000000000000000000000000000000000004f1f14

-----Decoded View---------------
Arg [0] : token_ (address): 0x20cD2E7Ec8F5d8b337fe46a4F565Ccef1561b9a9
Arg [1] : beneficiary_ (address): 0x19aaeCd4cB0e39515169cff740e48dD69de56bC4
Arg [2] : lockTime_ (uint256): 5185300

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000020cd2e7ec8f5d8b337fe46a4f565ccef1561b9a9
Arg [1] : 00000000000000000000000019aaecd4cb0e39515169cff740e48dd69de56bc4
Arg [2] : 00000000000000000000000000000000000000000000000000000000004f1f14


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.