Funds can be locked forever in a game in a situation when one of players never commits his move due to either malicious behaviour or life-related event.
There might be a situation when both players entered the game and then one of the players commits its move as a hashed value and waits for the other player. However, the second player never commits their move due to being malicious or because of some life-related events which prevent them from submitting the move. As a result, the first player who submitted a move wants to exit the game and return their locked funds, but they are stuck in the game because the cancelGame
function cannot be called (the game state is not Created
anymore), and timeoutReveal
function cannot be called either.
Users' funds are locked in the game without possibility to retrieve them.
Manual code review
Foundry
The following proof of code represents a situation where Player A creates game with ETH bet. and waits for another player to join.
When Player B joined the game, the Player A decides to make first move and commits move.
When 2 days passed and no there no move from the Player B, Player A decides to cancel the game and retrieve his funds, but cannot do so.
The following test_fundsStuckWhenOnePlayerDoesntCommitMove
test function can be placed in the RockPaperScissorsTest.t.sol file:
Add commit phase timeout with a new `commitDeadline` and timeout logic:
Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating
Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.