浏览代码

Simplification of SampleToken (#1734)

* Simplification and optimization of existing contracts #8888

* Simplification of SimpleToken

* This is the fixed Simplification

* My bad I'm playing around with this git stuff, should be correct now

* add missing parenthesis
phant0m 6 年之前
父节点
当前提交
08f8bf71d7
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      contracts/examples/SimpleToken.sol

+ 2 - 4
contracts/examples/SimpleToken.sol

@@ -10,13 +10,11 @@ import "../token/ERC20/ERC20Detailed.sol";
  * `ERC20` functions.
  */
 contract SimpleToken is ERC20, ERC20Detailed {
-    uint8 public constant DECIMALS = 18;
-    uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(DECIMALS));
 
     /**
      * @dev Constructor that gives msg.sender all of existing tokens.
      */
-    constructor () public ERC20Detailed("SimpleToken", "SIM", DECIMALS) {
-        _mint(msg.sender, INITIAL_SUPPLY);
+    constructor () public ERC20Detailed("SimpleToken", "SIM", 18) {
+        _mint(msg.sender, 10000 * (10 ** uint256(decimals())));
     }
 }