The _calculateDistribution
function in FeeCollector.sol
distributes fees among different categories based on predefined share percentages. However, due to Solidity’s integer division behavior, there is a risk that small allocations will round down to zero, leading to an unintended loss of funds for certain recipients.
The issue arises because the function calculates weighted shares using:
BASIS_POINTS = 10,000, the division can result in rounding down to zero if the previous multiplication is too small.
Fee loss and possible fee abuse
Funds misallocation
Manual Review
Increase precision in intermediate calculations using 1e18 before applying integer division or Use a round-up function to avoid rounding issues
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.