but i get error when I use upgrades.upgradeProxy with hardhat.
Error is
Error: New storage layout is incompatible
contracts/BoxV2.sol:8: Inserted amount
New variables should be placed after all existing inherited variables
contracts/BoxV2.sol:9: Upgraded __gapUint256 to an incompatible type
Hi @jachung91 , the gap name needs to be exactly __gap or start with __gap_ (with the extra underscore after it). In your example, can you use a gap name like __gap_uint256?
I am using
hardhat v2.14.0 solidity v0.8.9
Simple code is like
original code
upgrading code
but i get error when I use upgrades.upgradeProxy with hardhat.
Error is
As i read docs at https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#storage-gaps I think i did anything wrong. Any one can help?