The testMustImproveHealthFactorOnLiquidation()
is meant to check if the user health factor improves on liquidation or not but it is checking for a revert statement that will hit if the health factor is not improved.
The testMustImproveHealthFactorOnLiquidation()
function is currently utilizing the mockMoreDebtDSC.sol contract for testing purposes. However, an issue exists with the burn function within mockMoreDebtDSC.sol, which erroneously sets the priceFeed to 0. Consequently, when the liquidator attempts to liquidate a user, the price feed is set to zero. As a result, the user's health factor fails to improve and immediately crashes to 0, triggering the condition that leads to a revert.
This is not exactly checking if the user health factor improves upon liquidation or not this is simply crashing the price which doesn’t make any sense with the test name.
This creates confusion and not exactly does what it is meant to do. If the protocol undergoes some changes in liquidation logic this test will always pass without reflecting the actual scenario.
manual review
Instead of using mockMoreDebtDSC.sol
token we can simply use DSC token and check if the new health factor is greater than old health factor after liquidation.
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.