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