Core Contracts

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

Precision Loss in Fee Distribution Calculation

Summary

The fee distribution calculations suffer from precision loss due to integer division, which may result in inaccurate fee allocations.

Vulnerability Details

In the _calculateDistribution function, the contract computes fee shares using expressions like:

uint256 weight = (feeAmount * BASIS_POINTS) / totalFees;
shares[0] += (weight * feeType.veRAACShare) / BASIS_POINTS;

Because Solidity uses integer arithmetic, this division in weight calculation can truncate fractional parts, causing rounding errors. Over time and across multiple fee types, these small losses can accumulate, leading to a significant discrepancy between the intended and actual distribution of fees.

Impact

Cumulative precision loss can undermine the integrity of the fee distribution mechanism.

Tools Used

Manual Review

Recommendations

  • Explore using fixed-point math libraries that support fractional calculations to improve accuracy.

  • divide by totalFees after shares calcualtion

Updates

Lead Judging Commences

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

FeeCollector distributes too much to treasury when fee amounts are small relative to total due to precision loss in (feeAmount * BASIS_POINTS) / totalFees

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

FeeCollector distributes too much to treasury when fee amounts are small relative to total due to precision loss in (feeAmount * BASIS_POINTS) / totalFees

Support

FAQs

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

Give us feedback!