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

untrusted-render: live is the only stored string Render echoes, and SetLive validates it with assertPkgPath before st...

Readme View source

gno.land/r/moul/x/upgrade/store/root/v0

The data realm of pattern C. Holds the counter and grants write access to exactly one logic realm at a time, identified by the package path read off the crossing frame. SetLive(path) is the upgrade.

See the pattern and the exploration.


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/upgrade/store/root/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

untrusted-render: live is the only stored string Render echoes, and SetLive validates it with assertPkgPath before storing it.

Package root is the data realm of the "state realm + swappable logic" upgrade pattern (pattern C of the exploration; see ../../README.md).

root holds the state and nothing else worth changing. It grants write access to exactly one logic realm at a time, identified by package path off the crossing frame rather than passed in as an argument, so a logic realm cannot claim to be a path it does not occupy. Upgrading is a single SetLive call: no migration, no downtime, and the data never moves.

Variables 1

Functions 5

func Get

Action
1func Get() int
source

Get is open to everyone: the data is public, only writes are gated.

func Inc

crossing Action
1func Inc(cur realm, n int) int
source

Inc adds n to the stored counter. Only the live logic realm may call it.

func Live

Action
1func Live() string
source

Live is the package path currently allowed to write.

func SetLive

crossing Action
1func SetLive(cur realm, pkgPath string)
source

SetLive hands write access to another logic realm. This is the upgrade.

Imports 3

Source Files 4