tx · Hhr2L8CMXXQpRZeM625GnCbisUzPurMtPdEjrf9WAXoD 3NBzKMPpmXT7kQt7nwdkuAyu3snUy1RTC6n: -0.00300000 Waves 2022.07.10 00:59 [2132754] smart account 3NBzKMPpmXT7kQt7nwdkuAyu3snUy1RTC6n > SELF 0.00000000 Waves
{ "type": 13, "id": "Hhr2L8CMXXQpRZeM625GnCbisUzPurMtPdEjrf9WAXoD", "fee": 300000, "feeAssetId": null, "timestamp": 1657404050519, "version": 2, "chainId": 84, "sender": "3NBzKMPpmXT7kQt7nwdkuAyu3snUy1RTC6n", "senderPublicKey": "8XeWci9aaCjzH79BACEeCGyh6HS9RXZRBC6uSbjmpeeZ", "proofs": [ "5JdJcoDyrQAHCpAdGkjmaBBJT2zcsQvJ2mWC416WkWAGxaSVtLGEuQV5NEDwCJgAjsAa4JhGuPrpEFfu7CQ95onU" ], "script": "base64:BgIMCAISBgoECAgICBIAAwENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAEMdHJ5R2V0U3RyaW5nAQNrZXkEByRtYXRjaDAJAJ0IAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACBlN0cmluZwQBYgUHJG1hdGNoMAUBYgIAAQhjaGVja05GVAEFYXNzZXQDAwMJAAACCAgFBWFzc2V0Bmlzc3VlcgVieXRlcwgFBHRoaXMFYnl0ZXMJAAACCAUFYXNzZXQIZGVjaW1hbHMAAAcJAAACCAUFYXNzZXQKcmVpc3N1YWJsZQcHCQAAAggFBWFzc2V0CHF1YW50aXR5AAEHAgFpAQljcmVhdGVORlQEB25mdE5hbWUHbmZ0RGVzYwVpbWFnZQ5jb2xsZWN0aW9uTmFtZQQFYXNzZXQJAMMIBwUHbmZ0TmFtZQUHbmZ0RGVzYwABAAAHBQR1bml0AAAEB2Fzc2V0SWQJALgIAQUFYXNzZXQECmFzc2V0SWRT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AgRuZnRfBQphc3NldElkU3RyAgdfaXNzdWVyCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICCQCsAgICC2NvbGxlY3Rpb25fBRBjb2xsZWN0aW9uRG9tYWluAglfYXNzZXRJZF8FCmFzc2V0SWRTdHIFA25pbAkAAgECFkl2YWxpZCBjb2xsZWN0aW9uIG5hbWUJAAIBAhNJdmFsaWQgTkZUIGF0dGFjaGVkAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleTSqTXA=", "height": 2132754, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func a (b) = { | |
5 | + | let c = getInteger(this, b) | |
6 | + | if ($isInstanceOf(c, "Int")) | |
7 | + | then { | |
8 | + | let d = c | |
9 | + | d | |
10 | + | } | |
11 | + | else 0 | |
12 | + | } | |
13 | + | ||
14 | + | ||
15 | + | func e (b) = { | |
16 | + | let c = getString(this, b) | |
17 | + | if ($isInstanceOf(c, "String")) | |
18 | + | then { | |
19 | + | let d = c | |
20 | + | d | |
21 | + | } | |
22 | + | else "" | |
23 | + | } | |
24 | + | ||
25 | + | ||
26 | + | func f (g) = if (if (if ((g.issuer.bytes == this.bytes)) | |
27 | + | then (g.decimals == 0) | |
28 | + | else false) | |
29 | + | then (g.reissuable == false) | |
30 | + | else false) | |
31 | + | then (g.quantity == 1) | |
32 | + | else false | |
33 | + | ||
34 | + | ||
35 | + | @Callable(h) | |
36 | + | func createNFT (i,j,k,l) = { | |
37 | + | let g = Issue(i, j, 1, 0, false, unit, 0) | |
38 | + | let m = calculateAssetId(g) | |
39 | + | let n = toBase58String(m) | |
40 | + | let o = ((toString(h.caller) + "_") + (if ((size(l) > 0)) | |
41 | + | then l | |
42 | + | else "basic")) | |
43 | + | let p = (a((("collection_" + o) + "_size")) + 1) | |
44 | + | $Tuple2([StringEntry((("nft_" + n) + "_data"), (((("{'collection': '" + o) + "', 'num': ") + toString(p)) + "}")), StringEntry((("nft_" + n) + "_image"), k), StringEntry((("nft_" + n) + "_issuer"), toString(h.caller)), IntegerEntry((("collection_" + o) + "_size"), p), StringEntry(((("collection_" + o) + "_assetId_") + n), n), g, ScriptTransfer(h.caller, 1, m)], n) | |
45 | + | } | |
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | @Callable(h) | |
50 | + | func burnNFT () = { | |
51 | + | let m = value(value(h.payments[0]).assetId) | |
52 | + | let g = value(assetInfo(m)) | |
53 | + | if (if ((value(h.payments[0]).amount == 1)) | |
54 | + | then f(g) | |
55 | + | else false) | |
56 | + | then { | |
57 | + | let n = toBase58String(m) | |
58 | + | let q = e((("nft_" + n) + "_issuer")) | |
59 | + | let r = e((("nft_" + n) + "_data")) | |
60 | + | let s = split(r, ", ") | |
61 | + | let t = split(s[0], ": ") | |
62 | + | let o = dropRight(drop(t[1], 1), 1) | |
63 | + | let p = a((("collection_" + o) + "_size")) | |
64 | + | if ((p > 0)) | |
65 | + | then { | |
66 | + | let u = if ((p == 1)) | |
67 | + | then DeleteEntry((("collection_" + o) + "_size")) | |
68 | + | else IntegerEntry((("collection_" + o) + "_size"), (p - 1)) | |
69 | + | [u, Burn(m, 1), DeleteEntry((("nft_" + n) + "_data")), DeleteEntry((("nft_" + n) + "_image")), DeleteEntry((("nft_" + n) + "_issuer")), DeleteEntry(((("collection_" + o) + "_assetId_") + n))] | |
70 | + | } | |
71 | + | else throw("Ivalid collection name") | |
72 | + | } | |
73 | + | else throw("Ivalid NFT attached") | |
74 | + | } | |
75 | + | ||
76 | + | ||
77 | + | @Verifier(v) | |
78 | + | func w () = sigVerify(v.bodyBytes, v.proofs[0], v.senderPublicKey) | |
79 | + |
github/deemru/w8io/169f3d6 15.91 ms ◑