A vulnerability exists in the RAACToken smart contract that causes the fee collector to receive less tax than intended whenever a user burns tokens. This issue arises because of the burn effect introduced by RAACToken:: _update , which applies a secondary tax deduction on the tax amount before it reaches the fee collector.
This unintended behavior reduces protocol revenue, causing a potential loss of funds for the fee collector and affecting any protocol mechanisms that depend on these collected fees.
RAACToken::burn() function in RAACToken is structured as follows:
The burn tax is first calculated as taxAmount = amount * burnTaxRate / 10000.
The remaining amount (amount - taxAmount) is sent to _burn().
The tax amount is then sent to the feeCollector via _transfer().
RAACToken overrides the ERC20 _update() function, which applies a tax whenever a transfer occurs:
Key Issue:
RAACToken::_burn() internally calls RAACToken::_update() with to = address(0).
Since RAACToken::_update() skips taxes when to = address(0), no additional tax is applied when _burn() is executed.
However, when the tax amount is sent to the fee collector (_transfer(msg.sender, feeCollector, taxAmount)), it goes through RAACToken::_update() again, where a second burn tax is applied to the tax amount.
This means that some of the tax that should go to the fee collector is instead burned, reducing protocol revenue.
This test was run in the RAACToken.test.js file in the "Tax Calculation" describe block
Fee Collector Receives Less Revenue Than Expected: The protocol expects full tax collection from token burns. Instead, some of the tax is being burned, causing a revenue shortfall.
Negative Effect on Protocol Mechanisms That Depend on Fees : RAAC Ddocumentation at https://docs.raac.io/quickstart/about-raac say the following about the RAACToken:
"It includes a built-in tax and fee collection mechanisms that is collected by the protocol in order to finance real-world aspects related to the properties (for instance, repairs). " If fee collection funds are reduced, RAAC has less funds to perform its real-world aspects
Manual Review, Hardhat
Modify _update() to exempt transfers where to == feeCollector so that the tax amount is not reduced by an extra burn.
Now, tax is not applied when sending tax amounts to the fee collector.
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.