Core Contracts

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

Unprocessed Burn Tax When feeCollector is Disabled

Summary

When the feeCollector is set to the zero address, the RAACToken:: burn function fails to process the burn tax properly, resulting in the tax amount remaining in the user’s account instead of being burned.

Vulnerability Details

RAACToken:: burn

/**
* @dev Burns tokens from the caller's balance
* @param amount The amount of tokens to burn
*/
function burn(uint256 amount) external {
uint256 taxAmount = amount.percentMul(burnTaxRate);
_burn(msg.sender, amount - taxAmount);
// amount-taxAmount
if (taxAmount > 0 && feeCollector != address(0)) {
_transfer(msg.sender, feeCollector, taxAmount);
}
}

When feeCollector = address(0), the taxAmount is neither transferred nor burned.
The actual amount burned is amount - taxAmount, and the taxAmount remains in the user's balance instead of being deducted.

Mathematical Proof

If a user calls burn(1000):

  • taxAmount = 1000 * 0.5% = 5 RAAC

  • User's balance change: 995 RAAC burned, but 5 RAAC remains in the user's balance instead of being deducted.

Tools Used

Manual

Recommendations

Modify the burn function to ensure that the tax amount is burned when feeCollector is disabled:

/**
* @dev Burns tokens from the caller's balance
* @param amount The amount of tokens to burn
*/
function burn(uint256 amount) external {
uint256 taxAmount = amount.percentMul(burnTaxRate);
_burn(msg.sender, amount - taxAmount);
// amount-taxAmount
if (taxAmount > 0) {
if (feeCollector != address(0)) {
_transfer(msg.sender, feeCollector, taxAmount);
} else {
_burn(msg.sender, taxAmount);
}
}
}

This ensures that the burn tax is always processed correctly, either by transferring it to feeCollector or burning it directly if feeCollector is disabled.

Updates

Lead Judging Commences

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

RAACToken::burn incorrectly deducts tax amount but doesn't burn or transfer it when feeCollector is address(0), preventing complete token burns

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

RAACToken::burn incorrectly deducts tax amount but doesn't burn or transfer it when feeCollector is address(0), preventing complete token burns

Support

FAQs

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

Give us feedback!