Vote will end early with a wrong result when there is an even number of votes if s_totalAllowedVoters
is 3 or 7, and remaining voters who can change the result of the vote can't vote
An allowList
with a length of 3, 5, 7 and 9 is allowed
When the allowList has a length of 3 or 7, it will reach the MIN_QUORUM
of 51% when there is an even number of votes :
For example, s_totalAllowedVoters
is 3, and voter1 wants to vote against, and voter2 and voter3 wants to vote for, so there is 2 for votes and 1 against vote, the for voters should win the vote and voting reward should be distributed to the for voters
However, it reaches the MIN_QUORUM
of 51% when there is 2 votes, so voter1 voted against and voter2 voted for, then voter3 who want to vote for can't vote and will revert as the vote has ended, but voter3 can change the result of the vote
After voter2 has voted, it reaches MIN_QUORUM
and the vote will be ended, and there is 1 for vote and 1 against vote which is equal
If the for votes and against votes are equal when it end the vote, it will send the reward to the creator, but there are more voters that want to vote for that the proposal should pass and the reward should be distributed to the for voters instead
The vote can have a wrong result and proposal supposed to pass can be defeated
Manual review
Change the vote() function so it won't end early when there is an even number of votes
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.