You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
sherlock-admin opened this issue
May 23, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
However, when calculating the price in USD of DAI, it was incorrectly scaled up by 1e10 (it incorrectly assumes that the decimal is 8). This leads to a wrong price of DAI.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
ast3ros
medium
Incorrect decimal of the DAI/ETH price feed
Summary
The return value of the DAI/ETH price feed has 18 decimals. However, it is treated as 8 decimals.
Vulnerability Detail
The price feed of DAI/ETH is obtained from the contract:
0x773616E4d11A78F511299002da57A0a94577F1f4
. The decimal of the return value is 18.https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/oracles/StableOracleDAI.sol#L48
However, when calculating the price in USD of DAI, it was incorrectly scaled up by 1e10 (it incorrectly assumes that the decimal is 8). This leads to a wrong price of DAI.
https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/oracles/StableOracleDAI.sol#L52
Impact
The StableOracleDAI returns an inaccurate price.
Code Snippet
https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/oracles/StableOracleDAI.sol#L52
Tool used
Manual Review
Recommendation
Remove the scale factor:
Duplicate of #236
The text was updated successfully, but these errors were encountered: