Core Contracts

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

Mint incorrect amount of tokens

Summary

In RToken contract the function mint() mints wrong amount of tokens. It was missed to add interest value to amount.

Vulnerability Details

The mint function in RToken contract expect to return:

  • bool: True if this is the first mint for the recipient, false otherwise

  • uint256: The amount of scaled tokens minted

  • uint256: The new total supply after minting

  • uint256: The amount of underlying tokens minted

In the function is forgotten to add the balance increase to the amount. It returns amountToMint with no added balanceIncrease.

Impact

The problem is that the function mints to the user wrong amount of tokens. It mints tokens with no interest value to the user.

Recommendations

To fix this issues i recommend in RToken contract in mint() function before _mint() function to add:

amountScaled += balanceIncrease
Updates

Lead Judging Commences

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