In the unlikely event that the price of an asset goes negative, the getTokenAmountFromUsd
function will convert the int256
result to uint256
and return the invalid result, leading to a loss of funds.
The Chainlink Data Feeds use int
instead of uint
because some prices can be negative, like when oil futures dropped below 0. Source
The usage of off-chain oracle prices in DSCEngine.sol
:
Positions won't be liquidatable, and DSC system will become insolvent.
Manual review
Provide a mechanism for positions to be liquidated even if the price becomes negative.
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.