const MaxSVGBytes, MaxTraits, MaxTraitLen, MaxNameLen, MaxVersionLen, MaxDescLen, MaxLicenseLen, MaxParamsSchema
Limits core enforces on every engine.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package engine is the "art as code" contract (design §5.2): what a generative engine implements, what core hands it, ...
Package engine is the "art as code" contract (design §5.2): what a generative engine implements, what core hands it, and the conformance rules both core and engine authors check against.
An engine is registered from its own /r/ adapter realm. Because the adapter's methods are declared in that realm, core calling them runs the engine with the adapter's authority, never core's (interrealm v2 borrow rule #1). Methods receive and return plain values only: an engine never gets a reference into core state.
Limits core enforces on every engine.
CheckSVG is the output rule core applies to every render.
Conformance is the self-test engine authors run in their _test.gno before registering: manifest, default params, determinism, size, SVG hygiene, traits, and — for non-living engines — independence from the living fields.
SampleSeed returns the i-th Studio/conformance sample seed.
ValidateManifest checks sizes, text hygiene and the author address.
ValidateTraits checks one Traits() result against the manifest.
SampleInput is the fixed input of an engine's fingerprint: core renders it at registration and stores sha256(svg); anyone can recompute it later.
Engine is implemented by a stateless value declared in the adapter realm.
Contract: deterministic in Input; ValidateParams("") must accept the engine's defaults; Render returns raw SVG (core does the base64); Traits only uses types listed in the manifest, each at most once.
1type Input struct {
2 Seed string // 64-hex final seed (sample seeds in Studio)
3 Params string // collection params, in the engine's own format
4 CollectionID string
5 TokenID string
6 MintHeight int64
7 LastMoveHeight int64 // patina: holding time = Height - LastMoveHeight
8 Moves int64 // transfers so far
9 Height int64 // height of the read (fixed by Verify)
10}Input is everything an engine may depend on. p/ packages are frozen once deployed, so the fields "living" engines will need later (phase 2) are here from day one.
1type Manifest struct {
2 Name, Version, Description, License string
3 Author address // proven by core.ClaimEngine
4 ParamsSchema string // JSON Schema subset; Studio builds its form from it
5 TraitTypes []string
6 Living bool // Render depends on LastMoveHeight/Moves/Height
7 MaxSVGBytes int64 // <= MaxSVGBytes
8}