The calculations for the reward distribution in the VotingBooth::_distributeRewards()
is done wrong which leads to the user who have votes for getting less amount of rewards.
In the VotingBooth::_distributeRewards()
reward per user is calculated by
uint256 rewardPerVoter = totalRewards / totalVotes;
Here , totalVotes are used to calculate the rewards which means the count of voters who have voted against this proposal is also being counted in the total votes.
This leads to some amount of rewards getting sent to the voters and few stays like it is in the contract.
User who voted for the proposal get less reward
Foundry,Vs code.
Change the calculation for the distribution of rewards in the VotingBooth::_distributeRewards()
function as shown below.
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.