Exisiting logic in _repay function, Prevents full debt repayment .
Compares repayment amount (in underlying asset terms) against userScaledDebt (scaled value)
Should compare against unscaled userDebt instead
Present comparison Caps repayments at scaled debt (userScaledDebt) instead of actual debt (userDebt)
actualRepayAmount will be capped at userScaledDebt which is far less than userDebt(actual debt of user).
This will prevent full debt repayment, leading to unnecesary liquidations, loss of user Collateral.
fix the following line in the _repay function:
That amount is not actually used.
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.