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

Funds locked in contract due to Reward Distribution

Summary

Funds can be locked in the VotingBooth contract due to wrong logic for Reward Distribution in _distributeRewards function.

Vulnerability Details

VotingBooth contract is a one-time use smart contract in which funds can only be withdrawn via Reward Distribution in _distributeRewards function.
Due to this, after the voting is over, funds left inside the contract can never be recovered.

One such case depicting the vulnerability - When 4 voters votes in favor of the proposal and wins the proposal. Reward/funds in contract is 10 ether. This case will cause the first 3 voters to get 2 ethers each and last voter will get 3 ether. Total comes out to be 9 ether and 1 ether is left in the contract with no way to recover it.

Impact

Funds are locked in the contract with no way to recover them.

Tools Used

Manual Review

Recommendations

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.