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

Can't initialize after upgrading to new ThunderLoanUpgraded

Summary

Can't initialize after upgrading to new ThunderLoanUpgraded

Vulnerability Details

If we upgrade ThunderLoan to ThunderLoanUpgraded, the initialize of ThunderLoanUpgraded will fail. According to the documentation of OpenZeppelin, the initialization functions use a version number. Once a version number is used, it is consumed and cannot be reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in case an upgrade adds a module that needs to be initialized.

Impact

The ThunderLoanUpgraded can't initialize.

Tools Used

manual

Recommendations

It is recommended to write initialize() function in this way.

function initialize(address tswapAddress) external reinitializer(2) {
__Ownable_init();
__UUPSUpgradeable_init();
__Oracle_init(tswapAddress);
s_flashLoanFee = 3e15; // 0.3% ETH fee
}
Updates

Lead Judging Commences

0xnevi Lead Judge
about 2 years ago
0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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