Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Event Emission on `timeoutReveal()`

Description:

The timeoutReveal function allows a player to close a game early (in case of not revealing the opponent). However, no information is issued on the blockchain to indicate that a player has won by timeout or that the game has been canceled.

*** Recommendation:**

Add one or more events as appropriate:

event GameTimeoutWin(uint256 indexed gameId, address indexed winner);
event GameTimeoutCancelled(uint256 indexed gameId);
- _finishGame(_gameId, game.playerA);
+ _finishGame(_gameId, game.playerA);
+ emit GameTimeoutWin(_gameId, game.playerA);
- _finishGame(_gameId, game.playerB);
+ _finishGame(_gameId, game.playerB);
+ emit GameTimeoutWin(_gameId, game.playerB);
- _cancelGame(_gameId);
+ _cancelGame(_gameId);
+ emit GameTimeoutCancelled(_gameId);
Updates

Appeal created

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational

Code suggestions or observations that do not pose a direct security risk.

Support

FAQs

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