[ERC721URIStorageUpgradeable] Not supporting parameters for initialize function

Hi all, if you are at least reading this thanks in advance.

I've implemented an ERC721URIStorage token with no problems but now that I'm trying to make that contract upgradeable using ERC721URIStorageUpgradeable I noticed that the __ERC721URIStorage_init doesn't admit any parameters so I can't initialize the token name and symbol. Am I missing someting?

I actually implemented my own version adding the missing parameters and it works but not sure if it's the right way to go.

abstract contract ERC721URIStorageUpgradeable is
   Initializable,
   ERC721Upgradeable
{
   function __ERC721URIStorage_init(string memory name_, string memory symbol_)
       internal
       initializer
   {
       __Context_init_unchained();
       __ERC165_init_unchained();
       __ERC721_init(name_, symbol_);
       __ERC721URIStorage_init_unchained();
   }

   function __ERC721URIStorage_init_unchained() internal initializer {}

Thanks for your help and sorry if my question does not follow the right format, it's my first time here

To initialize name and symbol you need to call __ERC721_init. I recommend taking a look at the code generated by Wizard when selecting URI Storage and Upgradeable:

1 Like