When the feeCollector is set to address(0) (disabling fee collection), the burn function still deducts a taxAmount from the user’s specified burn amount but fails to handle the taxAmount properly. Instead of burning the full amount, the function only burns amount - taxAmount, leaving the taxAmount in the user’s balance. This results in:
Incomplete Burning: Users unintentionally retain taxAmount tokens in their balance, contrary to their expectation of burning the full amount.
Funds Mismanagement: The unburned taxAmount remains in the user’s account, where it's intended to burnt
Burn Function
Scenario:
feeCollector = address(0) (fee collection disabled).
User calls burn(100) with burnTaxRate = 50 (0.5%).
Outcome:
taxAmount = 100 * 0.5% = 0.5.
_burn(msg.sender, 99.5) reduces the user’s balance by 99.5.
The taxAmount (0.5) is not sent to feeCollector (since feeCollector is address(0)).
The user retains 0.5 tokens in their balance, despite intending to burn 100.
Contradiction:
The documentation states that disabling the feeCollector should make transactions tax-free. However, the burn function still applies a tax, leading to incomplete burning.
Manual code review
Modify the burn function to skip tax calculation entirely when feeCollector is address(0), ensuring the full amount is burned:
Tax-Free Burning: When feeCollector is address(0), taxAmount is set to 0, and the entire amount is burned.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.