Wrong distribution of rewards between voters. Rewards are distributed among all allowed voters, but only "for" voters receive them. The rest of the rewards locked on the contract.
In the "_distributeRewards" function, rewards are distributed, and if the vote is successful, according to the logic of the contract, the total amount of funds will be divided among the voters "for". The issue is that this amount is divided by the number of all voters, and only users from the "s_votersFor" list will receive it. That is, each voter will receive a smaller share than they should.
For example, the creator sends 5 ethers to the contract and adds 9 voters. 4 votes for, 1 against, voting is over. The value of "rewardPerVoter" is equal to 1 ether, 4 voters will receive 1 ether each. The rest (1 ether) will be locked in the contract.
Paste this code in VotingBoothTest.sol:
Locking of funds on the contract.
Manual rewiew, forge.
Recommended add "totalVotesFor" in line 192 instead of "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.