Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Division before multiplication leads to minor precision loss

Summary

Division before multiplication leads to minor, yet still unnecessary precision loss.

Vulnerability Details

amountOutX18 = usdAmountInX18.div(indexPriceX18).mul(premiumDiscountFactorX18);
This instance of division before multiplication will lead to minor precision loss, and although minor due to using a fixed point math library, it could still cause dust funds to be stuck in the contract so funds could be lost.

Impact

Dust funds stuck in the contract.

Tools Used

Manual review

Recommendations

Multiply before divide to reduce unneeded precision loss.

Updates

Lead Judging Commences

inallhonesty Lead Judge
7 months ago
inallhonesty Lead Judge 7 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.