There is a critical issue with the logic used to collect and distribute fees in the RAACToken
and FeeCollector
contracts. Specifically, the FeeCollector
contract does not properly track and accumulate the fees sent from the RAACToken
, which leads to incorrect fee distribution behavior. This vulnerability may cause the distributeCollectedFees
function to fail and the fees to be improperly allocated or lost.
RAACToken Contract:
The RAACToken
contract implements a tax system (swap tax and burn tax) on token transfers.
Part of the collected tax (swap tax) is transferred to the FeeCollector
contract using the _transfer
function in the _update
method.
FeeCollector Contract:
The FeeCollector
contract is supposed to collect taxes sent to it and accumulate them.
However, when tokens are transferred to the FeeCollector
contract, the collectFee
function is not being called or properly triggered, leading to the collected fees not being tracked.
As a result, the fees that are supposed to be distributed via the distributeCollectedFees
function are not properly accumulated and are essentially lost or incorrectly tracked.
Incorrect Fee Collection: The FeeCollector
does not update its internal state (collectedFees
) when tokens are transferred from the RAACToken
. As a result, the total fees collected are not properly accounted for.
Disrupted Fee Distribution: Since the distributeCollectedFees
function relies on the collectedFees
variable, its execution may fail or result in incorrect distribution of fees.
Loss of Fees: Collected fees could be "lost" or inaccessible for future distribution, leading to potential losses for users relying on the fee distribution system (e.g., liquidity providers, stakers, etc.).
Manual Code Review
Code Fix for RAACToken
:
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.