-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Problem
The OpenZeppelin Upgrades plugin uses contract bytecode to distinguish between artifacts and locate storage layouts. Currently, resolc generates identical bytecode for contracts that differ only in their storage layout (e.g., different __gap sizes), causing the plugin to fail to differentiate between contract versions.
Example
These two contracts produce identical bytecode:
contract GapV1 {
string greeting;
uint256[49] private __gap;
uint256 end;
}
contract GapV2 {
string greeting;
uint256 new1;
uint256 new2;
uint256[47] private __gap;
uint256 end;
}Root Cause
resolc does not append CBOR metadata to the bytecode, which would normally differentiate contracts with identical runtime logic but different source code or storage layouts.
Related Issues
Depends on: #379 (should be tested after this issue is resolved)