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

Package lock is version 1 of the "retire the predecessor" upgrade pattern (pattern B of the exploration; see ../READM...

Readme View source

gno.land/r/moul/x/upgrade/lock/v1

Version 1 of the retire the predecessor upgrade pattern (pattern B). Refuses every write until v0 has been retired onto it, then folds v0's frozen total into its own. At most one version is writable at any height, so there is a single authoritative answer.

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

Overview

Package lock is version 1 of the "retire the predecessor" upgrade pattern (pattern B of the exploration; see ../README.md).

v1 refuses every write until v0 has been retired. That is the whole point: at most one version is writable at any height, so v1 can safely fold v0's frozen total into its own and report a single authoritative number, the thing pattern A cannot do.

Constants 1

const Predecessor

1const Predecessor = "gno.land/r/moul/x/upgrade/lock/v0"
source

Predecessor is the version this one supersedes.

Functions 4

func Get

Action
1func Get() int
source

Get returns the predecessor's frozen total plus this version's own.

func Inc

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

Inc adds n once the predecessor is frozen.

func Live

Action
1func Live() bool
source

Live reports whether the handover has happened.

Imports 2

Source Files 4