Core Contracts

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

Missing Accrual Adjustment in Minting Function: Excluding Balance Increase from Minted Amount

Summary

In the mint (Rtoken) function, a variable balanceIncrease is calculated to represent the accrued tokens that should be added due to an increase in the liquidity index. However, this calculated value is not added to the amountToMint when minting new tokens. As a result, the user receives fewer tokens than intended because the minting does not account for the accrued balance increase.

Vulnerability Details

The root cause is that the function computes balanceIncrease to capture the difference between the scaled balances at the current index and the previous index. However, this computed value is not incorporated into the final minted amount. Instead, the function mints only the original amountToMint, thereby neglecting the necessary adjustment for accrued interest or index growth.

Imagine a scenario where:

A user has an existing scaled balance of 1,000 tokens.

Their previous index was 1.0, and the current index has increased to 1.1.

The accrued increase should then be calculated as:

If the user mints an additional amountToMint of 500 tokens based on the underlying asset, the correct adjusted mint should be:

However, since balanceIncrease is not added, only 500 tokens are minted. This discrepancy of 100 tokens per transaction (or proportional shortfall in each mint) leads to cumulative losses for the user and can distort the token’s total supply over time.

Impact

Because the accrued increase is omitted, users end up with a token balance that is lower than it should be, given the current liquidity index. This miscalculation can lead to:

Incorrect User Balances: Users receive less than the correct amount of tokens, reducing their expected rewards or stake.

Discrepancies in Total Supply: The overall token supply might be underrepresented relative to the accrued values, leading to accounting errors.

Unfair Reward Distribution: Over time, this can accumulate, causing systemic inaccuracies that may unfairly penalize users who have been active longer.

Recommendations

To correct the error, the function should add the balanceIncrease to the amountToMint when minting tokens. For instance, modify the minting process as follows:

uint256 adjustedAmountToMint = amountToMint + balanceIncrease;
_mint(onBehalfOf, adjustedAmountToMint.toUint128());
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

RToken::mint calculates balanceIncrease (interest accrued since last interaction) but never mints it, causing users to lose earned interest between deposits

The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

RToken::mint calculates balanceIncrease (interest accrued since last interaction) but never mints it, causing users to lose earned interest between deposits

The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.

Support

FAQs

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

Give us feedback!