Blackjack

Contract Details

blackjack-v2.warsofcards.near

The Blackjack contract is a seat-based game management contract that operates as a single table for up to 3 players. It functions as bookkeeping logic, managing game state, round progression, and token operations while delegating actual game logic to the off-chain server.

The contract's structure is designed to be table-scoped, making it suitable for a multi-table architecture using NEAR sub-accounts, where each sub-account (e.g., table1.blackjack-v3.warsofcards.near) would manage its own isolated game state while sharing token operations through a parent contract.

The contract maintains a tracking of CARDS token usage by players (total_winnings and total_burned). Leaderboard is sorted by total winnings, where only players with at least one win appear.

Objective

Beat the dealer by getting as close to 21 as possible without exceeding it.

Card Values

Dealer Rules

Actions

Payouts

Result Payout
Blackjack 3:2
Win 1:1
Push Bet returned
Bust Lose bet

Payout Examples — Split & Double

Example 1: Mixed Results

Hand 1:

Hand 2:

Final:

Example 2: Double Blackjacks

Both hands:

Final: