This happens due to the following line of code in the StabilityPool::liquidateBorrower
functio:
When comparing the user debt and the crvUSD
balance of the contract, the most important thing is both amounts to be denominated in crvUSD. This is not the case here, since the LenidingPool::getUserDebt
function already makes the scaledUserDebt
into crvUSD
amount as can be seen here:
This means that the following block of code in the StabilityPool::liquidateBorrower
is actually useless and can even result in bad reverts for the protocol since it inflates the amount of crvUSD
for the liquidation:
This may result in some improper liquidation reverts because of the following check
Manual Review
Cut the following line from the function:
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.