The burn function in the RAACToken contract incorrectly deducts the tax fee during the transfer to the fee collector, triggering an additional tax deduction. As a result, the actual fee transferred to the feeCollector is less than expected, causing a loss in protocol revenue.
The issue arises in the RAACToken::burn function, where the tax fee is calculated and transferred to the feeCollector. The tax fee transfer triggers a secondary tax deduction in the _transfer function. This behavior leads to the feeCollector receiving less than the intended tax amount.
The core issue is that when the burn function is called, the tax fee is calculated and transferred to the feeCollector. However, the _transfer function calls the _update function, which contains additional tax logic:
In this logic, part of the tax amount (the burnAmount) is transferred to address(0) for burning, which reduces the actual fee amount that is transferred to the feeCollector.
Mathematical Example
Let’s assume the following:
burnTaxRate = 50 (0.5%)
swapTaxRate = 100 (1%)
User burns 1000 RAAC tokens
The tax calculation would be:
Direct loss: Every burn operation results in a tax revenue reduction of 0.5%.
Manual
This is by design, sponsor's words: Yes, burnt amount, done by whitelisted contract or not always occur the tax. The feeCollector is intended to always be whitelisted and the address(0) is included in the _transfer as a bypass of the tax amount, so upon burn->_burn->_update it would have not applied (and would also do another burn...). For this reason, to always apply such tax, the burn function include the calculation (the 2 lines that applies) and a direct transfer to feeCollector a little bit later. This is done purposefully
This is by design, sponsor's words: Yes, burnt amount, done by whitelisted contract or not always occur the tax. The feeCollector is intended to always be whitelisted and the address(0) is included in the _transfer as a bypass of the tax amount, so upon burn->_burn->_update it would have not applied (and would also do another burn...). For this reason, to always apply such tax, the burn function include the calculation (the 2 lines that applies) and a direct transfer to feeCollector a little bit later. This is done purposefully
This is by design, sponsor's words: Yes, burnt amount, done by whitelisted contract or not always occur the tax. The feeCollector is intended to always be whitelisted and the address(0) is included in the _transfer as a bypass of the tax amount, so upon burn->_burn->_update it would have not applied (and would also do another burn...). For this reason, to always apply such tax, the burn function include the calculation (the 2 lines that applies) and a direct transfer to feeCollector a little bit later. This is done purposefully
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.