pool
[]uint8pool holds the ids not minted yet, two bytes each. Its length over two is how many are left.
- OID
- 011fde…9bbe:131
pool details
mintedBits
[]uint8mintedBits has one bit per id, set once the id is minted (burned or not): what tells a burned plane from one not minted yet, without scanning pool.
- OID
- 011fde…9bbe:132
mintedBits details
lastDraw
[32]uint8lastDraw is the hash of the previous draw, chained into the next.
- OID
- 011fde…9bbe:3685
lastDraw details
testDraw
func(...)testDraw, when set by a test, replaces the hash to pick an index in a pool of n ids. It is never set outside the tests.
Value
<zero>
resetPool
func(pkgPath string)resetPool fills the pool with every id, from 777 down to 1, and seeds the chain of draws from the realm's path.
- OID
- 011fde…9bbe:8
resetPool details
left
func() int64left returns how many ids are not minted yet.
- OID
- 011fde…9bbe:10
left details
drawHash
func(height int64, nanos int64, minter .uverse.address, minted int64, prev [32]uint8) [32]uint8drawHash is the hash a draw picks its index from. It is a pure function of its inputs, so that the tests can check what moves it.
- OID
- 011fde…9bbe:11
drawHash details
drawID
func(minter .uverse.address) int64drawID takes one id out of the pool, at random, for minter, and marks it minted. The pool must not be empty.
- OID
- 011fde…9bbe:12
drawID details
wasMinted
func(id int64) boolwasMinted reports whether id was ever minted, burned since or not.
- OID
- 011fde…9bbe:13
wasMinted details
errSpoofedRealm
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: spoofed realm"
errNotAdmin
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: caller is not an admin"
errBadTable
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: the plane table does not run from 1 to 777"
errCorruptRow
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: corrupt plane row"
errUnknownPlane
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: unknown plane"
errNotMinted
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: plane not minted"
errNotPlaneOwner
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: caller does not own this plane"
errMintClosed
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: the mint is closed"
errSoldOut
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: every plane is minted"
errCapReached
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: this wallet minted as many planes as the cap allows"
errNotUserCall
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: Mint must be called directly by a user (maketx call)"
errInvalidCount
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: mint 1 to 7 planes at a time"
errInvalidPrice
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: price must be between 1000000 and 10000000000 ugnot"
errInvalidCap
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: cap must be between 1 and 777"
errInvalidBase
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: image base must be an https URL ending in /, 12 to 200 characters of [A-Za-z0-9./_-:]"
errInvalidRoyalty
untyped stringThe refusals of this realm, as strings. The game and arena realms keep theirs as error values; this one is published with a 42 KB table and every byte of state is paid for at deploy. Measured on a mainnet-like node, an errors.New value costs about 1.15 KB of storage (a pointer, a heap item and a struct, each with its header) where a string constant costs its length: twenty of them are 2 GNOT against 0.1. A panic with a string aborts the call with the same message.
Value
"gnofly: royalty must be between 0 and 1000 basis points"
PlaneJSON
func(id int64) stringPlaneJSON returns one plane as a JSON object, minted or not: { "id": 42, "name": "Storm Saint", "model": "delta", "pilot": "gnome", "body": "#1e1b4b", "wing": "#1e293b", "accent": "#00f5ff", "tier": "epic", "laser": "#39ff14", "image": "https://gnofly.xyz/nft/collections/planes/042.png", "owner": "g1..." } The output has no whitespace. "owner" is "" for a plane not minted, or burned. An id outside 1 to 777 returns "". Which plane a pilot flies is not on-chain: the game server checks the owner when a pilot picks one.
- OID
- 011fde…9bbe:14
PlaneJSON details
PlanesOf
func(addr .uverse.address) stringPlanesOf returns the ids of the planes addr owns as a JSON array, in ascending order: \[3,42,700]. It is \[] for an address without planes.
- OID
- 011fde…9bbe:16
PlanesOf details
maxMintedPage
int64maxMintedPage is the most ids MintedJSON looks at in one call.
Value
200
MintedJSON
func(offset int64, limit int64) stringMintedJSON returns who owns the minted planes among the ids offset+1 to offset+limit, as a JSON array in id order: [{"id":3,"owner":"g1..."},{"id":42,"owner":""},...] Ids not minted are left out; "owner" is "" for a burned plane. limit is capped at 200, so four calls (offsets 0, 200, 400, 600) cover the 777, whatever was minted: planes are drawn at random, minted ids are not a prefix. It is what the website's grid reads. An empty range is \[].
- OID
- 011fde…9bbe:17
MintedJSON details
CollectionJSON
func() stringCollectionJSON returns the state of the collection as one JSON object: { "name": "gnofly planes", "symbol": "PLANE", "supply": 777, "minted": 12, "burned": 0, "price": 77000000, "open": true, "cap": 7, "royaltyBps": 500, "treasury": "g1...", "imageBase": "https://gnofly.xyz/nft/collections/planes/", "tiers": { "common": { "supply": 500, "minted": 8 }, "rare": { "supply": 200, "minted": 3 }, "epic": { "supply": 70, "minted": 1 }, "legendary": { "supply": 7, "minted": 0 } } } The output has no whitespace. "minted" counts every mint so far, burned planes included; "minted" minus "burned" is what exists.
- OID
- 011fde…9bbe:18
CollectionJSON details
writePlane
func(b *v0.NodeBuilder, p planes.plane)writePlane writes the nine fields of a plane, in the order of a row, so that a caller can add fields after them.
- OID
- 011fde…9bbe:19
writePlane details
encode
func(n *v0.Node) stringencode marshals a document built above. It cannot fail on a document built from the builder, so a failure is a bug and panics.
- OID
- 011fde…9bbe:20
encode details
maxBatch
int64maxBatch is the most planes one Mint call mints. It is a constant, apart from the per-wallet cap that admins tune with SetMintCap.
Value
7
Mint
func(count int64) []int64Mint mints count planes for the caller, 1 to 7 in one call, drawn at random among the ids not minted yet (draw.gno), and returns their ids in the order drawn. Exactly count times the price must be attached to the transaction (-send "\<count\*price>ugnot"); it is forwarded to the treasury of the game realm, in one send, before the call returns. Each id comes out once, while the mint is open. A batch is minted whole or not at all: one that would take the caller over the per-wallet cap, or past the last plane, is refused with how many are left. It must be called directly by a user (maketx call): a call relayed by another realm or by a maketx run script is refused. That is also what keeps the draw fair: a contract could otherwise look at the ids it got and panic to draw again. The caller pays the storage of their planes as a deposit on top of the price, given back on burn: the ledger entries only, the traits stay in the table (see the numbers in docs/spec.md, section 9.2).
- OID
- 011fde…9bbe:21
Mint details
mintedBy
func(addr .uverse.address) int64mintedBy returns how many planes addr minted so far.
- OID
- 011fde…9bbe:23
mintedBy details
TokenMetadata
func(tid v0.TokenID) (string, .uverse.error)TokenMetadata returns the metadata of a minted plane as JSON, built from the table on every read: the realm stores no metadata per token. {"name":"Storm Saint","description":"Plane 42 of 777, ...", "image":"https://gnofly.xyz/nft/collections/planes/042.png", "attributes":[{"traitType":"model","value":"delta"}, ...]} The keys are the ones Adena reads, traitType included.
- OID
- 011fde…9bbe:24
TokenMetadata details
mintedID
func(tid v0.TokenID) (int64, .uverse.error)mintedID reads a token id, "1" to "777", and checks the plane is minted.
- OID
- 011fde…9bbe:25
mintedID details
parseID
func(s string) int64parseID reads "1" to "777" in decimal, 0 for anything else.
- OID
- 011fde…9bbe:26
parseID details
description
func(p planes.plane) stringdescription is one sentence about a plane: "Plane 42 of 777, an epic delta flown by a gnome." The tier is the only word that may start with a vowel.
- OID
- 011fde…9bbe:27
description details
Burn
func(id int64)Burn destroys a plane. Only its owner can, and nobody can mint it again: the id stays out of circulation.
- OID
- 011fde…9bbe:28
Burn details
TransferFrom
func(from .uverse.address, to .uverse.address, id int64)TransferFrom moves plane id from one address to another. The caller must own it or be approved for it.
- OID
- 011fde…9bbe:29
TransferFrom details
Approve
func(to .uverse.address, id int64)Approve lets to move plane id once. The caller must own it. An empty address revokes.
- OID
- 011fde…9bbe:30
Approve details
SetApprovalForAll
func(operator .uverse.address, approved bool)SetApprovalForAll lets operator move every plane of the caller, or revokes it.
- OID
- 011fde…9bbe:31
SetApprovalForAll details
ownerOf
func(id int64) .uverse.address- OID
- 011fde…9bbe:32
ownerOf details
OwnerOf
func(tid v0.TokenID) (.uverse.address, .uverse.error)- OID
- 011fde…9bbe:33
OwnerOf details
BalanceOf
func(addr .uverse.address) (int64, .uverse.error)BalanceOf returns how many planes addr owns.
- OID
- 011fde…9bbe:34
BalanceOf details
TotalSupply
func() int64TotalSupply returns how many planes exist: minted and not burned.
- OID
- 011fde…9bbe:35
TotalSupply details
GetApproved
func(id int64) .uverse.address- OID
- 011fde…9bbe:36
GetApproved details
IsApprovedForAll
func(owner .uverse.address, operator .uverse.address) boolIsApprovedForAll reports whether operator may move every plane of owner.
- OID
- 011fde…9bbe:37
IsApprovedForAll details
TokenURI
func(tid v0.TokenID) (string, .uverse.error)TokenURI returns the image of a minted plane, "\<image base>\<nnn>.png": what a wallet shows (Adena puts it in an \<img>). The metadata is TokenMetadata, or "\<image base>\<id>.json" on the website. It is computed, not stored: a mint writes no URI.
- OID
- 011fde…9bbe:38
TokenURI details
RoyaltyInfo
func(id int64, salePrice int64) (.uverse.address, int64)- OID
- 011fde…9bbe:39
RoyaltyInfo details
RoyaltyBps
func() int64RoyaltyBps returns the royalty of a resale, in basis points.
- OID
- 011fde…9bbe:40
RoyaltyBps details
Token
*v0.Token// name, symbol, owners, balances, approvals
- OID
- 011fde…9bbe:111
Token details
Royalties
*v0.Royalty// EIP-2981 royalty
- OID
- 011fde…9bbe:123
Royalties details
ledger
*v0.PrivateLedger// the collection, write side: mint, burn
- OID
- 011fde…9bbe:113
ledger details
teller
*v0.fnTeller// acts as the caller of this realm: transfers and approvals
- OID
- 011fde…9bbe:120
teller details
royaltyLedger
*v0.Ledger// royalty, write side
- OID
- 011fde…9bbe:129
royaltyLedger details
mintCount
int64// planes minted so far, burned ones included; the ids left are in pool (draw.gno)
Value
198
price
int64// ugnot, what a mint costs
Value
77000000
mintOpen
bool// whether Mint is accepting calls
Value
true
mintCap
int64// how many planes one wallet may mint, over its lifetime
Value
7
imageBase
string// "[https://gnofly.xyz/nft/collections/planes/](https://gnofly.xyz/nft/collections/planes/)", the image of plane 42 is at \<base>042.png
Value
"https://gnofly.xyz/nft/collections/planes/"
mints
v0.BPTree// minter address -> int64, planes minted so far, for the cap
- OID
- 011fde…9bbe:135
mints details
tierMinted
[4]int64// planes minted so far per tier, in the order of tiers
- OID
- 011fde…9bbe:136
tierMinted details
recent
[5]int64// the last ids minted, newest first, 0 for none, for Render
- OID
- 011fde…9bbe:134
recent details
webPath
string// "/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes", used to build links in Render
Value
"/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes"
supply
int64The collection, and the settings at deploy.
Value
777
tokenName
untyped stringThe collection, and the settings at deploy.
Value
"gnofly planes"
tokenSymbol
untyped stringThe collection, and the settings at deploy.
Value
"PLANE"
payDenom
untyped string// the only coin planes are sold for
Value
"ugnot"
defaultPrice
int64// 77 GNOT
Value
77000000
minPrice
int64The collection, and the settings at deploy.
Value
1000000
maxPrice
int64The collection, and the settings at deploy.
Value
10000000000
defaultMintCap
int64The collection, and the settings at deploy.
Value
7
defaultImageBase
untyped stringThe collection, and the settings at deploy.
Value
"https://gnofly.xyz/nft/collections/planes/"
defaultRoyaltyBps
int64// 5% of a resale, to the treasury
Value
500
maxRoyaltyBps
int64// the most SetRoyaltyBps accepts
Value
1000
models
untyped stringThe collection, and the settings at deploy.
Value
"prop,biplane,stunt,jet,seaplane,twin,delta,glider,supergnome"
pilots
untyped stringThe collection, and the settings at deploy.
Value
"none,gnome"
tiers
untyped stringThe collection, and the settings at deploy.
Value
"common,rare,epic,legendary"
tierSupply
[4]int64tierSupply is how many planes of each tier the table holds, in the order of tiers. The tests check it against the table.
- OID
- 011fde…9bbe:59
tierSupply details
tierIndex
func(tier string) inttierIndex returns the position of tier in tiers, or -1.
- OID
- 011fde…9bbe:60
tierIndex details
init.82
func()- OID
- 011fde…9bbe:62
init.82 details
bootstrap
func(int, rlm .uverse.realm)bootstrap (re)creates the initial state: the token, its extensions and the settings. The tests call it to start from a clean slate. rlm is the live realm of the caller: grc721 records its package path as the home of the Token.
- OID
- 011fde…9bbe:63
bootstrap details
setRoyalty
func(bps int64)setRoyalty points the royalty of every plane at the treasury of the game realm, as it is now, at bps basis points.
- OID
- 011fde…9bbe:64
setRoyalty details
SetMintOpen
func(open bool)SetMintOpen opens or closes the mint. Admin only. The mint starts closed.
- OID
- 011fde…9bbe:65
SetMintOpen details
SetPrice
func(ugnot int64)SetPrice sets what a mint costs, from 1 to 10000 GNOT. Admin only. It applies to the next mint.
- OID
- 011fde…9bbe:66
SetPrice details
SetMintCap
func(n int64)SetMintCap sets how many planes one wallet may mint over its lifetime, from 1 to 777. Admin only. A wallet already over a lowered cap keeps its planes and mints no more.
- OID
- 011fde…9bbe:67
SetMintCap details
SetImageBase
func(base string)SetImageBase sets where the images and the metadata of the planes are served from: the image of plane 42 is \<base>042.png and its token URI is \<base>42.json. Admin only. It applies at once to every plane: the URLs are computed on read, nothing is stored per token.
- OID
- 011fde…9bbe:68
SetImageBase details
SetRoyaltyBps
func(bps int64)SetRoyaltyBps sets the royalty of a resale, from 0 to 1000 basis points, and points it at the treasury of the game realm as it is now. Admin only. The royalty is advisory, as EIP-2981 is: a marketplace reads RoyaltyInfo and pays it, the realm cannot enforce it on a transfer.
- OID
- 011fde…9bbe:69
SetRoyaltyBps details
Minted
func() int64Minted returns how many planes were minted so far, burned ones included. Planes are drawn at random, so it says nothing of which ids. The settings (price, open, cap, image base, royalty) are read with CollectionJSON: every exported function costs storage at deploy, measured at about 650 bytes each, so there is no getter per setting.
- OID
- 011fde…9bbe:70
Minted details
webPathOf
func(pkgPath string) stringwebPathOf turns "gno.land/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes" into "/r/g1t2kg2vtr3fukg43eujkn6x53gfdyakhngt4sfd/gnofly/nfts/planes".
- OID
- 011fde…9bbe:71
webPathOf details
imageURL
func(id int64) stringimageURL returns where the image of plane id is: \<image base>\<id>.png, the id on three digits, "042.png", as the image files are named. The token URI keeps the plain id, "42.json".
- OID
- 011fde…9bbe:72
imageURL details
pad3
func(id int64) stringpad3 writes an id of 1 to 777 on three digits: 7 -> "007", 42 -> "042".
- OID
- 011fde…9bbe:73
pad3 details
itoa
func(n int64) string- OID
- 011fde…9bbe:74
itoa details
boolString
func(b bool) string- OID
- 011fde…9bbe:75
boolString details
Render
func(path string) stringRender returns the state of the collection as markdown, for gnoweb: "" the collection: minted, price, tiers, the last mints "plane/<id>" one plane: traits, owner "player/<addr>" the planes of one address Everything printed here is a row of the table, whose charset the tests pin, a setting validated when it was written, or an address the chain gave the realm. The two caller-supplied values, an id and an address, are printed only once parsed and found valid. Nothing needs markdown escaping. No images: the planes are drawn by the game and by the website.
- OID
- 011fde…9bbe:76
Render details
link
func(path string) stringlink returns the gnoweb URL of a Render path of this realm.
- OID
- 011fde…9bbe:78
link details
renderHome
func() string- OID
- 011fde…9bbe:79
renderHome details
renderPlane
func(p planes.plane) string- OID
- 011fde…9bbe:80
renderPlane details
renderPlayer
func(addr .uverse.address) string- OID
- 011fde…9bbe:81
renderPlayer details
planeLink
func(p planes.plane) stringplaneLink is "\[42 Storm Saint](.../plane/42)".
- OID
- 011fde…9bbe:82
planeLink details
playerLink
func(addr .uverse.address) stringplayerLink is "\[g1...](.../player/g1...)".
- OID
- 011fde…9bbe:83
playerLink details
gnot
func(ugnot int64) stringgnot formats an amount of ugnot in GNOT, without trailing zeros: 77000000 gives "77 GNOT", 9500000 gives "9.5 GNOT".
- OID
- 011fde…9bbe:84
gnot details
percent
func(bps int64) stringpercent formats basis points as a percentage, without trailing zeros: 500 gives "5%", 250 gives "2.5%", 1 gives "0.01%".
- OID
- 011fde…9bbe:85
percent details
plural
func(n int64) string- OID
- 011fde…9bbe:86
plural details
yesNo
func(b bool) string- OID
- 011fde…9bbe:87
yesNo details
recentIDs
func() []int64recentIDs returns the last ids minted, newest first.
- OID
- 011fde…9bbe:88
recentIDs details
authority
typeauthority is the set of questions this realm asks about roles.
Value
planes.authority
gameRoles
typegameRoles answers with the roles of the game realm.
Value
planes.gameRoles
roles
planes.gameRolesroles is the authority of this realm: the game realm, always. It is a variable for one reason. Under \`gno test\` an imported realm is initialized without a deployer, and a test of this package has no way to become an admin of the game realm, so the tests put their own answers here. Nothing outside the test files assigns it, and there is no setter.
- OID
- 011fde…9bbe:90
roles details
callerOf
func(int, rlm .uverse.realm) .uverse.address- OID
- 011fde…9bbe:91
callerOf details
assertAdmin
func(int, rlm .uverse.realm) .uverse.address- OID
- 011fde…9bbe:93
assertAdmin details
plane
typeplane is one row of the table: what a plane looks like. Nothing here is stored per token, the table is the only copy.
Value
planes.plane
row
func(id int64) stringrow returns the line of plane id, or "" when there is no such row.
- OID
- 011fde…9bbe:94
row details
lineAt
func(i int) (start int, end int)lineAt returns the bounds of the line containing offset i: start is its first byte, end the offset of its newline, or len(table) for the last line.
- OID
- 011fde…9bbe:96
lineAt details
rowID
func(i int) int64rowID reads the id of the line containing offset i, or 0 when the line does not start with a number.
- OID
- 011fde…9bbe:97
rowID details
idAt
func(start int, end int) int64idAt reads the id at the start of the line table\[start:end].
- OID
- 011fde…9bbe:98
idAt details
parsePlane
func(line string) (planes.plane, bool)parsePlane turns a row into a plane. It checks the shape of the row, not its values: those are the table's promise, checked by the tests.
- OID
- 011fde…9bbe:99
parsePlane details
getPlane
func(id int64) (planes.plane, bool)getPlane returns plane id from the table, or false when the id is out of range.
- OID
- 011fde…9bbe:100
getPlane details
mustPlane
func(id int64) planes.planemustPlane returns plane id from the table, or panics.
- OID
- 011fde…9bbe:101
mustPlane details
tokenID
func(id int64) v0.TokenIDtokenID is the GRC721 id of plane id: its number, in decimal.
- OID
- 011fde…9bbe:102
tokenID details
validName
func(s string) boolvalidName reports whether s matches \[A-Za-z0-9 -]{1,24}.
- OID
- 011fde…9bbe:103
validName details
validColor
func(s string) boolvalidColor reports whether s is "#rrggbb" with lowercase hex digits.
- OID
- 011fde…9bbe:104
validColor details
validBase
func(s string) boolvalidBase reports whether s can be an image base: an https URL ending in "/", 12 to 200 characters of \[A-Za-z0-9./\_-:]. The charset keeps it safe in JSON and markdown without escaping.
- OID
- 011fde…9bbe:105
validBase details
validAddress
func(addr .uverse.address) boolvalidAddress reports whether addr is a valid address in its canonical, lowercase form, the only form the game realm and this one key on.
- OID
- 011fde…9bbe:106
validAddress details
oneOf
func(s string, list string) booloneOf reports whether s is one of the comma-separated words of list.
- OID
- 011fde…9bbe:107
oneOf details
table
untyped stringtable holds the traits of the 777 planes, one per line, in id order: id|name|model|pilot|body|wing|accent|tier|laser Ids run from 1 to 777 with no gap. Names are unique and match \[A-Za-z0-9 -]{1,24}. Tiers are common (500), rare (200), epic (70) and legendary (7). Models are those the client draws: prop, biplane, stunt for a common plane, jet, seaplane, twin for a rare one, delta, glider for an epic one, any of them for a legendary one, and supergnome for id 777 alone. Pilot is none or gnome; the super-gnome is the gnome, its pilot is none. Colours are #rrggbb in lowercase, the first three all different; on the super-gnome they are its cape, its suit and its emblem. The laser is the colour of the shots the plane fires; it comes last, added after the first version of the table. It is one string, parsed on read: 777 rows as structs would cost about ten times the storage deposit at deploy. See rows.gno for the parser.
Value
"1|Storm Sentinel|delta|gnome|#172554|#27272a|#ff4d6d|epic|#ff9e00\n2|Windy Thrush|biplane|none|#ddd5c7|#8c7b6b|#f2cc8f|common|#ffb347\n3|Humble Bucket|prop|none|#b5a27a|#4f5d75|#c9a227|common|#ffc971\n4|Lonely Pony|prop|none|#c2b280|#5c5c5c|#588157|common|#ff"...