github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/examples/gno.land/r/demo/nft/z_0_filetest.gno (about) 1 // PKGPATH: gno.land/r/nft_test 2 package nft_test 3 4 import ( 5 "gno.land/p/demo/testutils" 6 "gno.land/r/demo/nft" 7 ) 8 9 func main() { 10 addr1 := testutils.TestAddress("addr1") 11 // addr2 := testutils.TestAddress("addr2") 12 grc721 := nft.GetToken() 13 tid := grc721.Mint(addr1, "NFT#1") 14 println(grc721.OwnerOf(tid)) 15 println(addr1) 16 } 17 18 // Output: 19 // g1v9jxgu33ta047h6lta047h6lta047h6l43dqc5 20 // g1v9jxgu33ta047h6lta047h6lta047h6l43dqc5 21 22 // Realm: 23 // switchrealm["gno.land/r/demo/nft"] 24 // switchrealm["gno.land/r/demo/nft"] 25 // c[67c479d3d51d4056b2f4111d5352912a00be311e:8]={ 26 // "Fields": [ 27 // { 28 // "T": { 29 // "@type": "/gno.RefType", 30 // "ID": "std.Address" 31 // }, 32 // "V": { 33 // "@type": "/gno.StringValue", 34 // "value": "g1v9jxgu33ta047h6lta047h6lta047h6l43dqc5" 35 // } 36 // }, 37 // { 38 // "T": { 39 // "@type": "/gno.RefType", 40 // "ID": "std.Address" 41 // } 42 // }, 43 // { 44 // "T": { 45 // "@type": "/gno.RefType", 46 // "ID": "gno.land/p/demo/grc/grc721.TokenID" 47 // }, 48 // "V": { 49 // "@type": "/gno.StringValue", 50 // "value": "1" 51 // } 52 // }, 53 // { 54 // "T": { 55 // "@type": "/gno.PrimitiveType", 56 // "value": "16" 57 // }, 58 // "V": { 59 // "@type": "/gno.StringValue", 60 // "value": "NFT#1" 61 // } 62 // } 63 // ], 64 // "ObjectInfo": { 65 // "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:8", 66 // "ModTime": "0", 67 // "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:7", 68 // "RefCount": "1" 69 // } 70 // } 71 // c[67c479d3d51d4056b2f4111d5352912a00be311e:7]={ 72 // "Fields": [ 73 // { 74 // "T": { 75 // "@type": "/gno.PrimitiveType", 76 // "value": "16" 77 // }, 78 // "V": { 79 // "@type": "/gno.StringValue", 80 // "value": "1" 81 // } 82 // }, 83 // { 84 // "T": { 85 // "@type": "/gno.PointerType", 86 // "Elt": { 87 // "@type": "/gno.RefType", 88 // "ID": "gno.land/r/demo/nft.NFToken" 89 // } 90 // }, 91 // "V": { 92 // "@type": "/gno.PointerValue", 93 // "Base": null, 94 // "Index": "0", 95 // "TV": { 96 // "T": { 97 // "@type": "/gno.RefType", 98 // "ID": "gno.land/r/demo/nft.NFToken" 99 // }, 100 // "V": { 101 // "@type": "/gno.RefValue", 102 // "Hash": "c06f58d0ff2bc26ad3e65e953b127a0d03353e97", 103 // "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:8" 104 // } 105 // } 106 // } 107 // }, 108 // { 109 // "T": { 110 // "@type": "/gno.PrimitiveType", 111 // "value": "64" 112 // } 113 // }, 114 // { 115 // "N": "AQAAAAAAAAA=", 116 // "T": { 117 // "@type": "/gno.PrimitiveType", 118 // "value": "32" 119 // } 120 // }, 121 // { 122 // "T": { 123 // "@type": "/gno.PointerType", 124 // "Elt": { 125 // "@type": "/gno.RefType", 126 // "ID": "gno.land/p/demo/avl.Node" 127 // } 128 // } 129 // }, 130 // { 131 // "T": { 132 // "@type": "/gno.PointerType", 133 // "Elt": { 134 // "@type": "/gno.RefType", 135 // "ID": "gno.land/p/demo/avl.Node" 136 // } 137 // } 138 // } 139 // ], 140 // "ObjectInfo": { 141 // "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:7", 142 // "ModTime": "0", 143 // "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", 144 // "RefCount": "1" 145 // } 146 // } 147 // u[67c479d3d51d4056b2f4111d5352912a00be311e:5]={ 148 // "Fields": [ 149 // { 150 // "T": { 151 // "@type": "/gno.PointerType", 152 // "Elt": { 153 // "@type": "/gno.RefType", 154 // "ID": "gno.land/p/demo/avl.Node" 155 // } 156 // }, 157 // "V": { 158 // "@type": "/gno.PointerValue", 159 // "Base": null, 160 // "Index": "0", 161 // "TV": { 162 // "T": { 163 // "@type": "/gno.RefType", 164 // "ID": "gno.land/p/demo/avl.Node" 165 // }, 166 // "V": { 167 // "@type": "/gno.RefValue", 168 // "Hash": "45a64533aa57b49b6b4a1d3f6de79db8bea3a710", 169 // "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:7" 170 // } 171 // } 172 // } 173 // } 174 // ], 175 // "ObjectInfo": { 176 // "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:5", 177 // "ModTime": "6", 178 // "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:4", 179 // "RefCount": "1" 180 // } 181 // } 182 // u[67c479d3d51d4056b2f4111d5352912a00be311e:4]={ 183 // "Fields": [ 184 // {}, 185 // { 186 // "N": "AQAAAAAAAAA=", 187 // "T": { 188 // "@type": "/gno.PrimitiveType", 189 // "value": "32" 190 // } 191 // }, 192 // { 193 // "T": { 194 // "@type": "/gno.RefType", 195 // "ID": "gno.land/p/demo/avl.Tree" 196 // }, 197 // "V": { 198 // "@type": "/gno.RefValue", 199 // "Hash": "dad3106a54e1facb92bce473898b8aec0eb930ff", 200 // "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:5" 201 // } 202 // }, 203 // { 204 // "T": { 205 // "@type": "/gno.RefType", 206 // "ID": "gno.land/p/demo/avl.Tree" 207 // }, 208 // "V": { 209 // "@type": "/gno.RefValue", 210 // "Hash": "05ab6746ea84b55ca133806af215d99a1c4b045e", 211 // "ObjectID": "67c479d3d51d4056b2f4111d5352912a00be311e:6" 212 // } 213 // } 214 // ], 215 // "ObjectInfo": { 216 // "ID": "67c479d3d51d4056b2f4111d5352912a00be311e:4", 217 // "ModTime": "6", 218 // "OwnerID": "67c479d3d51d4056b2f4111d5352912a00be311e:2", 219 // "RefCount": "1" 220 // } 221 // } 222 // switchrealm["gno.land/r/demo/nft"] 223 // switchrealm["gno.land/r/nft_test"]