The fee distribution calculations suffer from precision loss due to integer division, which may result in inaccurate fee allocations.
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.
Cumulative precision loss can undermine the integrity of the fee distribution mechanism.
Manual Review
Explore using fixed-point math libraries that support fractional calculations to improve accuracy.
divide by totalFees after shares calcualtion
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.