gauge's weight will be updated to incorrect values, sometimes will even revert due to flawed calculations
When the user vote, related gauge's weight will be updated. During the update, the user's old gauge weight is subtracted first, and then add the user's new gauge weight. The user's old gauge weight is calculated based on the user's current votingPower, not the user's old votingPower, this may cause 'oldGaugeWeight - (oldWeight * votingPower / WEIGHT_PRECISION)' revert.
Please refer to the following steps for POC:
1, create a new gauge;
2, userA vote to this gauge, weight = 5000, voting power = 100, gauge.weight = (5000 * 100) / 10000 = 50.
3, userA get more voting power, veRAACToken.balanceOf(userA)=200.
4, userA vote again to this gauge, weight = 9000, voting power = 200, for GaugeController.sol#L222, since gauge.weight = 50, (oldWeight votingPower / WEIGHT_PRECISION) = (5000 * 200)/10000 = 100, 50 < 100, will revert.
gauge's weight will be update to incorrect values, sometimes will even revert.
manually reviewed
define userVotingPower to record user's voting power, and update gauge's weight accoring to user's voting power.
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.