Rechercher

PythonReactSEOPDF
OpenClaw

Genlayer Dev

GenLayer Intelligent Contracts

acastellana0 installations selon la source☆ 0 Étoiles du dépôt

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install acastellana/genlayer-dev

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

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"...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/acastellana/genlayer-dev
Version
—
Commit
680ef4ede5c3b3f86b3f587e023faf80705fff2c
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

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...

Contenu extrait

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...

Skills associés

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.