TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing `indexed` Fields in Events Limits Searchability

Root Cause

The events defined in the contract do not use indexed parameters:

event PlayerLostTheGame(string message, uint256 cardsTotal);
event PlayerWonTheGame(string message, uint256 cardsTotal);
event FeeWithdrawn(address owner, uint256 amount);

Impact

Without indexed fields, it is difficult for off-chain services and users to filter and search for specific events in the transaction logs. This reduces the usability of the events for monitoring and analytics.

Recommendations

  • Add indexed Parameters: Mark frequently queried parameters as indexed:

    event PlayerLostTheGame(address indexed player, string message, uint256 cardsTotal);
    event PlayerWonTheGame(address indexed player, string message, uint256 cardsTotal);
    event FeeWithdrawn(address indexed owner, uint256 amount);
  • Limit to Three Indexed Fields: Remember that up to three parameters can be indexed per event.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.