The contract uses transfer
for sending Ether to players:
Using transfer
is unsafe because it forwards a fixed amount of 2300 gas, which may not be sufficient if the recipient is a contract with a fallback or receive function requiring more gas.
If the recipient address is a contract that needs more than 2300 gas units to process the incoming Ether, the transfer will fail, potentially causing the transaction to revert. This can prevent players from receiving their winnings and disrupt the game's functionality.
Use call
Instead of transfer
: Replace transfer
with call
to forward all available gas and handle failures gracefully:
Reentrancy Protection: Implement reentrancy guards to protect against potential reentrancy attacks when using call
.
Check Transfer Success: Always check the return value of the call
to ensure the transfer was successful.
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.