Closed as duplicate of#1136
Description
npx @openzeppelin/upgrades-core@1.41.0 validate --contract Pool --referenceBuildInfoDirs out-v1/build-info-v1 --reference build-info-v1:pool
I'm using upgrades-core 'svalidate
command to compare two versions of the Pool
contract. The only change between the versions is an addition to a struct:
- The
Pool
contract has a single state variable: a struct namedPoolState
. - I added a
uint256
variable at the end of thePoolState
struct.
Expected Behavior:
Since the new field is appended to the end of the struct and there is no other state after the struct, this should not cause any storage layout issues.
Observed Behavior:
Despite the safe change, I get the following error:
src/Pool.sol:9: Upgraded `pool` to an incompatible type
- Bad upgrade to struct PoolState
- In struct PoolState
- Added `additionalUint256`
Why is this considered an incompatible upgrade?
Is this a false positive, or is there something I'm missing about how OpenZeppelin detects unsafe changes to structs?
Metadata
Metadata
Assignees
Labels
No labels