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
Oracle will return too expensive price of DAI because of excessive precision scaling
Summary
Oracle will return too expensive price because of excessive precision scaling.
Vulnerability Detail
In StableOracleDAI.sol#L52price is being multiplied by 1e10 -> uint256(price) * 1e10 assuming that Chainlink price feed returns 8 decimals. However checking the decimals of the oracle address used DAI/ETH decimals we see that it returns 18 decimals.
Impact
The price of DAI will not be representative of the real price of DAI - too expensive. Causing the protocol to pay way more for collateral while rebalancing. rebalance() calls two functions which use getPriceUSD() from StableOracleDAI contract.
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
Proxy
high
Oracle will return too expensive price of DAI because of excessive precision scaling
Summary
Oracle will return too expensive price because of excessive precision scaling.
Vulnerability Detail
In StableOracleDAI.sol#L52
price
is being multiplied by1e10
->uint256(price) * 1e10
assuming that Chainlink price feed returns 8 decimals. However checking the decimals of the oracle address used DAI/ETH decimals we see that it returns 18 decimals.Impact
The price of
DAI
will not be representative of the real price ofDAI
- too expensive. Causing the protocol to pay way more for collateral while rebalancing.rebalance()
calls two functions which usegetPriceUSD()
fromStableOracleDAI
contract.Code Snippet
StableOracleDAI.sol#L52
Tool used
Manual Review
Recommendation
Change
uint256(price) * 1e10
touint256(price)
removing* 1e10
Duplicate of #236
The text was updated successfully, but these errors were encountered: