Hello all,
I need to initialize a variable in the constructor of my UUPS ERC721
Is following the correct way to do it ALSO for UUPS implementations?
Parameter is "contractUri".
Thanks in advance.
function initialize(string memory contractUri) public initializer {
__ERC721_init("MyContract", "MY");
__ERC721Enumerable_init();
__ERC721URIStorage_init();
__Pausable_init();
__AccessControl_init();
__ERC721Burnable_init();
__UUPSUpgradeable_init();
__ERC721Royalty_init();
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(PAUSER_ROLE, msg.sender);
_grantRole(MINTER_ROLE, msg.sender);
_setContractURI(contractUri);
}
In Hardhat tests called via:
let myc = await upgrades.deployProxy(MyContract,['https://myurl'],{kind: 'uups'});