Core Contracts

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

Unnecessary Token Transfer to Self (FoT Issue

Summary:

In the emergencyRevoke() function, when a beneficiary’s vesting is revoked, the contract attempts to transfer the unreleased tokens to itself using:

raacToken.transfer(address(this), unreleasedAmount);

However, this is unnecessary since the contract already holds the tokens, and it incurs extra gas costs. Additionally, ithe RAAC token has a Fee-on-Transfer (FoT) mechanism, this self-transfer would result in an unintended deduction of tokens. And therefore with every successful call of emergencyRevoke() there is less tokens to release and can will cause ATLEAST one beneficiary (most probably the last cliamer) from being able to claim as a slightly less balance than his schedule.totalAmount would lead to reverts

Vulnerability details

Supporting Evidence: FoT in raacToken._update Function

Here is the relevant _update function in the RAAC token contract, confirming that a transfer tax is applied:

function _update(
address from,
address to,
uint256 amount
) internal virtual override {
uint256 baseTax = swapTaxRate + burnTaxRate;
if (
baseTax == 0 ||
from == address(0) ||
to == address(0) ||
whitelistAddress[from] ||
whitelistAddress[to] ||
feeCollector == address(0)
) {
super._update(from, to, amount);
return;
}
// All other cases where tax is applied
uint256 totalTax = amount.percentMul(baseTax);
uint256 burnAmount = (totalTax * burnTaxRate) / baseTax;
super._update(from, feeCollector, totalTax - burnAmount);
super._update(from, address(0), burnAmount);
super._update(from, to, amount - totalTax);
}

Impact:

  • Gas Inefficiency: The contract pays gas for an unnecessary transfer.

  • FoT Deduction Risk: If the RAAC token applies a transaction tax, the transferred amount will be reduced, permanently locking some tokens in the contract.

Recommendation:

Instead of transferring the tokens to the contract itself, simply delete the vesting schedule and adjust categoryUsed[category] accordingly.

Fixed Code Snippet:

Replace this:

raacToken.transfer(address(this), unreleasedAmount);

With this:

categoryUsed[schedule.category] -= unreleasedAmount;

This prevents unnecessary transfers while ensuring that the category allocation is correctly updated.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!