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

Contract will lock/burn Eth upon vote completion

Summary

If there are any votes against the proposal, a corresponding amount of the totalRewards will be locked/burned forever.

Vulnerability Details

The rewardPerVoter is calculated based on the totalVotes (which includes both votes for and against the proposal), but the rewards are only distributed to the voters who voted for the proposal (s_votersFor).

If there are any votes against the proposal, the total rewards will not be perfectly divisible by the number of votes for the proposal,

Impact

The fraction of totalVotesAgainst / totalVotes is the fraction of the totalRewards that will be locked/burned forever.

Tools Used

Recommendations

This could potentially be improved by calculating the rewardPerVoter based on the totalVotesFor instead of totalVotes

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.