Using GaugeController users can vote for gauges increasing their gauge weight. This can be done via vote()
function. User can specify a weight or a percentage of their voting power they wisht to delegate.
_updateGaugeWeight()
will subtract user's old vote and add the new one.
The problem arises when users vote again after their voting power has changed. Assume a scenario where user has 100 voting power and votes with 100% of it for one gauge. Now gauge's weight is 100. User's voting power increases to 200, and now if he wishes to withdraw his vote or add additional weight to the gauge, the _updageGaugeWeight()
will revert. This will happen because the function will subtract (oldWeight) 100% * 200 (user's current voting power), while gauge weight is only equal 100. If the gauge has other people voting for it, this action will subtract from other peoples votes.
DoS of the vote function or incorrect accounting of gauge's weight.
Please add this test to GaugeController.test.js
and run it with npx hardhat test --grep "DoS or incorrect accounting"
.
When voting for a gauge apart from storing user's old weight, store the voting power he has voted with, so when _updateGaugeWeight()
is called, it will subtract oldWeight using original 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.