tx · 5UfWwd8UygKEG7SE9xGzvhHU4jGWCSLWMm1Jr21p16Zp

3N2Fq3xoRamZ62SFkonL1kcSs9womjpF7KQ:  -0.00400000 Waves

2022.07.04 20:02 [2125202] smart account 3N2Fq3xoRamZ62SFkonL1kcSs9womjpF7KQ > SELF 0.00000000 Waves

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

github/deemru/w8io/026f985 
31.12 ms