Closed gnarvaja closed 2 years ago
Hello,
This was already discussed many times, #111 being one of them.
TLDR: for some reason that we don't need to dive into, this has been the case for quite a while. Changing that today would be a breaking change. It would cause more issues then it would fix.
The contract
Initializable
doesn't have a storage gap (__gap
variable) as other similar contracts have. This means that if new attributes are added to this contract in the future, it will shift the storage layout of the inherited contracts, breaking upgrades.Also, when inheriting from this contract, the storage layout of inherited contracts is no longer aligned with the convention of 50 slots for each contract in the inheritance chain.
You should add at the end of the contract something like this:
💻 Environment
@openzeppelin/contracts-upgradeable == 4.7.3
📝 Details
You can check the storage layout in this picture:
(More similar contract in https://github.com/ensuro/ensuro/pull/106#issue-1419895527)