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

erc1155 source realm

Package erc1155 is an idiomatic gno.land port of the Solidity ERC-1155 multi-token standard. A single realm tracks ma...

Overview

Package erc1155 is an idiomatic gno.land port of the Solidity ERC-1155 multi-token standard. A single realm tracks many distinct token ids, each with its own fungible balances. Balances are keyed by (owner, id) in an avl.Tree so Render can iterate deterministically.

Functions 5

func BalanceOf

Action
1func BalanceOf(owner address, id int) uint64
source

BalanceOf returns the amount of token `id` held by `owner`.

func Mint

crossing Action
1func Mint(cur realm, to address, id int, amount uint64)
source

Mint creates `amount` units of token `id` and credits them to `to`.

func Render

1func Render(path string) string
source

Render prints a balances table and a per-id supply table.

func TransferSingle

crossing Action
1func TransferSingle(cur realm, to address, id int, amount uint64)
source

TransferSingle moves `amount` of token `id` from the caller to `to`.

Imports 5

Source Files 2