In GaugeControllercontract, function vote()is used for user to vote for gauge:
Lets look at formula to calculate new weight:
There are multiple issues in this formula, and this voting mechanism:
Voting might be reverted due to underflow: If only one user voting for that gauge, and their voting power is increase, they can not voting after voting for first time because oldGaugeWeight - (oldWeight * votingPower / WEIGHT_PRECISION) will revert due to underflow. Or another cases that can lead to unintentionally underflow is someone what to break gauge weight by doing these actions:
Vote with dust amount with maximum weight (for example: 10000)
Increase voting power by getting more veraac token, then voting for that gauge with smaller weight (for example: 100), that lead to weight smaller that before voting.
Wrong votingPower is used in formula to calculate newGaugeWeight: it can be seen that this formula will not change if user increase their voting power and keep the same old weight and new weight. Minus value should be rely on old voting power, not same as new voting power that used in the new one
Wrong formula to calculate new weight, and voting can be reverted in some cases
Update voting mechanism.
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.