Function: liquidate(IERC20 collateral, address borrower)
This is the function used to liquidate a trove whose owner is a borrower.
Inputs
collateral
Control: Fully controlled.
Constraints: Should be valid collateral.
Impact: The collateral will be used to get the address of
troveManager
.
borrower
Control: Fully controlled.
Constraints: Should be an owner of a valid trove that should be open.
Impact: The address of the owner of the trove that would be liquidated.
Branches and code coverage (including function calls)
Intended branches
Liquidate the trove if the trove is open and can be liquidated.
Negative behavior
Revert if trove does not exist or is closed.
Revert if wrong collateral is used.
Revert if
batchLiquidateTroves
reverts.