##Summary
Protocol has 2 types of gauges: RWA and RAAC gauges. Each type has its own reward amount emission.
GaugeController calculates and distribute the rewards as a percent of total weight of all active gauges. Instead it should calculate the rewards as a percent of the total weight of all active gauges of the same type as the gauge for which rewards are being distributed.
GaugeController can have 2 types of gauges: RWA gauges and RAAC gauges. Each type has it's own reward emission schedule( defined by amount and duration)
GaugeController::distributeRewards can be called to distribute the rewards to the specified gauge.
The reward amount is calculated by _calculateReward:
gaugeShare is the percentage of gauge's weight relative to the total weight of all active gauges
typeShare which is based on typeWeights admin set multiplier
periodEmission is the amount to be distributed to all gauges of the same type as gauge's type (g.gaugeType);
The reward is calculated as a percentage of the gauge's weight relative to the sum of all active gauges. This is wrong because each gauge type has it's own amount of rewards configured and the gaugeShare is applied to that amount.
The gaugeShare should be calculated as a % of the total weights allocated to all gauges of of the same type.
Gauge rewards are incorrectly calculated. Gauges receive less rewards.
Implement a new function similarly to getTotalWeight(). It should return the weight of all active gauges for the given GaugeType.
Use this function to calculate the correct gaugesShare, passing the gauge's type as argument .
Additionally, the typeWeights admin set mapping has a simmilar purpose as _calculateRWAEmission and _calculateRAACEmission functions. To avoid confusion and reward configuration errors, consider removing the typeWeights mapping.
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.