We are using OpenZeppelin's library for our proxy pattern.
Just want to double-check on the restriction on the new version of the contract.
It is mentioned here that
https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#modifying-your-contracts
we cannot change the order in which the contract state variables are declared, nor their type.
Is mapping, struct or dynamic-sized array considered at state variables? Is it safe to append the new variables before a mapping (or arrary)?
i.e.
contract ImplementationA {
uint256 a;
uint256 constant b;
struct someStruct {
...;
...;
}
[some mappings]
[some dynamic-size arrays]
}
contract ImplementationB {
uint256 a;
uint256 constant b;
uint256 newVariable;
struct someStruct {
...;
...;
}
[some mappings]
[some dynamic-size arrays]
}
Is upgrading from ImplementationA to ImplementationB safe?