1package skins23import "gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/game/v0"45// The skins realm keeps no roles of its own. Who administers it and where6// its money goes are the answers of the game realm, asked again at every7// call: an admin removed there is refused here in the same block, and a8// treasury moved there receives the next sale.910// authority is the set of questions this realm asks about roles.11type authority interface {12 IsAdmin(addr address) bool13 Treasury() address14}1516// gameRoles answers with the roles of the game realm.17type gameRoles struct{}1819func (gameRoles) IsAdmin(addr address) bool { return game.IsAdmin(addr) }20func (gameRoles) Treasury() address { return game.Treasury() }2122// roles is the authority of this realm: the game realm, always.23//24// It is a variable for one reason. Under `gno test` an imported realm is25// initialized without a deployer, and a test of this package has no way to26// become an admin of the game realm, so the tests put their own answers27// here. Nothing outside the test files assigns it, and there is no setter.28var roles authority = gameRoles{}2930// callerOf returns the verified caller of a crossing function. rlm must be31// the cur of the crossing function calling this helper: a stale or forged32// realm value fails IsCurrent, and Previous is only meaningful on a live one.33//34// It takes the realm in second position on purpose, like p/nt/ownable does:35// a function whose first parameter is a realm is a crossing function.36func callerOf(_ int, rlm realm) address {37 if !rlm.IsCurrent() {38 panic(errSpoofedRealm)39 }40 return rlm.Previous().Address()41}4243// assertAdmin panics unless the caller is an admin of the game realm, and44// returns the caller.45func assertAdmin(_ int, rlm realm) address {46 caller := callerOf(0, rlm)47 if !roles.IsAdmin(caller) {48 panic(errNotAdmin)49 }50 return caller51}52BalanceOf(addr string) (int64, interface {Error func() string})
Burn(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id int64)
Buy(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, skinID string) int64
CatalogJSON() string
OwnerOf(tid string) (string, interface {Error func() string})
Render(path string) string
SetSkin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string, name string, model string, pilot string, body string, wing string, accent string, price int64, maxSupply int64)
SetSkinListed(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, id string, listed bool)
SkinOf(id int64) string
SkinsOf(addr string) string
TokenMetadata(tid string) (string, interface {Error func() string})
TokenURI(tid string) (string, interface {Error func() string})
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.