Skip to content

Critical Risk of Storage Collision in Upgradable Contract Due to Inadequate Storage Management #228

@ptisserand

Description

@ptisserand

From https://codehawks.cyfrin.io/c/2024-07-ark-project/s/435

The Starklane contract, designed to be an upgradable contract, inherits from multiple contracts (UUPSOwnableProxied, StarklaneState, StarklaneEscrow, StarklaneMessaging, and CollectionManager). Each of these contracts defines its own set of storage variables, but none of them reserve storage gaps for future upgrades. This makes it impossible to safely add new variables to any of the inherited contracts without causing storage collisions. The Starklane contract itself is the only safe place to add new variables, significantly limiting the flexibility of future upgrades and increasing the risk of storage collision.

Unit tests must be provided.

Metadata

Metadata

Assignees

Labels

ODHack8app:solidityWork on the Ethereum part of the application; you need to know Solidity.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions