-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Overview
i have launched genlayer-utils — a reusable patterns library for GenLayer contracts that directly addresses several improvement suggestions from the recent ecosystem report (see issue #346).
What was solved
Instead of every contract developer writing the same 15‑20 lines of boilerplate, genlayer-utils provides:
1. Best Practices Guide (#7)
✅ Complete documentation for:
- Non‑deterministic patterns (web + LLM + consensus)
- LLM prompt engineering for contracts
- Access control patterns
- Storage optimization
- Web oracle patterns
2. Access Control Primitives (#11)
✅ Ready‑to‑copy patterns:
require_sender()— owner checksrequire_value()— payment validation- Ownable pattern
- Role‑based access control
3. Storage Helpers (#10)
✅ Solutions for TreeMap/DynArray limitations:
treemap_paginate()— pagination without range queriesaddress_map_to_dict()— type conversionincrement_or_init()— counter initialization
The library
Repo: https://github.com/luch91/genlayer-utils
Design:
- Copy‑paste friendly (contracts are single Python files)
- No runtime imports needed
- Five focused modules
- Four complete example contracts
Real SDK gaps that remain
These would need SDK changes (not solved by a patterns library):
- add files in gitignore #3 — Outdated API docs (migration guide exists but not swept)
- Define Initial Content Structure #6 — Event querying/filtering
- Docs - Draft glossary of key GenLayer terms and acronyms #8 — Gas estimation
- Create a guide on the GenLayer transaction lifecycle #12 — Timeout/retry controls for web & LLM calls
- Docs - GenLayer simulator concept docs #20 — No documented upgrade pattern (could add to patterns library)
Call for collaboration
i will love:
- Feedback – What patterns are missing?
- Contributions – More example contracts
- SDK team input – Which gaps are in‑flight?
Let's turn issue #346 into a guide for both SDK improvements AND ecosystem patterns.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels