Search

PythonReactSEOPDF
OpenClaw

Genlayer Dev

GenLayer Intelligent Contracts

acastellana0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install acastellana/genlayer-dev

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

GenLayer Intelligent Contracts

GenLayer enables Intelligent Contracts - Python smart contracts that can call LLMs, fetch web data, and handle non-deterministic operations while maintaining blockchain consensus.

Quick Start

Minimal Contract
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class MyContract(gl.Contract):
    value: str
    
    def __init__(self, initial: str):
        self.value = initial
    
    @gl.public.view
    def get_value(self) -> str:
        return self.value
    
    @gl.public.write
    def set_value(self, new_value: str) -> None:
        self.value = new_value
Contract with LLM
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *
import json

class AIContract(gl.Contract):
    result: str
    
    def __init__(self):
        self.result = ""
    
    @gl.public.write
    def analyze(self, text: str) -> None:
        prompt = f"Analyze this text and respond with JSON: {text}"
        
        def get_analysis():
            return gl.nondet.exec_prompt(prompt)
        
        # All validators must get the same result
        self.result = gl.eq_principle.strict_eq(get_analysis)
    
    @gl.public.view
    def get_result(self) -> str:
        return self.result
Contract with Web Access
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class WebContract(gl.Contract):
    content: str
    
    def __init__(self):
        self.content = ""
    
    @gl.public.write
    def fetch(self, url: str) -> None:
        url_copy = url  # Capture for closure
        
        def get_page():
            return gl.nondet.web.render(url_copy, mode="text")
        
        self.content = gl.eq_principle.strict_eq(get_page)
    
    @gl.public.view
    def get_content(self) -> str:
        return self.content

Core Concepts

Contract Structure
  1. Version header: # v0.1.0 (required)
  2. Dependencies: `# { "Depends"...

Source information

Source
github
Repository
openclaw/skills
Path
skills/acastellana/genlayer-dev
Version
—
Commit
680ef4ede5c3b3f86b3f587e023faf80705fff2c
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

README

genlayer-dev-claw-skill

A Claw skill for building GenLayer Intelligent Contracts—Python smart contracts with LLM calls and web access.

Purpose

This skill helps AI assistants write and deploy Intelligent Contracts:

  • SDK API reference
  • Code examples and patterns
  • CLI commands
  • Deployment workflows
  • Equivalence principles

For explaining GenLayer concepts, use the companion skill: genlayer-claw-skill

What's Inside

File Description
SKILL.md Quick start, core concepts, common patterns
references/sdk-api.md Complete SDK API reference
references/equivalence-principles.md Consensus patterns in depth
references/examples.md Annotated contract examples
references/deployment.md CLI commands, networks, deployment
references/genvm-internals.md VM architecture, storage, ABI

Quick Example

# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class MyContract(gl.Contract):
    result: str
    
    def __init__(self):
        self.result = ""
    
    @gl.public.write
    def analyze(self, text: str) -> None:
        prompt = f"Analyze: {text}"
        
        def get_analysis():
            return gl.nondet.exec_prompt(prompt)
        
        self.result = gl.eq_principle.strict_eq(get_analysis)
    
    @gl.public.view
    def get_result(self) -> str:
        return self.result

Key Topics Covered

  • Contract structure — gl.Contract, decorators, state types
  • Storage types — DynArray, TreeMap, sized integers (u256, etc.)
  • Non-deterministic ops — gl.nondet.exec_prompt(), gl.nondet.web.render()
  • Equivalence principles — strict_eq, prompt_comparative, prompt_non_comparative, custom patterns
  • Contract interactions — Cross-contract calls, EVM interop
  • CLI — genlayer deploy, genlayer call, genlayer write
  • Networks — localnet, studionet, test...

Extracted content

SKILL.md
# GenLayer Intelligent Contracts

GenLayer enables **Intelligent Contracts** - Python smart contracts that can call LLMs, fetch web data, and handle non-deterministic operations while maintaining blockchain consensus.

## Quick Start

### Minimal Contract
```python
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class MyContract(gl.Contract):
    value: str
    
    def __init__(self, initial: str):
        self.value = initial
    
    @gl.public.view
    def get_value(self) -> str:
        return self.value
    
    @gl.public.write
    def set_value(self, new_value: str) -> None:
        self.value = new_value
```

### Contract with LLM
```python
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *
import json

class AIContract(gl.Contract):
    result: str
    
    def __init__(self):
        self.result = ""
    
    @gl.public.write
    def analyze(self, text: str) -> None:
        prompt = f"Analyze this text and respond with JSON: {text}"
        
        def get_analysis():
            return gl.nondet.exec_prompt(prompt)
        
        # All validators must get the same result
        self.result = gl.eq_principle.strict_eq(get_analysis)
    
    @gl.public.view
    def get_result(self) -> str:
        return self.result
```

### Contract with Web Access
```python
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class WebContract(gl.Contract):
    content: str
    
    def __init__(self):
        self.content = ""
    
    @gl.public.write
    def fetch(self, url: str) -> None:
        url_copy = url  # Capture for closure
        
        def get_page():
            return gl.nondet.web.render(url_copy, mode="text")
        
        self.content = gl.eq_principle.strict_eq(get_page)
    
    @gl.public.view
    def get_content(self) -> str:
        return self.content
```

## Core Concepts

### Contract Structure
1. **Version header**: `# v0.1.0` (required)
2. **Dependencies**: `# { "Depends"...
README
# genlayer-dev-claw-skill

A Claw skill for building GenLayer Intelligent Contracts—Python smart contracts with LLM calls and web access.

## Purpose

This skill helps AI assistants write and deploy Intelligent Contracts:
- SDK API reference
- Code examples and patterns
- CLI commands
- Deployment workflows
- Equivalence principles

**For explaining GenLayer concepts**, use the companion skill: [genlayer-claw-skill](https://github.com/acastellana/genlayer-claw-skill)

## What's Inside

| File | Description |
|------|-------------|
| `SKILL.md` | Quick start, core concepts, common patterns |
| `references/sdk-api.md` | Complete SDK API reference |
| `references/equivalence-principles.md` | Consensus patterns in depth |
| `references/examples.md` | Annotated contract examples |
| `references/deployment.md` | CLI commands, networks, deployment |
| `references/genvm-internals.md` | VM architecture, storage, ABI |

## Quick Example

```python
# v0.1.0
# { "Depends": "py-genlayer:latest" }
from genlayer import *

class MyContract(gl.Contract):
    result: str
    
    def __init__(self):
        self.result = ""
    
    @gl.public.write
    def analyze(self, text: str) -> None:
        prompt = f"Analyze: {text}"
        
        def get_analysis():
            return gl.nondet.exec_prompt(prompt)
        
        self.result = gl.eq_principle.strict_eq(get_analysis)
    
    @gl.public.view
    def get_result(self) -> str:
        return self.result
```

## Key Topics Covered

- **Contract structure** — `gl.Contract`, decorators, state types
- **Storage types** — `DynArray`, `TreeMap`, sized integers (`u256`, etc.)
- **Non-deterministic ops** — `gl.nondet.exec_prompt()`, `gl.nondet.web.render()`
- **Equivalence principles** — `strict_eq`, `prompt_comparative`, `prompt_non_comparative`, custom patterns
- **Contract interactions** — Cross-contract calls, EVM interop
- **CLI** — `genlayer deploy`, `genlayer call`, `genlayer write`
- **Networks** — localnet, studionet, test...

Related skills

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.