The RankedChoice smart contract lacks a structured tie-breaking mechanism, resulting in ties being handled arbitrarily. This could cause a candidate to be prematurely eliminated during the voting rounds, potentially leading to unfair or inaccurate election outcomes.
The contract's _selectPresidentRecursive function handles the elimination of candidates with the fewest votes in each round of the election. However, if two or more candidates have the same number of votes (i.e., a tie), the contract does not have a defined process to break the tie. Instead, it relies on the order of iteration, which could arbitrarily eliminate one of the tied candidates.
In this code, if two candidates have an equal number of votes, the one that appears later in the loop is arbitrarily chosen for elimination. This can result in an unfair removal of a candidate.
This arbitrary elimination of candidates could result in a situation where a candidate who should have advanced based on voter preference is removed from the race prematurely, affecting the fairness of the election process. The randomness of this tie-breaking mechanism undermines the legitimacy of the results, especially in close elections.
Manual Review
Introduce a structured tie-breaking process that could involve comparing the rankings from subsequent rounds to determine which tied candidate should advance.
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.