Back to HomeDeployer 0xe35f12...d0804b Deployment Block 6,348,067 Deployment Date Sep 17, 2018, 11:31 AM Code Size 1.5 KB Gas at Deploy 518,762
Deployed September 17, 2018 (7 years ago)Block 6,348,067
Token vesting lockup contract. Holds ERC20 tokens for a beneficiary until end_time, then allows release() to transfer them. lockOver() checks completion.
Byzantium EraVerified Source
Key Facts
Transactions by Year
20181
20191
Deployment Transaction: 0x6add514b6236f067...b4741e516f982b82
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Detected Type: other
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Block span: 4,370,000 — 7,279,999
October 16, 2017 — February 28, 2019
Bytecode Overview
Opcodes1,524
Unique Opcodes165
Jump Instructions96
Storage Operations33
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": []
}
}