TwentyOne

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

Potential Denial of Service Due to Unhandled Game States

Root Cause

The contract assumes that the game will always end properly via the endGame function. There is no mechanism to handle scenarios where a player might abandon a game without completing it.

Impact

  • Stalled Games: Players who abandon games may have their state preserved indefinitely, preventing them from starting new games.

  • Storage Bloat: Accumulated data from incomplete games can consume unnecessary storage on the blockchain.

  • Resource Wastage: The contract may maintain unnecessary state information, leading to inefficiencies.

Recommendations

  • Game Timeout Mechanism: Implement a timeout feature that automatically ends games after a certain period of inactivity.

  • State Cleanup: Provide a function to clean up or reset game states for inactive players.

  • Player Notifications: Inform players about the timeout policy to encourage timely completion of games.

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.