Stellar-Arcade Contract README (Soroban + Dart Integration) 🧾 Overview
Stellar-Arcade Contracts power the decentralized gaming logic of the platform using the Stellar ecosystem and **Soroban smart contracts.
These contracts enable:
On-chain game validation Score tracking Leaderboards Reward distribution
Although contracts are written in Rust (Soroban requirement), Dart SDKs are used for interaction and integration.
🎯 Features
🎮 On-Chain Game Logic
Verifiable gameplay outcomes
Anti-cheat enforcement at contract level
🏆 Immutable Leaderboards
Daily and global rankings
Fully transparent and tamper-proof
💰 Tokenized Rewards
Rewards distributed in Stellar-based tokens
Claimable directly from contract
🔐 Wallet-Based Identity
Uses Stellar wallet addresses as identity
No centralized authentication
🏗️ Tech Stack
Smart Contracts: Rust (Soroban)
Blockchain: Stellar
Contract SDK: Soroban SDK
Client Interaction: Dart (Stellar SDK bindings)
📂 Project Structure
contracts/
├── src/
│ ├── lib.rs
│ ├── arcade.rs # Core game logic
│ ├── leaderboard.rs # Ranking system
│ ├── rewards.rs # Reward distribution
│ └── storage.rs # Persistent storage
├── Cargo.toml
└── README.md
⚙️ Core Functions
🎮 Game
start_session(player: Address)
submit_score(player: Address, score: u32)
end_session(player: Address)
📊 Leaderboard
get_daily_leaderboard(day: u64)
update_leaderboard()
💸 Rewards
distribute_rewards(day: u64)
claim_rewards(player: Address)
🔄 Contract Flow
Player connects wallet
Starts a session
Plays game off-chain
Score submitted via Dart backend/frontend
Contract validates & stores score
Leaderboard updates
Rewards distributed
🔐 Security
Signature verification via Stellar accounts
Immutable on-chain records
Replay attack protection
Score validation logic enforced
🚀 Deployment
Build
cargo build --target wasm32-unknown-unknown --release
Deploy
soroban contract deploy
--wasm target/.../stellar_arcade.wasm
--source
🧪 Testing
cargo test
🔮 Future Enhancements
NFT rewards
Tournament contracts
Cross-game asset interoperability
DAO governance
⚙️ Stellar-Arcade Backend README (Dart Server)
🧾 Overview
The Stellar-Arcade Backend is built using Dart, serving as a high-performance bridge between the frontend and the Stellar network.
It provides:
Game session orchestration Score validation Blockchain interaction Real-time updates 🎯 Responsibilities Validate gameplay data before on-chain submission Interact with Soroban contracts Manage caching and leaderboards Provide APIs for frontend apps 🏗️ Tech Stack Language: Dart Framework: Dart Frog / Shelf Blockchain SDK: Stellar SDK (Dart bindings) Database: PostgreSQL (optional) Cache: Redis (optional) 📂 Project Structure backend/ ├── lib/ │ ├── controllers/ │ │ └── game_controller.dart │ ├── services/ │ │ ├── game_service.dart │ │ ├── stellar_service.dart │ │ └── leaderboard_service.dart │ ├── middleware/ │ │ └── auth_middleware.dart │ ├── models/ │ └── utils/ ├── routes/ ├── pubspec.yaml └── README.md 🔌 API Endpoints 🎮 Game POST /game/start POST /game/submit-score GET /leaderboard GET /history 🔐 Authentication Wallet-based authentication Signed message verification Stateless sessions 🌉 Blockchain Integration
Backend communicates with:
Stellar RPC endpoints Soroban smart contracts Transaction signing & submission ⚡ Architecture Flow Flutter App / Web App ↓ Dart Backend (API Layer) ↓ Soroban Smart Contract ↓ Stellar Network 🚀 Getting Started Install Dependencies dart pub get Run Server dart run bin/server.dart 🔧 Environment Variables PORT=8080 STELLAR_RPC_URL= NETWORK=testnet CONTRACT_ID= JWT_SECRET= DATABASE_URL= REDIS_URL= 🧪 Testing dart test 📊 Design Principles Minimal trust backend Fast validation layer Event-driven updates Scalable architecture 🔮 Future Improvements WebSocket real-time gameplay Anti-cheat AI validation Analytics service Multi-region deployment