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 24, 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
Both DAIWethPrice and price return 1e18 decimals. Therefore there is no need to multiply the value by 1e10. Since price is an ETH pair, the returned decimals are 1e18 and not 1e8.
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
sam_gmk
medium
Loss in precision in StableOracleDAI
Summary
Vulnerability Detail
getPriceUSD
inStableOracleDAI
is used to get the price of DAI from multiple sources and return the average.Both
DAIWethPrice
andprice
return 1e18 decimals. Therefore there is no need to multiply the value by 1e10. Sinceprice
is an ETH pair, the returned decimals are1e18
and not1e8
.POC:
Logs:
NUMBER OF DECIMALS: 18
REAL PRICE: 549993804800023
SUPER LARGE NUMBER: 5499938048000230000000000
Impact
Loss in precision when performing calculations
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 1e10 multiplication
Duplicate of #236
The text was updated successfully, but these errors were encountered: