Core Contracts

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

Incorrect Return Value Sequence in RToken Mint Function

Summary

The RToken contract's mint function returns values in an incorrect sequence compared to its documented return specification. This mismatch between documentation and implementation can lead to incorrect interpretations by calling contracts, particularly the LendingPool, potentially causing accounting errors in the protocol.

Vulnerability Details

LendingPool::deposit --> ReserveLibrary:deposit --> RToken.mint()

LendingPool & ReserveLibrary expect amountScaled but instead recieve amountToMint.

/**
* @return A tuple containing:
* - bool: True if this is the first mint for the recipient
* - uint256: The amount of scaled tokens minted
* - uint256: The new total supply after minting
* - uint256: The amount of underlying tokens minted
*/
return (isFirstMint, amountToMint, totalSupply(), amountScaled);//@audit incorrect order

Impact

severity: HIGH (Likelihood: Always, Impact: High )

  1. The LendingPool contract receives amountToMint when it expects amountScaled in the second position

  2. Since scaled amounts are used to track user balances and protocol accounting, this leads to:

    1. Incorrect user balance calculations

    2. Inaccurate interest accrual

    3. Potential loss of funds due to miscalculated withdrawals

Tools Used

Recommendations

Modify the return statement to return correct sequence, as expected.

return (isFirstMint, amountScaled, totalSupply(), amountToMint);

Updates

Lead Judging Commences

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

RToken::mint doesn't return data in the right order, making the protocol emit wrong events

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

RToken::mint doesn't return data in the right order, making the protocol emit wrong events

Support

FAQs

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