The protocol could use as collateral any token that has a Chainlink USD price feed to query for prices, but it assumes all of them work with 8 decimals places, currently there are feeds like AMP/USD (Ethereum Mainnet) or SAVAX/USD (BNB Chain Mainnet) what work with 18 decimals places, if these price feeds were used then huge precision problems will occur.
Manual verification.
Don't assume the number of decimals for all the price feeds and instead dynamically add the precision required for each one.
DSCEngine::getUsdValue
could be modified like this:
Where PRECISION = 18
and BASE = 10
.
A similar setup could be implement for DSCEngine::getTokenAmountFromUsd
.
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.