This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
0xPkhatri - Incorrect Calculation return in StableOracleDAI#getPriceUSD Function #758
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Escalation Resolved
This issue's escalations have been approved/rejected
High
A valid High severity issue
Reward
A payout will be made for this issue
0xPkhatri
high
Incorrect Calculation return in StableOracleDAI#getPriceUSD Function
Summary
The StableOracleDAI#getPriceUSD function is incorrectly computing the DAI/USD price due to improper handling of exchange rates and decimal precision. A detailed given below.
Vulnerability Detail
In the StableOracleDAI#getPriceUSD function, three prices are used: wethPriceUSD, DAIWethPrice, and priceFeedDAIETH price to calculate the DAI/USD rate. However, there are two issues in the computation of the DAI/USD price:
Impact
The incorrect DAI price calculation can result in a wrong price return from getPriceUSD function.
Code Snippet
https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/oracles/StableOracleDAI.sol#L46-L53
Tool used
Manual Review
Recommendation
It's recommended to revise the calculation method used in the getPriceUSD function to correctly account for the different exchange rates and decimal precision.
Duplicate of #102
The text was updated successfully, but these errors were encountered: