When creating a game with tokens using createGameWithToken()
, the function does not check if ETH was sent with the transaction. Any ETH accidentally sent will be lost forever.
The createGameWithToken()
function is meant to create games using tokens instead of ETH. However:
The function does not check if msg.value > 0
Any ETH sent with this function call gets trapped in the contract
There is no way to recover this ETH
Users who accidentally send ETH when creating token games will lose their funds. This is especially risky if the front-end interface doesn't prevent this mistake.
Manual code review
Add a simple check at the start of the function:
This will protect users from accidentally losing their ETH.
ETH sent directly to the contract via the receive function or after a canceled game becomes permanently locked
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.