Core Contracts

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

Users Don't Receive Accrued Interest During RToken Withdrawals

Summary

The RToken contract's burn mechanism prevents users from withdrawing their full balance including accrued interest. While the contract correctly calculates the interest-adjusted amount, it attempts to burn more tokens than the user has, causing the transaction to revert. Additionally, when a withdrawal succeeds, users only receive their original deposit amount, losing all accrued interest.

Vulnerability Details

In the burn() function, two critical issues occur:

  1. It calculates the amountScaled but did not use it

function burn(...) external override onlyReservePool returns (uint256, uint256, uint256) {
// Calculates scaled amount with interest
uint256 amountScaled = amount.rayMul(index);
// But transfers original amount, ignoring accrued interest
IERC20(assetAddress).safeTransfer(receiverOfUnderlying, amount);
}
  1. If user tries to withdraw full balance (including interest), this amount will be greater than their rToken balance

if(amount > userBalance){
amount = userBalance;
}
//..
_burn(from, amount.toUint128()); // @audit will revert (insufficient rToken)

Example scenario:

Initial State:

  • User has 100 rTokens (index 1)

  • Index has increased to 1.5 (50% interest accrued)

  • User Balance = 150 ( 100 + 50 interest)
    Current Implementation:

  1. Withdraw rToken balance ( 100 )

    • Burns 100 rTokens

    • Transfers 100 underlying tokens

    • No way to claim remaining interest since user burns all his rTokens

  2. Withdraw userBalance ( 150 )

    • Burns 150 rTokens -> will revert since user only has 100 rTokens

Impact

Users cannot withdraw their accrued interest as attempts to withdraw the full entitled balance will revert due to insufficient rToken balance, and successful withdrawals only return the original deposit amount, resulting in permanent loss of earned interest.

Recommendations

Modify the burn mechanism to correctly calculate and burn the appropriate number of rTokens based on the requested underlying amount while ensuring the full interest-adjusted amount is transferred

Updates

Lead Judging Commences

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

RToken::burn incorrectly burns amount (asset units) instead of amountScaled (token units), breaking token economics and interest-accrual mechanism

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

RToken::burn incorrectly burns amount (asset units) instead of amountScaled (token units), breaking token economics and interest-accrual mechanism

Support

FAQs

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