Solana Blockchain Game
A full-stack blockchain virtual pet game built on Solana, combining NFT collectible mechanics with evolution systems and real-time stat decay
Clean separation between on-chain logic and frontend interface
Core systems that power the NeuroBeasts experience
Mint unique creatures with 10 species and pseudo-random visual traits (color, pattern, accessory) stored on-chain via PDAs.
seeds = [b"neurobeast", owner, &[species]]
Four-stage progression from Baby to Legendary with increasing XP thresholds. Stats fully restored on evolution.
Baby → Teen → Adult → Legendary
Stats realistically decay over time. Hunger rises, happiness and energy fall. Neglect causes cascading health loss.
if hunger > 80 || happiness < 20 { health-= }
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
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)
Send items to other players. Sender inventory decremented, receiver inventory incremented — no receiver signature needed.
seeds = [b"inventory", receiver]
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
Explore each layer of the NeuroBeasts stack
The Solana program in Rust/Anchor — 12 instructions covering minting, feeding, playing, healing, evolution, purchasing, and gifting.
React components for the game UI — wallet connection, animated stat bars, minting form, and game flow management.
Custom React hook abstracting blockchain interactions plus Anchor program initialization and PDA derivation utilities.
Comprehensive Mocha/Chai test suite covering initialization, feeding, evolution, decay, purchasing, and gifting.
Command-line tools for minting pets and initializing inventories directly from the terminal.