The GaugeController
's addGauge
function incorrectly passes unscaled weight values to the TimeWeightedAverage
library's createPeriod
function, which expects weights to be scaled by 1e18. This scaling mismatch results in significantly undervalued time-weighted calculations for gauge weights.
In the GaugeController
contract, gauges can be added with an initial weight of zero, which are then converted to a minimum weight of 1:
The TimeWeightedAverage
library's weight parameter in createPeriod
expects values scaled by 1e18, as documented in the library. This scaling is crucial for precise time-weighted calculations similar to how Curve and Balancer handle weights in their gauge systems
However, the GaugeController
passes the raw periodWeight
value without scaling it by 1e18 for both the initialValue
and weight
parameters.
The same unscaled value is used for both parameters.
The weight
parameter should be scaled by 1e18
This scaling mismatch means that gauge weights are effectively divided by 1e18 in all time-weighted calculations, severely undervaluing their impact.
All time-weighted calculations in the gauge system are off by a factor of 1e18.
Manual Review
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.