The joinGameWithToken
function performs an unsafe ERC20 token transfer that does not validate the success of the operation. This could allow games to start without properly transferring tokens from the player, leading to inconsistent protocol states and potential loss of funds.
Affected Code:
Root Cause:
The transferFrom
function returns a boolean indicating success, but this value is never checked. If the token transfer fails (e.g., insufficient allowance/balance), the function:
Proceeds as if the transfer succeeded
Updates the game state (playerB
)
Allows the game to start with invalid token custody
Severity: High
Likelihood: Medium (Depends on token implementation)
Consequences:
Games starting without token collateral
Players participating without staking tokens
Protocol accounting inconsistencies
Manual Review: Identified unchecked transferFrom
call
Slither: Flagged unchecked return value (Detector ID: unchecked-transfer
)
Add explicit success checks for token transfers:
joinGameWithEth function lacks a check to verify the game was created with ETH
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.