StabilityPool::liquidateBorrower()
calculates the user's debt incorrectly
To calculate scaledUserDebt
, we have the following code:
The issue is that getUserDebt()
calculates the debt with interest included (due to the index multiplication):
Then, we apply the index again which makes the amoun higher than supposed to as we are applying the index twice. Then, liquidations can be impossible due to this check:
As the scaledUserDebt
is inflated incorrectly, it can fail making liquidations impossible in cases they should be possible.
Liquidations will revert incorrectly
Manual Review
Do not apply the index twice
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.