Platform: Code4rena
Start Date: 03/05/2023
Pot Size: $60,500 USDC
Total HM: 25
Participants: 114
Period: 8 days
Judge: Picodes
Total Solo HM: 6
Id: 234
League: ETH
Rank: 41/114
Findings: 1
Award: $253.66
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: rbserver
Also found by: deadrxsezzz, rvierdiiev
253.665 USDC - $253.66
Users can get more or less voting power than what they should be able to.
According to the docs:
Voting power is the minimum of the amount of votes available at a snapshot block 33 blocks prior to voting start, and at the vote starting block.
However, due to the current implementation there are 2 scenarios where the implementation would malfunction and wrong number of votes would be accumulated
voteStartBlock_ = voteStartBlock_ != block.number ? voteStartBlock_ : block.number - 1;
Although the user has had 100 tokens at both the vote starting block and at the 33 blocks prior snapshot block, he has no voting power.
block.number - 1
where user B still had 100 Ajna tokens. Therefore, user B will get voting power for 100 Ajna tokens, although at the time of voting he had 0 tokensManual review
Do not accept voting in the vote starting block
require(voteStartBlock_ != block.number)
Error
#0 - c4-judge
2023-05-18T15:49:07Z
Picodes marked the issue as primary issue
#1 - c4-judge
2023-05-18T16:01:02Z
Picodes marked issue #288 as primary and marked this issue as a duplicate of 288
#2 - c4-judge
2023-05-31T14:02:36Z
Picodes marked the issue as satisfactory