Skip to content

Smart Contracts

All Pachinko smart contracts are currently deployed on Solana devnet for active testing. Program IDs listed on this page are devnet addresses and will change for mainnet launch.

This page is the canonical source of truth for program IDs and deployment network. Other docs link back here instead of repeating addresses.

Deployed Contracts

Core Platform (Devnet)

ContractProgram IDDescription
Unified Wallet9LkwNkyFM2D4gvjBCRxqiZ8PgxeMvTBgUSMwpyvDC42VPlayer balance management
Blockpad GamefCGi2QxYkHH4A79sHUbtzB5DDASpSgd5WLvUPsthwSUTile betting game logic
Lotto Lottery2SyVdy5osy3LsUMZauMkfKb1zY6gigXRQhjS73LBh8aSLottery game mechanics
Megablock JackpotTBAProgressive jackpot system (not yet deployed)

Token Contracts

ContractAddressDescription
PACHI TokenTBANative utility token
Staking ContractTBAToken staking rewards

External Integrations

ServiceProgram IDPurpose
ORAO VRFVRFzZoJdhFWL8rkvu87LpKM3RbcVezpMEc6X5GVDr7yVerifiable random function

Contract Architecture

CONTRACT ARCHITECTURESOLANAWALLETDeposit/WithdrawPACHINKO PLATFORMUnified Wallet9LkwNk...BlockpadfCGi2Q...Lotto2SyVdy...MegablockTBAEXTERNALORAO VRFVRFzZo...RandomWalletBlockpadLottoMegablockVRF Oracle

Verification

How to Verify Transactions

  1. Find transaction on pachinko.fun history
  2. Copy transaction ID
  3. View on Solscan: https://solscan.io/tx/{TX_ID}
  4. Verify program ID matches our deployed contracts
  5. Check instruction data for expected parameters
ContractSolscan Link
Unified WalletView on Solscan
BlockpadView on Solscan
ORAO VRFView on Solscan

Security

Audit Status

ContractAuditorStatusReport
Unified WalletPendingIn Progress-
BlockpadPendingIn Progress-
LottoPendingIn Progress-

Security Features

SECURITY LAYERSPDA-BasedAccountsOwner-OnlyWithdrawalsOn-ChainVerificationVRFRandomness
FeatureImplementation
Non-CustodialUsers maintain wallet control
PDA SecurityProgram Derived Addresses for fund safety
Immutable LogicCore game logic cannot be modified
TransparentAll transactions visible on-chain
VRF VerifiedRandomness from ORAO oracle network

Technical Specifications

Unified Wallet Account Structure

rust
pub struct UnifiedPlayerAccount {
    pub owner: Pubkey,              // Wallet owner
    pub balance: u64,               // SOL balance (lamports)
    pub token_balance: u64,         // SPL token balance
    pub total_deposited: u64,       // Lifetime deposits
    pub total_withdrawn: u64,       // Lifetime withdrawals
    pub blockpad_stats: BlockpadStats,
    pub lottery_stats: LotteryStats,
    pub referral_stats: ReferralStats,
    pub referrer: Option<Pubkey>,   // Referrer address
    pub bump: u8,                   // PDA bump seed
}

Blockpad Round Structure

rust
pub struct BlockpadRound {
    pub round_id: u64,              // Unique round identifier
    pub start_time: i64,            // Unix timestamp
    pub end_time: i64,              // Round end timestamp
    pub total_pool: u64,            // Total bets (lamports)
    pub tile_bets: [u64; 25],       // Bets per tile
    pub winning_tile: Option<u8>,   // VRF result (0-24)
    pub vrf_seed: [u8; 32],         // ORAO VRF seed
    pub status: RoundStatus,        // Active/Resolved
}

API Endpoints

WebSocket Events

EventDescription
round_startNew Blockpad round begins
bet_placedPlayer places a bet
round_endRound timer expires
vrf_resultVRF seed received
winner_declaredWinning tile announced
payout_completeWinnings distributed

REST Endpoints

EndpointMethodDescription
/api/rounds/currentGETCurrent round status
/api/rounds/{id}GETHistorical round data
/api/player/{wallet}GETPlayer statistics
/api/verify/{tx}GETTransaction verification

Developer Resources

SDKs & Libraries

ResourceLinkDescription
Solana Web3.jsnpmSolana JavaScript SDK
Anchoranchor-lang.comSolana framework
ORAO SDKGitHubVRF integration

Integration Example

typescript
import { Connection, PublicKey } from '@solana/web3.js';

// Contract addresses
const UNIFIED_WALLET = new PublicKey('9LkwNkyFM2D4gvjBCRxqiZ8PgxeMvTBgUSMwpyvDC42V');
const BLOCKPAD = new PublicKey('fCGi2QxYkHH4A79sHUbtzB5DDASpSgd5WLvUPsthwSU');

// Derive player PDA
const [playerPDA] = PublicKey.findProgramAddressSync(
  [Buffer.from('player'), walletAddress.toBuffer()],
  UNIFIED_WALLET
);

Built on Solana