Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

pafta package

Overview

Package pafta is the adapter that registers the Pafta engine (p/…/sinopia/art/pafta/v1) with core. Core knows the engine only as this realm's package path plus an interface value.

Pafta is a collection-level engine: 256 tokens are the 256 sheets of one map. Which map and which sheet a token is must stay unknown until the sale is over (otherwise buyers could target the summit or the lone island), so both come from the collection's final salt (art.Placement):

  • core's own TokenURI / TokenCard / TokenTraits call for a Final Pafta collection is "placed": core passes the collection's final salt in engine.Input.Salt (core-final round), Render and Traits check that the seed is exactly core's (seed == safe.Seed(cid, tid, salt)) and draw sheet tile(tid) of map mapSeed(cid, salt) — no read-back of core;
  • everything else is "standalone" (art.Render / art.Traits of the seed): core.RenderWith / RenderWithInput / EngineTraits (CollectionID "0", Salt ""), the registration sample and any forged input;
  • before Final core never calls Render or Traits (placeholder / "Unrevealed"), core.Salt is "" and so are Sheet and Sheets here;
  • CheckLaunch refuses any supply but 256 (one token per sheet) and GateLaunch (engine.LaunchGate) refuses open mode: an open collection's salt is public from Launch, so a shared map would be targetable. Every Pafta collection is therefore a 256-sheet commit-reveal collection, which is what lets Render trust Input.Salt.

The adapter keeps no state of its own (selfPath is set once by init) and has no admin: what it renders is fixed by the p/ package it imports. Never mark this realm private (design §5.4: a re-deployable adapter could swap the art). Per-chain values (author key, fee) live in config.gno.

Functions

Register

func Register(cur realm) string
Ask AI Claude ChatGPT

Register is an explicit call, not init: under the inert package policy init runs inside the approver's transaction (RA B-1). It registers this realm, once, and core accepts it only when the transaction is signed by the manifest author (author, config.gno). salt "" = no commit reservation; the fingerprint is in core's in-source reserved table (r/core config.gno), so only that key can register this art anywhere.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta" -func "Register" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta" -func "Register" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

SelfPath

func SelfPath() string
Ask AI Claude ChatGPT

SelfPath is the engine id.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta.SelfPath()"

Result

Sheet

func Sheet(cid, tid string) string
Ask AI Claude ChatGPT

Sheet is token tid's place on the map once collection cid is Final: {"cid","tid","tile","sheet","col","row"} (tile 0..255 row-major, col and row 0..15), or null (not a Final commit-reveal Pafta collection, or no such token). Before Final it is always null: nothing about the map exists yet.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta.Sheet(,)"

Result

Sheets

func Sheets(cid string) string
Ask AI Claude ChatGPT

Sheets is the whole layout of a Final collection: {"cid","mapSeed", "tiles":[tid of each sheet 0..255, "" where no token was minted]} or null (as Sheet). A composite view (gallery, reader) crops each token's TokenURI to the map face (art.MapX, MapY, MapSize of a Width x Height sheet) and lays the faces edge to edge in this order; burned tokens stay listed (check OwnerOf).

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta.Sheets()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/pafta, for example a function call with arguments.