The distributeRevenue()
function in the contract has a flaw in its revenue distribution logic, particularly when distributing rewards
to active gauges
of a specific type
. This issue arises due to integer truncation
during the calculation of gauge shares
, which can lead to leftover
undistributed revenue.
When the distributeRevenue()
function is called with a specific gaugeType
and an amount
, the function calculates the share for veRAAC
holders and attempts to distribute this share among active gauges
.
However, due to integer division, the calculated shares may not sum up to the total revenue share during distibution.
This results in unallocated funds.
Consider the following scenario:
amount = 2500
veRAACShare = 2000
(calculated as 2500 * 80 / 100
)
Active gauges: 3
with weights of 100 each
(total weight = 300
)
During distribution:
Due to truncation, each gauge receives:
Total distributed to 3 gauges:
Leftover amount:
The failure to distribute the entire revenue share can lead to inefficiencies in the reward distribution mechanism where rewards intended to be ditributed to gauges remain unallocated.
Manual Review
The distribution logic should be modified to ensure that any leftover
amount is allocated to the last gauge
during the distribution process.
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.