Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

VotingBooth::_distributeRewards reward distribution error

Summary

VotingBooth::_distributeRewards reward distribution error

Vulnerability Details

distributes rewards to the for voters if the proposal,but in the _distributeRewards function, there is an error in the calculation where totalVotes is incorrectly used as the divisor for totalRewards. This includes individuals who voted against the proposal in the reward calculation, resulting in an inaccurate distribution of ETH amount to those who voted in favor. As a consequence, the allocated ETH amount to supporters is incorrectly calculated and ends up being less than intended, with the excess amount erroneously remaining in the VotingBooth contract.

Impact

The amount of ETH received by voters supporting the proposal is miscalculated, resulting in less than the deserved amount,The unallocated portion of ETH will be incorrectly left in the VotingBooth contract.

Tools Used

Foundry

Recommendations

Modify it to divide totalRewards by s_votersFor.length.

Updates

Lead Judging Commences

0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

VotingBooth._distributeRewards(): Incorrect computation of rewardPerVoter

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.