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.

Playground

cinar.gno

// Package cinar is the thin adapter that registers the Cinar engine
// (p/…/sinopia/art/cinar/v1), Sinopia's first living engine, with core.
// Core knows the engine only as this realm's package path plus an interface
// value; on every read core passes the token's chain state (MintHeight,
// LastMoveHeight, Moves, Height) in engine.Input and the art follows it.
//
// The adapter is stateless and has no admin: what it renders is fixed by
// the p/ package it imports, which can never change. 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.
package cinar

import (
	art "gno.land/p/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/art/cinar/v1"
	"gno.land/p/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engine/v2"
	"gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/core"
)

// Author is the engine-author key that registers, claims and may deprecate
// this engine in core.
func Author() address { return author }

// impl is zero-size and declared here, so core runs it with this realm's
// authority (interrealm v2 borrow rule #1).
type impl struct{}

func (impl) Manifest() engine.Manifest {
	m := art.Manifest()
	m.Author = author
	m.FeeBps = AuthorFeeBps
	return m
}

func (impl) ValidateParams(params string) error { return art.ValidateParams(params) }

// TraitTypes: a static trait list (the values of Season, Stage, Roots and
// Notches change with chain time; the types do not).
func (impl) TraitTypes(params string) []string { return art.Manifest().TraitTypes }

// CheckLaunch: a generative engine has no launch precondition.
func (impl) CheckLaunch(cid, params string, maxSupply int64) error { return nil }

func (impl) Traits(in engine.Input) []engine.Trait { return art.Traits(in) }

func (impl) Render(in engine.Input) string { return art.Render(in) }

// Media: an svg engine; Render is the art.
func (impl) Media(in engine.Input) engine.Media { return engine.Media{} }

// 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 must be signed by the manifest author (author, config.gno).
// The fingerprint is in core's in-source reserved table, so only that key
// can register this art anywhere; no commit reservation is
// used, so the salt is "".
func Register(cur realm) string {
	return core.RegisterEngine(cross(cur), impl{}, "")
}

config.gno

package cinar

// Deploy-time configuration (mainnet plan §3.1, M-8, M-10, M-27). Staging
// (WP-H, deploy/realms/<chain>.json) rewrites this file per chain; the
// source carries the Onyx values.

// author is the platform engine-author key (S-8: no other role). It signs
// Register and ClaimEngine; core's reserved-fingerprint table names the same
// key for Cinar's fingerprint, so the two must be staged equal.
var author = address("g1nm8kd8hsmp6pr7mudj2c3y2hnmnl8awx7vcz4m") // stage:engineAuthor

// AuthorFeeBps is the author's fee on primary and secondary sales of
// collections by other creators (engine.Manifest.FeeBps; waived for the
// author's own collections, capped by core's engine-fee cap). Showcase
// engines 1 % (user decision §6-4).
const AuthorFeeBps = 100

// Access policy (core I-19, docs/mainnet/engine-access-policy.md): a
// signature engine, "closed". Core registers every engine closed and the
// bootstrap leaves it so (deploy/realms/<chain>.json engines.cinar.policy),
// so only the author key opens collections with it; the author may later
// license creators (core.GrantLicence) without a new deploy.

gnomod.toml

module = "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia4/engines/cinar"
gno = "0.9"

[addpkg]
  creator = "g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06"
  height = 1450648
  max_deposit = "5000000ugnot"