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.

kilimv2.gno

2.38 Kb · 57 lines
 1// Package kilimv2 is the thin adapter that registers the Kilim v2 "Niyet"
 2// engine (p/…/sinopia/art/kilim/v2) with core. Core knows the engine only as
 3// this realm's package path plus an interface value.
 4//
 5// The adapter is stateless and has no admin: what it renders is fixed by
 6// the p/ package it imports, which can never change. Never mark this realm
 7// private (design §5.4: a re-deployable adapter could swap the art).
 8// Per-chain values (author key, fee) live in config.gno.
 9package kilimv2
10
11import (
12	art "gno.land/p/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/art/kilim/v2"
13	"gno.land/p/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engine/v2"
14	"gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/core"
15)
16
17// Author is the engine-author key that registers, claims and may deprecate
18// this engine in core.
19func Author() address { return author }
20
21// impl is zero-size and declared here, so core runs it with this realm's
22// authority (interrealm v2 borrow rule #1).
23type impl struct{}
24
25func (impl) Manifest() engine.Manifest {
26	m := art.Manifest()
27	m.Author = author
28	m.FeeBps = AuthorFeeBps
29	return m
30}
31
32func (impl) ValidateParams(params string) error { return art.ValidateParams(params) }
33
34// TraitTypes: a static engine, every collection uses the manifest's list.
35func (impl) TraitTypes(params string) []string { return art.Manifest().TraitTypes }
36
37// CheckLaunch: a generative engine has no launch precondition.
38func (impl) CheckLaunch(cid, params string, maxSupply int64) error { return nil }
39
40func (impl) Traits(in engine.Input) []engine.Trait { return art.Traits(in) }
41
42// Render reads in.TokenID (the künye band); core passes the token id on
43// TokenURI and "0" on RenderWith/RenderWithInput.
44func (impl) Render(in engine.Input) string { return art.Render(in) }
45
46// Media: an svg engine; Render is the art.
47func (impl) Media(in engine.Input) engine.Media { return engine.Media{} }
48
49// Register is an explicit call, not init: under the inert package policy
50// init runs inside the approver's transaction (RA B-1). It registers this
51// realm, once; core requires the transaction to be signed by the manifest
52// author (I-14, WP-J J-2). The fingerprint is in core's in-source reserved
53// table (r/core config.gno), so only that key can register this art
54// anywhere; no commit reservation, the salt is "".
55func Register(cur realm) string {
56	return core.RegisterEngine(cross(cur), impl{}, "")
57}