The endGame function attempts to transfer 2 ether to the player if they win but does not check the balance before doing it.
The endGame function of the TwentyOne contract attempts to transfer 2 ether to the player if they win the game. However, if the contract does not have enough ether to cover the transfer, the transaction will revert, causing all previous state changes in the function to be undone.
Game State Inconsistency: The failure to transfer funds and subsequent reversion could result in the game state not being cleared as intended.
User Experience: Players might experience failed transactions and unexpected behavior, leading to a poor user experience.
Security Concerns: Repeated attempts to call the endGame function without sufficient funds can lead to denial-of-service scenarios where legitimate game operations are interrupted.
Manual Review
Check the balance before transferring funds.
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.