Rock Paper Scissors

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

[L-131] Wrong place of transferFrom Re-entrancy Risk

Summary

The createGameWithToken function performs the external ERC‑20 transferFrom Call before updating critical game state, enabling a malicious token contract to reenter and corrupt the freshly initialized game data.

Vulnerability Details

If the game state was not updated before the call, then that user reenters that function with the old state and does malicious actions.

Solution

Reorder to Follow Checks → Effects → Interactions

Like that :

uint256 gameId = gameCounter++;
winningToken.transferFrom(msg.sender, address(this), 1);
Updates

Appeal created

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

Support

FAQs

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