Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
e6252d51
Commit
e6252d51
authored
Sep 26, 2018
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert SimpleToken to initializers
parent
e2e05294
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
SimpleToken.sol
contracts/examples/SimpleToken.sol
+3
-2
SimpleTokenMock.sol
contracts/mocks/SimpleTokenMock.sol
+10
-0
SimpleToken.test.js
test/examples/SimpleToken.test.js
+1
-1
No files found.
contracts/examples/SimpleToken.sol
View file @
e6252d51
pragma solidity ^0.4.24;
import "../Initializable.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
* `ERC20` functions.
*/
contract SimpleToken is ERC20 {
contract SimpleToken is
Initializable,
ERC20 {
string public constant name = "SimpleToken";
string public constant symbol = "SIM";
...
...
@@ -21,7 +22,7 @@ contract SimpleToken is ERC20 {
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public
{
function initialize() public initializer
{
_mint(msg.sender, INITIAL_SUPPLY);
}
...
...
contracts/mocks/SimpleTokenMock.sol
0 → 100644
View file @
e6252d51
pragma solidity ^0.4.24;
import "../Initializable.sol";
import "../examples/SimpleToken.sol";
contract SimpleTokenMock is Initializable, SimpleToken {
constructor() public {
SimpleToken.initialize();
}
}
test/examples/SimpleToken.test.js
View file @
e6252d51
const
{
decodeLogs
}
=
require
(
'../helpers/decodeLogs'
);
const
SimpleToken
=
artifacts
.
require
(
'SimpleToken'
);
const
SimpleToken
=
artifacts
.
require
(
'SimpleToken
Mock
'
);
const
BigNumber
=
web3
.
BigNumber
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment