Initialize upgradeable ERC721 extending Preset

Question. So I setup the contract like so. Is it okay to initialize it like this? I’m not sure if I need to save the ERC721.intialize somewhere.

contract NFTVendor is Initializable, ERC721PresetMinterPauserAutoIdUpgradeable {

    string public purpose;

    function initialize(

        string memory name,

        string memory symbol,

        string memory baseURI,

        string memory _purpose

    ) public {






        purpose = _purpose;

1 Like

Hi @presidento23,

You should add the initializer modifier to your initialize function to ensure it is only called once.

Instead of calling ERC721PresetMinterPauserAutoIdUpgradeable.initialize you should call __ERC721PresetMinterPauserAutoId_init.

See the documentation for more details:

appreciated! this is exactly what I was wondering.

1 Like