In RAACToken, the burn()
manually transfers the taxAmount
to the feeCollector
, but this tax is already deducted inside _update()
during the _transfer()
call. As a result, users pay the burn tax twice:
First deduction in burn()
before _update()
executes.
Second deduction in _update()
due to tax logic.
burn(msg.sender, amount - taxAmount);
→ Reduces amount - taxAmount
from user balance. At this time, burnTaxAmount is included and feeCollector should receive taxAmount.
_transfer(msg.sender, feeCollector, taxAmount);
→ Triggers _update()
, which applies tax logic again.
_update()
automatically applies swapTaxRate + burnTaxRate if msg.sender is not in whitelist. As a result, feeCollector couldn't receive burnAmount.
Protocol loses burnTaxAmount of burnTaxAmount in burn().
manual
Adds validation of to == feeCollector
in _update()
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.