tx · 3KojrtqfHoJe5euPC8h4gvhNLqnDSfti6yXYZXrxvWeJ 3N11gzZic4yASFhatzjC8zvLnpNhDo2B1Rv: -0.01000000 Waves 2023.10.07 02:28 [2787436] smart account 3N11gzZic4yASFhatzjC8zvLnpNhDo2B1Rv > SELF 0.00000000 Waves
{ "type": 13, "id": "3KojrtqfHoJe5euPC8h4gvhNLqnDSfti6yXYZXrxvWeJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1696634960027, "version": 2, "chainId": 84, "sender": "3N11gzZic4yASFhatzjC8zvLnpNhDo2B1Rv", "senderPublicKey": "EnUXxxhBK8wUfh1FveDYv9G5HBMXop6YwZWzVrBrLo2i", "proofs": [ "7zE4eyVjCY6D6vZQL4jFxyEPnfnvZFMSzVxCpLLic1k8oHWRXDeT8WMqqnBWLy9VFkpXdVdtp66B3WHhUs5VjBw" ], "script": "base64:BgIJCAISBQoDAQEYAwELd3JpdGVTdHJpbmcCA2tleQtzdHJpbmdWYWx1ZQkBC1N0cmluZ0VudHJ5AgUDa2V5BQtzdHJpbmdWYWx1ZQENc3BsaXRDZm1tSnNvbgEFZW50cnkJALUJAgUFZW50cnkCAS8BFGRpc3RyaWJ1dGVEaWZmZXJlbmNlAgVzd2FwcwRkaWZmBAp0b3RhbFN3YXBzCQCQAwEFBXN3YXBzCgENYWRqdXN0QW1vdW50cwIFYWNjdW0EbmV4dAQJJHQwNTk2NjM4BQVhY2N1bQQNYWRqdXN0ZWRTd2FwcwgFCSR0MDU5NjYzOAJfMQQNcmVtYWluaW5nRGlmZggFCSR0MDU5NjYzOAJfMgQEaXRlbQkBDXNwbGl0Q2ZtbUpzb24BBQRuZXh0BAtpbnB1dEFtb3VudAkAtgkBCQCRAwIFBGl0ZW0AAgQHJG1hdGNoMAULaW5wdXRBbW91bnQDCQABAgUHJG1hdGNoMAIDSW50BAVpbnB1dAUHJG1hdGNoMAQOYW1vdW50VG9BZGp1c3QECnJlbWFpbkRpZmYJAGkCBQ1yZW1haW5pbmd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9vgfFQUfAXJNYCijME Next: Ca66mpEXSrbvRDtuvEMVGJ2SQ3GRfcrBy7rJXboDTjtS Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = valueOrElse(getString(this, "admin"), "") | |
5 | - | ||
6 | - | let b = "3P68zNiufsu1viZpu1aY3cdahRRKcvV5N93" | |
7 | - | ||
8 | - | func c (d,e) = StringEntry(d, e) | |
4 | + | func a (b,c) = StringEntry(b, c) | |
9 | 5 | ||
10 | 6 | ||
11 | - | func | |
7 | + | func d (e) = split(e, "/") | |
12 | 8 | ||
13 | 9 | ||
14 | - | func h (i) = if ((i == fromBase58String(a))) | |
15 | - | then true | |
16 | - | else false | |
17 | - | ||
18 | - | ||
19 | - | func j (k) = split(k, "/") | |
20 | - | ||
21 | - | ||
22 | - | func l (m,n,o) = { | |
23 | - | let p = j(m) | |
24 | - | let q = parseInt(p[2]) | |
25 | - | let r = q | |
26 | - | if ($isInstanceOf(r, "Int")) | |
27 | - | then { | |
28 | - | let q = r | |
29 | - | if ((p[0] == "SWOP")) | |
30 | - | then invoke(addressFromStringValue(p[1]), "exchange", [1], [AttachedPayment(fromBase58String(n), q)]) | |
31 | - | else if ((p[0] == "Waves Exchange")) | |
32 | - | then invoke(addressFromStringValue(b), "swap", [1, o, a], [AttachedPayment(fromBase58String(n), q)]) | |
33 | - | else if ((p[0] == "Puzzle Swap")) | |
34 | - | then invoke(addressFromStringValue(p[1]), "swap", [o, 1], [AttachedPayment(fromBase58String(n), q)]) | |
35 | - | else throw("Platform id does not match!") | |
36 | - | } | |
37 | - | else throw("value is not an int!") | |
38 | - | } | |
39 | - | ||
40 | - | ||
41 | - | func s (t,n,o) = { | |
42 | - | func u (v,w) = { | |
43 | - | let x = v | |
44 | - | let y = x._1 | |
45 | - | let z = x._2 | |
46 | - | if ((size(t) > z)) | |
47 | - | then $Tuple2(l(w, n, o), (z + 1)) | |
48 | - | else $Tuple2(y, z) | |
49 | - | } | |
50 | - | ||
51 | - | let A = t | |
52 | - | let B = size(A) | |
53 | - | let C = $Tuple2(nil, 0) | |
54 | - | func D (E,F) = if ((F >= B)) | |
55 | - | then E | |
56 | - | else u(E, A[F]) | |
57 | - | ||
58 | - | func G (E,F) = if ((F >= B)) | |
59 | - | then E | |
60 | - | else throw("List size exceeds 40") | |
61 | - | ||
62 | - | G(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(D(C, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40) | |
63 | - | } | |
64 | - | ||
65 | - | ||
66 | - | func H (t,I) = { | |
67 | - | let J = size(t) | |
68 | - | func K (v,w) = { | |
69 | - | let L = v | |
70 | - | let M = L._1 | |
71 | - | let N = L._2 | |
72 | - | let p = j(w) | |
10 | + | func f (g,h) = { | |
11 | + | let i = size(g) | |
12 | + | func j (k,l) = { | |
13 | + | let m = k | |
14 | + | let n = m._1 | |
15 | + | let o = m._2 | |
16 | + | let p = d(l) | |
73 | 17 | let q = parseInt(p[2]) | |
74 | 18 | let r = q | |
75 | 19 | if ($isInstanceOf(r, "Int")) | |
76 | 20 | then { | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | if ($isInstanceOf( | |
21 | + | let s = r | |
22 | + | let t = { | |
23 | + | let u = (o / ((i - size(n)) + 1)) | |
24 | + | let v = u | |
25 | + | if ($isInstanceOf(v, "Int")) | |
82 | 26 | then { | |
83 | - | let | |
84 | - | if (( | |
85 | - | then min([ | |
86 | - | else if ((0 > | |
87 | - | then max([(-( | |
27 | + | let w = v | |
28 | + | if ((o > 0)) | |
29 | + | then min([s, w]) | |
30 | + | else if ((0 > o)) | |
31 | + | then max([(-(s) + 1), w]) | |
88 | 32 | else 0 | |
89 | 33 | } | |
90 | 34 | else throw("Wrong datatype") | |
91 | 35 | } | |
92 | - | let | |
93 | - | let | |
94 | - | $Tuple2(( | |
36 | + | let x = max([1, (s + t)]) | |
37 | + | let y = ((((p[0] + "/") + p[1]) + "/") + toString(x)) | |
38 | + | $Tuple2((n :+ y), (o - (t * ((i - size(n)) + 1)))) | |
95 | 39 | } | |
96 | 40 | else throw("Input has wrong datatype!") | |
97 | 41 | } | |
98 | 42 | ||
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | func | |
103 | - | then | |
104 | - | else | |
43 | + | let z = g | |
44 | + | let A = size(z) | |
45 | + | let B = $Tuple2(nil, h) | |
46 | + | func C (D,E) = if ((E >= A)) | |
47 | + | then D | |
48 | + | else j(D, z[E]) | |
105 | 49 | ||
106 | - | func | |
107 | - | then | |
50 | + | func F (D,E) = if ((E >= A)) | |
51 | + | then D | |
108 | 52 | else throw("List size exceeds 40") | |
109 | 53 | ||
110 | - | | |
54 | + | F(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(C(B, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40) | |
111 | 55 | } | |
112 | 56 | ||
113 | 57 | ||
114 | - | func V (W,X,t) = { | |
115 | - | let I = (X - W) | |
116 | - | let M = if ((I != 0)) | |
117 | - | then H(t, I)._1 | |
118 | - | else t | |
119 | - | M | |
58 | + | @Callable(G) | |
59 | + | func call (H,I,g) = { | |
60 | + | let h = (I - H) | |
61 | + | let n = if ((h != 0)) | |
62 | + | then f(g, h)._1 | |
63 | + | else g | |
64 | + | [a("swaps", makeString(g, ",")), a("adjustedSwaps", makeString(n, ","))] | |
120 | 65 | } | |
121 | 66 | ||
122 | 67 | ||
123 | - | @Callable(Y) | |
124 | - | func setup () = if (!(isDefined(getString(this, "admin")))) | |
125 | - | then [c("admin", toBase58String(Y.caller.bytes))] | |
126 | - | else throw("Dapp already setup!") | |
127 | - | ||
128 | - | ||
129 | - | ||
130 | - | @Callable(Y) | |
131 | - | func basicArb (Z,aa,ab,ac,ad,ae) = if (h(Y.caller.bytes)) | |
132 | - | then { | |
133 | - | let af = { | |
134 | - | let ag = fromBase58String(ab) | |
135 | - | let r = ag | |
136 | - | if ($isInstanceOf(r, "ByteVector")) | |
137 | - | then { | |
138 | - | let ag = r | |
139 | - | ag | |
140 | - | } | |
141 | - | else throw("Invalid datatype") | |
142 | - | } | |
143 | - | let ah = assetBalance(this, af) | |
144 | - | if ((ah >= Z)) | |
145 | - | then { | |
146 | - | let y = s(ad, ab, ac) | |
147 | - | let ai = { | |
148 | - | let aj = fromBase58String(ac) | |
149 | - | let r = aj | |
150 | - | if ($isInstanceOf(r, "ByteVector")) | |
151 | - | then { | |
152 | - | let aj = r | |
153 | - | aj | |
154 | - | } | |
155 | - | else throw("Invalid datatype") | |
156 | - | } | |
157 | - | let ak = assetBalance(this, ai) | |
158 | - | let al = if ((ak == aa)) | |
159 | - | then ae | |
160 | - | else V(aa, ak, ae) | |
161 | - | let am = s(al, ac, ab) | |
162 | - | let an = assetBalance(this, af) | |
163 | - | if ((an > Z)) | |
164 | - | then nil | |
165 | - | else throw("Trade was not profitable!") | |
166 | - | } | |
167 | - | else throw("Available input amount is not sufficient!") | |
168 | - | } | |
169 | - | else throw("Address does not match with admin address!") | |
170 | - | ||
171 | - | ||
172 | - | ||
173 | - | @Callable(Y) | |
174 | - | func updateStringEntry (d,e) = if (h(Y.caller.bytes)) | |
175 | - | then [c(d, e)] | |
176 | - | else throw("Address does not match with admin address!") | |
177 | - | ||
178 | - | ||
179 | - | ||
180 | - | @Callable(Y) | |
181 | - | func updateIntegerEntry (d,g) = if (h(Y.caller.bytes)) | |
182 | - | then [f(d, g)] | |
183 | - | else throw("Address does not match with admin address!") | |
184 | - | ||
185 | - | ||
186 | - | ||
187 | - | @Callable(Y) | |
188 | - | func deleteStorageEntry (d) = if (h(Y.caller.bytes)) | |
189 | - | then [DeleteEntry(d)] | |
190 | - | else throw("Address does not match with admin address!") | |
191 | - | ||
192 | - | ||
193 | - | @Verifier(ao) | |
194 | - | func ap () = sigVerify(ao.bodyBytes, ao.proofs[0], ao.senderPublicKey) | |
68 | + | @Verifier(J) | |
69 | + | func K () = sigVerify(J.bodyBytes, J.proofs[0], J.senderPublicKey) | |
195 | 70 |
github/deemru/w8io/169f3d6 52.46 ms ◑