Calculation of rewardPerVoter in _distributeRewards() is wrong
in this logic uint256 rewardPerVoter = totalRewards / totalVotes;
we're considering the totalRewards with totalVotes, totalVotes were the total number of voters who participated in this VotingBooth, So, once rewards distributed there is still remaining eth exist in the contract.
The voters in s_votersFor will get only a small share due to considering the whole voters in this VotingBooth.
Remix IDE
Need to re-write the logic, by considering only the voters in s_votersFor. So the voters in s_votersFor will get a correct share of reward.
The else block in
Green highlighted one is recommended
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.