There is no check for the answer
from latestRoundData
, the value is a int256 and in some cases it can return negative value, a security recommendation is to validate this variable.
The answer
variable in OracleLib
contract is used to calculate the amount of token from USD in DSCEngine.sol#getTokenAmountFromUsd()
or to get the total o collateral value in `DSCEngine.sol#LgetAccountCollateralValue(), due to incorrect price the borrower can be liquidated even if he has the necessary amount of collateral to cover the debts.
Due to an invalid calculation of the price, the borrower can be liquidated earlier.
I consider this to be a low possibility because a negative price is highly unlikely to occur.
Manual Review
It is recommended to validate the answer
is more than zero.
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.