{"_id":"@whisky-gaming/core","_rev":"6-cc1180dbc1dcaf176bc0355927590f7d","name":"@whisky-gaming/core","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.1":{"name":"@whisky-gaming/core","version":"1.0.1","keywords":["solana","gaming","blockchain","casino","defi","whisky","protocol","sdk","web3","smart-contracts"],"author":{"name":"Sarthak Kapila"},"license":"MIT","_id":"@whisky-gaming/core@1.0.1","maintainers":[{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com"}],"homepage":"https://whisky.gg","bugs":{"url":"https://github.com/whisky-gaming/whisky-core/issues"},"dist":{"shasum":"ade753843f59f679cbf48afca532e08b3c994f07","tarball":"https://registry.npmjs.org/@whisky-gaming/core/-/core-1.0.1.tgz","fileCount":5,"integrity":"sha512-isTNdOvx88zlWHWxmXyRmW8UDOhCWJTTi4gKLspZ4bRczw9O8QJ+JFXv4ImxNwUU+HGaN8JkiGSc+W3vlI6BKA==","signatures":[{"sig":"MEUCIAN/+rqxENP/vPvvEw/UuuaxntzeYjRErlrY0BJ62m4uAiEA0LmCqgUdBx1DDRhkiVy0LAmaAZYeZoAoD73X/KdMHF8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":292385},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=16.0.0"},"private":false,"scripts":{"dev":"tsup src/index.ts --watch --format cjs,esm --dts","lint":"tsc --noEmit","test":"jest","build":"tsup src/index.ts --format cjs,esm --dts","clean":"rm -rf .turbo && rm -rf node_modules && rm -rf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"sarthakkapila27","actor":{"name":"sarthakkapila27","type":"user","email":"sarthakkapila1@gmail.com"},"email":"sarthakkapila1@gmail.com"},"repository":{"url":"git+https://github.com/whisky-gaming/whisky-core.git","type":"git"},"_npmVersion":"11.3.0","description":"Core SDK for Whisky Gaming Protocol","directories":{},"sideEffects":false,"_nodeVersion":"24.1.0","dependencies":{"bn.js":"^5.2.1","@solana/web3.js":"^1.93.0","@coral-xyz/anchor":"^0.27.0","@solana/spl-token":"^0.3.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^7.2.0","eslint":"^8.48.0","ts-jest":"^29.1.1","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/bn.js":"^5.1.1"},"peerDependencies":{"@solana/web3.js":"^1.93.0","@coral-xyz/anchor":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.1_1750458632028_0.49523725639664606","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@whisky-gaming/core","version":"1.0.2","keywords":["solana","gaming","blockchain","casino","defi","whisky","protocol","sdk","web3","smart-contracts"],"author":{"name":"Sarthak Kapila"},"license":"MIT","_id":"@whisky-gaming/core@1.0.2","maintainers":[{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com"}],"homepage":"https://whisky.gg","bugs":{"url":"https://github.com/whisky-gaming/whisky-core/issues"},"dist":{"shasum":"985ef529ff931d376a4dd1f20b15ba46b05a7e21","tarball":"https://registry.npmjs.org/@whisky-gaming/core/-/core-1.0.2.tgz","fileCount":5,"integrity":"sha512-HLVEP+pWjqs972GhoqRpFGUu6ufolw3v54i4atIb/XOdSnKq7kmtFwzGLorOF1iVGm/pw3MkFW8cPdtzzkHBsw==","signatures":[{"sig":"MEYCIQD1nPtU/0Ib8nyZTHboOseNq3tW4/5CCHb4Q/2oV041/wIhANrxAGSrRrXxXFR1aqucjwYDDM8JOKw7FbEFGJq8EDQ8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":294449},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=16.0.0"},"gitHead":"4748ef9c6a3cadce41772a6312dc6d11c34114d1","private":false,"scripts":{"dev":"tsup src/index.ts --watch --format cjs,esm --dts","lint":"tsc --noEmit","test":"jest","build":"tsup src/index.ts --format cjs,esm --dts","clean":"rm -rf .turbo && rm -rf node_modules && rm -rf dist","prepublishOnly":"npm run build"},"_npmUser":{"name":"sarthakkapila27","actor":{"name":"sarthakkapila27","type":"user","email":"sarthakkapila1@gmail.com"},"email":"sarthakkapila1@gmail.com"},"repository":{"url":"git+https://github.com/whisky-gaming/whisky-core.git","type":"git"},"_npmVersion":"11.3.0","description":"Core SDK for Whisky Gaming Protocol","directories":{},"sideEffects":false,"_nodeVersion":"24.1.0","dependencies":{"bn.js":"^5.2.1","@solana/web3.js":"^1.93.0","@coral-xyz/anchor":"^0.27.0","@solana/spl-token":"^0.3.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","tsup":"^7.2.0","eslint":"^8.48.0","ts-jest":"^29.1.1","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/bn.js":"^5.1.1"},"peerDependencies":{"@solana/web3.js":"^1.93.0","@coral-xyz/anchor":"^0.27.0"},"_npmOperationalInternal":{"tmp":"tmp/core_1.0.2_1751043694275_0.546761259795816","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@whisky-gaming/core","private":false,"version":"1.0.3","description":"Core SDK for Whisky Gaming Protocol","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","sideEffects":false,"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/whisky-gaming/whisky-core.git"},"homepage":"https://whisky.gg","bugs":{"url":"https://github.com/whisky-gaming/whisky-core/issues"},"scripts":{"dev":"tsup src/index.ts --watch --format cjs,esm --dts","build":"tsup src/index.ts --format cjs,esm --dts","lint":"tsc --noEmit","test":"jest","clean":"rm -rf .turbo && rm -rf node_modules && rm -rf dist","prepublishOnly":"npm run build"},"dependencies":{"@coral-xyz/anchor":"^0.27.0","@solana/spl-token":"^0.3.8","@solana/web3.js":"^1.93.0","bn.js":"^5.2.1"},"devDependencies":{"@types/bn.js":"^5.1.1","@types/jest":"^29.5.5","eslint":"^8.48.0","jest":"^29.7.0","ts-jest":"^29.1.1","tsup":"^7.2.0","typescript":"^5.2.2"},"peerDependencies":{"@coral-xyz/anchor":"^0.27.0","@solana/web3.js":"^1.93.0"},"keywords":["solana","gaming","blockchain","casino","defi","whisky","protocol","sdk","web3","smart-contracts"],"author":{"name":"Sarthak Kapila"},"license":"MIT","engines":{"node":">=16.0.0"},"_id":"@whisky-gaming/core@1.0.3","gitHead":"bb5bb39540fc9395a87f45d8449b5af2d52524be","_nodeVersion":"24.1.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-j6s0EylgH5ZX7FnRcVwJIUeEXiI6gNIWPMGd2udDqRXIZG0WnuV5irLFYNOHPJnjYMVwJbHNo+XkFJr6h1n11Q==","shasum":"6aeff96442c8204d485f669295fcc528908c6084","tarball":"https://registry.npmjs.org/@whisky-gaming/core/-/core-1.0.3.tgz","fileCount":6,"unpackedSize":310220,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCVFlaMHc0UL+Ru+amCrusOa7lq0uY/EVSJt5Lha6gCKAIgRM7rAQg4o41xEosP4asVR+yIzJDCs8Kohcz8uYD3+BY="}]},"_npmUser":{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com","actor":{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com","type":"user"}},"directories":{},"maintainers":[{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_1.0.3_1751044886972_0.3276028390983514"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-20T22:30:31.956Z","modified":"2025-06-27T17:21:27.665Z","1.0.0":"2025-06-20T21:00:08.735Z","1.0.1":"2025-06-20T22:30:32.199Z","1.0.2":"2025-06-27T17:01:34.523Z","1.0.3":"2025-06-27T17:21:27.169Z"},"bugs":{"url":"https://github.com/whisky-gaming/whisky-core/issues"},"author":{"name":"Sarthak Kapila"},"license":"MIT","homepage":"https://whisky.gg","keywords":["solana","gaming","blockchain","casino","defi","whisky","protocol","sdk","web3","smart-contracts"],"repository":{"type":"git","url":"git+https://github.com/whisky-gaming/whisky-core.git"},"description":"Core SDK for Whisky Gaming Protocol","maintainers":[{"name":"sarthakkapila27","email":"sarthakkapila1@gmail.com"}],"readme":"# Whisky Gaming Protocol [WORK IN PROGRESS]\n\nA comprehensive, production-ready decentralized gaming infrastructure built on Solana, providing provably fair randomness, liquidity pooling, and complete game state management for blockchain-based gaming applications.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Architecture](#architecture)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [API Reference](#api-reference)\n- [Examples](#examples)\n- [Security](#security)\n- [Economic Model](#economic-model)\n- [Development](#development)\n- [Testing](#testing)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Overview\n\nWhisky is a sophisticated gaming protocol that enables developers to build trustless, verifiable gaming experiences on the Solana blockchain. The protocol features a robust architecture with built-in randomness verification, liquidity management, and economic sustainability through a carefully designed fee structure.\n\n### Key Benefits\n\n- **Provably Fair**: Cryptographically verifiable randomness generation\n- **Decentralized Liquidity**: Community-driven liquidity pools for any SPL token\n- **Economic Sustainability**: Built-in fee structure supporting long-term viability\n- **Developer Friendly**: Comprehensive SDK and documentation\n- **Production Ready**: Thoroughly tested and audited codebase\n\n## Features\n\n### Core Functionality\n\n- **Multi-token Support**: Create gaming pools for any SPL token\n- **Flexible Betting Structure**: Support for any probability distribution\n- **Provably Fair RNG**: Verifiable random number generation\n- **Liquidity Management**: Automated yield distribution to LP token holders\n- **Progressive Jackpots**: Dynamic jackpot accumulation system\n- **Emergency Controls**: Protocol-wide safety mechanisms\n\n### Advanced Features\n\n- **Program Derived Addresses**: Secure account management\n- **Mathematical Overflow Protection**: Safe arithmetic operations\n- **Comprehensive Error Handling**: Robust error management system\n- **Authority Management**: Granular permission controls\n- **Fee Customization**: Configurable fee structures\n\n## Architecture\n\n### Core Data Structures\n\n#### WhiskyState (Global Protocol)\n```rust\npub struct WhiskyState {\n    pub authority: Pubkey,           // Protocol governance authority\n    pub rng_address: Pubkey,         // Random number provider\n    pub whisky_fee_bps: u64,        // Protocol fee (basis points)\n    pub playing_allowed: bool,       // Emergency stop switch\n    // Additional configuration fields\n}\n```\n\n#### Pool (Liquidity Management)\n```rust\npub struct Pool {\n    pub pool_authority: Pubkey,      // Pool owner\n    pub underlying_token_mint: Pubkey,  // Token type (USDC, SOL, etc.)\n    pub min_wager: u64,             // Minimum bet amount\n    pub plays: u64,                 // Total games played\n    // Additional pool settings\n}\n```\n\n#### Game (Individual Sessions)\n```rust\npub struct Game {\n    pub wager: u64,                 // Player bet amount\n    pub bet: Vec<u32>,              // Outcome probability weights\n    pub client_seed: String,        // Player randomness input\n    pub rng_seed: String,           // Server randomness input\n    pub status: GameStatus,         // Current game state\n    pub result: u32,                // Winning outcome index\n    // Additional game fields\n}\n```\n\n### Instruction Set\n\nThe protocol implements 17 core instructions divided into three categories:\n\n**Gaming Instructions:**\n- `play_game` - Initiate new gaming session\n- `rng_settle` - Process randomness and determine outcome\n- `player_claim` - Claim winnings\n\n**Pool Management:**\n- `pool_initialize` - Create new liquidity pool\n- `pool_deposit` - Add liquidity to pool\n- `pool_withdraw` - Remove liquidity from pool\n\n**Administrative:**\n- `whisky_initialize` - Initialize protocol\n- `update_authority` - Modify protocol settings\n\n## Installation\n\n### Prerequisites\n\n- Node.js 16.0.0 or higher\n- Solana CLI tools\n- Anchor framework\n- TypeScript 4.5.0 or higher\n\n### Install Dependencies\n\n```bash\nnpm install @whisky-core/sdk\n```\n\n### Anchor Program\n\n```bash\nanchor build\nanchor deploy\n```\n\n## Quick Start\n\n### Initialize Protocol\n\n```typescript\nimport { WhiskySDK } from '@whisky-core/sdk';\n\nconst sdk = new WhiskySDK({\n  connection: new Connection('https://api.mainnet-beta.solana.com'),\n  wallet: yourWallet,\n  programId: WHISKY_PROGRAM_ID\n});\n\n// Initialize protocol (one-time setup)\nawait sdk.initializeProtocol({\n  authority: authorityPublicKey,\n  rngProvider: rngProviderPublicKey,\n  protocolFee: 200 // 2%\n});\n```\n\n### Create Gaming Pool\n\n```typescript\n// Create USDC gaming pool\nconst poolAddress = await sdk.createPool({\n  tokenMint: USDC_MINT_ADDRESS,\n  minimumWager: 1_000_000, // 1 USDC\n  poolAuthority: poolAuthorityKeypair\n});\n```\n\n### Add Liquidity\n\n```typescript\n// Deposit 1000 USDC to earn fees from games\nawait sdk.depositLiquidity(poolAddress, 1000_000_000);\n```\n\n### Play Game\n\n```typescript\n// Simple coinflip game\nconst gameResult = await sdk.playGame({\n  poolAddress,\n  wager: 10_000_000, // 10 USDC\n  bet: [50, 50], // Equal probability outcomes\n  clientSeed: 'player_randomness_123',\n  creatorFee: 100, // 1%\n  jackpotFee: 50,  // 0.5%\n  metadata: 'Coinflip Game #1'\n});\n\n// Wait for RNG settlement\nawait sdk.waitForSettlement(gameResult.gameAddress);\n\n// Claim winnings if won\nif (gameResult.won) {\n  await sdk.claimWinnings(gameResult.gameAddress);\n}\n```\n\n## API Reference\n\n### Core Methods\n\n#### `playGame(params: PlayGameParams): Promise<GameResult>`\n\nInitiates a new gaming session.\n\n**Parameters:**\n- `poolAddress: PublicKey` - Target liquidity pool\n- `wager: number` - Bet amount in token base units\n- `bet: number[]` - Outcome probability weights\n- `clientSeed: string` - Player randomness contribution\n- `creatorFee: number` - Creator fee in basis points\n- `jackpotFee: number` - Jackpot fee in basis points\n- `metadata: string` - Game identification string\n\n**Returns:**\n- `GameResult` - Game session details and outcome\n\n#### `createPool(params: CreatePoolParams): Promise<PublicKey>`\n\nCreates a new liquidity pool for specified token.\n\n**Parameters:**\n- `tokenMint: PublicKey` - SPL token mint address\n- `minimumWager: number` - Minimum acceptable bet\n- `poolAuthority: Keypair` - Pool management authority\n\n**Returns:**\n- `PublicKey` - Created pool address\n\n#### `depositLiquidity(poolAddress: PublicKey, amount: number): Promise<string>`\n\nDeposits tokens into liquidity pool.\n\n**Parameters:**\n- `poolAddress: PublicKey` - Target pool address\n- `amount: number` - Token amount to deposit\n\n**Returns:**\n- `string` - Transaction signature\n\n### Utility Functions\n\n#### `validateBet(bet: number[]): boolean`\n\nValidates betting structure for mathematical correctness.\n\n```typescript\n// Valid examples\nvalidateBet([50, 50]);           // Equal probability\nvalidateBet([25, 25, 25, 25]);   // Four equal outcomes\nvalidateBet([90, 10]);           // Asymmetric probability\n\n// Invalid examples\nvalidateBet([0, 0]);             // No winning outcomes\nvalidateBet([]);                 // Empty bet array\n```\n\n#### `calculatePayout(wager: number, bet: number[], outcome: number): number`\n\nCalculates payout for specific outcome.\n\n```typescript\nconst payout = calculatePayout(1000000, [50, 50], 0); // 2x multiplier\n```\n\n#### `calculateJackpotOdds(wager: number, poolSize: number): number`\n\nDetermines jackpot probability based on wager size.\n\n```typescript\nconst odds = calculateJackpotOdds(10000000, 1000000000); // 0.001% base odds\n```\n\n## Examples\n\n### Binary Prediction Market\n\n```typescript\n// Create yes/no prediction market\nconst predictionGame = await sdk.playGame({\n  poolAddress: usdcPool,\n  wager: 50_000_000, // 50 USDC\n  bet: [60, 40], // 60% probability for \"Yes\"\n  clientSeed: 'prediction_12345',\n  creatorFee: 200, // 2% to market creator\n  jackpotFee: 0,   // No jackpot for predictions\n  metadata: 'Election Outcome Prediction'\n});\n```\n\n### Multi-Outcome Casino Game\n\n```typescript\n// Six-sided dice roll\nconst diceGame = await sdk.playGame({\n  poolAddress: solPool,\n  wager: 5_000_000_000, // 5 SOL\n  bet: [16, 16, 16, 16, 16, 20], // Slightly favor outcome 6\n  clientSeed: 'dice_roll_789',\n  creatorFee: 300, // 3% house edge\n  jackpotFee: 100, // 1% progressive jackpot\n  metadata: 'Lucky Dice Roll'\n});\n```\n\n### Slot Machine Simulation\n\n```typescript\n// Complex probability distribution\nconst slotGame = await sdk.playGame({\n  poolAddress: bonkPool,\n  wager: 1_000_000_000, // 1B BONK tokens\n  bet: [\n    500, // 50% - No win\n    300, // 30% - Small win (2x)\n    150, // 15% - Medium win (5x)\n    40,  // 4% - Large win (20x)\n    9,   // 0.9% - Huge win (100x)\n    1    // 0.1% - Jackpot (1000x)\n  ],\n  clientSeed: 'slot_machine_456',\n  creatorFee: 500, // 5% house edge\n  jackpotFee: 200, // 2% progressive jackpot\n  metadata: 'Triple 7s Slot Machine'\n});\n```\n\n## Security\n\n### Randomness Generation\n\nThe protocol implements a dual-seed randomness system ensuring provable fairness:\n\n1. **Client Seed**: Player provides randomness input\n2. **Server Seed**: RNG provider contributes entropy\n3. **Combination**: Seeds are cryptographically combined using SHA-256\n4. **Verification**: All randomness is publicly verifiable on-chain\n\n### Mathematical Integrity\n\n- **Overflow Protection**: All arithmetic operations use checked math\n- **Bet Validation**: Comprehensive validation of probability distributions\n- **Payout Limits**: Maximum payout restrictions prevent pool drainage\n- **House Edge Caps**: Maximum 3% house edge enforcement\n\n### Access Controls\n\n- **Authority Management**: Granular permission system\n- **PDA Security**: Program Derived Addresses prevent account manipulation\n- **Emergency Controls**: Protocol-wide emergency stop functionality\n- **Audit Trail**: Complete on-chain transaction history\n\n### Known Security Considerations\n\n- RNG provider must be trusted for seed generation\n- Pool liquidity affects maximum possible payouts\n- Smart contract upgrades require governance approval\n- Client seed predictability could affect fairness\n\n## Economic Model\n\n### Fee Structure\n\nFrom each gaming session, fees are distributed as follows:\n\n| Recipient | Default Rate | Purpose |\n|-----------|--------------|---------|\n| Protocol Treasury | 2.0% | Development and maintenance |\n| Game Creator | 1.0% | Application development incentives |\n| Liquidity Providers | 1.0% | Yield for LP token holders |\n| Progressive Jackpot | 0.5% | Exceptional payout accumulation |\n| **Available for Payout** | **95.5%** | **Player winnings pool** |\n\n### Liquidity Provider Benefits\n\n- **Passive Income**: Earn fees from all gaming activity\n- **LP Tokens**: Tradeable tokens representing pool ownership\n- **Proportional Rewards**: Earnings scale with liquidity contribution\n- **No Gaming Risk**: Earn fees without direct betting participation\n\n### Economic Sustainability\n\n- Protocol fees fund ongoing development\n- Creator incentives encourage ecosystem growth\n- Liquidity provider rewards ensure adequate pool funding\n- Progressive jackpots drive player engagement\n\n## Development\n\n### Project Structure\n\n```\nwhisky-protocol/\n├── programs/\n│   └── whisky/\n│       ├── src/\n│       │   ├── lib.rs          # Main program entry\n│       │   ├── state.rs        # Data structures\n│       │   ├── instructions/   # Instruction handlers\n│       │   ├── utils.rs        # Mathematical utilities\n│       │   └── errors.rs       # Error definitions\n│       └── Cargo.toml\n├── sdk/\n│   ├── src/\n│   │   ├── index.ts           # Main SDK export\n│   │   ├── instructions.ts    # Instruction builders\n│   │   ├── accounts.ts        # Account management\n│   │   └── utils.ts           # Utility functions\n│   └── package.json\n├── tests/\n│   ├── integration/           # Integration tests\n│   ├── unit/                  # Unit tests\n│   └── fixtures/              # Test data\n└── docs/                      # Documentation\n```\n\n### Building from Source\n\n```bash\n# Clone repository\ngit clone https://github.com/weknowyourgame/whisky-gaming.git\ncd whisky-gaming\n\n# Install dependencies\nnpm install\n\n# Build Anchor program\nanchor build\n\n# Build TypeScript SDK\nnpm run build:sdk\n\n# Run tests\nnpm test\n```\n\n### Environment Setup\n\n```bash\n# Set Solana cluster\nsolana config set --url devnet\n\n# Create keypair for testing\nsolana-keygen new --outfile ~/.config/solana/id.json\n\n# Request airdrop for testing\nsolana airdrop 2\n```\n\n## Testing\n\n### Test Suite\n\nThe protocol includes comprehensive testing covering:\n\n- **Unit Tests**: Individual function validation\n- **Integration Tests**: End-to-end workflow testing\n- **Mathematical Tests**: Probability and payout calculations\n- **Security Tests**: Error handling and edge cases\n- **Performance Tests**: Transaction throughput and costs\n\n### Running Tests\n\n```bash\n# Run all tests\nnpm test\n\n# Run specific test category\nnpm run test:unit\nnpm run test:integration\nnpm run test:security\n\n# Run tests with coverage\nnpm run test:coverage\n```\n\n### Test Examples\n\n```typescript\ndescribe('Gaming Mathematics', () => {\n  test('calculates correct payout multipliers', () => {\n    const multiplier = calculateMultiplier([25, 25, 25, 25], 0);\n    expect(multiplier).toBe(4.0);\n  });\n\n  test('validates betting structures', () => {\n    expect(validateBet([50, 50])).toBe(true);\n    expect(validateBet([0, 0])).toBe(false);\n  });\n\n  test('prevents mathematical overflow', () => {\n    expect(() => calculatePayout(MAX_U64, [1, 99], 0))\n      .toThrow('Arithmetic overflow');\n  });\n});\n```\n\n## Deployment\n\n### Mainnet Deployment\n\n```bash\n# Build optimized program\nanchor build --verifiable\n\n# Deploy to mainnet\nanchor deploy --provider.cluster mainnet-beta\n\n# Initialize protocol\nanchor run initialize-mainnet\n```\n\n### Configuration\n\n```typescript\n// Production configuration\nconst MAINNET_CONFIG = {\n  programId: new PublicKey('WHISKY_PROGRAM_ID'),\n  rpcEndpoint: 'https://api.mainnet-beta.solana.com',\n  protocolFee: 200, // 2%\n  maxHouseEdge: 300, // 3%\n  minWager: 1000, // 0.001 token units\n};\n```\n\n### Monitoring\n\n- **Transaction Success Rate**: Monitor settlement success\n- **Pool Liquidity Levels**: Ensure adequate funding\n- **Fee Collection**: Track protocol revenue\n- **RNG Provider Uptime**: Monitor randomness availability\n\n## Contributing\n\n### Development Workflow\n\n1. Fork the repository\n2. Create feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit changes (`git commit -m 'Add amazing feature'`)\n4. Push to branch (`git push origin feature/amazing-feature`)\n5. Open Pull Request\n\n### Code Standards\n\n- **Rust**: Follow official Rust style guidelines\n- **TypeScript**: Use Prettier and ESLint configurations\n- **Testing**: Maintain 90%+ test coverage\n- **Documentation**: Update docs for all public APIs\n\n### Contribution Areas\n\n- **Protocol Enhancements**: Core functionality improvements\n- **SDK Development**: Client library features\n- **Documentation**: User guides and API documentation\n- **Testing**: Additional test coverage\n- **Security**: Audit and security improvements\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n### Documentation\n\n- [Technical Documentation]()\n- [API Reference]()\n- [Integration Guide]()\n- [Security Best Practices]()\n\n### Community\n\n- [Discord Server]()\n- [GitHub Discussions]()\n- [Developer Forum]()\n\n### Professional Support\n\nFor enterprise integration and custom development:\n- Email: \n- Documentation: [Enterprise Guide]()\n\n---\n\n**WhiskyState Protocol** - Building the future of decentralized gaming on Solana.\n","readmeFilename":"README.md"}