When fee collection is disabled (i.e., feeCollector == address(0)
), the burn
function does not correctly burn the full amount of tokens requested by the user. This occurs because the tax calculation is applied regardless of the fee collector's status, causing users to burn less than the intended amount even though no tax is transferred.
In the current implementation of the burn
function:
2025-02-raac/contracts/core/tokens/RAACToken.sol at main · Cyfrin/2025-02-raac
When Fee collection is disabled feeCollector == address(0)
, the burn tax is still subtracted from the amount being burned, but the tax is never transferred since the condition taxAmount > 0 && feeCollector != address(0)
fails. This leads to a situation where the deducted tax is effectively lost, and the user burns fewer tokens than requested without the tax being redirected anywhere.
Proof of Concept:
Outputs:
Before Burn 10000n
After burn 50n
Exact amount is never burned – Users will attempt multiple burns and never achieve a full burn of their intended amount.
Wasted gas fees – Users must execute multiple transactions, wasting gas to get their full tokens burnt.
To resolve this issue, the burn logic should be adjusted to conditionally apply the tax only when fee collection is enabled. Here’s the corrected implementation:
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.