Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

skins package

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. Use in production at your own risk.

Package skins is the catalog of plane skins of gnofly, a multiplayer plane game, and the tokens of the skins sold. Every skin bought is a GRC721 token on gno.land/p/nt/grc721/v0, one per buyer and design.

The tokens are soulbound: there is no TransferFrom, no Approve and no SetApprovalForAll, and the token object is not exported, so nothing can move a skin away from its buyer. Its owner can Burn it, which gives back the storage deposit (not the price).

Supply is unlimited by default; an admin can cap a design. Classic, the look every pilot flies by default, is free and is not a token.

Writers:

  • anyone buys a skin with its price attached (Buy), and burns their own (Burn);
  • the admins of the game realm edit the catalog (SetSkin, SetSkinListed).

The realm keeps no roles and no money: admins and treasury are those of gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/game/v0, and every sale is forwarded to the treasury in the same transaction.

A token stores only its owner (the ledger), its design and an entry in the buyer's list: no metadata record and no URI. TokenURI is computed from the design. Reads are plain functions meant for vm/qeval: CatalogJSON, SkinsOf, OwnerOf, SkinOf, TokenURI, Render.

Function

CatalogJSON

func CatalogJSON() string

CatalogJSON returns every design, sorted by id, as a JSON array:

Example
1[ { "id": "baron", "name": "Red Baron", "model": "biplane", "pilot": "none",
2    "body": "#c1121f", "wing": "#780000", "accent": "#fdf0d5",
3    "price": 1000000, "listed": true, "minted": 3, "maxSupply": 0 } ]

The output has no whitespace. maxSupply 0 is unlimited. Classic, the free look, is not in it: the client draws it without a token.

Command

gnokey query vm/qeval -remote "https://rpc.gno.land" -data "gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/skins.CatalogJSON()"

Result