goldenticket source realm
Package goldenticket is a 1/1 GRC721 NFT: one golden ticket, minted to the publisher when the package is added. It ex...
Package goldenticket is a 1/1 GRC721 NFT: one golden ticket, minted to the publisher when the package is added. It exists to check that a gno.land collection shows in the Adena wallet before gnofly's planes go to mainnet, so it is built the way the planes are:
- the collection is a gno.land/p/nt/grc721/v0 token made with NewToken, whose NewToken and Transfer events Adena finds on its indexer;
- the read functions take a grc721.TokenID and return (value, error), as Adena calls them: OwnerOf("1"), BalanceOf("g1..."), TokenURI("1") as the <img src>, TokenMetadata("1") as JSON with camelCase traitType.
Transfer moves the ticket, so it can reach any Adena account.
1
7
func BalanceOf
ActionBalanceOf returns 1 for the holder of the ticket, 0 for everyone else.
func Name
ActionName and Symbol, as GRC721 tokens have them. Adena reads both from the NewToken event.
func Render
Render shows the ticket and who holds it.
func Symbol
Actionfunc TokenMetadata
ActionTokenMetadata returns the metadata of the ticket as JSON, with the keys Adena reads.
func TokenURI
ActionTokenURI returns the image of the ticket: what Adena shows.
func Transfer
crossing ActionTransfer gives the ticket to someone else. Only its holder can, by a direct call (maketx call or Adena), not through another realm.
3
- errors stdlib
- gno.land/p/nt/grc721/v0 package
- strings stdlib