Summary
FeeCollector implement fees structures which should sum up to BASIS_POINTS for each fee type. For swap and royalty fees initialization, it doesn't default to BASIS_POINTS
Vulnerability Details
In updateFeeType, fees for a feeType should sum up to BASIS_POINTS
uint256 public constant BASIS_POINTS = 10000;
* @notice Updates parameters for a specific fee type
* @param feeType Fee type to update
* @param newFee New fee parameters
*/
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);
}
But the fee types initialization has a misconfiguration causing it to not sum up to BASIS_POINTS
* @dev Initializes default fee types according to protocol rules
*/
function _initializeFeeTypes() internal {
feeTypes[0] = FeeType({
veRAACShare: 8000,
burnShare: 0,
repairShare: 0,
treasuryShare: 2000
});
[...]
feeTypes[6] = FeeType({
veRAACShare: 500,
burnShare: 500,
repairShare: 1000,
treasuryShare: 0
});
feeTypes[7] = FeeType({
veRAACShare: 500,
burnShare: 0,
repairShare: 1000,
treasuryShare: 500
});
}
Impact
The impact is low as it will send the rest of the share to treasury but this is confusing and unexpected and should be configured properly from the beginning.
Recommendations
Set all feeTypes to sum up to BASIS_POINTS from initialization