- Contract name:
- Eqwe
- Optimization enabled
- true
- Compiler version
- v0.8.15+commit.e14f2714
- Optimization runs
- 200
- Verified at
- 2023-06-28T11:32:19.450903Z
Constructor Arguments
0000000000000000000000008dc8ab674243ee98c03e8ed71c1fc30b05beb597000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008dc8ab674243ee98c03e8ed71c1fc30b05beb59700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
Arg [0] (address) : 0x8dc8ab674243ee98c03e8ed71c1fc30b05beb597
Arg [1] (address[]) : [0x8dc8ab674243ee98c03e8ed71c1fc30b05beb597]
Arg [2] (uint256[]) : [1]
Arg [3] (uint256) : 0
Contract source code
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); } contract Eqwe { struct LockInfo { uint256 amount; uint256 end; } mapping(address => LockInfo) public locks; IERC20 public token; constructor( IERC20 _token, address[] memory _addresses, uint256[] memory _amounts, uint256 _lockDuration ) { require( _addresses.length == _amounts.length, 'Addresses and amounts length mismatch' ); token = _token; for (uint256 i = 0; i < _addresses.length; i++) { locks[_addresses[i]] = LockInfo({ amount: _amounts[i], end: block.timestamp + _lockDuration }); } } function withdraw() public { LockInfo storage lockInfo = locks[msg.sender]; require(block.timestamp >= lockInfo.end, 'Lock period not ended'); uint256 amount = lockInfo.amount; lockInfo.amount = 0; token.transfer(msg.sender, amount); } }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_token","internalType":"contract IERC20"},{"type":"address[]","name":"_addresses","internalType":"address[]"},{"type":"uint256[]","name":"_amounts","internalType":"uint256[]"},{"type":"uint256","name":"_lockDuration","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"end","internalType":"uint256"}],"name":"locks","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IERC20"}],"name":"token","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]}]
Contract Creation Code
0x608060405234801561001057600080fd5b506040516105af3803806105af83398101604081905261002f91610240565b81518351146100925760405162461bcd60e51b815260206004820152602560248201527f41646472657373657320616e6420616d6f756e7473206c656e677468206d69736044820152640dac2e8c6d60db1b606482015260840160405180910390fd5b600180546001600160a01b0319166001600160a01b03861617905560005b835181101561014a5760405180604001604052808483815181106100d6576100d6610320565b6020026020010151815260200183426100ef919061034c565b81525060008086848151811061010757610107610320565b6020908102919091018101516001600160a01b0316825281810192909252604001600020825181559101516001909101558061014281610364565b9150506100b0565b505050505061037d565b6001600160a01b038116811461016957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156101aa576101aa61016c565b604052919050565b60006001600160401b038211156101cb576101cb61016c565b5060051b60200190565b600082601f8301126101e657600080fd5b815160206101fb6101f6836101b2565b610182565b82815260059290921b8401810191818101908684111561021a57600080fd5b8286015b84811015610235578051835291830191830161021e565b509695505050505050565b6000806000806080858703121561025657600080fd5b845161026181610154565b602086810151919550906001600160401b038082111561028057600080fd5b818801915088601f83011261029457600080fd5b81516102a26101f6826101b2565b81815260059190911b8301840190848101908b8311156102c157600080fd5b938501935b828510156102e85784516102d981610154565b825293850193908501906102c6565b60408b0151909850945050508083111561030157600080fd5b505061030f878288016101d5565b606096909601519497939650505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561035f5761035f610336565b500190565b60006001820161037657610376610336565b5060010190565b6102238061038c6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80633ccfd60b146100465780635de9a13714610050578063fc0c546a14610091575b600080fd5b61004e6100bc565b005b61007761005e36600461019b565b6000602081905290815260409020805460019091015482565b604080519283526020830191909152015b60405180910390f35b6001546100a4906001600160a01b031681565b6040516001600160a01b039091168152602001610088565b336000908152602081905260409020600181015442101561011b5760405162461bcd60e51b8152602060048201526015602482015274131bd8dac81c195c9a5bd9081b9bdd08195b991959605a1b604482015260640160405180910390fd5b80546000825560015460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610172573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019691906101cb565b505050565b6000602082840312156101ad57600080fd5b81356001600160a01b03811681146101c457600080fd5b9392505050565b6000602082840312156101dd57600080fd5b815180151581146101c457600080fdfea26469706673582212202e93154545aee96a1e912a2b0da6e99556be05e18326123a25fcf27da7022e3964736f6c634300080f00330000000000000000000000008dc8ab674243ee98c03e8ed71c1fc30b05beb597000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000008dc8ab674243ee98c03e8ed71c1fc30b05beb59700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c80633ccfd60b146100465780635de9a13714610050578063fc0c546a14610091575b600080fd5b61004e6100bc565b005b61007761005e36600461019b565b6000602081905290815260409020805460019091015482565b604080519283526020830191909152015b60405180910390f35b6001546100a4906001600160a01b031681565b6040516001600160a01b039091168152602001610088565b336000908152602081905260409020600181015442101561011b5760405162461bcd60e51b8152602060048201526015602482015274131bd8dac81c195c9a5bd9081b9bdd08195b991959605a1b604482015260640160405180910390fd5b80546000825560015460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610172573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061019691906101cb565b505050565b6000602082840312156101ad57600080fd5b81356001600160a01b03811681146101c457600080fd5b9392505050565b6000602082840312156101dd57600080fd5b815180151581146101c457600080fdfea26469706673582212202e93154545aee96a1e912a2b0da6e99556be05e18326123a25fcf27da7022e3964736f6c634300080f0033