Core Contracts

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

Incorrect Revert Statement in _initiateLiquidation Misleads Users

Summary

The _initiateLiquidation function in LendingPool.sol incorrectly reverts with HealthFactorTooLow() when a user’s health factor is above the liquidation threshold. The condition itself is correct (if (healthFactor >= healthFactorLiquidationThreshold)), but the error message is misleading. This could cause confusion for users, auditors, and integrators, as the message suggests the health factor is too low when it is actually too high to allow liquidation.

Vulnerability Details

Incorrect Revert Statement:

if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow()
  • The condition is correct (liquidation should only happen if healthFactor < threshold).

  • However, the revert message is incorrect. If healthFactor is too high (not eligible for liquidation), the error message wrongly states that it is "too low."

Impact

  • Misleading Information: Users and developers might misdiagnose the issue.

  • Incorrect Error Handling: Automated scripts or frontend interfaces relying on this error message may behave incorrectly.

Tools Used

Manual Review

Recommendations

Modify the revert statement to accurately reflect the situation:

function initiateLiquidation(address userAddress) external nonReentrant whenNotPaused {
if (isUnderLiquidation[userAddress]) revert UserAlreadyUnderLiquidation();
// update state
ReserveLibrary.updateReserveState(reserve, rateData);
UserData storage user = userData[userAddress];
uint256 healthFactor = calculateHealthFactor(userAddress);
-- if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();
++ if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooHigh();
isUnderLiquidation[userAddress] = true;
liquidationStartTime[userAddress] = block.timestamp;
emit LiquidationInitiated(msg.sender, userAddress);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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