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

v1 source realm

Readme View source

Escrow

⚠️ 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 minimal 2-party escrow realm for gno.land (a port of the classic Solidity escrow idea, accounting only — no funds move). One party opens a deal against a counterparty with free-form terms; both parties confirm to settle it, and the creator can cancel any deal that is still open.

Realm path: gno.land/r/REPLACE_ADDR/escrow

Example calls

# Alice opens a deal with Bob; returns the new deal id (e.g. 0)
Create(g1bob..., "swap NFT for 100 GNOT")

# Each party confirms; when both have confirmed, the deal becomes "Settled"
Confirm(0)   # called by Alice
Confirm(0)   # called by Bob -> Settled

# The creator may cancel while the deal is still Open
Cancel(0)    # called by Alice

Read (Render)

  • / — table of all deals: id, parties, state, confirmations, terms.
  • /<id> — details for a single deal (e.g. /0).

What changed in v1

Identical behaviour to v0 apart from rendering, which now goes through p/moul/kit/ui instead of the local short, escapePipe helpers.

One address format. Eleven realms carried their own shortAddr with four different truncation rules, so the same account rendered differently depending on which realm you opened. ui.Addr is that decision made once: 8 leading characters, an ellipsis, 4 trailing, in backticks.

Real escaping. The local helper replaced a handful of markdown metacharacters. ui.Inline and ui.Cell delegate to p/nt/markdown/sanitize, which also strips bidi and zero-width characters and folds newlines, so user text cannot reorder or escape the line it sits on.

Visible change: addresses now render in monospace.

The rendering change means the output differs from v0, which under this repo's versioning rule is a compatibility change, hence a new version rather than an edit in place. v0 stays live and untouched.


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/escrow/v1 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.

Constants 1

Functions 4

func Cancel

crossing Action
1func Cancel(cur realm, id int)
source

Cancel voids an open deal. Only the creator may cancel, and only before the deal has settled.

func Confirm

crossing Action
1func Confirm(cur realm, id int)
source

Confirm records confirmation by whichever party is calling. Once both parties have confirmed, the deal transitions to Settled.

func Create

crossing Action
1func Create(cur realm, counterparty address, terms string) int
source

Create opens a new escrow deal between the caller (creator) and the given counterparty, governed by a free-form terms string. Returns the new deal id. Panics on invalid input (cross-realm abort).

func Render

1func Render(path string) string
source

Render lists all escrow deals with their parties, terms, and state. When path is a numeric id, renders just that deal.

Types 1

type Deal

struct
1type Deal struct {
2	ID           int
3	Creator      address
4	Counterparty address
5	Terms        string
6	State        string
7	CreatorOK    bool
8	CounterOK    bool
9}
source

Deal is a 2-party escrow record. Accounting only: no funds move, this tracks agreement and mutual confirmation between two parties.

Imports 7

Source Files 4