TwentyOne

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

Per-Game Deck Reset Deviates from Standard Blackjack Shoe Mechanics

Summary

The TwentyOne contract reinitializes a fresh 52-card deck for each game instead of using a persistent multi-deck shoe as in standard casino Blackjack. While this doesn't allow card counting, it changes the probabilities and game dynamics compared to traditional Blackjack.

This is probably more of a design choice than a vulnerability, as it actually prevents card counting.

Vulnerability Details

function initializeDeck(address player) internal {
require(
availableCards[player].length == 0,
"Player's deck is already initialized"
);
for (uint256 i = 1; i <= 52; i++) {
availableCards[player].push(i);
}
}
  • Each game starts with a fresh 52-card deck

  • No persistence of drawn cards between games

  • Differs from casino standard of multi-deck shoes

Impact

  • Different probability distribution than standard Blackjack

  • Changes optimal playing strategy

  • May affect player expectations and game experience

Tools Used

  • Manual Code Review

Recommendations

  • Consider implementing a persistent multi-deck shoe for more authentic gameplay.

Updates

Lead Judging Commences

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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