A decentralized Plinko game built on Injective blockchain with provably fair gameplay and native $PLINK token.
- ๐ฎ Provably Fair Gameplay: RNG using blockchain data (block height, timestamp, player nonce)
- ๐ช Native Token: $PLINK token (CW20-compliant)
- ๐ฐ 1000x Max Multiplier: On Hard difficulty, High risk edges
- ๐ฏ Three Difficulty Levels: Easy (8 rows), Medium (12 rows), Hard (16 rows)
- โก Three Risk Levels: Low, Medium, High with different multiplier distributions
- ๐ Multi-Wallet Support: Keplr, Leap, Metamask, Rabby
- ๐ Game History: Track all your plays on-chain
- ๐ฆ Treasury Integration: All INJ from purchases goes to treasury wallet
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Blockchain: Injective (CosmWasm)
- Smart Contracts: Rust, CosmWasm 1.5
- Wallet Integration: @injectivelabs SDK
โโโ contracts/ # CosmWasm smart contracts
โ โโโ plink-token/ # CW20 token contract
โ โโโ purchase-contract/ # INJ to PLINK conversion
โ โโโ plinko-game/ # Main game logic
โโโ src/
โ โโโ components/ # React components
โ โโโ hooks/ # Custom React hooks
โ โโโ services/ # Contract interaction services
โ โโโ config/ # Configuration files
โ โโโ types/ # TypeScript types
โโโ public/ # Static assets
- Node.js 18+
- pnpm
- Rust toolchain (for building contracts)
- Injective wallet (Keplr, Leap, Metamask, or Rabby)
- Clone and install dependencies:
pnpm install- Build smart contracts (requires Rust):
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
# Build contracts
cd contracts/plink-token && cargo wasm
cd ../purchase-contract && cargo wasm
cd ../plinko-game && cargo wasm- Deploy contracts (see
contracts/README.mdfor detailed instructions):
chmod +x contracts/deploy.sh
./contracts/deploy.sh- Configure environment:
cp .env.example .env
# Update .env with deployed contract addresses- Start development server:
pnpm dev- Type: CW20-compliant token
- Decimals: 18
- Minter: Purchase contract
- Features: Transfer, burn, mint, allowances
- Exchange Rate: 1 INJ = 100 PLINK (configurable)
- Treasury: All INJ sent to treasury wallet
- Features: Purchase tracking, admin controls
- RNG: SHA-256(block_height + timestamp + player_address + nonce)
- Multipliers: Stored as fractions for precision
- Features: Game history, house balance, provably fair
- Low Risk: 5.6x, 2.1x, 1.1x, 1.0x, 0.5x, 1.0x, 1.1x, 2.1x, 5.6x
- Medium Risk: 13x, 3x, 1.3x, 0.7x, 0.4x, 0.7x, 1.3x, 3x, 13x
- High Risk: 29x, 4x, 1.5x, 0.3x, 0.2x, 0.3x, 1.5x, 4x, 29x
- Low Risk: 8.9x, 3x, 1.4x, 1.1x, 1.0x, 0.5x, 1.0x, 1.1x, 1.4x, 3x, 8.9x
- Medium Risk: 18x, 4x, 1.7x, 0.9x, 0.5x, 0.3x, 0.5x, 0.9x, 1.7x, 4x, 18x
- High Risk: 43x, 7x, 2x, 0.6x, 0.2x, 0.2x, 0.2x, 0.6x, 2x, 7x, 43x
- Low Risk: 16x, 9x, 2x, 1.4x, 1.1x, 1.0x, 0.5x, 1.0x, 1.1x, 1.4x, 2x, 9x, 16x
- Medium Risk: 110x, 41x, 10x, 5x, 3x, 1.5x, 1.0x, 0.5x, 1.0x, 1.5x, 3x, 5x, 10x, 41x, 110x
- High Risk: 1000x, 130x, 26x, 9x, 4x, 2x, 0.2x, 0.2x, 0.2x, 2x, 4x, 9x, 26x, 130x, 1000x
- Connect Wallet: Click "Connect Wallet" and select your wallet
- Buy $PLINK: Click "Buy $PLINK" and purchase tokens with INJ
- Configure Game: Select difficulty and risk level
- Place Bet: Enter bet amount in $PLINK
- Drop Ball: Click "Drop Ball" to play
- Watch Result: Ball drops through pegs to final multiplier
- Collect Winnings: Winnings automatically sent to your wallet
Every game result can be verified on-chain:
- Check transaction on Injective Explorer
- Verify RNG inputs: block height, timestamp, player address, nonce
- Recalculate SHA-256 hash to verify ball path
- Confirm multiplier matches bucket position
- Audited Patterns: Uses OpenZeppelin-style patterns
- Checked Math: All calculations use overflow protection
- Access Control: Admin functions protected
- Transparent RNG: Verifiable on-chain randomness
# Run development server
pnpm dev
# Build for production
pnpm build
# Run tests
pnpm test
# Lint code
pnpm lint- Network: Injective Testnet
- Chain ID: injective-888
- RPC: https://testnet.sentry.tm.injective.network:443
- Faucet: https://testnet.faucet.injective.network/
- Network: Injective Mainnet
- Chain ID: injective-1
- RPC: https://sentry.tm.injective.network:443
VITE_NETWORK=testnet
VITE_CHAIN_ID=injective-888
VITE_RPC_URL=https://testnet.sentry.tm.injective.network:443
VITE_REST_URL=https://testnet.sentry.lcd.injective.network:443
VITE_PLINK_TOKEN_ADDRESS=inj1...
VITE_PURCHASE_CONTRACT_ADDRESS=inj1...
VITE_GAME_CONTRACT_ADDRESS=inj1...
VITE_TREASURY_ADDRESS=inj1...
VITE_EXCHANGE_RATE=100- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
MIT License - see LICENSE file for details
- Documentation: See
contracts/README.md - Issues: GitHub Issues
- Discord: [Join our community]
- Built on Injective blockchain
- Uses CosmWasm smart contracts
- Inspired by classic Plinko game
- Community-driven development