DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Valid

Loss of precision in increaseSharesOnMatch()

Summary

Loss of precision in increaseSharesOnMatch() could cause incorrect calculation of shares.

Vulnerability Details

There will be precision loss when calculating shares, because solidity truncates values when dividing and dividing before multiplying causes precision loss.

Impact

It could cause incorrect calculation of shares.

Tools Used

Manual review

Recommendations

-uint88 shares = eth * (timeTillMatch / 1 days); // 10 * (5 / 2) = 20
+uint88 shares = eth * timeTillMatch / 1 days; // 10 * 5 / 2 = 25
Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-139

Support

FAQs

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