Forkchoice Ethereum Mainnet

Address Contract Verified

Address 0x7B33a100417AAF44Adbd7C8aEd5dC8f0Fde3b3E0
Balance 0 ETH
Nonce 1
Code Size 2459 bytes
Indexed Transactions 0 (1 on-chain, 1.0% indexed)
External Etherscan · Sourcify

Contract Bytecode

2459 bytes
0x60806040526004361061004d575f3560e01c8063117803e3146100c8578063251c1aa3146100f2578063439370b11461011c578063a0ef91df14610126578063af8f23d21461013c5761008d565b3661008d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100849061057e565b60405180910390fd5b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100bf906105e6565b60405180910390fd5b3480156100d3575f5ffd5b506100dc610166565b6040516100e99190610643565b60405180910390f35b3480156100fd575f5ffd5b5061010661018a565b6040516101139190610674565b60405180910390f35b61012461018f565b005b348015610131575f5ffd5b5061013a61022c565b005b348015610147575f5ffd5b50610150610408565b60405161015d9190610674565b60405180910390f35b7f000000000000000000000000a66f98775ed1e073036fea9eec293e8174ec410e81565b5f5481565b61019761040f565b5f34116101d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101d0906106d7565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f73a19dd210f1a7f902193214c0ee91dd35ee5b4d920cba8d519eca65a7b488ca345f546040516102229291906106f5565b60405180910390a2565b61023461040f565b61023c61049f565b5f54421015610280576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161027790610766565b60405180910390fd5b5f4790505f81116102c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102bd906107ce565b60405180910390fd5b5f7f000000000000000000000000a66f98775ed1e073036fea9eec293e8174ec410e73ffffffffffffffffffffffffffffffffffffffff168260405161030b90610819565b5f6040518083038185875af1925050503d805f8114610345576040519150601f19603f3d011682016040523d82523d5f602084013e61034a565b606091505b505090508061038e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161038590610877565b60405180910390fd5b7f000000000000000000000000a66f98775ed1e073036fea9eec293e8174ec410e73ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5836040516103f49190610674565b60405180910390a25050610406610509565b565b6283d60081565b7f000000000000000000000000a66f98775ed1e073036fea9eec293e8174ec410e73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461049d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610494906108df565b60405180910390fd5b565b60015f9054906101000a900460ff16156104ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e590610947565b60405180910390fd5b6001805f6101000a81548160ff021916908315150217905550565b5f60015f6101000a81548160ff021916908315150217905550565b5f82825260208201905092915050565b7f757365206465706f7369744574682829000000000000000000000000000000005f82015250565b5f610568601083610524565b915061057382610534565b602082019050919050565b5f6020820190508181035f8301526105958161055c565b9050919050565b7f696e76616c6964000000000000000000000000000000000000000000000000005f82015250565b5f6105d0600783610524565b91506105db8261059c565b602082019050919050565b5f6020820190508181035f8301526105fd816105c4565b9050919050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61062d82610604565b9050919050565b61063d81610623565b82525050565b5f6020820190506106565f830184610634565b92915050565b5f819050919050565b61066e8161065c565b82525050565b5f6020820190506106875f830184610665565b92915050565b7f7a65726f2076616c7565000000000000000000000000000000000000000000005f82015250565b5f6106c1600a83610524565b91506106cc8261068d565b602082019050919050565b5f6020820190508181035f8301526106ee816106b5565b9050919050565b5f6040820190506107085f830185610665565b6107156020830184610665565b9392505050565b7f7374696c6c206c6f636b656400000000000000000000000000000000000000005f82015250565b5f610750600c83610524565b915061075b8261071c565b602082019050919050565b5f6020820190508181035f83015261077d81610744565b9050919050565b7f6e6f7468696e6720746f207769746864726177000000000000000000000000005f82015250565b5f6107b8601383610524565b91506107c382610784565b602082019050919050565b5f6020820190508181035f8301526107e5816107ac565b9050919050565b5f81905092915050565b50565b5f6108045f836107ec565b915061080f826107f6565b5f82019050919050565b5f610823826107f9565b9150819050919050565b7f7472616e73666572206661696c656400000000000000000000000000000000005f82015250565b5f610861600f83610524565b915061086c8261082d565b602082019050919050565b5f6020820190508181035f83015261088e81610855565b9050919050565b7f6e6f74206f776e657200000000000000000000000000000000000000000000005f82015250565b5f6108c9600983610524565b91506108d482610895565b602082019050919050565b5f6020820190508181035f8301526108f6816108bd565b9050919050565b7f7265656e7472616e7400000000000000000000000000000000000000000000005f82015250565b5f610931600983610524565b915061093c826108fd565b602082019050919050565b5f6020820190508181035f83015261095e81610925565b905091905056fea26469706673582212205720db0ffb52a05d772e4f35a22a53c765dee81b3ad49b31254d2e549aeba80b64736f6c634300081e0033

Verified Source Code Full Match

Compiler: v0.8.30+commit.73712a01 EVM: prague Optimization: No
Timelock.sol 75 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/// @title TimeLock
/// @notice A timelock contract that allows the owner to deposit and lock ETH for a specified period
/// @dev The owner can deposit funds, extend the lock period, and withdraw after the unlock time
///

contract Timelock {
    address public immutable OWNER;
    uint256 public unlockTime;

    bool private _entered;
        
    uint256 public constant MAX_INITIAL_LOCK = 100 days;    
    
    event Deposited(address indexed from, uint256 amount, uint256 unlockTime);
    event Withdrawn(address indexed to, uint256 amount);
    
    modifier onlyOwner() {
        _onlyOwner();
        _;
    }
    function _onlyOwner() internal view {
        require(msg.sender == OWNER, "not owner");
    }

    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() internal {
        require(!_entered, "reentrant");
        _entered = true;
    }
    
    function _nonReentrantAfter() internal {
        _entered = false;
    }

    /// @param lockDays Number of days to lock funds initially (≤ 300)
    constructor(uint256 lockDays) {
        require(lockDays > 0, "must lock > 0 days");
        require(lockDays <= MAX_INITIAL_LOCK, "max days");

        OWNER = msg.sender;        
        unlockTime = block.timestamp + (lockDays * 1 days);
    }

    function depositEth() external payable onlyOwner {
        require(msg.value > 0, "zero value");
        emit Deposited(msg.sender, msg.value, unlockTime);
    }

    function withdrawEth() external onlyOwner nonReentrant {
        require(block.timestamp >= unlockTime, "still locked");

        uint256 amt = address(this).balance;
        require(amt > 0, "nothing to withdraw");

        (bool ok, ) = OWNER.call{value: amt}("");
        require(ok, "transfer failed");
        emit Withdrawn(OWNER, amt);
    }

    receive() external payable {
        revert("use depositEth()");
    }

    fallback() external payable {
        revert("invalid");
    }
}

Read Contract

MAX_INITIAL_LOCK 0xaf8f23d2 → uint256
OWNER 0x117803e3 → address
unlockTime 0x251c1aa3 → uint256

Write Contract 2 functions

These functions modify contract state and require a wallet transaction to execute.

depositEth 0x439370b1
No parameters
withdrawEth 0xa0ef91df
No parameters

Recent Transactions

This address has 1 on-chain transactions, but only 1.0% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →