Skip to content

Commit 2eaee42

Browse files
fix: correct storage gap for ProtocolRegistryStorage (#1673)
Storage gaps should add up to 50. As demonstrated by inspecting storage via `forge`: ```txt % forge inspect ProtocolRegistryStorage storage ╭--------------------+--------------------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╮ | Name | Type | Slot | Offset | Bytes | Contract | +==================================================================================================================================================================================================+ | _semanticVersion | ShortString | 0 | 0 | 32 | src/contracts/core/storage/ProtocolRegistryStorage.sol:ProtocolRegistryStorage | |--------------------+--------------------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------| | _deployments | struct EnumerableMap.UintToAddressMap | 1 | 0 | 96 | src/contracts/core/storage/ProtocolRegistryStorage.sol:ProtocolRegistryStorage | |--------------------+--------------------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------| | _deploymentConfigs | mapping(address => struct IProtocolRegistryTypes.DeploymentConfig) | 4 | 0 | 32 | src/contracts/core/storage/ProtocolRegistryStorage.sol:ProtocolRegistryStorage | |--------------------+--------------------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------| | __gap | uint256[47] | 5 | 0 | 1504 | src/contracts/core/storage/ProtocolRegistryStorage.sol:ProtocolRegistryStorage | ╰--------------------+--------------------------------------------------------------------+------+--------+-------+--------------------------------------------------------------------------------╯ ``` The `__gap` begins at slot `5` -- however, the gap is of size `47`, which adds up to `52`. Though this is not an issue, it does defy convention, and can cause confusion later if a developer assumes the gap needs to be corrected to add up to 50. --------- Co-authored-by: Nadir Akhtar <9601075+nadir-akhtar@users.noreply.github.com> Co-authored-by: Yash Patil <40046473+ypatil12@users.noreply.github.com>
1 parent 1a9b3f7 commit 2eaee42

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

0 commit comments

Comments
 (0)