PathrockNetwork Gno Explorer
HomeBlocksTransactionsTokensRealmsPackagesValidatorsAnalytics

PathrockNetwork Gno Explorer — an independent explorer for Gno.land Mainnet (gnoland-1), operated by PathrockNetwork. Not an official Gno.land service.

gnowebarchive RPC

gno.land/p/nt/grc20/v0

Package
Open in gnoweb ↗

Overview

Kind
Pure package
Name
v0
Namespace
nt / grc20
Files
12 (gnomod.toml)
Exported functions
n/a — not supported for pure packages by the node (vm/qfuncs)
Module
gno.land/p/nt/grc20/v0
gno
0.9

Files (12)

  • gnomod.tomltoml
  • mock.gnogno
  • tellers.gnogno
  • token.gnogno
  • types.gnogno
  • caller_teller_sub_realm_filetest.gnogno
  • event_provenance_filetest.gno
gno
  • examples_test.gnogno
  • newtoken_event_filetest.gnogno
  • tellers_test.gnogno
  • token_identity_filetest.gnogno
  • token_test.gnogno
  • token_identity_filetest.gnogno
    1// PKGPATH: gno.land/r/demo/grc20identity23package grc20identity45import (6	"chain"78

    Functions

    not supported for pure packages by the node (vm/qfuncs)

    Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.

    "gno.land/p/nt/grc20/v0"
    9 "gno.land/p/nt/seqid/v0"
    10)
    11
    12var nextTokenID seqid.ID
    13
    14func main(cur realm) {
    15 first, firstLedger := newToken(cur)
    16 second, secondLedger := newToken(cur)
    17
    18 if first.ID() != "gno.land/r/demo/grc20identity.DUP.0000001" {
    19 panic("unexpected first token ID: " + first.ID())
    20 }
    21 if second.ID() != "gno.land/r/demo/grc20identity.DUP.0000002" {
    22 panic("unexpected second token ID: " + second.ID())
    23 }
    24
    25 holder := chain.PackageAddress("holder")
    26 spender := chain.PackageAddress("spender")
    27 firstLedger.Mint(holder, 1)
    28 firstLedger.Approve(holder, spender, 1)
    29 secondLedger.Mint(holder, 2)
    30 secondLedger.Approve(holder, spender, 2)
    31}
    32
    33func newToken(cur realm) (*grc20.Token, *grc20.PrivateLedger) {
    34 return grc20.NewToken("Same", "DUP", 6, nextTokenID.Next(), cur)
    35}
    36
    37// Events:
    38// [
    39// {
    40// "type": "NewToken",
    41// "attrs": [
    42// {
    43// "key": "token",
    44// "value": "gno.land/r/demo/grc20identity.DUP.0000001"
    45// },
    46// {
    47// "key": "name",
    48// "value": "Same"
    49// },
    50// {
    51// "key": "symbol",
    52// "value": "DUP"
    53// },
    54// {
    55// "key": "decimals",
    56// "value": "6"
    57// }
    58// ],
    59// "pkg_path": "gno.land/p/nt/grc20/v0"
    60// },
    61// {
    62// "type": "NewToken",
    63// "attrs": [
    64// {
    65// "key": "token",
    66// "value": "gno.land/r/demo/grc20identity.DUP.0000002"
    67// },
    68// {
    69// "key": "name",
    70// "value": "Same"
    71// },
    72// {
    73// "key": "symbol",
    74// "value": "DUP"
    75// },
    76// {
    77// "key": "decimals",
    78// "value": "6"
    79// }
    80// ],
    81// "pkg_path": "gno.land/p/nt/grc20/v0"
    82// },
    83// {
    84// "type": "Transfer",
    85// "attrs": [
    86// {
    87// "key": "token",
    88// "value": "gno.land/r/demo/grc20identity.DUP.0000001"
    89// },
    90// {
    91// "key": "from",
    92// "value": ""
    93// },
    94// {
    95// "key": "to",
    96// "value": "g18rwjsdf0kcy673ta0q4ujwvsncz4k2a8gcv94t"
    97// },
    98// {
    99// "key": "value",
    100// "value": "1"
    101// }
    102// ],
    103// "pkg_path": "gno.land/p/nt/grc20/v0"
    104// },
    105// {
    106// "type": "Approval",
    107// "attrs": [
    108// {
    109// "key": "token",
    110// "value": "gno.land/r/demo/grc20identity.DUP.0000001"
    111// },
    112// {
    113// "key": "owner",
    114// "value": "g18rwjsdf0kcy673ta0q4ujwvsncz4k2a8gcv94t"
    115// },
    116// {
    117// "key": "spender",
    118// "value": "g148tp8xkvvk3l73lmxywpdlsxgdujjlclx7wfyg"
    119// },
    120// {
    121// "key": "value",
    122// "value": "1"
    123// }
    124// ],
    125// "pkg_path": "gno.land/p/nt/grc20/v0"
    126// },
    127// {
    128// "type": "Transfer",
    129// "attrs": [
    130// {
    131// "key": "token",
    132// "value": "gno.land/r/demo/grc20identity.DUP.0000002"
    133// },
    134// {
    135// "key": "from",
    136// "value": ""
    137// },
    138// {
    139// "key": "to",
    140// "value": "g18rwjsdf0kcy673ta0q4ujwvsncz4k2a8gcv94t"
    141// },
    142// {
    143// "key": "value",
    144// "value": "2"
    145// }
    146// ],
    147// "pkg_path": "gno.land/p/nt/grc20/v0"
    148// },
    149// {
    150// "type": "Approval",
    151// "attrs": [
    152// {
    153// "key": "token",
    154// "value": "gno.land/r/demo/grc20identity.DUP.0000002"
    155// },
    156// {
    157// "key": "owner",
    158// "value": "g18rwjsdf0kcy673ta0q4ujwvsncz4k2a8gcv94t"
    159// },
    160// {
    161// "key": "spender",
    162// "value": "g148tp8xkvvk3l73lmxywpdlsxgdujjlclx7wfyg"
    163// },
    164// {
    165// "key": "value",
    166// "value": "2"
    167// }
    168// ],
    169// "pkg_path": "gno.land/p/nt/grc20/v0"
    170// }
    171// ]
    172