Commit d357cf3a by maurelian Committed by maurelian

Minor changes to doc comments for token and other contracts

parent 83f28494
...@@ -16,7 +16,7 @@ contract Bounty is PullPayment, Destructible { ...@@ -16,7 +16,7 @@ contract Bounty is PullPayment, Destructible {
event TargetCreated(address createdAddress); event TargetCreated(address createdAddress);
/** /**
* @dev Function that allows the contract to recieve funds, if it hasn't been claimed. * @dev Fallback function allowing the contract to recieve funds, if they haven't already been claimed.
*/ */
function() payable { function() payable {
if (claimed) { if (claimed) {
...@@ -25,7 +25,8 @@ contract Bounty is PullPayment, Destructible { ...@@ -25,7 +25,8 @@ contract Bounty is PullPayment, Destructible {
} }
/** /**
* @dev Create and deploy the target contract(extension of Target contract), and sets the msg.sender as a researcher * @dev Create and deploy the target contract (extension of Target contract), and sets the
* msg.sender as a researcher
* @return A target contract * @return A target contract
*/ */
function createTarget() returns(Target) { function createTarget() returns(Target) {
...@@ -68,8 +69,10 @@ contract Bounty is PullPayment, Destructible { ...@@ -68,8 +69,10 @@ contract Bounty is PullPayment, Destructible {
contract Target { contract Target {
/** /**
* @dev Funtion tha should check everything your contract assumes to be true all the time. If this function returns false, it means your contract was broken in some way and is in an inconsistent state. This is what security researchers will try to acomplish when trying to get the bounty. * @dev Checks all values a contract assumes to be true all the time. If this function returns
* @return A boolean that indicates if the contract is broken or not. * false, the contract is broken in some way and is in an inconsistent state.
* In order to win the bounty, security researchers will try to cause this broken state.
* @return True if all invariant values are correct, false otherwise.
*/ */
function checkInvariant() returns(bool); function checkInvariant() returns(bool);
} }
...@@ -2,7 +2,8 @@ pragma solidity ^0.4.8; ...@@ -2,7 +2,8 @@ pragma solidity ^0.4.8;
/** /**
* @title DayLimit * @title DayLimit
* @dev Base contract that enables methods to be protected by placing a linear limit (specifiable) on a particular resource per calendar day. Is multiowned to allow the limit to be altered * @dev Base contract that enables methods to be protected by placing a linear limit (specifiable)
* on a particular resource per calendar day. Is multiowned to allow the limit to be altered.
*/ */
contract DayLimit { contract DayLimit {
...@@ -11,7 +12,7 @@ contract DayLimit { ...@@ -11,7 +12,7 @@ contract DayLimit {
uint public lastDay; uint public lastDay;
/** /**
* @dev Constructor that sets the passed value as a dailyLimit * @dev Constructor that sets the passed value as a dailyLimit.
* @param _limit Uint to represent the daily limit. * @param _limit Uint to represent the daily limit.
*/ */
function DayLimit(uint _limit) { function DayLimit(uint _limit) {
...@@ -20,7 +21,7 @@ contract DayLimit { ...@@ -20,7 +21,7 @@ contract DayLimit {
} }
/** /**
* @dev sets the daily limit. doesn't alter the amount already spent today * @dev sets the daily limit. Does not alter the amount already spent today.
* @param _newLimit Uint to represent the new limit. * @param _newLimit Uint to represent the new limit.
*/ */
function _setDailyLimit(uint _newLimit) internal { function _setDailyLimit(uint _newLimit) internal {
...@@ -35,8 +36,8 @@ contract DayLimit { ...@@ -35,8 +36,8 @@ contract DayLimit {
} }
/** /**
* @dev Checks to see if there is enough resource to spend today. If true, the resource is expended. * @dev Checks to see if there is enough resource to spend today. If true, the resource may be expended.
* @param _value Uint representing the amout of resurce to spend. * @param _value Uint representing the amount of resource to spend.
* @return A boolean that is True if the resource was spended and false otherwise. * @return A boolean that is True if the resource was spended and false otherwise.
*/ */
function underLimit(uint _value) internal returns (bool) { function underLimit(uint _value) internal returns (bool) {
...@@ -55,8 +56,8 @@ contract DayLimit { ...@@ -55,8 +56,8 @@ contract DayLimit {
} }
/** /**
* @dev Private function to determine today index * @dev Private function to determine today's index
* @return Uint of todays index. * @return Uint of today's index.
*/ */
function today() private constant returns (uint) { function today() private constant returns (uint) {
return now / 1 days; return now / 1 days;
......
...@@ -12,7 +12,7 @@ contract LimitBalance { ...@@ -12,7 +12,7 @@ contract LimitBalance {
uint public limit; uint public limit;
/** /**
* @dev Constructor that sets the passed value as a limit * @dev Constructor that sets the passed value as a limit.
* @param _limit Uint to represent the limit. * @param _limit Uint to represent the limit.
*/ */
function LimitBalance(uint _limit) { function LimitBalance(uint _limit) {
......
pragma solidity ^0.4.8; pragma solidity ^0.4.8;
/// @title Helps contracts guard agains rentrancy attacks. /**
/// @author Remco Bloemen <remco@2π.com> * @title Helps contracts guard agains rentrancy attacks.
/// @notice If you mark a function `nonReentrant`, you should also * @author Remco Bloemen <remco@2π.com>
/// mark it `external`. * @notice If you mark a function `nonReentrant`, you should also
* mark it `external`.
*/
contract ReentrancyGuard { contract ReentrancyGuard {
/// @dev We use a single lock for the whole contract. /**
* @dev We use a single lock for the whole contract.
*/
bool private rentrancy_lock = false; bool private rentrancy_lock = false;
/// Prevent contract from calling itself, directly or indirectly. /**
/// @notice If you mark a function `nonReentrant`, you should also * @dev Prevents a contract from calling itself, directly or indirectly.
/// mark it `external`. Calling one nonReentrant function from * @notice If you mark a function `nonReentrant`, you should also
/// another is not supported. Instead, you can implement a * mark it `external`. Calling one nonReentrant function from
/// `private` function doing the actual work, and a `external` * another is not supported. Instead, you can implement a
/// wrapper marked as `nonReentrant`. * `private` function doing the actual work, and a `external`
* wrapper marked as `nonReentrant`.
*/
modifier nonReentrant() { modifier nonReentrant() {
if(rentrancy_lock == false) { if(rentrancy_lock == false) {
rentrancy_lock = true; rentrancy_lock = true;
......
...@@ -44,9 +44,8 @@ contract Shareable { ...@@ -44,9 +44,8 @@ contract Shareable {
/** /**
* @dev Modifier for multisig functions. * @dev Modifier for multisig functions.
* @param _operation The operation must have an intrinsic hash in order * @param _operation The operation must have an intrinsic hash in order that later attempts can be
* that later attempts can be realised as the same underlying operation and * realised as the same underlying operation and thus count as confirmations.
* thus count as confirmations.
*/ */
modifier onlymanyowners(bytes32 _operation) { modifier onlymanyowners(bytes32 _operation) {
if (confirmAndCheck(_operation)) { if (confirmAndCheck(_operation)) {
...@@ -59,6 +58,7 @@ contract Shareable { ...@@ -59,6 +58,7 @@ contract Shareable {
* transactions as well as the selection of addresses capable of confirming them. * transactions as well as the selection of addresses capable of confirming them.
* @param _owners A list of owners. * @param _owners A list of owners.
* @param _required The amount required for a transaction to be approved. * @param _required The amount required for a transaction to be approved.
* @param _limit Uint to represent the daily limit.
*/ */
function Shareable(address[] _owners, uint _required) { function Shareable(address[] _owners, uint _required) {
owners[1] = msg.sender; owners[1] = msg.sender;
...@@ -74,8 +74,8 @@ contract Shareable { ...@@ -74,8 +74,8 @@ contract Shareable {
} }
/** /**
* @dev Revokes a prior confirmation of the given operation * @dev Revokes a prior confirmation of the given operation.
* @param _operation bytes32 A string the identfies the operation. * @param _operation A string identifying the operation.
*/ */
function revoke(bytes32 _operation) external { function revoke(bytes32 _operation) external {
uint index = ownerIndex[msg.sender]; uint index = ownerIndex[msg.sender];
......
...@@ -7,7 +7,7 @@ import '../SafeMath.sol'; ...@@ -7,7 +7,7 @@ import '../SafeMath.sol';
/** /**
* @title Basic token * @title Basic token
* @dev Basic version of StandardToken, with no allowances * @dev Basic version of StandardToken, with no allowances.
*/ */
contract BasicToken is ERC20Basic { contract BasicToken is ERC20Basic {
using SafeMath for uint; using SafeMath for uint;
...@@ -15,7 +15,7 @@ contract BasicToken is ERC20Basic { ...@@ -15,7 +15,7 @@ contract BasicToken is ERC20Basic {
mapping(address => uint) balances; mapping(address => uint) balances;
/** /**
* @dev Fix for the ERC20 short address attack * @dev Fix for the ERC20 short address attack.
*/ */
modifier onlyPayloadSize(uint size) { modifier onlyPayloadSize(uint size) {
if(msg.data.length < size + 4) { if(msg.data.length < size + 4) {
...@@ -26,8 +26,8 @@ contract BasicToken is ERC20Basic { ...@@ -26,8 +26,8 @@ contract BasicToken is ERC20Basic {
/** /**
* @dev transfer token for a specified address * @dev transfer token for a specified address
* @param _to address The address which you want to transfer to * @param _to The address to transfer to.
* @param _value uint the amout to be transfered * @param _value The amount to be transferred.
*/ */
function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) {
balances[msg.sender] = balances[msg.sender].sub(_value); balances[msg.sender] = balances[msg.sender].sub(_value);
...@@ -36,9 +36,9 @@ contract BasicToken is ERC20Basic { ...@@ -36,9 +36,9 @@ contract BasicToken is ERC20Basic {
} }
/** /**
* @dev Function to get the balance of the specified address * @dev Gets the balance of the specified address.
* @param _owner address The address you wish to get the balance from * @param _owner The address to query the the balance of.
* @return An uint representing the amout owned by the passed address * @return An uint representing the amount owned by the passed address.
*/ */
function balanceOf(address _owner) constant returns (uint balance) { function balanceOf(address _owner) constant returns (uint balance) {
return balances[_owner]; return balances[_owner];
......
...@@ -4,12 +4,12 @@ pragma solidity ^0.4.8; ...@@ -4,12 +4,12 @@ pragma solidity ^0.4.8;
import "./StandardToken.sol"; import "./StandardToken.sol";
/* /**
* @title CrowdsaleToken * @title CrowdsaleToken
* *
* @dev Simple ERC20 Token example, with crowdsale token creation * @dev Simple ERC20 Token example, with crowdsale token creation
* @dev IMPORTANT NOTE: do not use or deploy this contract as-is. It * @dev IMPORTANT NOTE: do not use or deploy this contract as-is. It needs some changes to be
needs some changes to be production ready. * production ready.
*/ */
contract CrowdsaleToken is StandardToken { contract CrowdsaleToken is StandardToken {
...@@ -24,17 +24,17 @@ contract CrowdsaleToken is StandardToken { ...@@ -24,17 +24,17 @@ contract CrowdsaleToken is StandardToken {
uint public constant PRICE = 500; uint public constant PRICE = 500;
/** /**
* @dev A function that recieves ether and send the equivalent amount of * @dev Fallback function which receives ether and sends the appropriate number of tokens to the
the token to the msg.sender * msg.sender.
*/ */
function () payable { function () payable {
createTokens(msg.sender); createTokens(msg.sender);
} }
/** /**
* @dev Function to create tokens and send to the specified address * @dev Creates tokens and send to the specified address.
* @param recipient address The address which will recieve the new tokens. * @param recipient The address which will recieve the new tokens.
*/ */
function createTokens(address recipient) payable { function createTokens(address recipient) payable {
if (msg.value == 0) { if (msg.value == 0) {
throw; throw;
...@@ -51,9 +51,9 @@ contract CrowdsaleToken is StandardToken { ...@@ -51,9 +51,9 @@ contract CrowdsaleToken is StandardToken {
} }
/** /**
* @dev replace this with any other price function * @dev replace this with any other price function
* @return The price per unit of token. * @return The price per unit of token.
*/ */
function getPrice() constant returns (uint result) { function getPrice() constant returns (uint result) {
return PRICE; return PRICE;
} }
......
...@@ -3,58 +3,54 @@ pragma solidity ^0.4.8; ...@@ -3,58 +3,54 @@ pragma solidity ^0.4.8;
import "./ERC20.sol"; import "./ERC20.sol";
/** /**
* @title LimitedTransferToken
* @title LimitedTransferToken * @dev LimitedTransferToken defines the generic interface and the implementation to limit token
* transferability for different events. It is intended to be used as a base class for other token
* @dev LimitedTransferToken defines the generic interface and the implementation * contracts.
to limit token transferability for different events. * LimitedTransferToken has been designed to allow for different limiting factors,
It is intended to be used as a base class for other token contracts. * this can be achieved by recursively calling super.transferableTokens() until the base class is
LimitedTransferToken has been designed to allow for different limiting factors, * hit. For example:
this can be achieved by recursively calling super.transferableTokens() until the * function transferableTokens(address holder, uint64 time) constant public returns (uint256) {
base class is hit. For example: * return min256(unlockedTokens, super.transferableTokens(holder, time));
function transferableTokens(address holder, uint64 time) constant public returns (uint256) { * }
return min256(unlockedTokens, super.transferableTokens(holder, time)); * A working example is VestedToken.sol:
} * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/VestedToken.sol
*/
A working example is VestedToken.sol:
https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/VestedToken.sol
*/
contract LimitedTransferToken is ERC20 { contract LimitedTransferToken is ERC20 {
/** /**
* @dev Checks whether it can transfer or otherwise throws. * @dev Checks whether it can transfer or otherwise throws.
*/ */
modifier canTransfer(address _sender, uint _value) { modifier canTransfer(address _sender, uint _value) {
if (_value > transferableTokens(_sender, uint64(now))) throw; if (_value > transferableTokens(_sender, uint64(now))) throw;
_; _;
} }
/** /**
* @dev Checks modifier and allows transfer if tokens are not locked. * @dev Checks modifier and allows transfer if tokens are not locked.
* @param _to address The address that will recieve the tokens * @param _to The address that will recieve the tokens.
* @param _value uint The amount of tokens to be transfered * @param _value The amount of tokens to be transferred.
*/ */
function transfer(address _to, uint _value) canTransfer(msg.sender, _value) { function transfer(address _to, uint _value) canTransfer(msg.sender, _value) {
return super.transfer(_to, _value); return super.transfer(_to, _value);
} }
/** /**
* @dev Checks modifier and allows transfer if tokens are not locked. * @dev Checks modifier and allows transfer if tokens are not locked.
* @param _from address The address that will send the tokens. * @param _from The address that will send the tokens.
* @param _to address The address that will recieve the tokens. * @param _to The address that will recieve the tokens.
* @param _value uint The amount of tokens to be transfered. * @param _value The amount of tokens to be transferred.
*/ */
function transferFrom(address _from, address _to, uint _value) canTransfer(_from, _value) { function transferFrom(address _from, address _to, uint _value) canTransfer(_from, _value) {
return super.transferFrom(_from, _to, _value); return super.transferFrom(_from, _to, _value);
} }
/** /**
* @dev Default transferable tokens function returns all tokens for a holder (no limit). * @dev Default transferable tokens function returns all tokens for a holder (no limit).
* @dev Overwriting transferableTokens(address holder, uint64 time) is the way to provide * @dev Overwriting transferableTokens(address holder, uint64 time) is the way to provide the
the specific logic for limiting token transferability for a holder over time. * specific logic for limiting token transferability for a holder over time.
*/ */
function transferableTokens(address holder, uint64 time) constant public returns (uint256) { function transferableTokens(address holder, uint64 time) constant public returns (uint256) {
return balanceOf(holder); return balanceOf(holder);
} }
......
...@@ -7,9 +7,9 @@ import '../ownership/Ownable.sol'; ...@@ -7,9 +7,9 @@ import '../ownership/Ownable.sol';
/** /**
* @tit;e Mintable token * @title Mintable token
* @dev: Simple ERC20 Token example, with mintable token creation * @dev: Simple ERC20 Token example, with mintable token creation
@dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/ */
...@@ -27,11 +27,11 @@ contract MintableToken is StandardToken, Ownable { ...@@ -27,11 +27,11 @@ contract MintableToken is StandardToken, Ownable {
} }
/** /**
* @dev Function to mint tokens * @dev Function to mint tokens
* @param _to address The address that will recieve the minted tokens * @param _to The address that will recieve the minted tokens.
* @param _amout uint The amount of tokens to mint * @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful * @return A boolean that indicates if the operation was successful.
*/ */
function mint(address _to, uint _amount) onlyOwner canMint returns (bool) { function mint(address _to, uint _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount); totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount); balances[_to] = balances[_to].add(_amount);
...@@ -40,9 +40,9 @@ contract MintableToken is StandardToken, Ownable { ...@@ -40,9 +40,9 @@ contract MintableToken is StandardToken, Ownable {
} }
/** /**
* @dev Function to spot minting new tokens * @dev Function to spot minting new tokens.
* @return True if the operation was successful * @return True if the operation was successful.
*/ */
function finishMinting() onlyOwner returns (bool) { function finishMinting() onlyOwner returns (bool) {
mintingFinished = true; mintingFinished = true;
MintFinished(); MintFinished();
......
...@@ -6,10 +6,9 @@ import "./StandardToken.sol"; ...@@ -6,10 +6,9 @@ import "./StandardToken.sol";
/** /**
* @title SimpleToken * @title SimpleToken
* * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned * Note they can later distribute these tokens as they wish using `transfer` and other
to the creator. Note they can later distribute these tokens * `StandardToken` functions.
as they wish using `transfer` and other `StandardToken` functions.
*/ */
contract SimpleToken is StandardToken { contract SimpleToken is StandardToken {
...@@ -19,8 +18,8 @@ contract SimpleToken is StandardToken { ...@@ -19,8 +18,8 @@ contract SimpleToken is StandardToken {
uint public INITIAL_SUPPLY = 10000; uint public INITIAL_SUPPLY = 10000;
/** /**
* @dev Contructor that gives the msg.sender all of existing tokens. * @dev Contructor that gives msg.sender all of existing tokens.
*/ */
function SimpleToken() { function SimpleToken() {
totalSupply = INITIAL_SUPPLY; totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY;
......
...@@ -36,9 +36,9 @@ contract StandardToken is BasicToken, ERC20 { ...@@ -36,9 +36,9 @@ contract StandardToken is BasicToken, ERC20 {
} }
/** /**
* @dev Aprove the passed address to spend the specified amout tokens on the msg.sender behalf. * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender.
* @param _spender address The address which will spend the funds. * @param _spender The address which will spend the funds.
* @param _value uint the amout of tokens to be spended. * @param _value The amount of tokens to be spent.
*/ */
function approve(address _spender, uint _value) { function approve(address _spender, uint _value) {
......
...@@ -5,9 +5,9 @@ import "./StandardToken.sol"; ...@@ -5,9 +5,9 @@ import "./StandardToken.sol";
import "./LimitedTransferToken.sol"; import "./LimitedTransferToken.sol";
/** /**
* @title Vested token * @title Vested token
* @dev Tokens that can be vested for a group of addresses. * @dev Tokens that can be vested for a group of addresses.
*/ */
contract VestedToken is StandardToken, LimitedTransferToken { contract VestedToken is StandardToken, LimitedTransferToken {
struct TokenGrant { struct TokenGrant {
...@@ -21,13 +21,13 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -21,13 +21,13 @@ contract VestedToken is StandardToken, LimitedTransferToken {
mapping (address => TokenGrant[]) public grants; mapping (address => TokenGrant[]) public grants;
/** /**
* @dev Grant tokens to a specified address * @dev Grant tokens to a specified address
* @param _to address The address which the tokens will be granted to. * @param _to address The address which the tokens will be granted to.
* @param _value uint256 The amount of tokens to be granted. * @param _value uint256 The amount of tokens to be granted.
* @param _start uint64 Represents time of the begining of the grant. * @param _start uint64 Represents time of the begining of the grant.
* @param _cliff uint64 Represents the cliff period. * @param _cliff uint64 Represents the cliff period.
* @param _vesting uint64 Represents the vesting period. * @param _vesting uint64 Represents the vesting period.
*/ */
function grantVestedTokens( function grantVestedTokens(
address _to, address _to,
uint256 _value, uint256 _value,
...@@ -53,11 +53,11 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -53,11 +53,11 @@ contract VestedToken is StandardToken, LimitedTransferToken {
} }
/** /**
* @dev Revoke the grant of tokens of a specifed address. * @dev Revoke the grant of tokens of a specifed address.
* @param _holder address The address which will have its tokens revoked. * @param _holder The address which will have its tokens revoked.
* @param _grantId uint The id of the token grant. * @param _grantId The id of the token grant.
*/ */
function revokeTokenGrant(address _holder, uint _grantId) { function revokeTokenGrant(address _holder, uint _grantId) {
TokenGrant grant = grants[_holder][_grantId]; TokenGrant grant = grants[_holder][_grantId];
...@@ -76,22 +76,22 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -76,22 +76,22 @@ contract VestedToken is StandardToken, LimitedTransferToken {
Transfer(_holder, msg.sender, nonVested); Transfer(_holder, msg.sender, nonVested);
} }
/** /**
* @dev Check the amount of grants that an address has. * @dev Check the amount of grants that an address has.
* @param _holder address The holder of the grants. * @param _holder The holder of the grants.
* @return A uint representing the total amount of grants. * @return A uint representing the total amount of grants.
*/ */
function tokenGrantsCount(address _holder) constant returns (uint index) { function tokenGrantsCount(address _holder) constant returns (uint index) {
return grants[_holder].length; return grants[_holder].length;
} }
/** /**
* @dev Get all information about a specifc grant. * @dev Get all information about a specifc grant.
* @param _holder address The address which will have its tokens revoked. * @param _holder The address which will have its tokens revoked.
* @param _grantId uint The id of the token grant. * @param _grantId The id of the token grant.
* @return Returns all the values that represent a TokenGrant(address, value, * @return Returns all the values that represent a TokenGrant(address, value, start, cliff
start, cliff and vesting) plus the vested value at the current time. * and vesting) plus the vested value at the current time.
*/ */
function tokenGrant(address _holder, uint _grantId) constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting) { function tokenGrant(address _holder, uint _grantId) constant returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting) {
TokenGrant grant = grants[_holder][_grantId]; TokenGrant grant = grants[_holder][_grantId];
...@@ -105,12 +105,11 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -105,12 +105,11 @@ contract VestedToken is StandardToken, LimitedTransferToken {
} }
/** /**
* @dev Get the amount of vested tokens at a specifc time. * @dev Get the amount of vested tokens at a specific time.
* @param grant TokenGrant The grant to be checked. * @param grant TokenGrant The grant to be checked.
* @param time uint64 The time to be checked * @param time The time to be checked
* @return An uint representing the amount of vested tokens of a specifc grant * @return An uint representing the amount of vested tokens of a specific grant at a specific time.
on specifc time. */
*/
function vestedTokens(TokenGrant grant, uint64 time) private constant returns (uint256) { function vestedTokens(TokenGrant grant, uint64 time) private constant returns (uint256) {
return calculateVestedTokens( return calculateVestedTokens(
grant.value, grant.value,
...@@ -154,21 +153,21 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -154,21 +153,21 @@ contract VestedToken is StandardToken, LimitedTransferToken {
} }
/** /**
* @dev Calculate the amount of non vested tokens at a specific time. * @dev Calculate the amount of non vested tokens at a specific time.
* @param grant TokenGrant The grant to be checked. * @param grant TokenGrant The grant to be checked.
* @param time uint64 The time to be checked * @param time uint64 The time to be checked
* @return An uint representing the amount of non vested tokens of a specifc grant * @return An uint representing the amount of non vested tokens of a specifc grant on the
on the passed time frame. * passed time frame.
*/ */
function nonVestedTokens(TokenGrant grant, uint64 time) private constant returns (uint256) { function nonVestedTokens(TokenGrant grant, uint64 time) private constant returns (uint256) {
return grant.value.sub(vestedTokens(grant, time)); return grant.value.sub(vestedTokens(grant, time));
} }
/** /**
* @dev Calculate the date when the holder can trasfer all its tokens * @dev Calculate the date when the holder can trasfer all its tokens
* @param holder address The address of the holder * @param holder address The address of the holder
* @return An uint representing the date of the last transferable tokens. * @return An uint representing the date of the last transferable tokens.
*/ */
function lastTokenIsTransferableDate(address holder) constant public returns (uint64 date) { function lastTokenIsTransferableDate(address holder) constant public returns (uint64 date) {
date = uint64(now); date = uint64(now);
uint256 grantIndex = grants[holder].length; uint256 grantIndex = grants[holder].length;
...@@ -178,11 +177,11 @@ contract VestedToken is StandardToken, LimitedTransferToken { ...@@ -178,11 +177,11 @@ contract VestedToken is StandardToken, LimitedTransferToken {
} }
/** /**
* @dev Calculate the total amount of transferable tokens of a holder at a given time * @dev Calculate the total amount of transferable tokens of a holder at a given time
* @param holder address The address of the holder * @param holder address The address of the holder
* @param time uint64 The specific time. * @param time uint64 The specific time.
* @return An uint representing a holder's total amount of transferable tokens. * @return An uint representing a holder's total amount of transferable tokens.
*/ */
function transferableTokens(address holder, uint64 time) constant public returns (uint256 nonVested) { function transferableTokens(address holder, uint64 time) constant public returns (uint256 nonVested) {
uint256 grantIndex = grants[holder].length; uint256 grantIndex = grants[holder].length;
for (uint256 i = 0; i < grantIndex; i++) { for (uint256 i = 0; i < grantIndex; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment