Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Invalid

Misleading Error Message in Liquidation Health Check

Summary

The initiateLiquidation function in LendingPool contract uses a confusing error message that contradicts the actual check being performed. When a position's health factor is above the liquidation threshold (i.e., healthy), it reverts with `HealthFactorTooLow` instead of a more accurate message like `HealthFactorIsHealthy`.

Vulnerability Details

function initiateLiquidation(address userAddress) external {
// ...
uint256 healthFactor = calculateHealthFactor(userAddress);
// Incorrect error message
if (healthFactor >= healthFactorLiquidationThreshold)
revert HealthFactorTooLow();
// ...
}

The check healthFactor >= healthFactorLiquidationThreshold verifies if a position is healthy and cannot be liquidated. However, when reverting, it uses HealthFactorTooLow which implies the opposite of what's actually happening.

Impact

  • Confusing error messages for integrators and front-end applications

Tools Used

Recommendations

Update the error message to accurately reflect the condition:

if (healthFactor >= healthFactorLiquidationThreshold) {
- revert HealthFactorTooLow();
+ revert HealthFactorIsHealthy();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!