In LendingPool::initiateLiquidation
, the error message HealthFactorTooLow()
is thrown when the health factor is actually too high for liquidation, causing confusing feedback for users and frontends.
When a position cannot be liquidated because it's healthy (health factor above threshold), the error message suggests the health factor is too low, which is contradictory to the actual check.
Example:
Position has health factor of 1.2
Liquidation threshold is 1.0
Liquidation attempt fails because 1.2 > 1.0
Error says "HealthFactorTooLow" when health factor is actually too high
The logic is correct, but the misleading error message can:
Confuse users trying to understand why their liquidation failed
Cause frontend developers to display incorrect error messages
Make integration testing and debugging more difficult
Foundry
Inside ILendingPool
add:
error HealthFactorTooHigh();
Replace the error with HealthFactorTooHigh
:
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.