President Elector

First Flight #24
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of events (emit) reduces transparency and makes difficult tracking in RankedChoice Contract

Summary

The RankedChoice contract does not emit events (emit) for critical actions such as vote submission and the election of a new president. This omission reduces transparency, makes it difficult for external systems to track key actions, and complicates the ability to audit or debug interactions with the contract.

Vulnerability Details

Key functions like rankCandidates() and selectPresident() do not trigger events to signal when a vote is submitted or when a president is elected. Events are crucial for allowing external systems, users, and developers to monitor and trace key actions in the contract without needing to query the blockchain directly.

Impact

  • Reduced transparency: The lack of events makes it difficult to track critical actions like vote submissions and the election of a president, reducing the overall transparency of the protocol.

  • Increased gas costs: Direct state queries are required to check the outcome of actions like voting or electing a president, increasing gas usage.

  • Harder to debug: Without events, developers and auditors cannot easily trace key actions, making debugging and monitoring more difficult.

Tools Used

Manual review

Recommendations

Add following events and emit in rankCandidates() and selectPresident():

event VoteSubmitted(address indexed voter, address[] orderedCandidates);
event PresidentElected(address indexed newPresident);
Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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