Skip to content

mason0510/eosDapps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

EOS DApps - Comprehensive Gaming Smart Contract Platform

EOS License C++

๐ŸŽฐ Overview

EOS DApps is a comprehensive gambling and gaming smart contract platform built on the EOS blockchain. This project implements multiple casino-style games with provably fair mechanics, sophisticated banking systems, and player engagement features.

๐ŸŽฎ Available Games

Game Description Features
Dice Number prediction game Simple betting, configurable odds
Blackjack Classic 21 card game Hit, stand, double, surrender
Baccarat Traditional card game Banker/Player betting
Roulette Wheel spinning game Multiple bet types
Slots Slot machine Multi-line betting
Bullfight Card-based game Traditional Chinese game
Quick3 Fast betting game Quick rounds
Red/Black Color prediction Simple 50/50 game
Scratch Lottery scratch cards Instant win mechanics

๐Ÿ—๏ธ Architecture

Core Components

  1. House Contract - Central banking and payment system
  2. Game Contracts - Individual game implementations
  3. Common Libraries - Shared utilities and templates
  4. Token Integration - Multi-token support

Key Features

  • โœ… Provably Fair Gaming - Cryptographic randomness verification
  • ๐Ÿฆ Multi-Token Support - Various cryptocurrency betting
  • ๐Ÿ“Š Player Statistics - Comprehensive tracking system
  • ๐ŸŽ Referral System - 0.5% bonus payments
  • ๐Ÿ” Security First - Multiple authorization layers
  • โšก Scalable Design - Modular contract architecture

๐Ÿš€ Quick Start

Prerequisites

  • EOSIO development environment
  • CMake 3.5+
  • C++17 compatible compiler

Building

git clone https://github.com/mason0510/eosDapps.git
cd eosDapps
mkdir build && cd build
cmake ..
make -j4

Deployment

  1. Deploy the house contract first:
cleos set contract house ./house -p house@active
  1. Deploy individual game contracts:
cleos set contract dice ./dice -p dice@active
cleos set contract blackjack ./blackjack -p blackjack@active
# ... repeat for other games
  1. Initialize the house contract:
cleos push action house init '[]' -p house@active

๐Ÿ’ก How It Works

Provably Fair System

The platform uses a sophisticated random number generation system:

  1. Seed Generation - Combines block data with game-specific parameters
  2. House Signature - Private key signing for verifiable randomness
  3. Hash Verification - SHA256 ensures tamper-proof results
  4. Public Verification - Players can verify game outcomes

Payment Flow

Player โ†’ Game Contract โ†’ House Contract โ†’ Payout Processing
                    โ†“
                Referral Bonuses & Statistics

๐Ÿ”ง Configuration

House Contract Settings

// Configure token support
cleos push action house addtoken '["EOS", "4,EOS", "eosio.token"]' -p house@active

// Set betting limits
cleos push action house setlimits '["EOS", "1.0000 EOS", "1000.0000 EOS"]' -p house@active

Game Parameters

Each game supports customizable parameters through memo fields:

  • Betting amounts
  • Game-specific options
  • Player preferences

๐Ÿ“Š Smart Contract Details

House Contract (house/)

  • Central banking and token management
  • Player statistics and history
  • Referral system implementation
  • Delayed payment handling

Game Contracts

Each game directory contains:

  • *.cpp - Main contract logic
  • *.hpp - Contract interface and tables
  • Game-specific mechanics and rules

Common Utilities (common/)

  • cards.hpp - Card game utilities
  • random.hpp - Cryptographic RNG
  • utils.hpp - General utilities
  • tables.hpp - Database helpers

๐Ÿ”’ Security Features

  • Authorization Checks - Multi-level permission system
  • Betting Limits - Configurable per token and game
  • Balance Verification - Pre-transaction validation
  • Emergency Controls - Contract pause mechanisms
  • Audit Trail - Comprehensive logging system

๐ŸŽฏ Player Features

Statistics Tracking

  • Total games played
  • Win/loss ratios
  • Betting history
  • Performance analytics

Reward System

  • Bonus point accumulation
  • Chest opening mechanics
  • Referral bonuses
  • Loyalty rewards

๐Ÿ› ๏ธ Development

Adding New Games

  1. Create game directory with contract files
  2. Implement game logic using provided templates
  3. Add to CMakeLists.txt
  4. Register with house contract

Testing

# Run unit tests
make test

# Deploy to testnet
./scripts/deploy_testnet.sh

๐Ÿ“ˆ Performance

  • Scalable Architecture - Handles high transaction volumes
  • Efficient Storage - Circular buffer history management
  • Gas Optimization - Minimal resource usage
  • Multi-Index Tables - Fast data retrieval

๐Ÿค Contributing

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

๐Ÿ“„ License

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

โš ๏ธ Disclaimer

This software is provided for educational and development purposes. Gambling may be illegal in your jurisdiction. Users are responsible for compliance with local laws and regulations.

๐Ÿ†˜ Support

๐Ÿ™ Acknowledgments

  • EOS.IO team for the blockchain platform
  • Community contributors and testers
  • Open source libraries and tools used

Built with โค๏ธ on EOS blockchain

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •