Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Valid

FeeCollector fee initialization doesn't follow sumup to BASIS_POINTS for swap and royalty fees

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();
// Validate fee shares total to 100%
// @audit Weird behavior compared to default fees for feeType 6 & 7 (2%total, not 10_000)
// @audit HIGH => causes lost funds if not 100% (or 10_000)
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 {
// Protocol Fees: 80% to veRAAC holders, 20% to treasury
feeTypes[0] = FeeType({
veRAACShare: 8000, // 80%
burnShare: 0,
repairShare: 0,
treasuryShare: 2000 // 20%
});
[...]
// Buy/Sell Swap Tax (2% total)
// @audit Doesn't sum up to 10_000
feeTypes[6] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 500, // 0.5%
repairShare: 1000, // 1.0%
treasuryShare: 0
});
// NFT Royalty Fees (2% total)
// @audit Doesn't sum up to 10_000
feeTypes[7] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 0,
repairShare: 1000, // 1.0%
treasuryShare: 500 // 0.5%
});
}

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

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Fee shares for fee type 6 and 7 inside FeeCollector do not total up to the expected 10000 basis points, this leads to update problems, moreover they are 10x the specifications

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!