Wrong check for sent wager in TwentyOne::startGame()
function.
Description: In line 2 of the TwentyOne::startGame()
function, the wager gets checked to be the value of 1 ETH or above, instead of checking it to be the exact value of 1 ETH.
This leads to the possibility of players losing part of their wagers even on a win, since the contract payout is designed to be relative to 1 ETH wager, not the actual sent wager. While not exploitable, this might result in loss of funds by a player.
Remix for a quick PoC.
Changing the conditional revert in line 2 of TwentyOne::startGame() to instead check for the exact value of 1 ETH will mitigate the issue. Additionally, putting the conditional revert on line 1 might improve gas cost on a revert.
Code example:
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.