In gauge controller, gauges can receive revenue through the distributeRevenue()
function, which internally calls _distributeToGauges()
. The calculations used to distribute revenue depend on the weight of each gauge.
The same can be said about distributeRewards()
function that is used to distribute rewards to a specific gauge. The amount to distribute is calculated inside _calculateReward()
function and also depends on the weight of a given gauge.
In both cases, the problem is the fact that time weighted average is not used to calculate weights. When a gauge is first added, the period with initial weight is created for that gauge.
However, later it's disregarded, as when the user votes for a gauge, the period is not updated and when the revenue/rewards calculations are being performed, the weight used is raw weight instead of time-weighted one. This allows anyone to manipulate revenue/reward distribution by front-running calls to distributeRevenue()
and distributeRewards()
with a call to vote to increase the gauge's weight.
Anyone can manipulate revenue/rewards distribution with frontrunning to increase the gauge's weight before calculations of revenue/rewards.
Inside GaugeController, use time-weighted average when calculating rewards and revenue.
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.