Core Contracts

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

Incorrect amount mint into RToken.sol

Summary

The mint function in the provided Solidity contract is responsible for minting debt tokens to a user (onBehalfOf). The function takes into account the current index (usage index) and calculates the scaled amount of tokens to mint. However, the current implementation mints the raw amountToMint (in underlying asset units) instead of the scaled amount (amountScaled). This inconsistency in units could lead to incorrect token minting and accounting.

Vulnerability Details

Here, amountToMint is the raw input amount in underlying asset units, but the rest of the function operates in scaled terms (amountScaled and balanceIncrease). The amountScaled is calculated using amountToMint.rayDiv(index), which converts the underlying asset amount into scaled debt tokens. Minting the raw amountToMint instead of the scaled amountScaled results in incorrect token minting

Impact

  • Incorrect Token Minting: Minting the raw amountToMint instead of the scaled amountScaled could result in users receiving an incorrect amount of tokens.

Tools Used

  • Manual code review

Recommendations

- _mint(onBehalfOf, amountToMint.toUint128());
+ _mint(onBehalfOf, amountScaled.toUint128());
Updates

Lead Judging Commences

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

RToken::mint should mint the amountScaled not the amountToMint

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

RToken::mint should mint the amountScaled not the amountToMint

Support

FAQs

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