More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
BridgeTokenVault
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import "@openzeppelin/contracts/interfaces/IERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract BridgeTokenVault is Ownable { IERC20 public token; uint256 public unlockTime; event Deposit(uint256 amount); event Withdrawal(uint256 amount); event UnlockTimeUpdated(uint256 unlockTime); constructor (IERC20 _token, uint256 _unlockTime) Ownable(msg.sender) { token = _token; unlockTime = _unlockTime; } function setUnlockTime(uint256 _unlockTime) public onlyOwner { require(_unlockTime > unlockTime, "Vault: Unlock time can only be extended"); unlockTime = _unlockTime; emit UnlockTimeUpdated(_unlockTime); } function deposit(uint256 amount) public onlyOwner { token.transferFrom(owner(), address(this), amount); emit Deposit(amount); } function withdraw(uint256 amount) public onlyOwner { require(block.timestamp >= unlockTime, "Vault: Unlock time not reached yet"); token.transfer(owner(), amount); emit Withdrawal(amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../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. * * The initial owner is set to the address provided by the deployer. 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; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(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 { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol) pragma solidity ^0.8.20; import {IERC20} from "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @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 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.0.0) (utils/Context.sol) pragma solidity ^0.8.20; /** * @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; } }
{ "evmVersion": "paris", "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","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":"uint256","name":"unlockTime","type":"uint256"}],"name":"UnlockTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"setUnlockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162000d4d38038062000d4d83398181016040528101906200003791906200028c565b33600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000ad5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000a49190620002e4565b60405180910390fd5b620000be816200010f60201b60201c565b5081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600281905550505062000301565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200020582620001d8565b9050919050565b60006200021982620001f8565b9050919050565b6200022b816200020c565b81146200023757600080fd5b50565b6000815190506200024b8162000220565b92915050565b6000819050919050565b620002668162000251565b81146200027257600080fd5b50565b60008151905062000286816200025b565b92915050565b60008060408385031215620002a657620002a5620001d3565b5b6000620002b6858286016200023a565b9250506020620002c98582860162000275565b9150509250929050565b620002de81620001f8565b82525050565b6000602082019050620002fb6000830184620002d3565b92915050565b610a3c80620003116000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063b6b55f251161005b578063b6b55f25146100ef578063dace45571461010b578063f2fde38b14610127578063fc0c546a1461014357610088565b8063251c1aa31461008d5780632e1a7d4d146100ab578063715018a6146100c75780638da5cb5b146100d1575b600080fd5b610095610161565b6040516100a29190610664565b60405180910390f35b6100c560048036038101906100c091906106b0565b610167565b005b6100cf610296565b005b6100d96102aa565b6040516100e6919061071e565b60405180910390f35b610109600480360381019061010491906106b0565b6102d3565b005b610125600480360381019061012091906106b0565b6103bf565b005b610141600480360381019061013c9190610765565b61044c565b005b61014b6104d2565b60405161015891906107f1565b60405180910390f35b60025481565b61016f6104f8565b6002544210156101b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ab9061088f565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6101fa6102aa565b836040518363ffffffff1660e01b81526004016102189291906108af565b6020604051808303816000875af1158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610910565b507f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de78160405161028b9190610664565b60405180910390a150565b61029e6104f8565b6102a8600061057f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6102db6104f8565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd6103216102aa565b30846040518463ffffffff1660e01b81526004016103419392919061093d565b6020604051808303816000875af1158015610360573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103849190610910565b507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e38426816040516103b49190610664565b60405180910390a150565b6103c76104f8565b600254811161040b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610402906109e6565b60405180910390fd5b806002819055507f6669a6c779a56629103733bcba993d66b30b061559b41f3c64bd2661cd9ea3c1816040516104419190610664565b60405180910390a150565b6104546104f8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036104c65760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016104bd919061071e565b60405180910390fd5b6104cf8161057f565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610500610643565b73ffffffffffffffffffffffffffffffffffffffff1661051e6102aa565b73ffffffffffffffffffffffffffffffffffffffff161461057d57610541610643565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610574919061071e565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6000819050919050565b61065e8161064b565b82525050565b60006020820190506106796000830184610655565b92915050565b600080fd5b61068d8161064b565b811461069857600080fd5b50565b6000813590506106aa81610684565b92915050565b6000602082840312156106c6576106c561067f565b5b60006106d48482850161069b565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610708826106dd565b9050919050565b610718816106fd565b82525050565b6000602082019050610733600083018461070f565b92915050565b610742816106fd565b811461074d57600080fd5b50565b60008135905061075f81610739565b92915050565b60006020828403121561077b5761077a61067f565b5b600061078984828501610750565b91505092915050565b6000819050919050565b60006107b76107b26107ad846106dd565b610792565b6106dd565b9050919050565b60006107c98261079c565b9050919050565b60006107db826107be565b9050919050565b6107eb816107d0565b82525050565b600060208201905061080660008301846107e2565b92915050565b600082825260208201905092915050565b7f5661756c743a20556e6c6f636b2074696d65206e6f742072656163686564207960008201527f6574000000000000000000000000000000000000000000000000000000000000602082015250565b600061087960228361080c565b91506108848261081d565b604082019050919050565b600060208201905081810360008301526108a88161086c565b9050919050565b60006040820190506108c4600083018561070f565b6108d16020830184610655565b9392505050565b60008115159050919050565b6108ed816108d8565b81146108f857600080fd5b50565b60008151905061090a816108e4565b92915050565b6000602082840312156109265761092561067f565b5b6000610934848285016108fb565b91505092915050565b6000606082019050610952600083018661070f565b61095f602083018561070f565b61096c6040830184610655565b949350505050565b7f5661756c743a20556e6c6f636b2074696d652063616e206f6e6c79206265206560008201527f7874656e64656400000000000000000000000000000000000000000000000000602082015250565b60006109d060278361080c565b91506109db82610974565b604082019050919050565b600060208201905081810360008301526109ff816109c3565b905091905056fea2646970667358221220ca41d0d21665abae44e5d9d6963084b8dd2a38ab238f0d9153c63beb0c165c5264736f6c6343000814003300000000000000000000000006ddb3a8bc0abc14f85e974cf1a93a6f8d4909d900000000000000000000000000000000000000000000000000000000657b9700
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063b6b55f251161005b578063b6b55f25146100ef578063dace45571461010b578063f2fde38b14610127578063fc0c546a1461014357610088565b8063251c1aa31461008d5780632e1a7d4d146100ab578063715018a6146100c75780638da5cb5b146100d1575b600080fd5b610095610161565b6040516100a29190610664565b60405180910390f35b6100c560048036038101906100c091906106b0565b610167565b005b6100cf610296565b005b6100d96102aa565b6040516100e6919061071e565b60405180910390f35b610109600480360381019061010491906106b0565b6102d3565b005b610125600480360381019061012091906106b0565b6103bf565b005b610141600480360381019061013c9190610765565b61044c565b005b61014b6104d2565b60405161015891906107f1565b60405180910390f35b60025481565b61016f6104f8565b6002544210156101b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ab9061088f565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6101fa6102aa565b836040518363ffffffff1660e01b81526004016102189291906108af565b6020604051808303816000875af1158015610237573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025b9190610910565b507f4e70a604b23a8edee2b1d0a656e9b9c00b73ad8bb1afc2c59381ee9f69197de78160405161028b9190610664565b60405180910390a150565b61029e6104f8565b6102a8600061057f565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6102db6104f8565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd6103216102aa565b30846040518463ffffffff1660e01b81526004016103419392919061093d565b6020604051808303816000875af1158015610360573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103849190610910565b507f4d6ce1e535dbade1c23defba91e23b8f791ce5edc0cc320257a2b364e4e38426816040516103b49190610664565b60405180910390a150565b6103c76104f8565b600254811161040b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610402906109e6565b60405180910390fd5b806002819055507f6669a6c779a56629103733bcba993d66b30b061559b41f3c64bd2661cd9ea3c1816040516104419190610664565b60405180910390a150565b6104546104f8565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036104c65760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016104bd919061071e565b60405180910390fd5b6104cf8161057f565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610500610643565b73ffffffffffffffffffffffffffffffffffffffff1661051e6102aa565b73ffffffffffffffffffffffffffffffffffffffff161461057d57610541610643565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610574919061071e565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6000819050919050565b61065e8161064b565b82525050565b60006020820190506106796000830184610655565b92915050565b600080fd5b61068d8161064b565b811461069857600080fd5b50565b6000813590506106aa81610684565b92915050565b6000602082840312156106c6576106c561067f565b5b60006106d48482850161069b565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610708826106dd565b9050919050565b610718816106fd565b82525050565b6000602082019050610733600083018461070f565b92915050565b610742816106fd565b811461074d57600080fd5b50565b60008135905061075f81610739565b92915050565b60006020828403121561077b5761077a61067f565b5b600061078984828501610750565b91505092915050565b6000819050919050565b60006107b76107b26107ad846106dd565b610792565b6106dd565b9050919050565b60006107c98261079c565b9050919050565b60006107db826107be565b9050919050565b6107eb816107d0565b82525050565b600060208201905061080660008301846107e2565b92915050565b600082825260208201905092915050565b7f5661756c743a20556e6c6f636b2074696d65206e6f742072656163686564207960008201527f6574000000000000000000000000000000000000000000000000000000000000602082015250565b600061087960228361080c565b91506108848261081d565b604082019050919050565b600060208201905081810360008301526108a88161086c565b9050919050565b60006040820190506108c4600083018561070f565b6108d16020830184610655565b9392505050565b60008115159050919050565b6108ed816108d8565b81146108f857600080fd5b50565b60008151905061090a816108e4565b92915050565b6000602082840312156109265761092561067f565b5b6000610934848285016108fb565b91505092915050565b6000606082019050610952600083018661070f565b61095f602083018561070f565b61096c6040830184610655565b949350505050565b7f5661756c743a20556e6c6f636b2074696d652063616e206f6e6c79206265206560008201527f7874656e64656400000000000000000000000000000000000000000000000000602082015250565b60006109d060278361080c565b91506109db82610974565b604082019050919050565b600060208201905081810360008301526109ff816109c3565b905091905056fea2646970667358221220ca41d0d21665abae44e5d9d6963084b8dd2a38ab238f0d9153c63beb0c165c5264736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000006ddb3a8bc0abc14f85e974cf1a93a6f8d4909d900000000000000000000000000000000000000000000000000000000657b9700
-----Decoded View---------------
Arg [0] : _token (address): 0x06DDb3a8BC0aBc14f85e974CF1A93a6f8d4909d9
Arg [1] : _unlockTime (uint256): 1702598400
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000006ddb3a8bc0abc14f85e974cf1a93a6f8d4909d9
Arg [1] : 00000000000000000000000000000000000000000000000000000000657b9700
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.002642 | 74,388,961.6191 | $196,527.45 |
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.