Can't mint token using ERC20PresetMinterPauserUpgradeable

Hi, it seems like your contract is ok, I think the error is in your scripts:

const ico = await deployProxy(IcoSeller, { deployer });

Actually, upgradeable contracts do not use constructor to initialize state, so you need to call a function to initialize state, for more details, please check at: initialize functions

So I think your script should be like:

const ico = await deployProxy(IcoSeller, [], {initializer: 'initializeIcoDeployer'});

And there is tutorial, maybe you can have a look:

1 Like