Core Contracts

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

Incorrect revert message in the `LendingPool::initiateLiquidation` function.

Summary

The initiateLiquidation function has an incorrect revert message.

Vulnerability Details

The if condition checks whether the user's health factor is greater or less than healthFactorLiquidationThreshold. If it is greater, liquidation should not be initiated, and the function should revert.

But the revert message "HealthFactorTooLow" is incorrect; it should be something like "HealthFactorIsGood" to indicate that liquidation cannot proceed.

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();
isUnderLiquidation[userAddress] = true;
liquidationStartTime[userAddress] = block.timestamp;
emit LiquidationInitiated(msg.sender, userAddress);
}

Impact

Incorrect revert message.

Recommendations

-if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorTooLow();
+if (healthFactor >= healthFactorLiquidationThreshold) revert HealthFactorIsGood();
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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.