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

Rewarding voters

Summary

The reward to be distributed per voter in the event of a successfull proposal is wrong.

Vulnerability Details

At line 192:

uint256 rewardPerVoter = totalRewards / totalVotes;

This is wrong. It should be:

uint256 rewardPerVoter = totalRewards / totalVotesFor;

instead

Impact

Medium, potential rewards for the upVoters are less, disincentivising users to vote.

Tools Used

Just reading the code.

Recommendations

Swap line 192 with the code:

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.