newGaugePoints
is not capped to MAX_GAUGE_POINTS
in a certain case leading to runaway guagePoints.
In the defaultGaugePointFunction()
function, gaugePoints
needs to be capped to MAX_GUAGE_POINTS
to avoid runaway gaugePoints and there is a check to ensure that in case of percentOfDepositedBdv < optimalPercentDepositedBdv.mul(LOWER_THRESHOLD).div(THRESHOLD_PRECISION)
:
But, in the case of percentOfDepositedBdv > optimalPercentDepositedBdv.mul(LOWER_THRESHOLD).div(THRESHOLD_PRECISION)
:
There is no check for: if (newGaugePoints > MAX_GAUGE_POINTS) return MAX_GAUGE_POINTS;
newGuagePoints
can break the MAX_GAUGE_POINTS
threshold leading to more guagePoints being returned than intended. This breaks the MAX_GAUGE_POINTS
invariant and users can receive more guagePoints and consequently more incentives than intended.
Manual Analysis
Add check for if (newGaugePoints > MAX_GAUGE_POINTS) return MAX_GAUGE_POINTS;
as follows:
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.