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

Integer Division

Summary

The voting process completion is controlled by an integer division, potentially leading to unexpected results.

Vulnerability Details

The line totalCurrentVotes * 100 / s_totalAllowedVoters >= MIN_QUORUM uses integer division, which always rounds down.

Impact

The voting process may not behave as the MIN_QUORUM implies that it does.

Users may complain that the voting process is not transparent.

Tools Used

Recommendations

It would be safer to rearrange this expression to avoid the need for multiplication by 100, or to use a library for safe math operations.

Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

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