Commit e6252d51 by Francisco Giordano

convert SimpleToken to initializers

parent e2e05294
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../Initializable.sol";
import "../token/ERC20/ERC20.sol"; import "../token/ERC20/ERC20.sol";
...@@ -10,7 +11,7 @@ import "../token/ERC20/ERC20.sol"; ...@@ -10,7 +11,7 @@ import "../token/ERC20/ERC20.sol";
* Note they can later distribute these tokens as they wish using `transfer` and other * Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions. * `ERC20` functions.
*/ */
contract SimpleToken is ERC20 { contract SimpleToken is Initializable, ERC20 {
string public constant name = "SimpleToken"; string public constant name = "SimpleToken";
string public constant symbol = "SIM"; string public constant symbol = "SIM";
...@@ -21,7 +22,7 @@ contract SimpleToken is ERC20 { ...@@ -21,7 +22,7 @@ contract SimpleToken is ERC20 {
/** /**
* @dev Constructor that gives msg.sender all of existing tokens. * @dev Constructor that gives msg.sender all of existing tokens.
*/ */
constructor() public { function initialize() public initializer {
_mint(msg.sender, INITIAL_SUPPLY); _mint(msg.sender, INITIAL_SUPPLY);
} }
......
pragma solidity ^0.4.24;
import "../Initializable.sol";
import "../examples/SimpleToken.sol";
contract SimpleTokenMock is Initializable, SimpleToken {
constructor() public {
SimpleToken.initialize();
}
}
const { decodeLogs } = require('../helpers/decodeLogs'); const { decodeLogs } = require('../helpers/decodeLogs');
const SimpleToken = artifacts.require('SimpleToken'); const SimpleToken = artifacts.require('SimpleTokenMock');
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
......
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