Core Contracts

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

updateFeeType in FeeCollector.sol does not work for feeTypes[6] and feeTypes[7]

Summary

The updateFeeType() function in FeeCollector.sol checks that the newFee adds up to 10,000.

However, there are some fee type that does not intend for the fee to add up to 10,000, like the Buy/Sell Swap Tax fee (2%) and the NFT Royalty Fees (2%).

Vulnerability Details

The updateFeeType() function checks that the feeType must add up to BASIS_POINTS (10,000)

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%
> if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
feeTypes[feeType] = newFee;
emit FeeTypeUpdated(feeType, newFee);
}

While the check works for some feeTypes, in _initializeFeeTypes(), there are two types of fees that does not add up to 10,000.

// Vault Fees
feeTypes[5] = FeeType({
veRAACShare: 7000, // 70%
burnShare: 0,
repairShare: 0,
treasuryShare: 3000 // 30%
});
// Buy/Sell Swap Tax (2% total)
> feeTypes[6] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 500, // 0.5%
repairShare: 1000, // 1.0%
treasuryShare: 0
});
// NFT Royalty Fees (2% total)
> feeTypes[7] = FeeType({
veRAACShare: 500, // 0.5%
burnShare: 0,
repairShare: 1000, // 1.0%
treasuryShare: 500 // 0.5%
});

Impact

feeTypes[6] and feeTypes[7] cannot be changed appropriately

Tools Used

Manual Review

Recommendations

Ensure that for those two fee types, the fees do not need to add up to 100%, but it must be below 100%, something like this:

if (feeType < 6){
if (newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare != BASIS_POINTS) {
revert InvalidDistributionParams();
}
}
if (feeType == 6 || feeType == 7{
newFee.veRAACShare + newFee.burnShare + newFee.repairShare + newFee.treasuryShare < BASIS_POINTS
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month 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.