Created
May 14, 2020 12:10
-
-
Save lucashenning/91210c34f9b5d66094224d54e4b375aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
import "https://github.com/OpenZeppelin/openzeppelin-sdk/blob/v2.5.0/packages/lib/contracts/Initializable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC721/ERC721.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC721/ERC721Enumerable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC721/ERC721Metadata.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC721/ERC721MetadataMintable.sol"; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC721/ERC721Pausable.sol"; | |
/** | |
* @title Standard ERC721 token, with minting and pause functionality. | |
* | |
*/ | |
contract StandaloneERC721 | |
is Initializable, ERC721, ERC721Enumerable, ERC721Metadata, ERC721MetadataMintable, ERC721Pausable | |
{ | |
function initialize(string memory name, string memory symbol, address[] memory minters, address[] memory pausers) public initializer { | |
ERC721.initialize(); | |
ERC721Enumerable.initialize(); | |
ERC721Metadata.initialize(name, symbol); | |
// Initialize the minter and pauser roles, and renounce them | |
ERC721MetadataMintable.initialize(address(this)); | |
_removeMinter(address(this)); | |
ERC721Pausable.initialize(address(this)); | |
_removePauser(address(this)); | |
// Add the requested minters and pausers (this can be done after renouncing since | |
// these are the internal calls) | |
for (uint256 i = 0; i < minters.length; ++i) { | |
_addMinter(minters[i]); | |
} | |
for (uint256 i = 0; i < pausers.length; ++i) { | |
_addPauser(pausers[i]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment