Skip to content

SolThrone is a high-stakes, blockchain-powered King of the Hill game on Solana where players compete to hold the throne and claim the jackpot. Built with Next.js, Anchor, and TypeScript.

License

Notifications You must be signed in to change notification settings

ANAS727189/SolThrone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘‘ SolThrone

King of the Hill on Solana

A high-stakes, blockchain-powered survival game where only the last monarch standing claims the throneโ€”and the treasure.

Next.js Solana Anchor TypeScript


๐ŸŽฎ What is SolThrone?

SolThrone is a decentralized, on-chain game of economic warfare built on Solana. Players compete to become the Reigning Monarch by outbidding each other in a high-stakes auction. The last player holding the throne when the timer expires wins the entire jackpot.

The Mechanics

  • ๐Ÿ† Seize the Throne: Pay 30% more than the current price to become king
  • ๐Ÿ’ฐ Instant ROI: Get 15% profit when someone usurps you
  • โฐ Anti-Snipe Protection: Timer extends when a bid comes in the final 5 minutes
  • ๐ŸŽฏ Winner Takes All: Last monarch claims the entire jackpot when time expires
  • โšก Lightning Fast: Built on Solana for sub-second transactions

๐Ÿ“ธ Screenshots

King's View (Royal Atmosphere) Challenger's View (The Forge)
King View Challenger View

โœจ Features

๐ŸŽจ Immersive UI/UX

  • Cinematic background with gradient effects and noise textures
  • Real-time throne visualization with 3D animations
  • Framer Motion-powered smooth transitions
  • Responsive design for mobile and desktop

๐Ÿ” Solana Wallet Integration

  • Support for Phantom, Solflare, and all major Solana wallets
  • Secure wallet connection via @solana/wallet-adapter
  • Real-time balance and transaction updates

๐Ÿ“Š Live Game Statistics

  • Protocol Bounty: Real-time jackpot tracker
  • Reigning Monarch: Current king's wallet address
  • Session Timer: Countdown with hours, minutes, and seconds
  • Activity Log: Transaction history with timestamps and explorer links

๐ŸŽฏ Smart Contract Features

  • Anti-Snipe Mechanism: Timer resets to 5 minutes if bid comes in late
  • Instant Payouts: Previous king receives 115% of their bid immediately
  • Creator Fee: 5% platform fee on every transaction
  • Jackpot Accumulation: Remaining funds flow into the grand prize
  • Auto-Reset: Game automatically restarts after jackpot is claimed

๐Ÿ—๏ธ Architecture

Frontend Stack

Next.js 16 (App Router)
โ”œโ”€โ”€ React 19.2
โ”œโ”€โ”€ TypeScript
โ”œโ”€โ”€ Tailwind CSS
โ”œโ”€โ”€ Framer Motion (Animations)
โ”œโ”€โ”€ Solana Wallet Adapter
โ””โ”€โ”€ Anchor Client

Smart Contract

Anchor Framework (Rust)
โ”œโ”€โ”€ On-Chain State Management
โ”œโ”€โ”€ PDA (Program Derived Address) for Game State
โ””โ”€โ”€ Safe Math with Overflow Checks

Project Structure

solthrone/
โ”œโ”€โ”€ client/               # Next.js Frontend
โ”‚   โ”œโ”€โ”€ app/             # App Router pages
โ”‚   โ”œโ”€โ”€ components/      # React components
โ”‚   โ”‚   โ”œโ”€โ”€ game/       # Game-specific components
โ”‚   โ”‚   โ””โ”€โ”€ layout/     # Layout components (Navbar, etc.)
โ”‚   โ”œโ”€โ”€ hooks/          # Custom React hooks
โ”‚   โ”œโ”€โ”€ context/        # Wallet context provider
โ”‚   โ””โ”€โ”€ idl/            # Anchor IDL for contract interaction
โ”‚
โ””โ”€โ”€ server/              # Solana Smart Contract
    โ”œโ”€โ”€ programs/       # Rust program source
    โ”œโ”€โ”€ tests/          # Anchor tests
    โ””โ”€โ”€ target/         # Compiled programs

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+ and pnpm
  • Solana CLI
  • Anchor CLI (for smart contract development)
  • A Solana wallet with devnet SOL

๐ŸŽฒ How to Play

Step 1: Connect Wallet

Click the wallet button in the top-right corner and connect your Solana wallet.

Step 2: Initialize Game (First Time Only)

If the game hasn't been initialized, click "INITIALIZE PROTOCOL" to set up the game state.

Step 3: Seize the Throne

Click "SEIZE THRONE" and pay the required SOL to become the king. The price increases by 30% with each bid.

Step 4: Defend or Exit

  • Defend: Hold your position and pray no one outbids you
  • Exit Strategy: Get usurped for an instant 15% ROI

Step 5: Claim Victory

If you're the king when the timer hits zero, click "CLAIM JACKPOT" to withdraw the entire prize pool.


Profit Scenarios

Scenario Your Action Outcome
Quick Exit Get usurped immediately +15% ROI (instant profit)
Hold & Lose Get usurped after holding +15% ROI (instant profit)
Win Jackpot Last king standing +Entire Jackpot (potentially 100x+)

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ”— Links


โš ๏ธ Disclaimer

This is an experimental project built for educational and entertainment purposes. Smart contracts involve financial risk. Always do your own research and never invest more than you can afford to lose. This game is deployed on Solana Devnet for testing purposes.


Built with ๐Ÿ’œ by Anas

SolThrone โ€ข Where Only the Last Monarch Reigns

About

SolThrone is a high-stakes, blockchain-powered King of the Hill game on Solana where players compete to hold the throne and claim the jackpot. Built with Next.js, Anchor, and TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published