Rock Paper Scissors

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

Game Creation Failure

Summary

Syntax error prevents ETH game creation. The code uses invalid mapping access which would cause a compilation error, making all ETH-based games non-functional

Vulnerability Details

The code attempts to access game storage using invalid array syntax [gameId] instead of the correct mapping access games[gameId]. This would cause a compilation error, but if it somehow compiled, would result in runtime failures.

function createGameWithEth(...) ... {
Game storage game = [gameId]; // Should be games[gameId]
}

Impact

Renders the game totally unplayable with native eth

Tools Used

Manual Review

Recommendations

function creategameWithEth(...) ... {
-- Game storage game = [gameId]; // remove this line
++ Game storage game = games[gameId]; // replace with this
}
Updates

Appeal created

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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