v0 source pure
Package framelab probes, at runtime, which realm frame pure-package code executes in when a realm forwards its own \`...
View source
gno.land/p/moul/x/framelab/v0
A 30-line probe for one language property: pure-package code runs in the frame
of the realm that imported it, when that realm forwards its own cur.
The instance-per-realm pattern (p/moul/x/pair/v0) rests entirely on this. If
the frame shifted, a shared p/ could not move an instance's funds and every
instance would have to carry its own copy of the logic.
r/moul/x/framelab/probe/v0 is the realm that exercises it, and asserts:
- pure-package code reports the instance realm's path and address;
- the forwarded
rlm.IsCurrent()is still true, so grc20's spoof check passes; - a
TransferFromissued from inside the pure package credits the instance realm's own address.
It also pins the two rules found while proving it: a pure package cannot declare
a crossing function (func F(cur realm, ...)), and the realm parameter cannot be
named cur there. Hence the (_ int, rlm realm, ...) shape used throughout.
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:

🧪 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.
Package framelab probes, at runtime, which realm frame pure-package code executes in when a realm forwards its own `cur` into it.
The whole instance-per-realm ("factory") pattern rests on the answer: if a p/ helper acting on `cur` binds to the *importing realm's* identity, then a 20-line instance realm can hold state and funds while every line of logic lives in one shared pure package. If instead the frame shifts, the pattern is dead and each instance has to carry its own copy of the logic.