tx · 6yB45WYSVaj5DC12Rd3kHNKU6y151e1ZHJUnLoe1cTmr 3N4LSmPe4zjEW81X1ix6maibiT5HzXrWpTj: -0.00400000 Waves 2022.07.27 22:29 [2158643] smart account 3N4LSmPe4zjEW81X1ix6maibiT5HzXrWpTj > SELF 0.00000000 Waves
{ "type": 13, "id": "6yB45WYSVaj5DC12Rd3kHNKU6y151e1ZHJUnLoe1cTmr", "fee": 400000, "feeAssetId": null, "timestamp": 1658950197713, "version": 2, "chainId": 84, "sender": "3N4LSmPe4zjEW81X1ix6maibiT5HzXrWpTj", "senderPublicKey": "3ket5TT3jvwuk1Zy5vmeyEBvFWWieoTc5WY3abj3Gqpq", "proofs": [ "4xsNjgZYaUxdXxjL4mgtdXkoP6Gs9mKqQLn9gCEei9NfHqkeLm4nggZpjWnHHj5uYJZ7iCRCwYrmoLZodmS2m7U1" ], "script": "base64:AAIFAAAAAAAAAAwIAhIGCgQICAgIEgAAAAADAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAABAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAABAAAACGNoZWNrTkZUAAAAAQAAAAVhc3NldAMDAwkAAAAAAAACCAgFAAAABWFzc2V0AAAABmlzc3VlcgAAAAVieXRlcwgFAAAABHRoaXMAAAAFYnl0ZXMJAAAAAAAAAggFAAAABWFzc2V0AAAACGRlY2ltYWxzAAAAAAAAAAAABwkAAAAAAAACCAUAAAAFYXNzZXQAAAAKcmVpc3N1YWJsZQcHCQAAA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dGlvbkRvbWFpbgIAAAAFX3NpemUJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAALY29sbGVjdGlvbl8FAAAAEGNvbGxlY3Rpb25Eb21haW4CAAAABV9zaXplCQAAZQAAAAIFAAAABm5mdE51bQAAAAAAAAAAAQkABEwAAAACBQAAABB1cGRhdGVDb2xsZWN0aW9uCQAETAAAAAIJAQAAAARCdXJuAAAAAgUAAAAHYXNzZXRJZAAAAAAAAAAAAQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAEbmZ0XwUAAAAKYXNzZXRJZFN0cgIAAAAFX2RhdGEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQABLAAAAAICAAAABG5mdF8FAAAACmFzc2V0SWRTdHICAAAABl9pbWFnZQkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIJAAEsAAAAAgIAAAAEbmZ0XwUAAAAKYXNzZXRJZFN0cgIAAAAHX2lzc3VlcgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAtjb2xsZWN0aW9uXwUAAAAQY29sbGVjdGlvbkRvbWFpbgIAAAAJX2Fzc2V0SWRfBQAAAAphc3NldElkU3RyBQAAAANuaWwJAAACAAAAAQIAAAAWSXZhbGlkIGNvbGxlY3Rpb24gbmFtZQkAAAIAAAABAgAAABNJdmFsaWQgTkZUIGF0dGFjaGVkAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlI6TI1", "height": 2158643, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
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) = if ((indexOf(k, "https://") != 0)) | |
37 | + | then throw("https link to image required") | |
38 | + | else { | |
39 | + | let g = Issue(i, j, 1, 0, false, unit, 0) | |
40 | + | let m = calculateAssetId(g) | |
41 | + | let n = toBase58String(m) | |
42 | + | let o = ((toString(h.caller) + "_") + (if ((size(l) > 0)) | |
43 | + | then l | |
44 | + | else "basic")) | |
45 | + | let p = (a((("collection_" + o) + "_size")) + 1) | |
46 | + | $Tuple2([StringEntry((("nft_" + n) + "_data"), (((("{'collection': '" + o) + "', 'num': ") + toString(p)) + "}")), StringEntry((("nft_" + n) + "_image"), k), StringEntry((("nft_" + n) + "_issuer"), toString(h.caller)), StringEntry(toBase58String(m), toBase58String(m)), StringEntry(toBase58String(h.transactionId), toBase58String(m)), IntegerEntry((("collection_" + o) + "_size"), p), StringEntry(((("collection_" + o) + "_assetId_") + n), n), g, ScriptTransfer(h.caller, 1, m)], n) | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | @Callable(h) | |
52 | + | func burnNFT () = { | |
53 | + | let m = value(value(h.payments[0]).assetId) | |
54 | + | let g = value(assetInfo(m)) | |
55 | + | if (if ((value(h.payments[0]).amount == 1)) | |
56 | + | then f(g) | |
57 | + | else false) | |
58 | + | then { | |
59 | + | let n = toBase58String(m) | |
60 | + | let q = e((("nft_" + n) + "_issuer")) | |
61 | + | let r = e((("nft_" + n) + "_data")) | |
62 | + | let s = split(r, ", ") | |
63 | + | let t = split(s[0], ": ") | |
64 | + | let o = dropRight(drop(t[1], 1), 1) | |
65 | + | let p = a((("collection_" + o) + "_size")) | |
66 | + | if ((p > 0)) | |
67 | + | then { | |
68 | + | let u = if ((p == 1)) | |
69 | + | then DeleteEntry((("collection_" + o) + "_size")) | |
70 | + | else IntegerEntry((("collection_" + o) + "_size"), (p - 1)) | |
71 | + | [u, Burn(m, 1), DeleteEntry((("nft_" + n) + "_data")), DeleteEntry((("nft_" + n) + "_image")), DeleteEntry((("nft_" + n) + "_issuer")), DeleteEntry(((("collection_" + o) + "_assetId_") + n))] | |
72 | + | } | |
73 | + | else throw("Ivalid collection name") | |
74 | + | } | |
75 | + | else throw("Ivalid NFT attached") | |
76 | + | } | |
77 | + | ||
78 | + | ||
79 | + | @Verifier(v) | |
80 | + | func w () = sigVerify(v.bodyBytes, v.proofs[0], v.senderPublicKey) | |
81 | + |
github/deemru/w8io/026f985 18.68 ms ◑