Core Contracts

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

Incorrect Tax Handling in Burn Function When feeCollector is Zero address

Link to Affected Code:\

Description:
Here , we can see that its possible to not have a feeCollector.

In the burn function , when the feeCollector is a 0 address , the calculated taxAmount is Neither burned or transfered , it remains in the user's balance.

we can see that regardless of if there is a feeCollector or not, the tax amount is calculated here in the function, so there is an intended taxation:

uint256 taxAmount = amount.percentMul(burnTaxRate);

But if the FeeCollector doesnt exist , the transfer call doesnt happen.

@> _transfer(msg.sender, feeCollector, taxAmount);

Impact:

  • Users can bypass the burn tax

  • Incorrect token supply tracking (total supply does not decrease by the full amount).

  • If a user wants to burn a cetain amount they have to increase the amount by the taxAmount in order to achieve that

Proof of Concept:

  1. Set feeCollector = address(0).

  2. User calls burn(1000) with burnTaxRate = 50 (0.5%).

  3. taxAmount = 5 is calculated but not burned or transferred.

  4. User’s balance decreases by 995 instead of 1000.

Recommended Mitigation:

  • If no feeCollector further burn the tax amount

function burn(uint256 amount) external {
uint256 taxAmount = amount.percentMul(burnTaxRate);
_burn(msg.sender, amount - taxAmount);
if (taxAmount > 0) {
if (feeCollector != address(0)) {
super._update(msg.sender, feeCollector, taxAmount);
} else {
_burn(msg.sender, taxAmount); // Burn taxAmount if no feeCollector
}
}
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month 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 about 1 month 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.