From 9e0e80e820e49b26e8e5c79951202c1be722419a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Triay?= Date: Mon, 2 Oct 2017 17:30:35 -0300 Subject: [PATCH] [TokenVesting] Allow instantiation of already started vesting contracts. Improve comments' wording. --- contracts/token/TokenVesting.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contracts/token/TokenVesting.sol b/contracts/token/TokenVesting.sol index 096f84807..3cf576f5b 100644 --- a/contracts/token/TokenVesting.sol +++ b/contracts/token/TokenVesting.sol @@ -39,8 +39,7 @@ contract TokenVesting is Ownable { */ function TokenVesting(address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, bool _revocable) { require(_beneficiary != 0x0); - require(_cliff < _duration); - require(_start >= now); + require(_cliff <= _duration); beneficiary = _beneficiary; revocable = _revocable; @@ -82,7 +81,7 @@ contract TokenVesting is Ownable { } /** - * @dev Calculates the amount that has already vested but not released. + * @dev Calculates the amount that has already vested but hasn't been released yet. * @param token ERC20 token which is being vested */ function vestedAmount(ERC20Basic token) constant returns (uint256) { @@ -97,7 +96,7 @@ contract TokenVesting is Ownable { uint256 vested = totalBalance.mul(now - start).div(duration); uint256 unreleased = vested.sub(released[token]); - // currentBalance can be 0 in case of a revoke + // currentBalance can be 0 in case of vesting being revoked earlier. return Math.min256(currentBalance, unreleased); } }