Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

Missing Storage Gaps for Future Upgrades

The `MembershipERC1155` contract does not utilize storage gaps. Storage gaps are essential for maintaining consistent storage layouts during upgrades, especially when new variables or contracts are introduced.

Storage Collision Risk: When variables are added in future versions, the new storage layout could collide with existing data, leading to unpredictable contract behavior or data corruption.

  • OpenZeppelin suggests using a storage gap (`uint256[50] private __gap;`) at the end of contracts. This reserved space allows adding new variables in future contract versions without affecting the layout of existing storage.

Recommendation

Include a storage gap in the contract. This storage gap can be used as a buffer, providing flexibility in future upgrades

```solidity

uint256[50] private __gap;

```

Place this at the end of the contract to reserve storage space for potential upgrades.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.