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