One email each morning — yesterday's AI, sortedGet it in your inbox

METAL LAB

genlayerlabs/genlayer-project-boilerplate

16,259+430 todayTypeScript

A sample smart contract that reads football match results with AI and settles bets

This is a boilerplate project for GenLayer, a blockchain platform, showing how to build an intelligent contract that lets users bet on football match outcomes. The contract fetches match results from BBC Sport, uses an LLM to extract the score, and settles bets, all wrapped with a linter, fast mock tests, full integration tests, and a Next.js frontend. It has 16259 stars, making it a widely used starting point in the GenLayer ecosystem.

What it does

  1. Uses a football betting contract as a working example of an 'intelligent contract' that combines web access with LLM integration
  2. genvm-lint checks contracts before deployment, catching forbidden imports, invalid storage types, and other rule violations
  3. Direct mode tests mock web and LLM calls to run in milliseconds, while integration tests deploy to a real GenLayer Studio and verify actual consensus behavior
  4. After a match, the contract fetches the BBC Sport page, has an LLM extract the score, and validates the result through the 'equivalence principle' consensus check
  5. Ships with a production-style Next.js 15 frontend in TypeScript plus deployment scripts, covering the whole path from contract to UI

Why it matters

It gives developers a concrete, working example of a decentralized application that combines blockchain logic with live web data and AI judgment, rather than a purely theoretical description. It also demonstrates a fast development loop, using only the linter and in-memory tests, useful for AI coding agents that need quick feedback without running a full Studio instance.

Terms in this repo

  • intelligent contract · GenLayer's term for a smart contract that can do more than usual, such as accessing the web or calling an LLM
  • LLM · a large language model that understands and generates text
  • equivalence principle · GenLayer's consensus mechanism where validators compare non-deterministic web/LLM results to agree on an outcome
  • GenVM linter · a static analysis tool that checks contract code for forbidden calls or invalid storage types before deployment
  • direct mode tests · in-memory tests that mock web requests and LLM calls to run quickly without a live Studio

Repository description (English)

genlayerlabs/genlayer-project-boilerplate

Open on GitHub

Trending repos

All repos →

Latest from METAL LAB