Core Contracts

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

Incorrect Amount Burned When Fee Collection is Disabled in RAACToken

Summary

The burn() function in RAACToken incorrectly calculates the burned amount when fee collection is disabled (feeCollector == address(0)). The function always deducts taxAmount, but when there is no valid feeCollector, the tax is neither burned nor transferred

Vulnerability Details

function burn(uint256 amount) external {
uint256 taxAmount = amount.percentMul(burnTaxRate);
_burn(msg.sender, amount - taxAmount);
if (taxAmount > 0 && feeCollector != address(0)) {
_transfer(msg.sender, feeCollector, taxAmount);
}
}

When the FeeCollector is address(0), the burn function does not burn all the tokens, the taxAmount remains with the sender, this is not the intended design, when a user burns a token, all the tokens should be burned whether the collector is enabled or disabled.

Impact

Not all the tokens are burned. The taxAmount token is not burned and remains in the user account.

Tools Used

Manual Review

Recommendations

Adjust the burn function to burn all tokens when feeCollector is equal to zero

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!