|
|
|
@ -5,11 +5,11 @@ import './ERC20Basic.sol'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @title TokenTimelock |
|
|
|
|
* @dev TokenTimelock is a token holder contract that will allow a |
|
|
|
|
* @dev TokenTimelock is a token holder contract that will allow a |
|
|
|
|
* beneficiary to extract the tokens after a given release time |
|
|
|
|
*/ |
|
|
|
|
contract TokenTimelock { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ERC20 basic token contract being held |
|
|
|
|
ERC20Basic token; |
|
|
|
|
|
|
|
|
@ -17,9 +17,9 @@ contract TokenTimelock { |
|
|
|
|
address beneficiary; |
|
|
|
|
|
|
|
|
|
// timestamp when token release is enabled |
|
|
|
|
uint releaseTime; |
|
|
|
|
uint64 releaseTime; |
|
|
|
|
|
|
|
|
|
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) { |
|
|
|
|
function TokenTimelock(ERC20Basic _token, address _beneficiary, uint64 _releaseTime) { |
|
|
|
|
require(_releaseTime > now); |
|
|
|
|
token = _token; |
|
|
|
|
beneficiary = _beneficiary; |
|
|
|
@ -41,7 +41,7 @@ contract TokenTimelock { |
|
|
|
|
function release() { |
|
|
|
|
require(now >= releaseTime); |
|
|
|
|
|
|
|
|
|
uint amount = token.balanceOf(this); |
|
|
|
|
uint256 amount = token.balanceOf(this); |
|
|
|
|
require(amount > 0); |
|
|
|
|
|
|
|
|
|
token.transfer(beneficiary, amount); |
|
|
|
|