Did i miss something about current EIP712 implementation ? Is it OK to add to an existing upgradable contract ?
Perhaps the issue is just i can’t add EIP712 to an existing, deployed contract.
I should’ve updated also @openzeppelin/contract-loader & @openzeppelin/upgrades ?
I will have to come back to you if you can upgrade from OpenZeppelin Contracts Ethereum Package 3.0 to OpenZeppelin Contracts Upgradeable 3.3.
As OpenZeppelin Contracts Ethereum Package has an Initializable with a uint256[50] private ______gap;, whilst Initializable in OpenZeppelin Contracts Upgradeable is without a gap state variable.
Please note: We’ve decided it’s best to focus our upgradeability efforts on the Upgrades Plugins exclusively, and have halted development on the OpenZeppelin CLI. We will continue to provide support for the CLI until the end of 2020.
See: Building for interoperability: why we’re focusing on Upgrades Plugins
The lack of the gap variable in the new Initializable makes it incompatible with ethereum package deployments. We’re really sorry about this inconvenience. The fact that you were able to deploy using --force does not mean it is safe at all; it is not safe.
Fortunately it’s possible to insert the gap in the right place using multiple inheritance so that the new layouts match with the old one. You should define the following contract:
import '@openzeppelin/contracts-upgradeable/proxy/Initializable.sol';
contract InitializableGap is Initializable {
uint256[50] ____gap;
}
You can include this in your inheritance immediately after Initializable like this:
contract DarkPay is Initializable, InitializableGap, [...] ERC20PermitUpgradeable { ... }
This will insert the gap so that storage layout matches the layout from contracts-ethereum-package.
Again, we’re sorry about this inconvenience but let us know if you try this workaround and if it works for you.