In the TwentyOne::startGame function, players can stake more than 1 ether. However, regardless of the amount staked (e.g., 3, 4, or 5 ether), the contract always pays out exactly 2 ether as the winning prize. This means that players who stake more than 1 ether will lose the extra funds they contribute.
Here is the relevant code that allows players to stake more than 1 ether:
Players who stake more than 1 ether will lose the extra funds, as the contract only considers 1 ether when calculating the winning prize. (double 1 ether == 2 ether)
Manual Review
##Proof of Concept
The following scenario shows how a player can lose ether:
Initial Contract Balance: 10 ether
A player initiates TwentyOne::startGame with 3 ether instead of 1 ether
Contract Balance: 13 ether
If the player wins, they will receive only 2 ether (the winning prize), causing them to lose 1 ether to the contract.
To fix this issue, modify the contract to restrict players to stake exactly 1 ether:
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.