Core Contracts

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

Double scaling applied during RToken transfers

Summary

The RToken _update hook scales the amounts dividing them by the liquidity index, so that transfers can directly pass the unscaled token amount. However, both transfer and transferFrom are also dividing the amount by the liquidity index:

function transfer(
address recipient,
uint256 amount
) public override(ERC20, IERC20) returns (bool) {
//@audit _update already scales the amount
uint256 scaledAmount = amount.rayDiv(
ILendingPool(_reservePool).getNormalizedIncome()
);
return super.transfer(recipient, scaledAmount);
}

This is not correct.

Vulnerability Details

Impact

Actual balance is incorrectly adjusted.

Tools Used

Manual review.

Recommendations

Only scale amounts once.

Updates

Lead Judging Commences

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

RToken::transfer and transferFrom double-scale amounts by dividing in both external functions and _update, causing users to transfer significantly less than intended

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

RToken::transfer and transferFrom double-scale amounts by dividing in both external functions and _update, causing users to transfer significantly less than intended

Support

FAQs

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