TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Invalid

Misinterpretation of Card Value in `playersHand` Function

Summary

The playersHand function incorrectly treats a card value of 0 as 10, which is not in line with standard blackjack rules.

Vulnerability Details

In the playersHand function, the condition if (cardValue == 0 || cardValue >= 10) incorrectly maps 0 to a value of 10. This misinterpretation can lead to incorrect hand value calculations for the player.

Impact

This incorrect calculation may lead to an unfair game, as the player's hand value would be artificially inflated, potentially altering the game outcome.

Tools Used

Manual Code Review

Recommendations

Update the condition to correctly handle the card values. 0 should not be treated as 10. The logic should ensure that the card value is correctly interpreted.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.