Relevant Github Link
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/collectors/FeeCollector.sol#L330
https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/collectors/FeeCollector.sol#L220
Summary
Incorrect values for Buy/Sell Swap Tax and NFT Royalty Fees, which cannot be updated subsequently.
Vulnerability Details
function updateFeeType(uint8 feeType, FeeType calldata newFee) external override {
if (!hasRole(FEE_MANAGER_ROLE, msg.sender)) revert UnauthorizedCaller();
if (feeType > 7) revert InvalidFeeType();
if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
feeTypes[feeType] = newFee;
emit FeeTypeUpdated(feeType, newFee);
}
function _initializeFeeTypes() internal {
feeTypes[0] = FeeType({
veRAACShare: 8000,
burnShare: 0,
repairShare: 0,
treasuryShare: 2000
});
feeTypes[1] = FeeType({
veRAACShare: 7000,
burnShare: 0,
repairShare: 0,
treasuryShare: 3000
});
feeTypes[2] = FeeType({
veRAACShare: 6000,
burnShare: 0,
repairShare: 0,
treasuryShare: 4000
});
feeTypes[3] = FeeType({
veRAACShare: 5000,
burnShare: 0,
repairShare: 2000,
treasuryShare: 3000
});
feeTypes[4] = FeeType({
veRAACShare: 6000,
burnShare: 0,
repairShare: 2000,
treasuryShare: 2000
});
feeTypes[5] = FeeType({
veRAACShare: 7000,
burnShare: 0,
repairShare: 0,
treasuryShare: 3000
});
feeTypes[6] = FeeType({
veRAACShare: 500,
burnShare: 500,
repairShare: 1000,
treasuryShare: 0
});
feeTypes[7] = FeeType({
veRAACShare: 500,
burnShare: 0,
repairShare: 1000,
treasuryShare: 500
});
}
According to the comments, the veRAACShare
for the Buy/Sell Swap Tax should be 0.5%. However, the actual assigned value is 500, which represents 5% instead of 0.5%. The same issue affects the other elements of the Buy/Sell Swap Tax and NFT Royalty Fees.
Additionally, these values cannot be updated using the FeeCollector.sol::updateFeeType
function, as the function enforces a total fee share of 100%, whereas the intended sum for the Buy/Sell Swap Tax and NFT Royalty Fees is only 2%.
Impact
• Fees will be distributed incorrectly due to the miscalculated values.
• The incorrect fee percentages cannot be corrected because FeeCollector.sol::updateFeeType enforces a total fee share of 100%, preventing adjustments to the 2% categories.
Tools Used
Manual review
Recommendations
Correct the values to ensure the proper fee distribution.