tx · 6Qv4iWKXgWXR9Y51btDWgvHPLKJfDf5U8Dvja2m5rAmv 3N2Fq3xoRamZ62SFkonL1kcSs9womjpF7KQ: -0.01400000 Waves 2022.07.04 20:05 [2125207] smart account 3N2Fq3xoRamZ62SFkonL1kcSs9womjpF7KQ > SELF 0.00000000 Waves
{ "type": 13, "id": "6Qv4iWKXgWXR9Y51btDWgvHPLKJfDf5U8Dvja2m5rAmv", "fee": 1400000, "feeAssetId": null, "timestamp": 1656954354486, "version": 2, "chainId": 84, "sender": "3N2Fq3xoRamZ62SFkonL1kcSs9womjpF7KQ", "senderPublicKey": "9s1gudEMHm746dNqnAUyThSzsf5cNdcNTuBE1ABNtZ5C", "proofs": [ "5cnBdJuYP8XCagi5Vi67833f3E3cN9YgmLfkfJgTzCbRpNnkL1JwjDs6eHocoe57mHi3DZh51AYFYVMhs6EMzWih" ], "script": "base64:AAIFAAAAAAAAAAwIAhIGCgQICAgIEgAAAAADAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAABAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAABAAAACGNoZWNrTkZUAAAAAQAAAAVhc3NldAMDAwkAAAAAAAACCAgFAAAABWFzc2V0AAAABmlzc3VlcgAAAAVieXRlcwgFAAAABHRoaXMAAAAFYnl0ZXMJAAAAAAAAAggFAAAABWFzc2V0AAAACGRlY2ltYWxzAAAAAAAAAAAABwkAAAAAAAACCAUAAAAFYXNzZXQAAAAKcmVpc3N1YWJsZQcHCQAAA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AgkAASwAAAACCQABLAAAAAICAAAAC2NvbGxlY3Rpb25fBQAAABBjb2xsZWN0aW9uRG9tYWluAgAAAAVfc2l6ZQkAAGUAAAACBQAAAAZuZnROdW0AAAAAAAAAAAEJAARMAAAAAgUAAAAQdXBkYXRlQ29sbGVjdGlvbgkABEwAAAACCQEAAAAEQnVybgAAAAIFAAAAB2Fzc2V0SWQAAAAAAAAAAAEJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQABLAAAAAICAAAABG5mdF8FAAAACmFzc2V0SWRTdHICAAAABV9kYXRhCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgkAASwAAAACAgAAAARuZnRfBQAAAAphc3NldElkU3RyAgAAAAZfaW1hZ2UJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQABLAAAAAICAAAABG5mdF8FAAAACmFzc2V0SWRTdHICAAAAB19pc3N1ZXIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAALY29sbGVjdGlvbl8FAAAAEGNvbGxlY3Rpb25Eb21haW4CAAAACV9hc3NldElkXwUAAAAKYXNzZXRJZFN0cgUAAAADbmlsCQAAAgAAAAECAAAAFkl2YWxpZCBjb2xsZWN0aW9uIG5hbWUJAAACAAAAAQIAAAATSXZhbGlkIE5GVCBhdHRhY2hlZAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5kMulUw==", "height": 2125207, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5UfWwd8UygKEG7SE9xGzvhHU4jGWCSLWMm1Jr21p16Zp Next: none Diff:
Old | New | Differences | |
---|---|---|---|
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | - | func createNFT (nftName,nftDesc,image,collectionName) = if ((toString(i.caller) == " | |
30 | + | func createNFT (nftName,nftDesc,image,collectionName) = if ((toString(i.caller) == "3MuocfPorcMAUnSc35WpLgUKFQJKm611111")) | |
31 | 31 | then throw("issuance of new NFTs is limited") | |
32 | 32 | else if ((indexOf(image, "https://") != 0)) | |
33 | 33 | then throw("https link to image required") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetInteger (key) = match getInteger(this, key) { | |
5 | 5 | case b: Int => | |
6 | 6 | b | |
7 | 7 | case _ => | |
8 | 8 | 0 | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetString (key) = match getString(this, key) { | |
13 | 13 | case b: String => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | "" | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func checkNFT (asset) = if (if (if ((asset.issuer.bytes == this.bytes)) | |
21 | 21 | then (asset.decimals == 0) | |
22 | 22 | else false) | |
23 | 23 | then (asset.reissuable == false) | |
24 | 24 | else false) | |
25 | 25 | then (asset.quantity == 1) | |
26 | 26 | else false | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Callable(i) | |
30 | - | func createNFT (nftName,nftDesc,image,collectionName) = if ((toString(i.caller) == " | |
30 | + | func createNFT (nftName,nftDesc,image,collectionName) = if ((toString(i.caller) == "3MuocfPorcMAUnSc35WpLgUKFQJKm611111")) | |
31 | 31 | then throw("issuance of new NFTs is limited") | |
32 | 32 | else if ((indexOf(image, "https://") != 0)) | |
33 | 33 | then throw("https link to image required") | |
34 | 34 | else { | |
35 | 35 | let asset = Issue(nftName, nftDesc, 1, 0, false, unit, 0) | |
36 | 36 | let assetId = calculateAssetId(asset) | |
37 | 37 | let assetIdStr = toBase58String(assetId) | |
38 | 38 | let collectionDomain = ((toString(i.caller) + "_") + (if ((size(collectionName) > 0)) | |
39 | 39 | then collectionName | |
40 | 40 | else "basic")) | |
41 | 41 | let nftNum = (tryGetInteger((("collection_" + collectionDomain) + "_size")) + 1) | |
42 | 42 | $Tuple2([StringEntry((("nft_" + assetIdStr) + "_data"), (((("{'collection': '" + collectionDomain) + "', 'num': ") + toString(nftNum)) + "}")), StringEntry((("nft_" + assetIdStr) + "_image"), image), StringEntry((("nft_" + assetIdStr) + "_issuer"), toString(i.caller)), IntegerEntry((("collection_" + collectionDomain) + "_size"), nftNum), StringEntry(((("collection_" + collectionDomain) + "_assetId_") + assetIdStr), assetIdStr), asset, ScriptTransfer(i.caller, 1, assetId)], assetIdStr) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func burnNFT () = { | |
49 | 49 | let assetId = value(value(i.payments[0]).assetId) | |
50 | 50 | let asset = value(assetInfo(assetId)) | |
51 | 51 | if (if ((value(i.payments[0]).amount == 1)) | |
52 | 52 | then checkNFT(asset) | |
53 | 53 | else false) | |
54 | 54 | then { | |
55 | 55 | let assetIdStr = toBase58String(assetId) | |
56 | 56 | let issuer = tryGetString((("nft_" + assetIdStr) + "_issuer")) | |
57 | 57 | let data = tryGetString((("nft_" + assetIdStr) + "_data")) | |
58 | 58 | let partsData = split(data, ", ") | |
59 | 59 | let partsCollection = split(partsData[0], ": ") | |
60 | 60 | let collectionDomain = dropRight(drop(partsCollection[1], 1), 1) | |
61 | 61 | let nftNum = tryGetInteger((("collection_" + collectionDomain) + "_size")) | |
62 | 62 | if ((nftNum > 0)) | |
63 | 63 | then { | |
64 | 64 | let updateCollection = if ((nftNum == 1)) | |
65 | 65 | then DeleteEntry((("collection_" + collectionDomain) + "_size")) | |
66 | 66 | else IntegerEntry((("collection_" + collectionDomain) + "_size"), (nftNum - 1)) | |
67 | 67 | [updateCollection, Burn(assetId, 1), DeleteEntry((("nft_" + assetIdStr) + "_data")), DeleteEntry((("nft_" + assetIdStr) + "_image")), DeleteEntry((("nft_" + assetIdStr) + "_issuer")), DeleteEntry(((("collection_" + collectionDomain) + "_assetId_") + assetIdStr))] | |
68 | 68 | } | |
69 | 69 | else throw("Ivalid collection name") | |
70 | 70 | } | |
71 | 71 | else throw("Ivalid NFT attached") | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Verifier(tx) | |
76 | 76 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
77 | 77 |
github/deemru/w8io/026f985 25.79 ms ◑