Currently, liquidators can choose how much debt they want to cover from an under-collateralized user in DSCEngine::liquidate
, but the amount they might decide to cover may not restore the health factor to be equal or greater than MIN_HEALTH_FACTOR
Assume DSCEngine.sol
and DecentralizedStableCoin.sol
are deployed and a user decides to use the protocol.
The user deposits 10 WBTC tokens in the protocol as collateral and chooses to mint 4,000 DSC tokens.
The price of each WBTC token is of $1,000, therefore the total value of the user collateral in USD is of $10,000.
The price of WBTC tanks to $750 per token, decreasing the value of the collateral to $7,500.
Due to the decrease of the price of WBTC the health factor of the user also decreases from 1.25 to 0.9375.
The user is now under-collateralized.
A liquidator decides to partially liquidate the user to obtain a portion of the user collateral at a discount. Instead of paying the full debt of 4,000 DSC, he chooses to only cover 500 DSC.
The output is shown below.
The protocol aims to be 200% over-collateralized and solvent at all times, by allowing under-collateralized users to remain in the system after a liquidation represents a threat to the solvency and avaliability of the protocol. For these reasons I evaluate the severity to MEDIUM.
Visual Studio code and Foundry.
Consider modifying the sanity check after a liquidation to revert if the liquidated user health factor is not equal or greater than MIN_HEALTH_FACTOR
.
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.