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

erc721 source realm

Package erc721 is an idiomatic gno.land port of the Solidity ERC-721 non-fungible token standard. Each token has a un...

Overview

Package erc721 is an idiomatic gno.land port of the Solidity ERC-721 non-fungible token standard. Each token has a unique integer id owned by exactly one address; ids are minted sequentially. Ownership, per-owner balances and single-token approvals are kept in ordered avl trees so that Render can iterate deterministically.

Functions 6

func Approve

crossing Action
1func Approve(cur realm, spender address, id int64)
source

Approve grants `spender` the right to transfer token `id`. Only the current owner may approve.

func BalanceOf

Action
1func BalanceOf(owner address) uint64
source

BalanceOf is the exported read-only accessor for balanceOf.

func Mint

crossing Action
1func Mint(cur realm, to address) int64
source

Mint creates the next token id and assigns it to `to`. Only sequential minting is supported (id is returned via the Mint event).

func Render

1func Render(path string) string
source

Render displays collection metadata and a token -> owner table.

func Transfer

crossing Action
1func Transfer(cur realm, to address, id int64)
source

Transfer moves token `id` from the caller to `to`. The caller must own the token (approvals are cleared on transfer).

Imports 4

Source Files 2