remove added sender argument

This commit is contained in:
Francisco Giordano
2019-01-28 19:08:32 -03:00
parent 3fd5195573
commit 2eb0de4cd2
4 changed files with 21 additions and 21 deletions

View File

@ -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
_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
} }
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)

View File

@ -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)

View File

@ -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 });
} }

View File

@ -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 });
} }