tx · ErNqC8KJHfx4EPDTbeYwSxSrL3FPWS9rJW6HKGgex4wK 3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu: -0.00900000 Waves 2022.08.17 18:07 [2188628] smart account 3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu > SELF 0.00000000 Waves
{ "type": 13, "id": "ErNqC8KJHfx4EPDTbeYwSxSrL3FPWS9rJW6HKGgex4wK", "fee": 900000, "feeAssetId": null, "timestamp": 1660748910699, "version": 2, "chainId": 84, "sender": "3MugHf1wRTdGuTrjXGB4qunDNZ6jNEVEAdu", "senderPublicKey": "FbyxDzJQJeCSLtjFFYUf8YN6yLMPB1sXnpiQ13oFNHWd", "proofs": [ "5CXGE6q5qHK7Xo3aXMJbo92FoVCEYzXTgk5yd2WBt4fiARti8xE98mRUufaiiazsG24uBGhghuCp7yqz4A1Mitv" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAACgAAAAAJbWF4U3VwcGx5AAAAAAAAAAPoAAAAAAV3YXZlcwAAAAAABfXhAAEAAAAMZ2V0UHVua0lES2V5AAAAAQAAAAJpZAkAASwAAAACAgAAAAVwdW5rXwUAAAACaWQBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAAZnZXRVUkwAAAABAAAAAmlkAwkBAAAAD2NvbnRhaW5zRWxlbWVudAAAAAIJAAS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HJ5AAAAAgIAAAAPcHJlbWludF9hZGRyZXNzCQAEuQAAAAIJAARRAAAAAgUAAAAOcHJlTWludEFkZHJlc3MFAAAABWluZGV4AgAAAAEsBQAAAANuaWwFAAAABHRlbXADCQAAZgAAAAIFAAAACXN0YXJ0TWludAgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAACAAAAAQIAAAAVTWludCBoYXNuYHQgeWV0IGJlZ3VuAwUAAAAQZmlyc3RQYXltZW50Qm9vbAkAAAIAAAABAgAAACRQYXltZW50IG11c3QgYmUgaW4gV2F2ZXMgdG9rZW5zIG9ubHkDCQAAZgAAAAIFAAAAC3dhdmVzTmVlZGVkCAUAAAAMZmlyc3RQYXltZW50AAAABmFtb3VudAkAAAIAAAABAgAAABJJbnN1ZmZpY2llbnQgZnVuZHMJAQAAAAVfbWludAAAAAMFAAAAAWkFAAAAEHRvdGFsUHVua3NTdXBwbHkFAAAADmF2YWlsYWJsZVB1bmtzAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkhF4XS", "height": 2188628, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DZuzK4vAPbzoyMrGGQTutn76wempBaJe3XRLsH1Dq4UW Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = 1000 | |
5 | + | ||
6 | + | let b = 100000000 | |
7 | + | ||
8 | + | func c (d) = ("punk_" + d) | |
9 | + | ||
10 | + | ||
11 | + | func e (f) = { | |
12 | + | let g = { | |
13 | + | let h = getInteger(this, f) | |
14 | + | if ($isInstanceOf(h, "Int")) | |
15 | + | then { | |
16 | + | let i = h | |
17 | + | i | |
18 | + | } | |
19 | + | else 0 | |
20 | + | } | |
21 | + | g | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | func j (f) = { | |
26 | + | let g = { | |
27 | + | let h = getString(this, f) | |
28 | + | if ($isInstanceOf(h, "String")) | |
29 | + | then { | |
30 | + | let i = h | |
31 | + | i | |
32 | + | } | |
33 | + | else "" | |
34 | + | } | |
35 | + | g | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | func k (d) = if (containsElement(split(j("gif_punk"), ","), d)) | |
40 | + | then (("https://mypunks.wavespunks.com/mad/m" + d) + ".gif") | |
41 | + | else (("https://mypunks.wavespunks.com/mad/m" + d) + ".png") | |
42 | + | ||
43 | + | ||
44 | + | func l (d) = { | |
45 | + | let m = { | |
46 | + | let h = parseInt(d) | |
47 | + | if ($isInstanceOf(h, "Int")) | |
48 | + | then { | |
49 | + | let n = h | |
50 | + | n | |
51 | + | } | |
52 | + | else if ($isInstanceOf(h, "Unit")) | |
53 | + | then { | |
54 | + | let n = h | |
55 | + | 0 | |
56 | + | } | |
57 | + | else throw("Match error") | |
58 | + | } | |
59 | + | if (containsElement(split(j("gif_punk"), ","), toString(m))) | |
60 | + | then "ultra-rare" | |
61 | + | else if ((29 >= m)) | |
62 | + | then "rare" | |
63 | + | else "unique" | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func o (p,q,r,s) = { | |
68 | + | let t = value(blockInfoByHeight((r - 1))) | |
69 | + | let u = sha256_16Kb((q + value(t.vrf))) | |
70 | + | (toInt(u, s) % p) | |
71 | + | } | |
72 | + | ||
73 | + | ||
74 | + | func v () = (b * 6) | |
75 | + | ||
76 | + | ||
77 | + | func w (n,x,y) = { | |
78 | + | let z = split(y, ",") | |
79 | + | let A = o((a - x), n.transactionId, height, 0) | |
80 | + | let B = z[A] | |
81 | + | let C = ("MadPunk #" + B) | |
82 | + | let D = j("collection_description") | |
83 | + | let E = Issue(C, D, 1, 0, false, unit, height) | |
84 | + | let F = calculateAssetId(E) | |
85 | + | let G = [IntegerEntry("punks_supply", (x + 1)), StringEntry("available_punks", makeString(removeByIndex(z, A), ",")), E, StringEntry(c(B), toBase58String(F)), StringEntry((toBase58String(F) + "_id"), c(B)), StringEntry((toBase58String(F) + "_type"), l(B)), StringEntry((toBase58String(F) + "_url"), k(B)), StringEntry((toBase58String(F) + "_fraction"), j("fraction")), ScriptTransfer(n.caller, 1, F)] | |
86 | + | G | |
87 | + | } | |
88 | + | ||
89 | + | ||
90 | + | @Callable(n) | |
91 | + | func mint () = { | |
92 | + | let x = e("punks_supply") | |
93 | + | let y = j("available_punks") | |
94 | + | let H = split(j("premint_address"), ",") | |
95 | + | let I = e("start_mint") | |
96 | + | let J = v() | |
97 | + | let K = value(n.payments[0]) | |
98 | + | let L = { | |
99 | + | let h = K.assetId | |
100 | + | if ($isInstanceOf(h, "ByteVector")) | |
101 | + | then { | |
102 | + | let M = h | |
103 | + | true | |
104 | + | } | |
105 | + | else if ($isInstanceOf(h, "Unit")) | |
106 | + | then { | |
107 | + | let N = h | |
108 | + | false | |
109 | + | } | |
110 | + | else throw("Match error") | |
111 | + | } | |
112 | + | if ((x == a)) | |
113 | + | then throw("All punks are minted") | |
114 | + | else if ((y == "")) | |
115 | + | then throw("No punks available") | |
116 | + | else if (containsElement(H, toString(n.caller))) | |
117 | + | then { | |
118 | + | let O = { | |
119 | + | let h = indexOf(H, toString(n.caller)) | |
120 | + | if ($isInstanceOf(h, "Int")) | |
121 | + | then { | |
122 | + | let i = h | |
123 | + | i | |
124 | + | } | |
125 | + | else if ($isInstanceOf(h, "Unit")) | |
126 | + | then { | |
127 | + | let i = h | |
128 | + | 0 | |
129 | + | } | |
130 | + | else throw("Match error") | |
131 | + | } | |
132 | + | let P = (w(n, x, y) ++ [StringEntry("premint_address", makeString(removeByIndex(H, O), ","))]) | |
133 | + | P | |
134 | + | } | |
135 | + | else if ((I > lastBlock.timestamp)) | |
136 | + | then throw("Mint hasn`t yet begun") | |
137 | + | else if (L) | |
138 | + | then throw("Payment must be in Waves tokens only") | |
139 | + | else if ((J > K.amount)) | |
140 | + | then throw("Insufficient funds") | |
141 | + | else w(n, x, y) | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | @Verifier(G) | |
146 | + | func Q () = sigVerify(G.bodyBytes, G.proofs[0], G.senderPublicKey) | |
147 | + |
github/deemru/w8io/169f3d6 23.26 ms ◑