I so similar questions on the forum, but did not find a solution yet.
I have to upgrade storage layout in my contract(which is already deployed on mainnet)
uint256 private __gap;
address private _forwarder; uint256 private __gap;
await upgrades.upgradeProxy(contract.address, ContractV2)
Error: New storage layout is incompatible contracts/metatx/ERC2771Context.sol:21: Inserted `_forwarder` > New variables should be placed after all existing inherited variables contracts/metatx/ERC2771Context.sol:85: Upgraded `__gap` to an incompatible type - Bad array resize from 50 to 49 Size cannot decrease
- "@openzeppelin/contracts-upgradeable": "^4.1.0",
- "@openzeppelin/hardhat-upgrades": "^1.8.2",
As far as I understand
hardhat-upgrades does not support it yet.
Is there a way to do this?