Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: high
Valid

state variable difference in the upgraded contract

Summary

In upgraded contracts it's important to take care of the storage collisions.

Vulnerability Details

The order of the storage variables are different compared to ThunderLoan.sol vs ThunderLoanUpgraded.sol. Following command can be used to check the storage layout

forge inspect src/protocol/ThunderLoan.sol:ThunderLoan storagelayout --pretty

Impact

When the upgraded contract is called wrong storage variable will be updated.

Tools Used

  • Manual code review

  • Foundry

Recommendations

Correct the order of state variables in the upgraded contract

Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

storage collision on upgrade

Support

FAQs

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