In the call()
function of the TwentyOne
contract, draw scenarios (when the player's hand equals the dealer's hand) are treated as a loss for the player. This behavior violates standard blackjack rules, where a draw results in a "push," meaning the player's bet should be returned without any winnings or losses. This issue causes unfair losses for players and undermines trust in the platform.
The call()
function lacks explicit logic for handling draw scenarios. When the player's hand equals the dealer's hand, the contract defaults to the final else
statement, which treats the draw as a loss:
This implementation results in the player's deposit being forfeited even though neither side won the game.
The player's hand total is 20.
The dealer's hand total is also 20.
The player calls the call()
function.
The else
clause is executed, treating the draw as a loss.
The player loses their 1 ETH bet, which should have been refunded in a draw scenario.
Unfair Gameplay: Players lose their bet even when they tie with the dealer, leading to dissatisfaction.
Negative User Experience: Players may feel cheated, reducing trust in the platform.
Violation of Blackjack Rules: Standard rules dictate that a draw (push) should result in no net loss or gain for the player.
Manual Review
Add Draw Logic to call()
Function:
Update the function to handle draw scenarios explicitly. If the player's hand equals the dealer's hand, emit a specific event and refund the player's bet.
Updated call()
Function:
Update endGame
Function:
Modify endGame
to handle draws and refund the player's bet if the game ends in a draw.
Updated endGame
Function:
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.