TwentyOne

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

Players Can Start a Game Without Sufficient Ether

Root Cause

The startGame function requires a minimum of 1 ether to start the game:

require(msg.value >= 1 ether, "not enough ether sent");

However, ether values can include more decimal places (wei), and a player might accidentally send slightly less than 1 ether due to miscalculations, leading to transaction failures.

Impact

  • User Frustration: Players may experience failed transactions and lose gas fees.

  • Reduced Participation: The high entry cost may discourage players from engaging with the game.

  • Financial Loss: Repeated failed attempts can lead to unnecessary financial loss for players.

Recommendations

  • Accept Smaller Bets: Allow players to start the game with smaller amounts of ether to encourage participation.

  • User Interface Guidance: Provide clear instructions on the required amount of ether, possibly with exact values in wei.

  • Graceful Handling: Consider implementing a more informative error message or a fallback mechanism for slight discrepancies in sent amounts.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.