HardhatDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

DOS if collateral token is already registered

Summary

DOS while doing batch register collateral tokens, if collateral token is already registered

Vulnerability Details

The function batchRegisterCollateralToken is used to register collateral tokens batch wise. This function calls an internal function _registerCollateralToken, where it reverts when the collateral token is already registered. But because of this entire for loop get reverted, and also there is significant amount of gas lose. So, instead of reverting when collateral token is registered, simply return the address of wToken, such that there will be no revert and no problem in for loop too.

Impact

Because collateral token already registered, there will be significant amount of loss (it will be more if the batch collateral tokens length is large).

Tools Used

Manual

Recommendations

Instead of revert when collateral token already registered just return the wToken address

Updates

Lead Judging Commences

bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

0xiehnnkta Submitter
9 months ago
bube Lead Judge
9 months ago
bube Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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