The FeeCollector contract accumulates RAAC token as burn fees and swap fees, but these fees are not properly accounted for, making it impossible for the fee collector to withdraw the collected RAAC tokens via FeeCollector::distributeCollectedFees. While the contract includes a function (FeeCollector::distributeCollectedFees) intended for distributing fees, the mechanism only updates the fee amount in FeeCollector::collectFee, which does not track RAAC fees collected through token operations.
Problem Description
The RAACToken contract collects fees on token transactions and transfers them to the FeeCollector. However, FeeCollector does not properly track these fees, making them inaccessible when attempting to distribute the collected amounts. The root cause is that FeeCollector::collectFee does not register fees collected through RAAC token operations, causing all tracked fee categories to remain zero.
Since fees collected from RAAC token operations are not recorded under collectedFees, the function always evaluates totalDistributable as zero, preventing the distribution of funds.
A simple test demonstrates the issue:
Although there is a FeeCollector::emergencyWithdrawoperation, but it should only be used under emergency state, not the ordinary withdrawal circumstance.
Deploy RAACToken, FeeCollector, and related contracts.
Set up a user transaction that generates fees (e.g., a token transfer).
Observe that the FeeCollector contract receives RAAC tokens.
Call FeeCollector::distributeCollectedFees, which fails because collectedFees remains zero.
The RAAC tokens remain stuck in the FeeCollector contract.
Fee Collector Cannot Withdraw Funds: Accumulated fees in the contract are effectively locked and cannot be used as intended.
Protocol Revenue Stuck: Since fees cannot be distributed, protocol operations relying on these funds may be hindered.
Accounting Discrepancies: The fee collector does not accurately reflect the amount of collected fees, leading to misreporting of available protocol funds.
Manual Review
Instead of only relying on collectedFees, the function should also check the actual RAAC balance in the contract.
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.