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

v0 source realm

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

Readme View source

erc1155

⚠️ Experimental — generated with no human supervision by the daily MCP pipeline (Solidity→Gno port). Not audited. See r/moul/x/daily.


An idiomatic gno.land port of the Solidity ERC-1155 multi-token standard. One realm manages many distinct token ids, each with independent fungible balances tracked in an avl.Tree keyed by (owner, id), plus a per-id total supply. It keeps the core ERC-1155 ideas — minting, single transfers, balance and supply queries, and events — while dropping the Solidity-specific machinery (operator approvals, safe-transfer callbacks) that has no analog on gno.land.

Transactions

  • Mint(cur realm, to address, id int, amount uint64) — mint amount of token id to to; increases that id's total supply.
  • TransferSingle(cur realm, to address, id int, amount uint64) — move amount of token id from the caller to to.

Read-only

  • BalanceOf(owner address, id int) uint64 — balance of one owner for one id.
  • TotalSupply(id int) uint64 — total minted for a given id.
  • Render(path string) — Markdown balances table (owner · id · amount) and a per-id supply table.

Example

Mint(cur, g1owner..., 1, 100)      // 100 units of token #1 to g1owner
Mint(cur, g1owner..., 2, 5)        // 5 units of token #2
TransferSingle(cur, g1other..., 1, 40)  // caller sends 40 of token #1
BalanceOf(g1owner..., 1)           // -> 60
TotalSupply(1)                     // -> 100

Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

Dependency graph:

gno.land/r/moul/x/daily/erc1155/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

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 3