Mystery Box

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

Lack of Event Emissions for Critical Operations

Summary

The MysteryBox contract does not emit events for several critical operations, reducing transparency and making it difficult to track important contract state changes.

Vulnerability Details

The following functions perform critical operations without emitting events:

  • setBoxPrice: Changes the box price

  • addReward: Adds a new reward to the pool

  • changeOwner: Transfers contract ownership

  • Box purchase, opening, and reward claiming operations

Impact

  • Reduced contract transparency

  • Difficulty in auditing contract behavior over time

  • Limited integration capabilities with frontend applications

Tools Used

Manual code review

Recommendations

  1. Implement event emissions for all critical state-changing operations:

    • BoxPriceChanged

    • RewardAdded

    • OwnershipTransferred

    • BoxPurchased

    • BoxOpened

    • RewardsClaimed

  2. Emit these events in the respective functions after state changes.

  3. Update the contract's documentation to reflect the new events and their purposes.

By implementing these recommendations, the contract will provide better transparency, easier auditability, and improved integration with external systems.

Updates

Appeal created

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