tx · 3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq: -0.01300000 Waves 2023.01.31 17:37 [2429251] smart account 3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq > SELF 0.00000000 Waves
{ "type": 13, "id": "3AkwLU2kJEjw6Vu2cSbMikZqmHjAVdYKR9Kdh7PSHp4W", "fee": 1300000, "feeAssetId": null, "timestamp": 1675175867944, "version": 1, "sender": "3N6LHjfGb6Fgcy7YsVcNxGyPTj49XbQAijq", "senderPublicKey": "2u2wYYcVBQv43Cc71zkhHPPitkqgg6dqTZ3nUMvYJ1uq", "proofs": [ "uWTV6usqYKSRuzj5XfsGrx4ud7N8YyLLt3fc5jfvSnpACCCx83pPQYDr5AWXf6gzuG2bmMZC6hjTf8ZWfhSSXnh" ], "script": "base64:BgIXCAISBQoDAQgIEgUKAwEICBIDCgEIEgAVAANTRVACAl9fAAhmZWVTY2FsZQkAtgIBAKCNBgEPZ2V0U3RyaW5nT3JGYWlsAQNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBQNrZXkJAKwCAgIVTm8gZGF0YSBmb3IgdGhpcy5rZXk9BQNrZXkADHBvb2xEaXNhYmxlZAkAAgECDVBvb2wgZGlzYWJsZWQADHBvb2xOb3RFeGlzdAkAAgECEVBvb2wgaXMgbm90IGV4aXN0AA5zbGlwcGFnZVRvb0JpZwkAAgECE1NsaXBwYWdlIGlzIHRvbyBiaWcACXRlc3RFcnJvcgkAAgECD1Rlc3QgZXJyb3IgaGVyZQETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQACGyVzX19wZW5kaW5nTWFuYWdlclB1YmxpY0tleQECZmMAAhMlc19fZmFjdG9yeUNvbnRyYWN0AA9mYWN0b3J5Q29udHJhY3QJARFAZXh0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XRQdWJsaWNLZXkis2EU", "chainId": 84, "height": 2429251, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A7H6RqSs3FWyF4erSDHv8qyoE2kLqHs7ZLpxhZFrapMQ Next: 8fyTTicxNy8FUm7EdqywTq3einNg2xS3SFpygPNt2VnA Diff:
Old | New | Differences | |
---|---|---|---|
128 | 128 | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
129 | 129 | $Tuple2(R, S) | |
130 | 130 | } | |
131 | - | else | |
131 | + | else h | |
132 | 132 | let R = Q._1 | |
133 | 133 | let S = Q._2 | |
134 | 134 | let U = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000) | |
7 | 7 | ||
8 | 8 | func c (d) = valueOrErrorMessage(getString(this, d), ("No data for this.key=" + d)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let e = throw("Pool disabled") | |
12 | 12 | ||
13 | 13 | let f = throw("Pool is not exist") | |
14 | 14 | ||
15 | 15 | let g = throw("Slippage is too big") | |
16 | 16 | ||
17 | 17 | let h = throw("Test error here") | |
18 | 18 | ||
19 | 19 | func i () = "%s__managerPublicKey" | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func j () = "%s__pendingManagerPublicKey" | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func k () = "%s__factoryContract" | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | let l = addressFromStringValue(c(k())) | |
29 | 29 | ||
30 | 30 | func m () = makeString(["%s", "feeLiquidityContractAddress"], a) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func n () = makeString(["%s", "feeLiquidity"], a) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func o () = makeString(["%s", "protocolFee"], a) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func p (q) = { | |
40 | 40 | let r = q | |
41 | 41 | if ($isInstanceOf(r, "Int")) | |
42 | 42 | then { | |
43 | 43 | let s = r | |
44 | 44 | s | |
45 | 45 | } | |
46 | 46 | else throw("fail to cast into Int") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func t (u,v) = makeString(["%d%d", toString(u), toString(v)], a) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func w () = { | |
54 | 54 | let r = getString(i()) | |
55 | 55 | if ($isInstanceOf(r, "String")) | |
56 | 56 | then { | |
57 | 57 | let x = r | |
58 | 58 | fromBase58String(x) | |
59 | 59 | } | |
60 | 60 | else if ($isInstanceOf(r, "Unit")) | |
61 | 61 | then unit | |
62 | 62 | else throw("Match error") | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func y () = { | |
67 | 67 | let r = getString(j()) | |
68 | 68 | if ($isInstanceOf(r, "String")) | |
69 | 69 | then { | |
70 | 70 | let x = r | |
71 | 71 | fromBase58String(x) | |
72 | 72 | } | |
73 | 73 | else if ($isInstanceOf(r, "Unit")) | |
74 | 74 | then unit | |
75 | 75 | else throw("Match error") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func z (A) = { | |
80 | 80 | let r = w() | |
81 | 81 | if ($isInstanceOf(r, "ByteVector")) | |
82 | 82 | then { | |
83 | 83 | let B = r | |
84 | 84 | (A.callerPublicKey == B) | |
85 | 85 | } | |
86 | 86 | else if ($isInstanceOf(r, "Unit")) | |
87 | 87 | then (A.caller == this) | |
88 | 88 | else throw("Match error") | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func C (A) = if (z(A)) | |
93 | 93 | then true | |
94 | 94 | else throw("permission denied") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func D (E) = if ((E == "WAVES")) | |
98 | 98 | then wavesBalance(this).available | |
99 | 99 | else assetBalance(this, fromBase58String(E)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(A) | |
103 | 103 | func swapCalculateREADONLY (F,G,H) = { | |
104 | 104 | let I = value(getInteger(o())) | |
105 | 105 | let J = fraction(toBigInt(F), toBigInt(I), b) | |
106 | 106 | let K = fraction(toBigInt(F), toBigInt(I), b) | |
107 | 107 | let L = (toBigInt(F) - J) | |
108 | 108 | let M = (L - K) | |
109 | 109 | let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil) | |
110 | 110 | let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil) | |
111 | 111 | let P = if ((0 == 0)) | |
112 | 112 | then h | |
113 | 113 | else h | |
114 | 114 | let Q = if ((N != unit)) | |
115 | 115 | then { | |
116 | 116 | let R = false | |
117 | 117 | let S = { | |
118 | 118 | let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil) | |
119 | 119 | if ($isInstanceOf(T, "Address")) | |
120 | 120 | then T | |
121 | 121 | else throw(($getType(T) + " couldn't be cast to Address")) | |
122 | 122 | } | |
123 | 123 | $Tuple2(R, S) | |
124 | 124 | } | |
125 | 125 | else if ((O != unit)) | |
126 | 126 | then { | |
127 | 127 | let R = true | |
128 | 128 | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
129 | 129 | $Tuple2(R, S) | |
130 | 130 | } | |
131 | - | else | |
131 | + | else h | |
132 | 132 | let R = Q._1 | |
133 | 133 | let S = Q._2 | |
134 | 134 | let U = { | |
135 | 135 | let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil) | |
136 | 136 | if ($isInstanceOf(T, "Boolean")) | |
137 | 137 | then T | |
138 | 138 | else throw(($getType(T) + " couldn't be cast to Boolean")) | |
139 | 139 | } | |
140 | 140 | let V = if (U) | |
141 | 141 | then true | |
142 | 142 | else e | |
143 | 143 | if ((V == V)) | |
144 | 144 | then { | |
145 | 145 | let W = addressFromStringValue(valueOrElse(S, "")) | |
146 | 146 | let X = { | |
147 | 147 | let T = invoke(W, "calculateAmountOutForSwapREADONLY", [M, R], nil) | |
148 | 148 | if ($isInstanceOf(T, "Int")) | |
149 | 149 | then T | |
150 | 150 | else throw(($getType(T) + " couldn't be cast to Int")) | |
151 | 151 | } | |
152 | 152 | $Tuple2(nil, X) | |
153 | 153 | } | |
154 | 154 | else throw("Strict value is not equal to itself.") | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(A) | |
160 | 160 | func swap (Y,H,Z) = { | |
161 | 161 | let aa = value(A.payments[0]) | |
162 | 162 | let G = if ((aa.assetId == unit)) | |
163 | 163 | then toBytes("WAVES") | |
164 | 164 | else value(aa.assetId) | |
165 | 165 | let F = value(aa.amount) | |
166 | 166 | let I = value(getInteger(o())) | |
167 | 167 | let J = fraction(toBigInt(F), toBigInt(I), b) | |
168 | 168 | let K = fraction(toBigInt(F), toBigInt(I), b) | |
169 | 169 | let L = (toBigInt(F) - J) | |
170 | 170 | let M = (L - K) | |
171 | 171 | let ab = [if ((size(A.payments) == 1)) | |
172 | 172 | then true | |
173 | 173 | else throw("exactly 1 payment are expected")] | |
174 | 174 | if ((ab == ab)) | |
175 | 175 | then { | |
176 | 176 | let N = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [G, H], nil) | |
177 | 177 | let O = invoke(l, "getLpAssetFromPoolAssetsREADONLY", [H, G], nil) | |
178 | 178 | let ac = if ((N != unit)) | |
179 | 179 | then { | |
180 | 180 | let R = false | |
181 | 181 | let S = { | |
182 | 182 | let T = invoke(l, "getPoolAddressFromLpAssetREADONLY", [N], nil) | |
183 | 183 | if ($isInstanceOf(T, "Address")) | |
184 | 184 | then T | |
185 | 185 | else throw(($getType(T) + " couldn't be cast to Address")) | |
186 | 186 | } | |
187 | 187 | $Tuple2(R, S) | |
188 | 188 | } | |
189 | 189 | else if ((O != unit)) | |
190 | 190 | then { | |
191 | 191 | let R = true | |
192 | 192 | let S = invoke(l, "getPoolAddressFromLpAssetREADONLY", [O], nil) | |
193 | 193 | $Tuple2(R, S) | |
194 | 194 | } | |
195 | 195 | else f | |
196 | 196 | let R = ac._1 | |
197 | 197 | let S = ac._2 | |
198 | 198 | let U = { | |
199 | 199 | let T = invoke(l, "isPoolOneTokenOperationsDisabledREADONLY", [S], nil) | |
200 | 200 | if ($isInstanceOf(T, "Boolean")) | |
201 | 201 | then T | |
202 | 202 | else throw(($getType(T) + " couldn't be cast to Boolean")) | |
203 | 203 | } | |
204 | 204 | let V = if (U) | |
205 | 205 | then true | |
206 | 206 | else e | |
207 | 207 | if ((V == V)) | |
208 | 208 | then { | |
209 | 209 | let W = addressFromStringValue(valueOrElse(S, "")) | |
210 | 210 | let X = { | |
211 | 211 | let T = invoke(W, "calculateAmountOutForSwapAndSendTokens", [M, R, Y, Z], [AttachedPayment(G, toInt(L))]) | |
212 | 212 | if ($isInstanceOf(T, "Boolean")) | |
213 | 213 | then T | |
214 | 214 | else throw(($getType(T) + " couldn't be cast to Boolean")) | |
215 | 215 | } | |
216 | 216 | $Tuple2(nil, X) | |
217 | 217 | } | |
218 | 218 | else throw("Strict value is not equal to itself.") | |
219 | 219 | } | |
220 | 220 | else throw("Strict value is not equal to itself.") | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(A) | |
226 | 226 | func setManager (ad) = { | |
227 | 227 | let ae = C(A) | |
228 | 228 | if ((ae == ae)) | |
229 | 229 | then { | |
230 | 230 | let af = fromBase58String(ad) | |
231 | 231 | if ((af == af)) | |
232 | 232 | then [StringEntry(j(), ad)] | |
233 | 233 | else throw("Strict value is not equal to itself.") | |
234 | 234 | } | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | ||
240 | 240 | @Callable(A) | |
241 | 241 | func confirmManager () = { | |
242 | 242 | let ag = y() | |
243 | 243 | let ah = if (isDefined(ag)) | |
244 | 244 | then true | |
245 | 245 | else throw("no pending manager") | |
246 | 246 | if ((ah == ah)) | |
247 | 247 | then { | |
248 | 248 | let ai = if ((A.callerPublicKey == value(ag))) | |
249 | 249 | then true | |
250 | 250 | else throw("you are not pending manager") | |
251 | 251 | if ((ai == ai)) | |
252 | 252 | then [StringEntry(i(), toBase58String(value(ag))), DeleteEntry(j())] | |
253 | 253 | else throw("Strict value is not equal to itself.") | |
254 | 254 | } | |
255 | 255 | else throw("Strict value is not equal to itself.") | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | @Verifier(aj) | |
260 | 260 | func ak () = { | |
261 | 261 | let al = { | |
262 | 262 | let r = w() | |
263 | 263 | if ($isInstanceOf(r, "ByteVector")) | |
264 | 264 | then { | |
265 | 265 | let B = r | |
266 | 266 | B | |
267 | 267 | } | |
268 | 268 | else if ($isInstanceOf(r, "Unit")) | |
269 | 269 | then aj.senderPublicKey | |
270 | 270 | else throw("Match error") | |
271 | 271 | } | |
272 | 272 | sigVerify(aj.bodyBytes, aj.proofs[0], al) | |
273 | 273 | } | |
274 | 274 |
github/deemru/w8io/026f985 34.90 ms ◑