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