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

``VotingBoot::_distributeRewards`` sends funds based on the totalVoters not totalVotersFor ,leads to wrong calculations

Summary

VotingBoot::_distributeRewards sends funds based on the totalVoters not totalVotersFor ,leads to wrong calculations

Vulnerability Details

uint256 rewardPerVoter = totalRewards / totalVotes;

Impact

the rewards according to the natspec documentation are meant to be distributed amongst the voters for not the total voters
as seen in the VotingBoot::_distributeRewards function

uint256 rewardPerVoter = totalRewards / totalVotes;

Tools Used

manual review

Recommendations

- uint256 rewardPerVoter = totalRewards / totalVotes
+ uint256 rewardPerVoter = totalRewards / totalVotesFor
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year 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.