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/grc721/v0

Package
Open in gnoweb ↗

Overview

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

Files (8)

  • gnomod.tomltoml
  • tellers.gnogno
  • token.gnogno
  • types.gnogno
  • newtoken_event_filetest.gnogno
  • tellers_test.gnogno
  • token_test.gnogno
  • veto_no_event_filetest.gnogno
  • newtoken_event_filetest.gnogno
    1// PKGPATH: gno.land/r/demo/grc721dupsignal23// This filetest is the reference for the detection rule the NewToken event4// enables. The realm below reuses seqid 0 twice, so both tokens end up with the5// same Token.ID() and their Transfer events are indistinguishable — the6// long-standing event-provenance ambiguity.7//

    Functions

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

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

    8
    // What changes is that the ambiguity is now *announced*. Two NewToken events
    9// carry the same "token" value, which is a complete signal: NewToken is the only
    10// way a Token can exist (Token's fields are unexported), so an indexer watching
    11// this event sees every token that will ever emit. On the second duplicate
    12// announcement it should flag the realm and stop trusting its token events.
    13package grc721dupsignal
    14
    15import (
    16 "gno.land/p/nt/grc721/v0"
    17)
    18
    19func main(cur realm) {
    20 first, firstLedger := grc721.NewToken("Same", "DUP", 0, cur)
    21 second, secondLedger := grc721.NewToken("Same", "DUP", 0, cur)
    22
    23 println("same id:", first.ID() == second.ID())
    24
    25 // Two independent ledgers, one identifier: these Transfers cannot be
    26 // attributed to either object from the event stream alone.
    27 firstLedger.Mint(cur.Address(), "1")
    28 secondLedger.Mint(cur.Address(), "2")
    29}
    30
    31// Output:
    32// same id: true
    33
    34// Events:
    35// [
    36// {
    37// "type": "NewToken",
    38// "attrs": [
    39// {
    40// "key": "token",
    41// "value": "gno.land/r/demo/grc721dupsignal.DUP.0000000"
    42// },
    43// {
    44// "key": "name",
    45// "value": "Same"
    46// },
    47// {
    48// "key": "symbol",
    49// "value": "DUP"
    50// }
    51// ],
    52// "pkg_path": "gno.land/p/nt/grc721/v0"
    53// },
    54// {
    55// "type": "NewToken",
    56// "attrs": [
    57// {
    58// "key": "token",
    59// "value": "gno.land/r/demo/grc721dupsignal.DUP.0000000"
    60// },
    61// {
    62// "key": "name",
    63// "value": "Same"
    64// },
    65// {
    66// "key": "symbol",
    67// "value": "DUP"
    68// }
    69// ],
    70// "pkg_path": "gno.land/p/nt/grc721/v0"
    71// },
    72// {
    73// "type": "Transfer",
    74// "attrs": [
    75// {
    76// "key": "token",
    77// "value": "gno.land/r/demo/grc721dupsignal.DUP.0000000"
    78// },
    79// {
    80// "key": "from",
    81// "value": ""
    82// },
    83// {
    84// "key": "to",
    85// "value": "g1f2p7p8jhjmg6atgukt8kveqgsrrk3qqhe6vg9m"
    86// },
    87// {
    88// "key": "tokenId",
    89// "value": "1"
    90// }
    91// ],
    92// "pkg_path": "gno.land/p/nt/grc721/v0"
    93// },
    94// {
    95// "type": "Transfer",
    96// "attrs": [
    97// {
    98// "key": "token",
    99// "value": "gno.land/r/demo/grc721dupsignal.DUP.0000000"
    100// },
    101// {
    102// "key": "from",
    103// "value": ""
    104// },
    105// {
    106// "key": "to",
    107// "value": "g1f2p7p8jhjmg6atgukt8kveqgsrrk3qqhe6vg9m"
    108// },
    109// {
    110// "key": "tokenId",
    111// "value": "2"
    112// }
    113// ],
    114// "pkg_path": "gno.land/p/nt/grc721/v0"
    115// }
    116// ]
    117