convert SimpleToken to initializers
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
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";
|
|||||||
* 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 {
|
|||||||
/**
|
/**
|
||||||
* @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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
contracts/mocks/SimpleTokenMock.sol
Normal file
10
contracts/mocks/SimpleTokenMock.sol
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
pragma solidity ^0.4.24;
|
||||||
|
|
||||||
|
import "../Initializable.sol";
|
||||||
|
import "../examples/SimpleToken.sol";
|
||||||
|
|
||||||
|
contract SimpleTokenMock is Initializable, SimpleToken {
|
||||||
|
constructor() public {
|
||||||
|
SimpleToken.initialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user