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

Division by 0 in updateExchangeRate

Summary

There is a possibility of a reverted transaction due to a /0 division.

Vulnerability Details

Although it would be handled by the EVM, if no tokens are minted before calling the updateExchangeRate function, the transaction will be reverted because division by zero is undefined.

Impact

A reverted transaction.

Tools Used

Manual Review.

Recommendations

Check the totalSupply value before trying to get a newExchangeRate, to ensure it is not zero. If so, leave exchangeRate unmodified.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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