The purpose of the _get_usd_value
function is to compute the USD value of a specified amount of a given token by using an oracle to fetch the latest price data.
The code indicates that the precision for ETH is handled, but not for WBTC.
In code there is constant variable PRECISION
. It has value 1 * (10**18)
which is equat to 1 ETH in WEI, for WBTC should be 10^8
.
The result is divided by PRECISION
here to achieve the accurate USD value. Incorrect precision can lead to obtaining a lower or higher USD value within the protocol. And this can break the protocol due to an insufficient health factor.
manual review
Please add PRECISION for WBTC.
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.