The function joinGameWithToken()
does not verify whether playerB
has already joined the game. In edge cases with two concurrent calls, both could pass validation and overwrite the playerB
field.
Without a check that game.playerB == address(0)
, two users calling joinGameWithToken()
at the same time could both enter the game, race to store their address, and cause inconsistent state.
Race condition during game joining
Multiple users believe they joined same game
Manual code review
Add a condition to enforce single joiner:
This protects against race conditions and ensures that only one player joins per game.
Game state remains Created after a player joins
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.