|
|
@ -99,7 +99,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { |
|
|
|
* @param time uint64 The specific time. |
|
|
|
* @param time uint64 The specific time. |
|
|
|
* @return An uint256 representing a holder's total amount of transferable tokens. |
|
|
|
* @return An uint256 representing a holder's total amount of transferable tokens. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function transferableTokens(address holder, uint64 time) constant public returns (uint256) { |
|
|
|
function transferableTokens(address holder, uint64 time) public constant returns (uint256) { |
|
|
|
uint256 grantIndex = tokenGrantsCount(holder); |
|
|
|
uint256 grantIndex = tokenGrantsCount(holder); |
|
|
|
|
|
|
|
|
|
|
|
if (grantIndex == 0) return super.transferableTokens(holder, time); // shortcut for holder without grants |
|
|
|
if (grantIndex == 0) return super.transferableTokens(holder, time); // shortcut for holder without grants |
|
|
@ -123,7 +123,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { |
|
|
|
* @param _holder The holder of the grants. |
|
|
|
* @param _holder The holder of the grants. |
|
|
|
* @return A uint256 representing the total amount of grants. |
|
|
|
* @return A uint256 representing the total amount of grants. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function tokenGrantsCount(address _holder) constant returns (uint256 index) { |
|
|
|
function tokenGrantsCount(address _holder) public constant returns (uint256 index) { |
|
|
|
return grants[_holder].length; |
|
|
|
return grants[_holder].length; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -156,7 +156,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { |
|
|
|
uint256 time, |
|
|
|
uint256 time, |
|
|
|
uint256 start, |
|
|
|
uint256 start, |
|
|
|
uint256 cliff, |
|
|
|
uint256 cliff, |
|
|
|
uint256 vesting) constant returns (uint256) |
|
|
|
uint256 vesting) public constant returns (uint256) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Shortcuts for before cliff and after vesting cases. |
|
|
|
// Shortcuts for before cliff and after vesting cases. |
|
|
|
if (time < cliff) return 0; |
|
|
|
if (time < cliff) return 0; |
|
|
@ -185,7 +185,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { |
|
|
|
* @return Returns all the values that represent a TokenGrant(address, value, start, cliff, |
|
|
|
* @return Returns all the values that represent a TokenGrant(address, value, start, cliff, |
|
|
|
* revokability, burnsOnRevoke, and vesting) plus the vested value at the current time. |
|
|
|
* revokability, burnsOnRevoke, and vesting) plus the vested value at the current time. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function tokenGrant(address _holder, uint256 _grantId) constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) { |
|
|
|
function tokenGrant(address _holder, uint256 _grantId) public constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting, bool revokable, bool burnsOnRevoke) { |
|
|
|
TokenGrant storage grant = grants[_holder][_grantId]; |
|
|
|
TokenGrant storage grant = grants[_holder][_grantId]; |
|
|
|
|
|
|
|
|
|
|
|
granter = grant.granter; |
|
|
|
granter = grant.granter; |
|
|
@ -231,7 +231,7 @@ contract VestedToken is StandardToken, LimitedTransferToken { |
|
|
|
* @param holder address The address of the holder |
|
|
|
* @param holder address The address of the holder |
|
|
|
* @return An uint256 representing the date of the last transferable tokens. |
|
|
|
* @return An uint256 representing the date of the last transferable tokens. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function lastTokenIsTransferableDate(address holder) constant public returns (uint64 date) { |
|
|
|
function lastTokenIsTransferableDate(address holder) public constant returns (uint64 date) { |
|
|
|
date = uint64(now); |
|
|
|
date = uint64(now); |
|
|
|
uint256 grantIndex = grants[holder].length; |
|
|
|
uint256 grantIndex = grants[holder].length; |
|
|
|
for (uint256 i = 0; i < grantIndex; i++) { |
|
|
|
for (uint256 i = 0; i < grantIndex; i++) { |
|
|
|