Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

[L-2] Quality: Hardcoded Values and No Game Cancellation by Player B

Description:

Currently, only playerA is allowed to cancel a game if no one has joined yet (cancelGame). If playerB joins but playerA never proceeds, playerB is left stuck with no recourse.

function cancelGame(uint256 _gameId) external {
Game storage game = games[_gameId];
require(game.state == GameState.Created, "Game must be in created state");
require(msg.sender == game.playerA, "Only creator can cancel");
_cancelGame(_gameId);
}

Impact

Poor user experience

Games can become stuck indefinitely for playerB

Frustrating for users in stalled or abandoned matches

Recommended Mitigation

Allow both players to cancel the game if there is no progress after a reasonable timeout (e.g., no commits within a specified period).

Updates

Appeal created

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Player B cannot cancel a game if Player A becomes unresponsive after Player B joins

Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Player B cannot cancel a game if Player A becomes unresponsive after Player B joins

Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating

Support

FAQs

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