The distributeRevenue() function updates the revenueShares[gaugeType] before calling _distributeToGauges(). However, due to integer division rounding errors, some undistributed amount remains.
In distributeRevenue():
revenueShares[gaugeType] adds the full amount (veRAACShare).
_distributeToGauges(gaugeType, veRAACShare) distributes slightly less due to rounding.
Assume amount = 1000, and there are 3 active gauges with equal weights.
_distributeToGauges() has rounding errors:
gaugeShare = (1000 * 3333) / 10000 = 333 // Rounded down per gauge.
3 × 333 = 999 distributed.
1 unit remains undistributed.
This 1-unit difference accumulates over time, making the revenueShares inaccurate.
Incorrect Accounting: revenueShares[gaugeType] records a higher amount than actually distributed.
manual
Modify distributeRevenue() to only add the actually distributed amount to revenueShares[gaugeType].
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.