DSCEngine
contract assumes all of the USD pair chinlink price feeds have 8 decimals but there are certain token's USD feed has a different decimals
In the getTokenAmountFromUsd
and getUsdValue
functions price of tokens are calculated with chainlink price feeds and the function assumed that all of USD pairs has 8 decimals but there are certain tokens which they have different decimals.
For example AMPL / USD feed has 18 decimals
So if some tokens's price feed has not 8 decimals it will break a lots of things in the contract
Since returned value of this two functions is used for health factor and liquidation process it will cause loss of funds for users and protocol
Manual Analysis
Consider calling decimals()
function on the price feed contract to get the correct decimals and calculate the value based on the returned decimals
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.