This is a starter project for building on GenLayer, a platform for writing intelligent contracts that can access the web and call LLMs. It ships a complete example (a football bets game) that shows how to structure contracts, test them, and connect a frontend. It's aimed at developers new to GenLayer who want a working reference instead of starting from an empty repo.
The example contract lets users bet on football match outcomes, fetches results from BBC Sport after the match, and uses an LLM to extract the score, validating the result through GenLayer's equivalence principle. Points accumulate per correct prediction and a leaderboard can be queried.
genvm-lint) that catches forbidden imports, invalid storage types, missing decorators, and non-deterministic operations before deployment.It's not a fit if you need a production-ready betting application as-is (it's a demo contract, not audited for real-money use), or if your use case has nothing to do with intelligent contracts or GenLayer's specific execution model. It also assumes familiarity with Python for contract code and TypeScript/Next.js for the frontend; it isn't a general-purpose smart contract framework for other chains.
Requirements: Python >= 3.12, the GenLayer CLI installed globally, and GenLayer Studio (local or hosted) for integration tests and deployment.
npm install -g genlayer
Set up the Python environment:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Lint the contract before testing:
genvm-lint check contracts/football_bets.py
Run direct mode tests (no Studio required):
pytest tests/direct/ -v
Deploy the contract once you've picked a network:
genlayer network
genlayer deploy
Run integration tests against a running GenLayer Studio instance:
gltest tests/integration/ -v -s
Set up the frontend by copying frontend/.env.example to frontend/.env, adding your deployed contract address as NEXT_PUBLIC_CONTRACT_ADDRESS, then:
cd frontend
npm install
npm run dev
The app runs at http://localhost:3000/.