I have deployed an upgradable ERC20 token first and verified it.
- Token contract implementation: https://amoy.polygonscan.com/address/0x172B508a2961CCb0F45F501E13410517a550676c
- Proxy: https://amoy.polygonscan.com/address/0x54D7E85668fdB05A2501edb1565fBbf5e2e8Bc07#code
Then I upgraded the contract with new logic contract (added mintable). That is here:
I have a new initialize function with reinitializer modifier in the version 2 that I was expecting it work during the deployment but it didn't and I had to call it manually. Is this the expected behavior or did I do something wrong? My initialize function in the version 2 is this:
function initializeV2()
external
reinitializer(2)
onlyRole(DEFAULT_ADMIN_ROLE)
{
_grantRole(MINTER_ROLE, msg.sender);
}