Token vesting lockup contract. Holds ERC20 tokens for a beneficiary until end_time, then allows release() to transfer them. lockOver() checks completion.
Key Facts
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
{
"language": "Solidity",
"sources": {
"LockToken.sol": {
"content": "pragma solidity ^0.4.24;\r\n\r\n/**\r\n* @title SafeMath\r\n* @dev Math operations with safety checks that throw on error\r\n*/\r\nlibrary SafeMath {\r\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r\n uint256 c = a * b;\r\n assert(a == 0 || c / a == b);\r\n return c;\r\n }\r\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n // assert(b > 0); // Solidity automatically throws when dividing by 0\r\n uint256 c = a / b;\r\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\r\n return c;\r\n }\r\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n assert(b <= a);\r\n return a - b;\r\n }\r\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n uint256 c = a + b;\r\n assert(c >= a);\r\n return c;\r\n }\r\n}\r\n\r\ncontract token {\r\n\r\n function balanceOf(address _owner) public constant returns (uint256 balance);\r\n function transfer(address _to, uint256 _value) public returns (bool success);\r\n\r\n}\r\n\r\ncontract Ownable {\r\n address public owner;\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n /**\r\n * @dev The Ownable constructor sets the original `owner` of the contract to the sender\r\n * account.\r\n */\r\n constructor() public{\r\n owner = msg.sender;\r\n }\r\n /**\r\n * @dev Throws if called by any account other than the owner.\r\n */\r\n modifier onlyOwner() {\r\n require(msg.sender == owner);\r\n _;\r\n }\r\n /**\r\n * @dev Allows the current owner to transfer control of the contract to a newOwner.\r\n * @param newOwner The address to transfer ownership to.\r\n */\r\n function transferOwnership(address newOwner) onlyOwner public {\r\n require(newOwner != address(0));\r\n emit OwnershipTransferred(owner, newOwner);\r\n owner = newOwner;\r\n }\r\n}\r\n\r\ncontract LockToken is Ownable {\r\n using SafeMath for uint256;\r\n\r\n token token_reward;\r\n address public beneficiary;\r\n bool public isLocked = false;\r\n bool public isReleased = false;\r\n uint256 public start_time;\r\n uint256 public end_time;\r\n \r\n event TokenReleased(address beneficiary, uint256 token_amount);\r\n\r\n constructor(address tokenContractAddress, address _beneficiary) public{\r\n token_reward = token(tokenContractAddress);\r\n beneficiary = _beneficiary;\r\n }\r\n\r\n function tokenBalance() constant public returns (uint256){\r\n return token_reward.balanceOf(this);\r\n }\r\n\r\n function lock(uint256 lockTime) public onlyOwner returns (bool){\r\n require(!isLocked);\r\n require(tokenBalance() > 0);\r\n start_time = now;\r\n end_time = lockTime;\r\n isLocked = true;\r\n }\r\n\r\n function lockOver() constant public returns (bool){\r\n uint256 current_time = now;\r\n return current_time > end_time;\r\n }\r\n\r\n function release() onlyOwner public{\r\n require(isLocked);\r\n require(!isReleased);\r\n require(lockOver());\r\n uint256 token_amount = tokenBalance();\r\n token_reward.transfer( beneficiary, token_amount);\r\n emit TokenReleased(beneficiary, token_amount);\r\n isReleased = true;\r\n }\r\n}"
}
},
"settings": {
"compilationTarget": {
"LockToken.sol": "LockToken"
},
"evmVersion": "byzantium",
"libraries": {},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
}External Links
Related contracts
BankWallet
Same eraProxy wallet that forwards received ETH to a configured bank address. Owner can sweep ETH and ERC-20 token balances to that same destination.
0x449ad8...17a931November 14, 2017UserWallet
Same eraExchange deposit wallet with ETH and ERC20 sweep functions. One of the most widely deployed bytecodes on Ethereum.
0x24eb88...a068a7January 4, 2018Contract 0x3d40c2...1ec557
Same eraToken relay contract. Forwards ERC20 token transfers via transferToken(token, recipient, amount) on behalf of a configured owner.
0x3d40c2...1ec557January 4, 2018IMG
Same eraOn-chain JPEG of a tabby cat: a 128x128 JFIF baseline image returned as a hex-text string by a single read() function. January 2018.
0x2fabe6...86c7a1January 21, 2018Contract 0xda0a31...93b07c
Same eraToken distributor contract. Transfers ERC20 tokens from the contract to recipients via sendCoin(recipient, amount, tokenAddress).
0xda0a31...93b07cJanuary 27, 2018CryptoColors
Same eraFebruary 2018 hot-potato collectible game on Ethereum. Five tokens: Red, Blue, Lime, Yellow, Orange — each storing R/G/B values on-chain.
0x3116c4...ef9b96February 3, 2018