Trick or Treat

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

L-5: Events Missing `indexed` Parameters

Description:

Events are defined without indexed parameters, which are crucial for efficient event filtering and querying off-chain.

Instances:

  1. TreatAdded Event (Line 25):

    event TreatAdded(string name, uint256 cost, string metadataURI);
  2. Swapped Event (Line 26):

    event Swapped(address indexed user, string treatName, uint256 tokenId);
  3. FeeWithdrawn Event (Line 27):

    event FeeWithdrawn(address owner, uint256 amount);

Impact:

  • Inefficient Event Filtering:

    • Without indexed parameters, it's more challenging to search and filter events based on specific criteria, which can hinder data retrieval and analysis.

  • Developer and User Inconvenience:

    • Off-chain applications and users may find it difficult to track events related to specific treats, token IDs, or owners.

Recommendation:

  • Add Indexed Parameters to Events:

    • Modify events to include indexed keywords for relevant fields.

    • Updated TreatAdded Event:

      event TreatAdded(string indexed name, uint256 cost, string metadataURI);
    • Updated Swapped Event:

      event Swapped(address indexed user, string indexed treatName, uint256 tokenId);
    • Updated FeeWithdrawn Event:

      event FeeWithdrawn(address indexed owner, uint256 amount);
  • Limit Indexing to Essential Fields:

    • Remember that a maximum of three parameters can be indexed per event. Choose the most critical fields for indexing.

Updates

Appeal created

bube Lead Judge 10 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.