After the quorum has been reached, if the for votes are greater than the against votes, the ETH reward must be distributed among the for voters, but in VootingBooth::_distributeRewards the rewardPerVoter calculation wrongly divides the total reward by all voters instead of just for voters, causing ETH to be stuck in the contract forever.
Additionally, the for voters will receive less reward.
The ETH reward distributed among the for voters will be less than expected, and ETH will be stuck in the contract forever.
Create a proposal with a reward of 10 ETH and 5 voters.
Voter 1 votes for the proposal.
Voter 2 votes for the proposal.
Voter 3 votes against the proposal.
Voters 1 and 2 should each receive 5 ETH, but they receive less.
The voting booth contract should have 0 ETH, but this is not the case as proven in the below PoC
The easiest way to resolve this issue would be to calculate the rewardPerVoter as totalRewards / totalVotesFor instead of totalRewards / totalVotes.
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.