According to the storage layout in Solidity, a
and b
are tightly packed together in one storage slot. This will also be the case in the v2 version of the contract where a
, b
, and c
will be packed together in one storage slot. Is this a problem in terms of upgradeability and maintaining the original values of a
and b
from the v1 contract version?
In ContractV1
:
struct MyStruct {
uint8 a;
uint8 b;
}
mapping(address => MyStruct) myStructs;
In ContractV2
:
struct MyStruct {
uint8 a;
uint8 b;
uint128 c;
}
mapping(address => MyStruct) myStructs;