Verified contractPartial
TimeLockedWallet
Address0xcccb7b3a33f0edd13e3f839cb8a9fd33a6dd6174
- Balance
0 ETH
- Transactions
2
- Compiler
solc 0.4.26
- Same code
11 more contracts
Details
- Compiler
- solc 0.4.26+commit.4563c3fc
- Language
- solidity
- Optimization
- No
- EVM version
- byzantium
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 11,388,040
- Creation transaction
- 0x0698c2fc2d…354e4a15bf
- Main copy (most transactions)
- 0xf5e9a3eb…1cef0355
2 files
- TimeLockWallet.solmain1.83 KB
- ERC20.sol711 B
TimeLockWallet.sol
pragma solidity ^0.4.18;
import "./ERC20.sol";
contract TimeLockedWallet {
address public creator;
address public owner;
uint256 public unlockDate;
uint256 public createdAt;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
constructor(
address _creator,
address _owner,
uint256 _unlockDate
) public {
creator = _creator;
owner = _owner;
unlockDate = _unlockDate;
createdAt = now;
}
// keep all the ether sent to this address
function() payable public {
emit Received(msg.sender, msg.value);
}
// callable by owner only, after specified time
function withdraw() onlyOwner public {
require(now >= unlockDate,"Unlock date is in the future");
//now send all the balance
msg.sender.transfer(address(this).balance);
emit Withdrew(msg.sender, address(this).balance);
}
// callable by owner only, after specified time, only for Tokens implementing ERC20
function releaseTokens(address _tokenContract) onlyOwner public {
require(now >= unlockDate,"Unlock date is in the future");
ERC20 token = ERC20(_tokenContract);
//now send all the token balance
uint256 tokenBalance = token.balanceOf(this);
token.transfer(owner, tokenBalance);
emit ReleasedTokens(_tokenContract, msg.sender, tokenBalance);
}
function info() public view returns(address, address, uint256, uint256, uint256) {
return (creator, owner, unlockDate, createdAt, address(this).balance);
}
event Received(address from, uint256 amount);
event Withdrew(address to, uint256 amount);
event ReleasedTokens(address tokenContract, address to, uint256 amount);
}ERC20.sol
pragma solidity ^0.4.18;
/**
* @title ERC20
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
},
"evmVersion": "byzantium",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.