The smart contract for the decentralized Blackjack game has inconsistent logic for calculating card values between the playersHand
and dealersHand
functions. This discrepancy can lead to unfair gameplay outcomes where the dealer's hand is incorrectly calculated, potentially favoring one party over another.
In playersHand
, a cardValue
of 0 (e.g., representing Kings in modulo-13) is treated as 10 points:
In dealersHand
, a cardValue
of 0 is not explicitly handled and defaults to contributing 0 points:
The bug introduces a fundamental flaw in the game's logic, causing unequal treatment between player and dealer hands. This could lead to unfair wins or losses for players.
Manual Review
Update the dealersHand
function to handle cardValue == 0
similarly to playersHand
:
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.