Submitted by nnez
This vulnerability could allow revived gauges to claim more rewards than intended under specific circumstances, potentially leading to unfair distribution of rewards.
The reviveGauge function fails to update the gauges index to the current global index when reviving a previously killed gauge. While this issue is mitigated in most scenarios by the distributeAll function, which updates all gauges indices to the global index on each epoch, a vulnerability still exists under specific conditions.
Relevant code snippet:
The vulnerability arises in scenarios where:
In this specific scenario, a revived gauge could retain an outdated index, leading to incorrect reward calculations.
Epoch x:
Epoch x+1:
Epoch x+2:
When claiming rewards:
Gauge A claims excess rewards for the period it was killed. This discrepancy, while rare, could lead to unfair reward distribution for all gauges.
High impact - Lead to loss of funds of other gauges.
Low likelihood - Only happen in specific circumstances.
Hence, Medium severity.
The following test tries to demonstrate described scenario where GaugeA is killed and due to specific circumstance doesnt get update before being revived.
Context
b-hrytsak (Fenix) acknowledged and commented:
For this audit, 3 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by KupiaSec received the top score from the judge.
The following wardens also submitted reports: Ch_301 and K42.
