Core Contracts

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

ERC20 transfer fees causing accounting issues

Summary

The RAAC protocol does not account for ERC20 tokens with transfer fees, leading to incorrect minting or burning of RTokens.

Vulnerability Details

When depositing or withdrawing tokens in the LendingPool, the protocol assumes the transferred amount equals the input amount. However, tokens with transfer fees, such as USDT, may deduct a fee during transfer, causing discrepancies in the actual amount received. For instance, in LendingPool.deposit(), the use of reserveAssetToken.safeTransferFrom() does not account for potential fees, leading to over-minting of RTokens.

Impact

This vulnerability can result in incorrect asset accounting, potentially causing protocol insolvency or loss of funds. If the protocol mints more RTokens than the actual amount of tokens received, it could lead to an imbalance in the system's financial stability.

The protocol's interaction with various ERC20 tokens, including potentially fee-on-transfer tokens like USDT, makes this a critical issue. The project's mention of using USDC and other ERC20 tokens in pools supports the relevance of this vulnerability.

Tools Used

  • Manual review

Recommendations

Implement a check on the balance before and after the transfer to correctly account for the actual amount received. For example:

uint256 balanceBefore = raacToken.balanceOf(address(this));
raacToken.safeTransferFrom(msg.sender, address(this), amount);
uint256 received = raacToken.balanceOf(address(this)) - balanceBefore;
_updateCollectedFees(received, feeType);
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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