Description:
https://github.com/Cyfrin/2024-11-TwentyOne/blob/a4429168302722d14a5e5996d25d6fc5be22a899/src/TwentyOne.sol#L120
In the call function, there is no explicit handling for draw(push) scenarios where the player's hand total equals the dealer's hand total. This leads to ambiguity in the game's outcome and may result in the contract failing to return the player's bet or incorrectly determining a winner. Draws are a standard outcome in blackjack games and should be handled to ensure fairness and adherence to game rules.
Impact:
Without proper handling, players may lose their bets unfairly or fail to recover their wager when a draw occurs.
Proof of Concept:
Player 1 starts the game by betting 1 ether and receives a hand total of 18.
The dealer also ends up with a hand total of 18.
The endgame function currently lacks logic to detect and handle this draw scenario.
The contract may either revert or proceed incorrectly without returning the player's bet.
Tools Used:
Manual Review.
Recommended Mitigation:
Introduce a conditional check in the endgame function to handle draw scenarios explicitly. For 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.