From 512e8218ca52a4e8d328233782bfbffe9f9da6cb Mon Sep 17 00:00:00 2001 From: Vittorio Minacori Date: Tue, 5 Jun 2018 03:13:09 +0200 Subject: [PATCH] Add a comment on Detailed ERC20 token #953 (#960) * add a comment on detailed erc20 token #953 --- contracts/crowdsale/Crowdsale.sol | 5 ++++- contracts/token/ERC20/DetailedERC20.sol | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index d4578ec4e..1667b4bb5 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -25,7 +25,10 @@ contract Crowdsale { // Address where funds are collected address public wallet; - // How many token units a buyer gets per wei + // How many token units a buyer gets per wei. + // The rate is the conversion between wei and the smallest and indivisible token unit. + // So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK + // 1 wei will give you 1 unit, or 0.001 TOK. uint256 public rate; // Amount of wei raised diff --git a/contracts/token/ERC20/DetailedERC20.sol b/contracts/token/ERC20/DetailedERC20.sol index 749d96071..e4918533a 100644 --- a/contracts/token/ERC20/DetailedERC20.sol +++ b/contracts/token/ERC20/DetailedERC20.sol @@ -3,6 +3,12 @@ pragma solidity ^0.4.23; import "./ERC20.sol"; +/** + * @title DetailedERC20 token + * @dev The decimals are only for visualization purposes. + * All the operations are done using the smallest and indivisible token unit, + * just as on Ethereum all the operations are done in wei. + */ contract DetailedERC20 is ERC20 { string public name; string public symbol;