President Elector

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

Missing event emission for critical action: `President Selection`.

Description

The selectPresident() function performs a critical action — choosing a new president after each election. However, this function does not emit any event to notify external systems that a new president has been selected. Event emissions are vital for transparency, off-chain logging, and front-end applications that rely on updates from the contract.

Impact

Off-chain systems or front-end applications will not be notified about the election of a new president, potentially causing delays in updating relevant systems, records, or workflows.

Tools Used

Manual review, vscode

Recommended Mitigation

Add an event declaration and emit the event each time a new president is selected. For example:

// Event declaration before USER FUNCTIONS section
+ event PresidentSelected(address indexed newPresident);
// Inside `selectPresident()` function, after setting the new president:
+ emit PresidentSelected(s_currentPresident);
Updates

Lead Judging Commences

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

Appeal created

v1vah0us3 Submitter
9 months ago
inallhonesty Lead Judge
9 months ago
inallhonesty Lead Judge 9 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.