DittoETH

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

Precision loss due to division before multiplication

Summary

Division before multiplication will cause precision loss in baseOracleCircuitBreaker() function.

Vulnerability Details

In the function baseOracleCircuitBreaker() of LibOracle.sol there is a division before multiplication. It is generally known that division before the multiplication will cause precision loss,

uint256 twapPriceInEther = (twapPrice / Constants.DECIMAL_USDC) * 1 ether; //@audit precision loss

in the above line there is precision loss

Impact

The impact will be that the baseOracleCircuitBreaker() function will not work as intended

Tools Used

Manual Review

Recommendations

Do not divide before multiply.

Updates

Lead Judging Commences

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

finding-535

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

finding-535

Support

FAQs

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