Core Contracts

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

User have to pay interest even when protocol is paused

Vulnerability Details

In LendingPoolcontract, in multiple functions like deposit(), withdraw(), ..., it will call updateReserveState()function before doing any action. It will call updateReserveInterests()function:

function updateReserveState(ReserveData storage reserve,ReserveRateData storage rateData) internal {
updateReserveInterests(reserve, rateData);
}

It will update liquidity index and debt index with timeDelta is current block timestamp and last update timestamp:

function updateReserveInterests(ReserveData storage reserve,ReserveRateData storage rateData) internal { //@idea update cả khi pause
uint256 timeDelta = block.timestamp - uint256(reserve.lastUpdateTimestamp); // <--
if (timeDelta < 1) {
return;
}
uint256 oldLiquidityIndex = reserve.liquidityIndex;
if (oldLiquidityIndex < 1) revert LiquidityIndexIsZero();
// Update liquidity index using linear interest
reserve.liquidityIndex = calculateLiquidityIndex(
rateData.currentLiquidityRate,
timeDelta,
reserve.liquidityIndex
);
// Update usage index (debt index) using compounded interest
reserve.usageIndex = calculateUsageIndex(
rateData.currentUsageRate,
timeDelta,
reserve.usageIndex
);
// Update the last update timestamp
reserve.lastUpdateTimestamp = uint40(block.timestamp);
emit ReserveInterestsUpdated(reserve.liquidityIndex, reserve.usageIndex);
}

Which mean it is user's debt is charged even when protocol is paused. They can not repay the debt and have to pay the fee for the paused duration.

Impact

Users are forced to pay fee when protocol is paused.

Recommendations

Do not calculate interest when protocol is paused.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Unfair Liquidation As Borrow Interest Accumulates While Paused

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Unfair Liquidation As Borrow Interest Accumulates While Paused

Support

FAQs

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

Give us feedback!