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
2eb0de4c
Commit
2eb0de4c
authored
Jan 28, 2019
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove added sender argument
parent
3fd51955
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
StandaloneERC20.sol
contracts/token/ERC20/StandaloneERC20.sol
+10
-10
StandaloneERC721.sol
contracts/token/ERC721/StandaloneERC721.sol
+5
-5
StandaloneERC20.test.js
test/token/ERC20/StandaloneERC20.test.js
+4
-4
StandaloneERC721.test.js
test/token/ERC721/StandaloneERC721.test.js
+2
-2
No files found.
contracts/token/ERC20/StandaloneERC20.sol
View file @
2eb0de4c
...
@@ -13,7 +13,7 @@ import "./ERC20Pausable.sol";
...
@@ -13,7 +13,7 @@ import "./ERC20Pausable.sol";
contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pausable {
function initialize(
function initialize(
string memory name, string memory symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
string memory name, string memory symbol, uint8 decimals, uint256 initialSupply, address initialHolder,
address[] memory minters, address[] memory pausers
, address sender
address[] memory minters, address[] memory pausers
) public initializer {
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
ERC20Detailed.initialize(name, symbol, decimals);
...
@@ -21,11 +21,11 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
...
@@ -21,11 +21,11 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
_mint(initialHolder, initialSupply);
_mint(initialHolder, initialSupply);
// Initialize the minter and pauser roles, and renounce them
// Initialize the minter and pauser roles, and renounce them
ERC20Mintable.initialize(
sender
);
ERC20Mintable.initialize(
address(this)
);
_removeMinter(
sender
);
_removeMinter(
address(this)
);
ERC20Pausable.initialize(
sender
);
ERC20Pausable.initialize(
address(this)
);
_removePauser(
sender
);
_removePauser(
address(this)
);
// Add the requested minters and pausers (this can be done after renouncing since
// Add the requested minters and pausers (this can be done after renouncing since
// these are the internal calls)
// these are the internal calls)
...
@@ -39,16 +39,16 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
...
@@ -39,16 +39,16 @@ contract StandaloneERC20 is Initializable, ERC20Detailed, ERC20Mintable, ERC20Pa
}
}
function initialize(
function initialize(
string memory name, string memory symbol, uint8 decimals, address[] memory minters, address[] memory pausers
, address sender
string memory name, string memory symbol, uint8 decimals, address[] memory minters, address[] memory pausers
) public initializer {
) public initializer {
ERC20Detailed.initialize(name, symbol, decimals);
ERC20Detailed.initialize(name, symbol, decimals);
// Initialize the minter and pauser roles, and renounce them
// Initialize the minter and pauser roles, and renounce them
ERC20Mintable.initialize(
sender
);
ERC20Mintable.initialize(
address(this)
);
_removeMinter(
sender
);
_removeMinter(
address(this)
);
ERC20Pausable.initialize(
sender
);
ERC20Pausable.initialize(
address(this)
);
_removePauser(
sender
);
_removePauser(
address(this)
);
// Add the requested minters and pausers (this can be done after renouncing since
// Add the requested minters and pausers (this can be done after renouncing since
// these are the internal calls)
// these are the internal calls)
...
...
contracts/token/ERC721/StandaloneERC721.sol
View file @
2eb0de4c
...
@@ -15,17 +15,17 @@ import "./ERC721Pausable.sol";
...
@@ -15,17 +15,17 @@ import "./ERC721Pausable.sol";
contract StandaloneERC721
contract StandaloneERC721
is Initializable, ERC721, ERC721Enumerable, ERC721Metadata, ERC721MetadataMintable, ERC721Pausable
is Initializable, ERC721, ERC721Enumerable, ERC721Metadata, ERC721MetadataMintable, ERC721Pausable
{
{
function initialize(string memory name, string memory symbol, address[] memory minters, address[] memory pausers
, address sender
) public initializer {
function initialize(string memory name, string memory symbol, address[] memory minters, address[] memory pausers) public initializer {
ERC721.initialize();
ERC721.initialize();
ERC721Enumerable.initialize();
ERC721Enumerable.initialize();
ERC721Metadata.initialize(name, symbol);
ERC721Metadata.initialize(name, symbol);
// Initialize the minter and pauser roles, and renounce them
// Initialize the minter and pauser roles, and renounce them
ERC721MetadataMintable.initialize(
sender
);
ERC721MetadataMintable.initialize(
address(this)
);
_removeMinter(
sender
);
_removeMinter(
address(this)
);
ERC721Pausable.initialize(
sender
);
ERC721Pausable.initialize(
address(this)
);
_removePauser(
sender
);
_removePauser(
address(this)
);
// Add the requested minters and pausers (this can be done after renouncing since
// Add the requested minters and pausers (this can be done after renouncing since
// these are the internal calls)
// these are the internal calls)
...
...
test/token/ERC20/StandaloneERC20.test.js
View file @
2eb0de4c
...
@@ -23,14 +23,14 @@ contract('StandaloneERC20', function ([
...
@@ -23,14 +23,14 @@ contract('StandaloneERC20', function ([
});
});
async
function
initializeFull
(
token
,
name
,
symbol
,
decimals
,
initialSupply
,
initialHolder
,
minters
,
pausers
,
from
)
{
async
function
initializeFull
(
token
,
name
,
symbol
,
decimals
,
initialSupply
,
initialHolder
,
minters
,
pausers
,
from
)
{
const
signature
=
'initialize(string,string,uint8,uint256,address,address[],address[]
,address
)'
;
const
signature
=
'initialize(string,string,uint8,uint256,address,address[],address[])'
;
const
args
=
[
name
,
symbol
,
decimals
,
initialSupply
,
initialHolder
,
minters
,
pausers
,
from
];
const
args
=
[
name
,
symbol
,
decimals
,
initialSupply
,
initialHolder
,
minters
,
pausers
];
await
token
.
methods
[
signature
](...
args
,
{
from
});
await
token
.
methods
[
signature
](...
args
,
{
from
});
}
}
async
function
initializePartial
(
token
,
name
,
symbol
,
decimals
,
minters
,
pausers
,
from
)
{
async
function
initializePartial
(
token
,
name
,
symbol
,
decimals
,
minters
,
pausers
,
from
)
{
const
signature
=
'initialize(string,string,uint8,address[],address[]
,address
)'
;
const
signature
=
'initialize(string,string,uint8,address[],address[])'
;
const
args
=
[
name
,
symbol
,
decimals
,
minters
,
pausers
,
from
];
const
args
=
[
name
,
symbol
,
decimals
,
minters
,
pausers
];
await
token
.
methods
[
signature
](...
args
,
{
from
});
await
token
.
methods
[
signature
](...
args
,
{
from
});
}
}
...
...
test/token/ERC721/StandaloneERC721.test.js
View file @
2eb0de4c
...
@@ -14,8 +14,8 @@ contract('StandaloneERC721', function ([_, deployer, minterA, minterB, pauserA,
...
@@ -14,8 +14,8 @@ contract('StandaloneERC721', function ([_, deployer, minterA, minterB, pauserA,
});
});
async
function
initialize
(
token
,
name
,
symbol
,
minters
,
pausers
,
from
)
{
async
function
initialize
(
token
,
name
,
symbol
,
minters
,
pausers
,
from
)
{
const
signature
=
'initialize(string,string,address[],address[]
,address
)'
;
const
signature
=
'initialize(string,string,address[],address[])'
;
const
args
=
[
name
,
symbol
,
minters
,
pausers
,
from
];
const
args
=
[
name
,
symbol
,
minters
,
pausers
];
await
token
.
methods
[
signature
](...
args
,
{
from
});
await
token
.
methods
[
signature
](...
args
,
{
from
});
}
}
...
...
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