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
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
Bahurum
high
Incorrect decimals for
price
inStableOracleDAI.getPriceUSD()
Summary
In
StableOracleDAI
,price
is treated in computations as if it was 8 decimals, while it is in 18 decimals.Vulnerability Detail
StableOracleDAI.getPriceUSD()
takes the average of the UniV3 WETH-DAI TWAP price and the DAI/ETH Chainlink oracle price:Since DAI/ETH feed is in 18 decimals, the multiplication by
1e10
is incorrect.Impact
DAI price used is incorrect, causing amounts minted with DAI to be incorrect.
Code Snippet
https://github.com/USSDofficial/ussd-contracts/blob/f44c726371f3152634bcf0a3e630802e39dec49c/contracts/oracles/StableOracleDAI.sol#L52
Tool used
Manual Review
Recommendation
Remove multiplication of
price
by 1e10.Duplicate of #236
The text was updated successfully, but these errors were encountered: