Skip to content

UnityNodes/Skylar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฒ Skylar Roulette - Decentralized Gaming Platform

๐Ÿ“‹ Project Overview

Skylar Roulette is an innovative decentralized gaming platform built on the Linera blockchain using Rust and React. The project represents a fully functional casino application with case opening mechanics, where players can obtain items of various rarities.

๐Ÿ—๏ธ Project Architecture

Backend (Rust + Linera SDK)

  • Smart Contract (src/contract.rs) - core game logic
  • Service Layer (src/service.rs) - GraphQL API for frontend interaction
  • State Management (src/state.rs) - player and game state management
  • GraphQL Schema (src/graphql.rs) - schema for queries and mutations

Frontend (React + JavaScript)

  • React Application - modern user interface
  • Component Architecture - modular component structure
  • Linera Integration - blockchain integration via GraphQL

๐ŸŽฎ Core Features

Game Mechanics

  • Player Registration - account creation in smart contract
  • Case Opening - main game mechanics for tokens
  • Rarity System - 5 levels of item rarity:
    • Common (50% chance, 10 tokens)
    • Rare (25% chance, 25 tokens)
    • Epic (15% chance, 50 tokens)
    • Legendary (8% chance, 100 tokens)
    • Mythic (2% chance, 500 tokens)

User Features

  • Token Balance - in-game currency management
  • Player Statistics - tracking wins and opened cases
  • Leaderboard - ranking of top players
  • Game History - viewing results

Wallet Integration

  • MetaMask Support - seamless wallet connection
  • Ethereum Network - built for Ethereum blockchain
  • Real-time Balance - automatic balance updates
  • Secure Transactions - blockchain-based security

๐Ÿ› ๏ธ Technology Stack

Blockchain & Backend

  • Linera SDK - framework for dApp development
  • Rust - systems programming language for smart contracts
  • GraphQL - API for frontend interaction
  • Serde - data serialization

Frontend & UI

  • React 18 - modern UI library
  • TailwindCSS - utility-first CSS framework
  • JavaScript ES6+ - modern JavaScript
  • PostCSS - CSS processing
  • MetaMask Integration - Web3 wallet connectivity
  • Ethereum Integration - native Ethereum support

๐Ÿ“ Project Structure

skylar-roulette/
โ”œโ”€โ”€ src/                          # Application source code
โ”‚   โ”œโ”€โ”€ contract.rs              # Smart contract (Rust)
โ”‚   โ”œโ”€โ”€ service.rs               # GraphQL service (Rust)
โ”‚   โ”œโ”€โ”€ state.rs                 # Application state (Rust)
โ”‚   โ”œโ”€โ”€ graphql.rs               # GraphQL schema (Rust)
โ”‚   โ”œโ”€โ”€ lib.rs                   # Main library (Rust)
โ”‚   โ”œโ”€โ”€ App.jsx                  # Main React component
โ”‚   โ”œโ”€โ”€ components/              # React components
โ”‚   โ”‚   โ”œโ”€โ”€ Header/              # Application header with wallet
โ”‚   โ”‚   โ”œโ”€โ”€ Roulette/            # Roulette game component
โ”‚   โ”‚   โ”œโ”€โ”€ Rewards/             # Rewards display section
โ”‚   โ”‚   โ”œโ”€โ”€ Leaderboard/         # Player leaderboard
โ”‚   โ”‚   โ”œโ”€โ”€ Modals/              # Modal windows (login, FAQ)
โ”‚   โ”‚   โ”œโ”€โ”€ Wallet/              # Wallet integration components
โ”‚   โ”‚   โ””โ”€โ”€ Footer/              # Application footer
โ”‚   โ”œโ”€โ”€ contexts/                # React contexts
โ”‚   โ”‚   โ””โ”€โ”€ UserContext.js       # User state management
โ”‚   โ”œโ”€โ”€ utils/                   # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ walletUtils.js       # Wallet connection utilities
โ”‚   โ”‚   โ””โ”€โ”€ imageUtils.js        # Image processing utilities
โ”‚   โ””โ”€โ”€ styles/                  # CSS styles
โ”œโ”€โ”€ frontend-integration/         # Linera blockchain integration
โ”‚   โ”œโ”€โ”€ lineraClient.js          # Linera client connection
โ”‚   โ””โ”€โ”€ UserContextLinera.js     # Linera user context
โ”œโ”€โ”€ public/                      # Static assets
โ”‚   โ”œโ”€โ”€ images/                  # Game images and icons
โ”‚   โ””โ”€โ”€ index.html               # Main HTML template
โ”œโ”€โ”€ scripts/                     # Deployment and build scripts
โ”œโ”€โ”€ Cargo.toml                   # Rust dependencies
โ”œโ”€โ”€ linera.toml                  # Linera configuration
โ”œโ”€โ”€ package.json                 # Node.js dependencies
โ””โ”€โ”€ README.md                    # Project documentation

๐Ÿš€ API Endpoints

GraphQL Queries

  • player(owner: String!) - get player information
  • leaderboard(limit: Int) - get leaderboard
  • gameStats - get game statistics

GraphQL Mutations

  • registerPlayer - register new player
  • openCase(input: OpenCaseInput!) - open case

GraphQL Subscriptions

  • caseOpened - subscribe to case opening events

๐ŸŽฏ Implementation Features

Security

  • Provable Fairness - all results recorded on blockchain
  • Decentralization - no single point of failure
  • Immutability - impossible to alter game results

Performance

  • Linera Microchains - high scalability
  • Low Latency - fast transactions
  • Efficient Serialization - optimized data storage

User Experience

  • Responsive Design - works on all devices
  • Real-time Updates - instant updates via WebSocket
  • Intuitive Interface - ease of use
  • Wallet Integration - seamless MetaMask connection
  • Multi-language Support - English interface
  • Visual Feedback - animated loading states and wallet interactions

๐Ÿ”ง Installation and Setup

Requirements

  • Rust 1.70+ - for smart contract development
  • Node.js 18+ - for frontend development
  • Linera CLI - for blockchain deployment
  • MetaMask - for wallet functionality

Backend (Rust)

# Build smart contract
cargo build --release

# Deploy to Linera
linera project publish-and-create

Frontend (React)

# Install dependencies
npm install

# Run in development mode
npm start

# Build for production
npm run build

Wallet Setup

  1. Install MetaMask - browser extension or mobile app
  2. Connect Wallet - click "Connect Wallet" in the app
  3. Ethereum Network - ensure you're connected to Ethereum Mainnet

๐Ÿ‘ฅ Development Team

Builders: 0xFearless, Tenespir, good_boy98

๐Ÿ“„ License

This project is developed and provided strictly for demonstration purposes, illustrating a robust implementation of game logic and smart contract best practices in Rust. Unauthorized use, reproduction, or distribution of this project, in whole or in part, for any commercial or proprietary purpose, is strictly prohibited.

๐Ÿ”ฎ Future Development

Planned Features

  • Multiplayer Modes - play with friends
  • NFT Integration - unique items as NFTs
  • Tournaments - competitive events
  • Layer 2 Solutions - potential L2 integrations
  • Hardware Wallet Support - Ledger, Trezor compatibility

Technical Development

  • Performance Optimization - improved transaction speed
  • Advanced Analytics - detailed player statistics
  • Mobile Application - native iOS/Android apps
  • Additional Game Modes - new types of games
  • Enhanced Wallet Features - transaction history, gas optimization

๐Ÿ’ก Vision for Linera Integration

While Skylar Roulette currently functions as a standalone Rust contract, the strategic, long-term vision is its deep integration with the Linera blockchain. Linera's microchain architectureโ€”purpose-built for horizontal scalability and extremely low latencyโ€”makes it the ideal environment for interactive, real-time gaming applications.

Integration with Linera delivers:

  • Massive Scalability - ability to support extremely high transaction volumes without performance degradation
  • Low Latency - real-time transaction finality crucial for smooth and immersive gameplay experiences
  • True Decentralization - enhanced security and resilience across a distributed infrastructure
  • Interoperability - potential to integrate and interact with other decentralized applications within the broader Linera ecosystem

๐ŸŽฒ Demonstration

The contract's full operational workflow can be explored using the demo_client.py script. This client simulates the complete user journeyโ€”from initial registration and balance checks to opening cases and comprehensive error handlingโ€”providing a clear view of the system's behavior under real-world conditions.


Skylar Roulette demonstrates the capabilities of modern decentralized technologies in the gaming industry, combining blockchain security with the convenience of traditional gaming platforms.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published