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

The vote end when `MIN_QUORUM` is reached, and remaining for voters can't receive their reward

Summary

The vote end when MIN_QUORUM is reached, and remaining for voters can't receive their reward

Vulnerability Details

The vote end when MIN_QUORUM is reached, and it only add voters to s_votersFor when they call vote() which will revert after MIN_QUORUM is reached and the vote has ended, and remaining for voters will not be included in s_votersFor, which is used to distribute rewards

PoC

function testForVoterCantReceiveReward() public {
uint256 startingAmount = address(this).balance;
vm.prank(address(0x1));
booth.vote(true);
vm.prank(address(0x2));
booth.vote(true);
vm.prank(address(0x3));
booth.vote(true);
vm.prank(address(0x4));
try booth.vote(true) {} catch {
console.log("4th voter can't vote");
}
assert(address(0x4).balance > startingAmount);
}

Impact

Voters who are late and want to vote for will not receive their reward

Tools Used

Manual review

Recommendations

Don't end the vote when MIN_QUORUM is reached

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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