The RankedChoice
smart contract allows voters to rank candidates for the election of a president. However, a potential vulnerability exists due to the absence of time-based restrictions on when voters can modify their votes. This could allow last-minute vote changes, potentially leading to manipulative voting behavior and unfair election outcomes.
In the current implementation of the RankedChoice
smart contract, voters can change their rankings at any time before the selectPresident
function is called. Since there is no deadline or lock-in period for finalizing votes, this means voters have the flexibility to alter their choices as late as possible in the election process. This introduces an element of unpredictability and opens the system to strategic manipulation, where voters may wait for the results of others' rankings and adjust their votes accordingly.
Specifically, the contract lacks any function or mechanism that prevents vote changes after a certain period. The system only enforces the selection of the president after the presidentalDuration
has passed but doesn’t limit voter activity within that time window.
The absence of time-based restrictions could lead to voters adjusting their rankings at the last moment, creating an unfair advantage for those with knowledge of others' rankings, late-stage vote changes could drastically shift the election results, rendering earlier votes less impactful and also decreased election integrity where without a clear voting deadline, the election process may appear less transparent and more susceptible to tactical voting.
Manual Review
Introduce a deadline or time-based restriction, such as a predefined voting period. Once the deadline is reached, votes should be locked, and no further changes to rankings should be allowed or modify the selectPresident
function to only accept rankings that were finalized before the voting deadline. This ensures that the election results are based on the votes that were submitted within the allowed time window.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.