Core Contracts

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

Potential Usage Index Mismatch in DebtToken Causing Incorrect Interest Calculations

Summary

The DebtToken contract relies on _usageIndex and getNormalizedDebt() from the LendingPool to track debt growth over time. However, these values may not always be synchronized, leading to misaligned debt calculations.

If _usageIndex and getNormalizedDebt() diverge, users may experience incorrect interest accrual, affecting both borrowers and liquidators.

This issue can cause unexpected overcharges or undercharges in debt calculations, creating financial inconsistencies across the protocol.

Vulnerability Details

In the DebtToken contract, different pieces of code rely on the _usageIndex and the value returned by ILendingPool(_reservePool).getNormalizedDebt() . For instance:

function balanceOf(address account) public view override(ERC20, IERC20) returns (uint256) {
uint256 scaledBalance = super.balanceOf(account);
return scaledBalance.rayMul(ILendingPool(_reservePool).getNormalizedDebt());
}

and

function updateUsageIndex(uint256 newUsageIndex) external override onlyReservePool {
if (newUsageIndex < _usageIndex) revert InvalidAmount();
_usageIndex = newUsageIndex;
emit UsageIndexUpdated(newUsageIndex);
}

The _usageIndex may diverge from what getNormalizedDebt() returns, or be updated at different times, so users' scaled balances can become misaligned with the actual index used for interest accrual, leading to unexpected or incorrect interest calculations.

Impact

Incorrect Interest Calculations

Tools Used

Manual review

Recommendations

Use one single source of truth for debt scaling—either _usageIndex or getNormalizedDebt()

Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[INVALID] Unused _usageIndex Variable and updateUsageIndex() Function in DebtToken Contract

Support

FAQs

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