tx · GiHAFUyWrVDoyWvjGMZvdPJNZxbBbEQtfsZmHw7XgF3s 3Mx1vNMiWzJ2NgY1t8bqsj8vvpxjaTLJWyo: -0.01400000 Waves 2021.11.15 10:04 [1791818] smart account 3Mx1vNMiWzJ2NgY1t8bqsj8vvpxjaTLJWyo > SELF 0.00000000 Waves
{ "type": 13, "id": "GiHAFUyWrVDoyWvjGMZvdPJNZxbBbEQtfsZmHw7XgF3s", "fee": 1400000, "feeAssetId": null, "timestamp": 1636959845696, "version": 2, "chainId": 84, "sender": "3Mx1vNMiWzJ2NgY1t8bqsj8vvpxjaTLJWyo", "senderPublicKey": "5fUyPtPgB9o1mWXPYifKATuZc8PG2ErT5CGABbC7pu3", "proofs": [ "2LkKp3pwCXG2XSsRZHsB3K8K7VWd4q8NoNK1RV8wfZH2Pg8cLC9Mg1XDFoEe4YBGHhc3jKKDtt843ZgUFpM9BVWx" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACgAAAAAJbWF4U3VwcGx5AAAAAAAAAAPoAAAAAAV3YXZlcwAAAAAABfXhAAEAAAAMZ2V0UHVua0lES2V5AAAAAQAAAAJpZAkAASwAAAACAgAAAAVwdW5rXwUAAAACaWQBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAABQAAAAN2YWwBAAAADHRyeUdldFN0cmluZwAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWICAAAAAAUAAAADdmFsAQAAAA10cnlHZXRBZGRyZXNzAAAAAQAAAARhZGRyBAAAAA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nkAAAACCQEAAAAMZ2V0UHVua0lES2V5AAAAAQUAAAAGcHVua0lkCQACWAAAAAEFAAAAB2Fzc2V0SWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAAlgAAAABBQAAAAdhc3NldElkCQEAAAAMZ2V0UHVua0lES2V5AAAAAQUAAAAGcHVua0lkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA5yZWZlcmFsQWRkcmVzcwkAAGkAAAACCAUAAAAMZmlyc3RQYXltZW50AAAABmFtb3VudAAAAAAAAAAACgUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkzPH08", "height": 1791818, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 87QmdqLcghUMUbzexuh2NM794s2nrN2eN6WKNCCtw12i Next: 5ySNNs18VUCV1gq1zmdTwCehGED83PrY5CxEaDdwgoBT Diff:
Old | New | Differences | |
---|---|---|---|
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | - | func n (o,p,q,r) = { | |
59 | - | let s = value(blockInfoByHeight((q - 1))) | |
60 | - | let t = sha256_16Kb((p + value(s.vrf))) | |
61 | - | (toInt(t, r) % o) | |
58 | + | func n (d) = if ((d != "0")) | |
59 | + | then "unique" | |
60 | + | else "rare" | |
61 | + | ||
62 | + | ||
63 | + | func o (d) = (("https://wavespunks.com/punks/" + d) + ".png") | |
64 | + | ||
65 | + | ||
66 | + | func p (q,r,s,t) = { | |
67 | + | let u = value(blockInfoByHeight((s - 1))) | |
68 | + | let v = sha256_16Kb((r + value(u.vrf))) | |
69 | + | (toInt(v, t) % q) | |
62 | 70 | } | |
63 | 71 | ||
64 | 72 | ||
65 | - | func | |
73 | + | func w (x) = if ((x == 0)) | |
66 | 74 | then b | |
67 | - | else ((( | |
75 | + | else (((x / 100) + 1) * b) | |
68 | 76 | ||
69 | 77 | ||
70 | - | @Callable( | |
71 | - | func mint ( | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let h = | |
78 | + | @Callable(y) | |
79 | + | func mint (z) = { | |
80 | + | let x = e("punks_supply") | |
81 | + | let A = j("available_punks") | |
82 | + | let B = w(x) | |
83 | + | let C = value(y.payments[0]) | |
84 | + | let D = { | |
85 | + | let h = C.assetId | |
78 | 86 | if ($isInstanceOf(h, "ByteVector")) | |
79 | 87 | then { | |
80 | - | let | |
88 | + | let E = h | |
81 | 89 | true | |
82 | 90 | } | |
83 | 91 | else if ($isInstanceOf(h, "Unit")) | |
84 | 92 | then { | |
85 | - | let | |
93 | + | let F = h | |
86 | 94 | false | |
87 | 95 | } | |
88 | 96 | else throw("Match error") | |
89 | 97 | } | |
90 | - | if (( | |
98 | + | if ((x == a)) | |
91 | 99 | then throw("All punks are minted") | |
92 | - | else if (( | |
100 | + | else if ((A == "")) | |
93 | 101 | then throw("No punks available") | |
94 | - | else if ( | |
102 | + | else if (D) | |
95 | 103 | then throw("Payment must be in Waves tokens only") | |
96 | - | else if (( | |
104 | + | else if ((B > C.amount)) | |
97 | 105 | then throw("Insufficient funds") | |
98 | 106 | else { | |
99 | - | let E = split(y, ",") | |
100 | - | let F = n((a - v), w.transactionId, height, 0) | |
101 | - | let G = E[F] | |
102 | - | let H = ("WavesPunk #" + G) | |
103 | - | let I = Issue(H, H, 1, 0, false, unit, height) | |
104 | - | let J = calculateAssetId(I) | |
105 | - | let K = k(x) | |
106 | - | [IntegerEntry("punks_supply", (v + 1)), StringEntry("available_punks", makeString(removeByIndex(E, F), ",")), I, StringEntry(c(G), toBase58String(J)), StringEntry(toBase58String(J), c(G)), ScriptTransfer(w.caller, 1, J), ScriptTransfer(K, (A.amount / 10), unit)] | |
107 | + | let G = split(A, ",") | |
108 | + | let H = p((a - x), y.transactionId, height, 0) | |
109 | + | let I = G[H] | |
110 | + | let J = ("WavesPunk #" + I) | |
111 | + | let K = (((((("{\"id\":" + I) + ", \"type\":") + n(I)) + ", \"url\":") + o(I)) + "}") | |
112 | + | let L = Issue(J, K, 1, 0, false, unit, height) | |
113 | + | let M = calculateAssetId(L) | |
114 | + | let N = k(z) | |
115 | + | [IntegerEntry("punks_supply", (x + 1)), StringEntry("available_punks", makeString(removeByIndex(G, H), ",")), L, StringEntry(c(I), toBase58String(M)), StringEntry(toBase58String(M), c(I)), ScriptTransfer(y.caller, 1, M), ScriptTransfer(N, (C.amount / 10), unit)] | |
107 | 116 | } | |
108 | 117 | } | |
109 | 118 | ||
110 | 119 | ||
111 | - | @Verifier( | |
112 | - | func | |
120 | + | @Verifier(O) | |
121 | + | func P () = sigVerify(O.bodyBytes, O.proofs[0], O.senderPublicKey) | |
113 | 122 |
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 = getString(this, f) | |
28 | 28 | if ($isInstanceOf(h, "String")) | |
29 | 29 | then { | |
30 | 30 | let i = h | |
31 | 31 | i | |
32 | 32 | } | |
33 | 33 | else "" | |
34 | 34 | } | |
35 | 35 | g | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func k (l) = { | |
40 | 40 | let g = { | |
41 | 41 | let h = addressFromString(l) | |
42 | 42 | if ($isInstanceOf(h, "Address")) | |
43 | 43 | then { | |
44 | 44 | let m = h | |
45 | 45 | m | |
46 | 46 | } | |
47 | 47 | else if ($isInstanceOf(h, "Unit")) | |
48 | 48 | then { | |
49 | 49 | let m = h | |
50 | 50 | Address(base58'3Msrw9Kxa6RgHYQ63sSib9uESmaBU9gH6Gy') | |
51 | 51 | } | |
52 | 52 | else throw("Match error") | |
53 | 53 | } | |
54 | 54 | g | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | ||
58 | - | func n (o,p,q,r) = { | |
59 | - | let s = value(blockInfoByHeight((q - 1))) | |
60 | - | let t = sha256_16Kb((p + value(s.vrf))) | |
61 | - | (toInt(t, r) % o) | |
58 | + | func n (d) = if ((d != "0")) | |
59 | + | then "unique" | |
60 | + | else "rare" | |
61 | + | ||
62 | + | ||
63 | + | func o (d) = (("https://wavespunks.com/punks/" + d) + ".png") | |
64 | + | ||
65 | + | ||
66 | + | func p (q,r,s,t) = { | |
67 | + | let u = value(blockInfoByHeight((s - 1))) | |
68 | + | let v = sha256_16Kb((r + value(u.vrf))) | |
69 | + | (toInt(v, t) % q) | |
62 | 70 | } | |
63 | 71 | ||
64 | 72 | ||
65 | - | func | |
73 | + | func w (x) = if ((x == 0)) | |
66 | 74 | then b | |
67 | - | else ((( | |
75 | + | else (((x / 100) + 1) * b) | |
68 | 76 | ||
69 | 77 | ||
70 | - | @Callable( | |
71 | - | func mint ( | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let h = | |
78 | + | @Callable(y) | |
79 | + | func mint (z) = { | |
80 | + | let x = e("punks_supply") | |
81 | + | let A = j("available_punks") | |
82 | + | let B = w(x) | |
83 | + | let C = value(y.payments[0]) | |
84 | + | let D = { | |
85 | + | let h = C.assetId | |
78 | 86 | if ($isInstanceOf(h, "ByteVector")) | |
79 | 87 | then { | |
80 | - | let | |
88 | + | let E = h | |
81 | 89 | true | |
82 | 90 | } | |
83 | 91 | else if ($isInstanceOf(h, "Unit")) | |
84 | 92 | then { | |
85 | - | let | |
93 | + | let F = h | |
86 | 94 | false | |
87 | 95 | } | |
88 | 96 | else throw("Match error") | |
89 | 97 | } | |
90 | - | if (( | |
98 | + | if ((x == a)) | |
91 | 99 | then throw("All punks are minted") | |
92 | - | else if (( | |
100 | + | else if ((A == "")) | |
93 | 101 | then throw("No punks available") | |
94 | - | else if ( | |
102 | + | else if (D) | |
95 | 103 | then throw("Payment must be in Waves tokens only") | |
96 | - | else if (( | |
104 | + | else if ((B > C.amount)) | |
97 | 105 | then throw("Insufficient funds") | |
98 | 106 | else { | |
99 | - | let E = split(y, ",") | |
100 | - | let F = n((a - v), w.transactionId, height, 0) | |
101 | - | let G = E[F] | |
102 | - | let H = ("WavesPunk #" + G) | |
103 | - | let I = Issue(H, H, 1, 0, false, unit, height) | |
104 | - | let J = calculateAssetId(I) | |
105 | - | let K = k(x) | |
106 | - | [IntegerEntry("punks_supply", (v + 1)), StringEntry("available_punks", makeString(removeByIndex(E, F), ",")), I, StringEntry(c(G), toBase58String(J)), StringEntry(toBase58String(J), c(G)), ScriptTransfer(w.caller, 1, J), ScriptTransfer(K, (A.amount / 10), unit)] | |
107 | + | let G = split(A, ",") | |
108 | + | let H = p((a - x), y.transactionId, height, 0) | |
109 | + | let I = G[H] | |
110 | + | let J = ("WavesPunk #" + I) | |
111 | + | let K = (((((("{\"id\":" + I) + ", \"type\":") + n(I)) + ", \"url\":") + o(I)) + "}") | |
112 | + | let L = Issue(J, K, 1, 0, false, unit, height) | |
113 | + | let M = calculateAssetId(L) | |
114 | + | let N = k(z) | |
115 | + | [IntegerEntry("punks_supply", (x + 1)), StringEntry("available_punks", makeString(removeByIndex(G, H), ",")), L, StringEntry(c(I), toBase58String(M)), StringEntry(toBase58String(M), c(I)), ScriptTransfer(y.caller, 1, M), ScriptTransfer(N, (C.amount / 10), unit)] | |
107 | 116 | } | |
108 | 117 | } | |
109 | 118 | ||
110 | 119 | ||
111 | - | @Verifier( | |
112 | - | func | |
120 | + | @Verifier(O) | |
121 | + | func P () = sigVerify(O.bodyBytes, O.proofs[0], O.senderPublicKey) | |
113 | 122 |
github/deemru/w8io/169f3d6 30.24 ms ◑