Rewards are meant to be distributed using distributeRewards
to the guage.
The issue is that _calculateReward
returns an incorrect value for the rewards periodEmission
resulting guage
reverts with RewardCapExceeded
.
Assuming we have two gauge (A and B), an a monthly emission rate
1_000_000e18 (_calculateRWAEmission)
typeWeight = 5000 => 50%
WEIGHT_PRECISION = 10000 => 100%
MAX_TYPE_WEIGHT = 10000 => 100%
For simplicity, both gauge A and B have g.weight = 5000 (50%)
Then, totalWeight = 10000 = 100%
gaugeShare = (5000 * 10000) / 10000 = 5000 (50%)
typeShare = 5000 (50%)
With periodEmission (monthly) = 1_000_000e18
calculateReward for gauge A = (1_000_000e18 * 5000 * 5000) / (10000 * 10000) = 250_000e18
calculateReward for gauge B = (1_000_000e18 * 5000 * 5000) / (10000 * 10000) = 250_000e18
Within a single distribution both guage A and gauge B would receive a reward of 250_000e18
each totaling 500_000e18
a single period, while the monthly distribution is 1_000_000e18
.
Rewards would not be be distributed within periodEmission leading to reverts on gauge emission cap
The number of rewards to be shared to a guage
should also factor the period duration of the emission.
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.