Eggrypto
The team uses an upgradeable contract and a proxy: Etherscan or Polygonscan.
The ERC721 contract currently being called is: https://etherscan.io/address/0xd699c87e346a8d62caf0e07fe9a31fdeeb47dea5
Contract is the most layered ERC721 that I have seen to date. Deployed contract is really short, the minting function is actually inherited.
Purely setup code in this contract.
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]);
}
}
}
Contract that does the minting (seems to be an OpenZepplin contract):
contract ERC721MetadataMintable is Initializable, ERC721, ERC721Metadata, MinterRole {
function initialize(address sender) public initializer {
require(ERC721._hasBeenInitialized());
require(ERC721Metadata._hasBeenInitialized());
MinterRole.initialize(sender);
}
/**
* @dev Function to mint tokens.
* @param to The address that will receive the minted tokens.
* @param tokenId The token id to mint.
* @param tokenURI The token URI of the minted token.
* @return A boolean that indicates if the operation was successful.
*/
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {
_mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
return true;
}
uint256[50] private ______gap;
}
The ______gap
enables library upgrades without breaking user contracts. See this forum post