Loomii is a decentralized, AI-powered gaming platform built on GenLayer StudioNet.
It leverages GenLayer's Intelligent Contracts to bring a new level of fairness and unpredictability to Web3 gaming.
Loomii transforms traditional casino-style games into Intelligent Games. Instead of simple random number generators (RNG), Loomii uses GenLayer's Equivalence Principle (AI Consensus) to resolve game outcomes. This allows for complex, context-aware resolutions and unique vibes for every win or loss.
-
Dice: A high-stakes roll against the AI oracle.
-
Rock-Paper-Scissors (RPS): Classic strategy resolved by intelligent consensus.
-
Coin Flip: A simple 50/50, but with the oracle's cryptic commentary.
-
Mines: A strategic grid game where you avoid the hidden traps.
- Intelligent Contracts: Powered by Python-based GenLayer contracts.
- AI Oracle Resolution: Outcomes are determined by AI consensus, ensuring fairness and adding a layer of personality to the game engine.
- Gasless Experience: Optimized for the gasless testing environment of GenLayer StudioNet.
- Real-time Statistics: Track House Reserve, Total Wagered, and Total Paid directly from the smart contract.
- Deterministic Payouts: Secure, on-chain payouts executed automatically by the contract logic.
- Brutalist UI: A high-performance, dark-themed interface designed for precision and speed.
- Frontend: React 19, Vite, Tailwind CSS 4, Framer Motion, Lucide React.
- Blockchain:
ethers.js: For interacting with GenLayer Intelligent Contracts via standard Ethereum providers.genlayer-js: A cutting-edge integration that brings Intelligent Contracts to life.
- Smart Contract: Python (GenLayer Intelligent Contract framework).
The core logic resides in a GenLayer Intelligent Contract:
wager(game_type, data): Accepts wagers in GEN tokens.resolve_game(player_address, game_type, bet_amount, player_data): The AI-driven resolution engine that uses the Equivalence Principle to determine winners.get_stats(): Returns real-time contract metrics.
Network Transition This project was originally architected for GenLayer Bradbury. However, due to the migration to GenLayer StudioNet, certain transaction behaviors have been adjusted:
Gasless Transactions: StudioNet currently supports gasless testing. Unlike the original Bradbury specification which required a non-zero stake for state transitions, StudioNet allows for logic execution without a mandatory amount in some contexts.
The Zero-Bet Traceback: You may encounter an AssertionError: Bet amount must be greater than zero if the frontend defaults to 0. While StudioNet is gasless, the Smart Contract Logic still enforces a > 0 bet to maintain the integrity of the game's Wager/Payout economic model.
Why the Assertion Remains Even though the network is currently gasless, we have kept the assert amount > 0 check in loomii_contract.py (Line 23) because:
Economic Integrity: A gambling/gaming contract requires a stake to calculate a proportional payout.
Future Proofing: Ensuring the code remains compatible with the Bradbury economic model once value-based transactions are re-enabled.
- Node.js (v18+)
- MetaMask
- GenLayer Account (StudioNet)
- Python 3.10+ and
pipinstalled on your system.
Clone the repository and navigate into the project directory:
git clone https://github.com/ODbeke/gen-loomii.git
cd gen-loomii# Create the environment
python -m venv venv
# Activate it (Windows)
venv\Scripts\activate
# Activate it (Mac/Linux)
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
touch .envOpen the .env file and paste the following configuration:
RPC_URL="https://studio.genlayer.com/api"
CHAIN_ID=61999
CONTRACT_ADDRESS="0x33f2DAef61d792D1cFA2fE9635A873387e768775"
PRIVATE_KEY="your_actual_private_key_here"Once your .env is configured with your private key, you can start the application:
python main.py| Network Name | GenLayer StudioNet |
| RPC URL | https://studio.genlayer.com/api |
| Chain ID | 61999 |
| Currency Symbol | GEN |
- Main Games: Fully Functional on StudioNet.
- Bridge: Currently Under Construction 🛠️ (Upgrading for enhanced cross-chain support).
Built for the GenLayer Testnet Bradbury Hackaton.