The _initializeFeeTypes function in the FeeCollector contract uses incorrect basis point values for calculating certain fee distributions, specifically for Swap Tax and NFT Royalties. This leads to incorrect percentages being assigned to different stakeholders (veRAAC holders, burn, repair fund, and treasury), resulting in a loss of funds for the intended recipients and potentially gaining unintended beneficiaries.
The _initializeFeeTypes function sets up the distribution percentages for different fee types. Basis points are used for percentage calculations, where 10000 represents 100%. However, for Swap Tax (feeType 6) and NFT Royalties (feeType 7), the code uses 500 to represent 0.5%, which is actually 5%. The correct value for 0.5% should be 50. Furthermore, the repair share is set to 1000 (10%) instead of 100 (1%).
[https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/collectors/FeeCollector.sol#L380-#L394]
Because of this error, the Swap Tax and NFT Royalties are distributed as follows:
Swap Tax: 5% to veRAAC holders, 5% to burn, 10% to repair, and 0% to treasury (total 20% instead of intended 2%).
NFT Royalties: 5% to veRAAC holders, 0% to burn, 10% to repair, and 5% to treasury (total 20% instead of intended 2%).
This is a 10x error in the 0.5% distributions and a 10x error in the 1% repair share distribution.
The incorrect basis point calculation leads to a significant over-allocation of fees to the burn address, repair fund and veRAAC holders, and a corresponding under-allocation to the treasury. This results in:
Loss of Funds: The treasury receives significantly less revenue than intended.
Unfair Distribution: veRAAC holders and the repair fund receive a larger share of the fees than they should.
Token Burning Imbalance: More tokens are burned than intended, potentially affecting the tokenomics.
Excessive Repair Fund Allocation: The repair fund receives 10 times the intended amount, locking up more funds than necessary.
Manual code review.
Correct the basis point values in the _initializeFeeTypes function for Swap Tax and NFT Royalties to accurately reflect the intended percentages:
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.