Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Package handles is a tiny on-chain nickname registry.

Readme View source

handles

⚠️ Experimental — generated with no human supervision. This realm was produced automatically by an MCP-driven agent to exercise the gno MCP server and tooling, and to generate test content for gno compilers, linters and formatters. Not audited. Not for production. Full context & folder README: r/moul/x/daily


A tiny on-chain nickname registry. Any address can claim one unique handle (3-20 lowercase letters/digits, starting with a letter), attach a short bio, transfer the handle to another address, or release it back into the pool. Two avl.Tree indexes (handle -> record, owner -> record) keep lookups in both directions cheap and deterministic.

Realm path: gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/handles

Example calls

Register(cur, "moul")          # claim the handle "moul" for the caller
SetBio(cur, "building gno stuff")
Transfer(cur, g1...recipient)  # hand the handle to another address
Release(cur)                   # free the handle back up
OwnerOf("moul")                 # (address, bool)
HandleOf(g1...)                 # (string, bool)
Count()                         # number of registered handles

Render("") lists every registered handle in a table; Render("/moul") shows a single handle's detail page (owner, bio, block registered).

Toolchain status

Built and tested against a local gno build at master.3130+bf5b31eda (GNOROOT pointed at a full gnolang/gno checkout). gno test . and gno lint . both pass (6 tests, 0 lint issues). Note for test authors: plain recover() did not catch panics thrown across a cross(cur) boundary in this toolchain build — the non-crossing call form (Register(cur, ...) instead of Register(cross(cur), ...)) was used in the two panic-expectation tests instead, since no realm boundary is crossed and there was nothing to revive.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/handles/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package handles is a tiny on-chain nickname registry.

Any address may claim one unique handle (3-20 lowercase letters/digits, starting with a letter), attach a short bio, transfer the handle to another address, or release it back to the pool. It is deliberately small: two AVL indexes (handle -> record, address -> record) and a handful of guarded mutators.

Functions 7

func Count

Action
1func Count() int
source

Count returns the number of currently registered handles.

func HandleOf

Action
1func HandleOf(addr address) (string, bool)
source

HandleOf returns the handle owned by addr, if any.

func Register

crossing Action
1func Register(cur realm, handle string)
source

Register claims handle for the caller. Aborts if the handle is invalid, already taken, or the caller already owns a handle (release it first).

func Release

crossing Action
1func Release(cur realm)
source

Release frees the handle owned by the caller, making it claimable again.

func Render

1func Render(path string) string
source

Render renders Markdown. "/" lists every handle; "/<handle>" shows a single record's detail.

func SetBio

crossing Action
1func SetBio(cur realm, bio string)
source

SetBio updates the bio of the handle owned by the caller.

func Transfer

crossing Action
1func Transfer(cur realm, to address)
source

Transfer moves the caller's handle to another address that does not already own one.

Imports 5

Source Files 3