In upgradable contracts, there should be a storage location for variables to get added freely without causing any storage collision. In Bridge.sol
we can see that the contract inherits from a lot of contracts each of them has its own variables.
We are putting the ownable sub-storage after the main storage so if the Bridge storage took slot(0, 1, ..., 10). Ownable will take slots(11, 12). Any upgrade by adding a variable to the Bridge will result in Storage Collision.
The Bridge.cairo
is intended to be an upgradable contract, where we can easily change its ClassHash from BridgeUpgradeImpl::upgrade
.
So we will not be able to upgrade the contract and add new variables as Storaage Collision will occur.
The case is the same in erc721_bridgeable
, where we are importing the sub storage in the beginning, and we do not have any gap.
erc721_bridgeable.cairo#L37-L47
Inability to upgrade these contracts if a new variable will be added.
Manual Review
Move the Sub Storage from the Bottom to the Top, and make the main contract variables in the last
Add a Gap to preserve Storage Slots for Variables that can be added in the future.
The same thing should be made for erc721_bridgeable
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.