Rock Paper Scissors

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

Game state `Revealed` is defined but never used

Description: Game state Revealed is defined in the enum but never used in the contract.

Impact: Players can be confused by the unused state, leading to misunderstandings about the game flow, or make wrong actions.

Recommended Mitigation: change game state to Revealed in revealMove function

function revealMove(uint256 _gameId, uint8 _move, bytes32 _salt) external {
...
+ game.state = GameState.Committed;
if (msg.sender == game.playerA) {
game.moveA = _move;
game.saltA = _salt;
game.state = GameState.Revealed; // change to Revealed
} else {
game.moveB = _move;
game.saltB = _salt;
game.state = GameState.Revealed; // change to Revealed
}
...
}
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.

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.