* add improvement in simpletoken example #1458 * fix not calling decimals get function in initial supply
This commit is contained in:
committed by
Nicolás Venturo
parent
b5892a2b5e
commit
1186520617
@ -1,6 +1,7 @@
|
||||
pragma solidity ^0.4.24;
|
||||
|
||||
import "../token/ERC20/ERC20.sol";
|
||||
import "../token/ERC20/ERC20Detailed.sol";
|
||||
|
||||
/**
|
||||
* @title SimpleToken
|
||||
@ -8,18 +9,14 @@ import "../token/ERC20/ERC20.sol";
|
||||
* Note they can later distribute these tokens as they wish using `transfer` and other
|
||||
* `ERC20` functions.
|
||||
*/
|
||||
contract SimpleToken is ERC20 {
|
||||
contract SimpleToken is ERC20, ERC20Detailed {
|
||||
|
||||
string public constant name = "SimpleToken";
|
||||
string public constant symbol = "SIM";
|
||||
uint8 public constant decimals = 18;
|
||||
|
||||
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals));
|
||||
uint256 public constant INITIAL_SUPPLY = 10000 * (10 ** uint256(decimals()));
|
||||
|
||||
/**
|
||||
* @dev Constructor that gives msg.sender all of existing tokens.
|
||||
*/
|
||||
constructor() public {
|
||||
constructor() public ERC20Detailed("SimpleToken", "SIM", 18) {
|
||||
_mint(msg.sender, INITIAL_SUPPLY);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user