Solana Blockchain Game

NeuroBeasts

A full-stack blockchain virtual pet game built on Solana, combining NFT collectible mechanics with evolution systems and real-time stat decay

792
LINES OF RUST
12
ON-CHAIN
INSTRUCTIONS
10
PET SPECIES
4
EVOLUTION
STAGES
Nebula LEGENDARY
Level 16 Adult
Species 3
HP 100 XP 15,240 Fed 47
STR
100
HAP
85
HNG
12
ENG
92
CLR
7
PTN
3

Project Architecture

Clean separation between on-chain logic and frontend interface

FRONTEND
React 18 UI
Wallet Adapter
Component System
↓ @coral-xyz/anchor ↓
BLOCKCHAIN
Smart Contract (Rust)
PDA Accounts
Solana Devnet
↓ On-Chain Storage ↓
DATA
NeuroBeast NFT
Inventory Table
GameConfig PDA

Game Mechanics

Core systems that power the NeuroBeasts experience

🧬

NFT Pet Minting

Mint unique creatures with 10 species and pseudo-random visual traits (color, pattern, accessory) stored on-chain via PDAs.

seeds = [b"neurobeast", owner, &[species]]
📈

Evolution System

Four-stage progression from Baby to Legendary with increasing XP thresholds. Stats fully restored on evolution.

Baby Teen Adult Legendary
⏱️

Time-Based Decay

Stats realistically decay over time. Hunger rises, happiness and energy fall. Neglect causes cascading health loss.

if hunger > 80 || happiness < 20 { health-= }
🎒

Inventory & Items

8 item types across 4 categories with tiered effects. Basic, premium, and deluxe variants with different stat impacts.

food_basic: 20 | premium: 50 | deluxe: 100
💰

SOL Marketplace

Purchase items with real SOL transfers to the game treasury. Prices range from 0.01 to 0.2 SOL per item.

system_instruction::transfer(buyer, treasury)
🎁

Player Gifting

Send items to other players. Sender inventory decremented, receiver inventory incremented — no receiver signature needed.

seeds = [b"inventory", receiver]

Project Structure

sol-chainsaw/
  programs/neurobeasts/
    src/lib.rs          # Smart contract (792 lines, Rust)
    Cargo.toml          # Rust dependencies
  app/src/
    App.tsx             # Root component + wallet setup
    components/
      Game.tsx          # Main game container
      NeuroBeastCard.tsx# Pet stats + actions UI
      MintForm.tsx      # NFT minting form
    hooks/
      useNeuroBeast.ts  # Blockchain interaction hook
    utils/
      anchor.ts         # Program init + PDA helpers
    index.css           # Gradient styles + animations
  tests/
    neurobeasts.ts      # Integration test suite (428 lines)
  scripts/
    mint-neurobeast.js  # CLI minting script
  Anchor.toml           # Anchor framework config

Browse the Code

Explore each layer of the NeuroBeasts stack