The protocol can enter the state where the repayment for borrowers is paused, but their liquidation is still possible.
Inside the LendingPool
contract, users can borrow funds against their collateral. The liquidation process occurs in two steps. First, liquidation is initiated, marking the user's position as liquidatable. However, the user has a three-day grace period to repay their debt and close the liquidation. If the debt remains unpaid after three days, the user can no longer repay it, and the StabilityPool
can call finalizeLiquidation()
to finalize the liquidation.
This process ensures fairness and efficiency. However, if the LendingPool
is paused for any reason after liquidation has been initiated, the user is unable to repay their debt due to whenNotPaused
modifier on the repay
functions. Once the grace period expires, the StabilityPool
can still finalize the liquidation since this function does not have the whenNotPaused
modifier. This creates an unfair situation for borrowers, as they are prevented from repaying their debts while their positions can still be liquidated.
Add the following test to the LendingPool.test.js
High as it creates unfair situation for borrowers by being able to liquidate them while the contract is paused
Manual Review
Either add whenNotPaused
modifier to the finalizeLiquidation()
function as well, or remove it from the repay()
function so users have the ability to repay their debts even if the contract is paused.
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.