Quellcode durchsuchen

Add a comment on Detailed ERC20 token #953 (#960)

* add a comment on detailed erc20 token #953
Vittorio Minacori vor 7 Jahren
Ursprung
Commit
512e8218ca
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 4 1
      contracts/crowdsale/Crowdsale.sol
  2. 6 0
      contracts/token/ERC20/DetailedERC20.sol

+ 4 - 1
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

+ 6 - 0
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;