tx · 5w43zDNAmUKyq3WjkX9rvioAuQvaE3iwLm19KHCBhL8C 3Muey1cqNaBjjcxXfKHF8qqTZeyGPAsvCpP: -0.00800000 Waves 2022.08.10 11:12 [2178093] smart account 3Muey1cqNaBjjcxXfKHF8qqTZeyGPAsvCpP > SELF 0.00000000 Waves
{ "type": 13, "id": "5w43zDNAmUKyq3WjkX9rvioAuQvaE3iwLm19KHCBhL8C", "fee": 800000, "feeAssetId": null, "timestamp": 1660119214406, "version": 2, "chainId": 84, "sender": "3Muey1cqNaBjjcxXfKHF8qqTZeyGPAsvCpP", "senderPublicKey": "3bPATHM3GnqSGjJb8saHmYMvsaioqu2etEGkZDiuRCcn", "proofs": [ "2MD4WjKtiRhAf2CHYKku4RUp7UTGzPamdbxUUBN7FpJxHskrukq3aZsMp49U6Psny286uyx4NHaX1RMThZu6NkG5" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAAJAAAAAAltYXhTdXBwbHkAAAAAAAAAE4gBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAA10cnlHZXRBZGRyZXNzAAAAAQAAAARhZGRyBAAAAAN2YWwEAAAAByRtYXRjaDAJAAQmAAAAAQUAAAAEYWRkcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQWRkcmVzcwQAAAABYQUAAAAHJG1hdGNoMAUAA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AIhPQAAAAIJAQAAAAx0cnlHZXRTdHJpbmcAAAABCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgIAAAAACQAAAgAAAAECAAAAFllvdSBhbHJlYWR5IG1pbnRlZCBORlQEAAAAAmlkCQABpAAAAAEFAAAAE3RvdGFsTWVtYWxpZW5TdXBwbHkEAAAABWFzc2V0CQAEQwAAAAcJAQAAAAdnZXROYW1lAAAAAQUAAAACaWQJAQAAAAdnZXRNZXRhAAAAAQUAAAACaWQAAAAAAAAAAAEAAAAAAAAAAAAHBQAAAAR1bml0BQAAAAZoZWlnaHQEAAAAB2Fzc2V0SWQJAAQ4AAAAAQUAAAAFYXNzZXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAD21lbWFsaWVuX3N1cHBseQkAAGQAAAACBQAAABN0b3RhbE1lbWFsaWVuU3VwcGx5AAAAAAAAAAABCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQACWAAAAAEFAAAAB2Fzc2V0SWQJAARMAAAAAgUAAAAFYXNzZXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleUxg98A=", "height": 2178093, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: BB9FAuMxbHieyCbjeBV4czfUfesDaPVcUkXPsijEXNaP Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let maxSupply = 5000 | |
5 | + | ||
6 | + | func tryGetInteger (key) = { | |
7 | + | let val = match getInteger(this, key) { | |
8 | + | case b: Int => | |
9 | + | b | |
10 | + | case _ => | |
11 | + | 0 | |
12 | + | } | |
13 | + | val | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func tryGetString (key) = { | |
18 | + | let val = match getString(this, key) { | |
19 | + | case b: String => | |
20 | + | b | |
21 | + | case _ => | |
22 | + | "" | |
23 | + | } | |
24 | + | val | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func tryGetAddress (addr) = { | |
29 | + | let val = match addressFromString(addr) { | |
30 | + | case a: Address => | |
31 | + | a | |
32 | + | case a: Unit => | |
33 | + | Address(base58'3PQG1wqM5vECAGVzMDvBzyq5nSkriqnVFxs') | |
34 | + | case _ => | |
35 | + | throw("Match error") | |
36 | + | } | |
37 | + | val | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | func getName (id) = ("Memalien #" + id) | |
42 | + | ||
43 | + | ||
44 | + | func getURL (id) = (("https://images.wavespunks.com/memalien/" + id) + ".png") | |
45 | + | ||
46 | + | ||
47 | + | func getVideoURL (id) = (("https://images.wavespunks.com/memalien/" + id) + ".mp4") | |
48 | + | ||
49 | + | ||
50 | + | func getMeta (id) = (((("{\"id\": " + id) + "\", \"url\": \"") + getURL(id)) + "\"}") | |
51 | + | ||
52 | + | ||
53 | + | func getMetaVideo (id) = (((((("{\"id\": " + id) + "\", \"url\": \"") + getURL(id)) + "\", \"animation_url\": \"") + getVideoURL(id)) + "\"}") | |
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func dropNFT (address) = { | |
58 | + | let totalMemalienSupply = tryGetInteger("memalien_supply") | |
59 | + | let endDrop = tryGetInteger("end_drop") | |
60 | + | let owner = tryGetString("owner") | |
61 | + | if ((totalMemalienSupply > (endDrop - 1))) | |
62 | + | then throw("Drop was ended") | |
63 | + | else if ((totalMemalienSupply == maxSupply)) | |
64 | + | then throw("All memalien are minted") | |
65 | + | else if ((toString(i.caller) != owner)) | |
66 | + | then throw("The function is available only to the admin") | |
67 | + | else { | |
68 | + | let id = toString(totalMemalienSupply) | |
69 | + | if (containsElement(split(tryGetString("video_nft"), ","), id)) | |
70 | + | then { | |
71 | + | let asset = Issue(getName(id), getMetaVideo(id), 1, 0, false, unit, height) | |
72 | + | let assetId = calculateAssetId(asset) | |
73 | + | [IntegerEntry("memalien_supply", (totalMemalienSupply + 1)), StringEntry(("drop: " + address), toBase58String(assetId)), asset, ScriptTransfer(tryGetAddress(address), 1, assetId)] | |
74 | + | } | |
75 | + | else { | |
76 | + | let asset = Issue(getName(id), getMeta(id), 1, 0, false, unit, height) | |
77 | + | let assetId = calculateAssetId(asset) | |
78 | + | [IntegerEntry("memalien_supply", (totalMemalienSupply + 1)), StringEntry(address, toBase58String(assetId)), asset, ScriptTransfer(tryGetAddress(address), 1, assetId)] | |
79 | + | } | |
80 | + | } | |
81 | + | } | |
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | @Callable(i) | |
86 | + | func mint () = { | |
87 | + | let totalMemalienSupply = tryGetInteger("memalien_supply") | |
88 | + | let endDrop = tryGetInteger("end_drop") | |
89 | + | if (((endDrop - 1) > totalMemalienSupply)) | |
90 | + | then throw("Drop wasn`t ended yet") | |
91 | + | else if ((totalMemalienSupply == maxSupply)) | |
92 | + | then throw("All memalien are minted") | |
93 | + | else if ((tryGetString(toString(i.caller)) != "")) | |
94 | + | then throw("You already minted NFT") | |
95 | + | else { | |
96 | + | let id = toString(totalMemalienSupply) | |
97 | + | let asset = Issue(getName(id), getMeta(id), 1, 0, false, unit, height) | |
98 | + | let assetId = calculateAssetId(asset) | |
99 | + | [IntegerEntry("memalien_supply", (totalMemalienSupply + 1)), StringEntry(toString(i.caller), toBase58String(assetId)), asset, ScriptTransfer(i.caller, 1, assetId)] | |
100 | + | } | |
101 | + | } | |
102 | + | ||
103 | + | ||
104 | + | @Verifier(tx) | |
105 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
106 | + |
github/deemru/w8io/169f3d6 27.53 ms ◑