tx · DSmQDEwe6cvm6JWEPfvNjcZ96G24VNdmTb97JJXL2GCm 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.04400000 Waves 2023.06.28 13:44 [2642408] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "DSmQDEwe6cvm6JWEPfvNjcZ96G24VNdmTb97JJXL2GCm", "fee": 4400000, "feeAssetId": null, "timestamp": 1687949090086, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "44LchAEP2mVH2PFMrc85QpM8gGLAhbTtpVmSRTkULEK621xKX2vi7Z9ws8fcixCdsfKfc4oLW1wuCGEk9s1k5Pr7" ], "script": "base64:BgKYAQgCEgcKBQgBCAEBEgMKAQgSBAoCCAgSBQoDCBgYEgUKAwgBCBIECgIIARIGCgQBCAgBEgUKAwEICBILCgkICAgICAgICAgSAwoBCBIDCgEIEgUKAwgIARIGCgQIAQgIEg4KDAgICAEEERgYEQEBGBIKCggICAgBBAgBGBIOCgwICAgBBBgYGBgYARgSCwoJCAgBAQEBAQEEagAHU0ZfUE9PTAICU0YAB1dYX1BPT0wCAldYAA9DQVBfRkVFX05PX0xPQU4CCWNhcE5vTG9hbgAMQ0FQX0ZFRV9MT0FOAgdjYXBMb2FuABRTVE9QTE9TU19GRUVfTk9fTE9BTgIOc3RvcExvc3NOb0xvYW4ADVNUT1BMT1NTX0xPQU4CDHN0b3BMb3NzTG9hbgAITE9BTl9GRUUCBGxvYW4AC05PX0xPQU5fRkVFAgZub0xvYW4ABk5PX0ZFRQIFbm9GZWUABlNDQUxFOACAwtcvAAdTQ0FMRTEwAIDIr6AlAAdTQ0FMRTE2CQC2AgEAgICE/qbe4REACkZFRV9TQ0FMRTYAwIQ9ABRrU0ZQb29sQUFzc2V0QmFsY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Gx5U3RvcExvc3NMb2FuRmVlBRNzdG9wbG9zc0ZlZVdpdGhMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBRFrUG9vbEludGVyZXN0TG9hbgAACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBRNrUG9vbEludGVyZXN0Tm9Mb2FuAAAJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQVrUG9vbAUIcG9vbEFkZHIFBHR5cGUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQdzaGFyZUlkBQprU2hhcmVQb29sBQhwb29sQWRkcgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkArAICBQhwb29sQWRkcgUOa1Bvb2xDYW5Cb3Jyb3cFCWNhbkJvcnJvdwUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tledx6SS4=", "height": 2642408, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HjN54TVya4jBZ7Gzy6f7nPeWba4tn28dRUWwEmLX84cp Next: G7rzmQHAtsfUpwa9mB74gfth6zoUZETuovY4X2y2dZXb Diff:
Old | New | Differences | |
---|---|---|---|
87 | 87 | ||
88 | 88 | let Q = "last_price" | |
89 | 89 | ||
90 | - | let R = "_ | |
90 | + | let R = "_twap5B" | |
91 | 91 | ||
92 | - | let S = " | |
92 | + | let S = "_stop_loss" | |
93 | 93 | ||
94 | - | let T = " | |
94 | + | let T = "axly_money_box" | |
95 | 95 | ||
96 | - | let U = " | |
96 | + | let U = "swopfi_farming_addr" | |
97 | 97 | ||
98 | - | let V = " | |
98 | + | let V = "lend_service_addr" | |
99 | 99 | ||
100 | - | let W = " | |
100 | + | let W = "admin_call_pub_key" | |
101 | 101 | ||
102 | - | let X = " | |
102 | + | let X = "price_oracle" | |
103 | 103 | ||
104 | - | let Y = " | |
104 | + | let Y = "exchange_contract" | |
105 | 105 | ||
106 | - | let Z = " | |
106 | + | let Z = "wx_swap_contract" | |
107 | 107 | ||
108 | - | let aa = " | |
108 | + | let aa = "swop_id" | |
109 | 109 | ||
110 | - | let ab = | |
110 | + | let ab = "wx_id" | |
111 | 111 | ||
112 | - | let ac = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
112 | + | let ac = Address(fromBase58String(valueOrErrorMessage(getString(this, T), "No axly moneyBox address"))) | |
113 | 113 | ||
114 | - | let ad = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
114 | + | let ad = Address(fromBase58String(valueOrErrorMessage(getString(this, Y), "No exchange contract address"))) | |
115 | 115 | ||
116 | - | let ae = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
116 | + | let ae = Address(fromBase58String(valueOrErrorMessage(getString(this, X), "No price oracle address"))) | |
117 | 117 | ||
118 | - | let af = fromBase58String(valueOrErrorMessage(getString(this, Z), "No | |
118 | + | let af = Address(fromBase58String(valueOrErrorMessage(getString(this, Z), "No wx swap address"))) | |
119 | 119 | ||
120 | - | let ag = fromBase58String(valueOrErrorMessage(getString(this, aa), "No | |
120 | + | let ag = fromBase58String(valueOrErrorMessage(getString(this, aa), "No swop id")) | |
121 | 121 | ||
122 | - | func ah () = Address(fromBase58String(valueOrErrorMessage(getString(this, U), "Can't get lend service addr"))) | |
122 | + | let ah = fromBase58String(valueOrErrorMessage(getString(this, ab), "No wx id")) | |
123 | + | ||
124 | + | func ai () = Address(fromBase58String(valueOrErrorMessage(getString(this, V), "Can't get lend service addr"))) | |
123 | 125 | ||
124 | 126 | ||
125 | - | func | |
127 | + | func aj () = addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, W), "Can't get admin addr"))) | |
126 | 128 | ||
127 | 129 | ||
128 | - | func | |
130 | + | func ak (al) = if ((al.caller == aj())) | |
129 | 131 | then unit | |
130 | 132 | else throw("Only admin can call this function") | |
131 | 133 | ||
132 | 134 | ||
133 | - | func | |
135 | + | func am (al) = if ((al.caller == this)) | |
134 | 136 | then unit | |
135 | 137 | else throw("Only contract itself can call this function") | |
136 | 138 | ||
137 | 139 | ||
138 | - | func | |
140 | + | func an (al) = if ((al.caller == ai())) | |
139 | 141 | then unit | |
140 | 142 | else throw("Only land contract can call this function") | |
141 | 143 | ||
142 | 144 | ||
143 | - | func | |
144 | - | let | |
145 | - | if ($isInstanceOf( | |
145 | + | func ao (ap) = { | |
146 | + | let aq = ap | |
147 | + | if ($isInstanceOf(aq, "ByteVector")) | |
146 | 148 | then { | |
147 | - | let | |
148 | - | assetBalance(this, | |
149 | + | let ar = aq | |
150 | + | assetBalance(this, ar) | |
149 | 151 | } | |
150 | - | else if ($isInstanceOf( | |
152 | + | else if ($isInstanceOf(aq, "Unit")) | |
151 | 153 | then { | |
152 | - | let | |
154 | + | let as = aq | |
153 | 155 | wavesBalance(this).available | |
154 | 156 | } | |
155 | 157 | else throw("Match error") | |
156 | 158 | } | |
157 | 159 | ||
158 | 160 | ||
159 | - | func | |
161 | + | func at (au) = $Tuple5(valueOrErrorMessage(getString(au, p), "Can't get pool A asset id"), valueOrErrorMessage(getString(au, q), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(au, n), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(au, o), "Can't get pool B asset balance"), valueOrErrorMessage(getString(au, r), "Can't get share asset id")) | |
160 | 162 | ||
161 | 163 | ||
162 | - | func | |
163 | - | let | |
164 | - | let | |
165 | - | if ($isInstanceOf( | |
166 | - | then | |
167 | - | else throw(($getType( | |
164 | + | func av (au) = { | |
165 | + | let aw = { | |
166 | + | let ax = invoke(au, "getPoolConfigWrapperREADONLY", nil, nil) | |
167 | + | if ($isInstanceOf(ax, "List[Any]")) | |
168 | + | then ax | |
169 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
168 | 170 | } | |
169 | - | if (( | |
171 | + | if ((aw == aw)) | |
170 | 172 | then { | |
171 | - | let | |
172 | - | let | |
173 | - | if ($isInstanceOf( | |
174 | - | then | |
173 | + | let ay = valueOrErrorMessage({ | |
174 | + | let ax = aw[4] | |
175 | + | if ($isInstanceOf(ax, "String")) | |
176 | + | then ax | |
175 | 177 | else unit | |
176 | 178 | }, "Can't get pool A asset id") | |
177 | - | let | |
178 | - | let | |
179 | - | if ($isInstanceOf( | |
180 | - | then | |
179 | + | let az = valueOrErrorMessage({ | |
180 | + | let ax = aw[5] | |
181 | + | if ($isInstanceOf(ax, "String")) | |
182 | + | then ax | |
181 | 183 | else unit | |
182 | 184 | }, "Can't get pool B asset id") | |
183 | - | let | |
184 | - | let | |
185 | - | if ($isInstanceOf( | |
186 | - | then | |
185 | + | let aA = valueOrErrorMessage({ | |
186 | + | let ax = aw[3] | |
187 | + | if ($isInstanceOf(ax, "String")) | |
188 | + | then ax | |
187 | 189 | else unit | |
188 | 190 | }, "Can't get pool LP asset id") | |
189 | - | let | |
190 | - | let | |
191 | - | if ($isInstanceOf( | |
192 | - | then | |
193 | - | else throw(($getType( | |
191 | + | let aB = { | |
192 | + | let ax = invoke(au, "getAccBalanceWrapperREADONLY", [ay], nil) | |
193 | + | if ($isInstanceOf(ax, "Int")) | |
194 | + | then ax | |
195 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
194 | 196 | } | |
195 | - | if (( | |
197 | + | if ((aB == aB)) | |
196 | 198 | then { | |
197 | - | let | |
198 | - | let | |
199 | - | if ($isInstanceOf( | |
200 | - | then | |
201 | - | else throw(($getType( | |
199 | + | let aC = { | |
200 | + | let ax = invoke(au, "getAccBalanceWrapperREADONLY", [az], nil) | |
201 | + | if ($isInstanceOf(ax, "Int")) | |
202 | + | then ax | |
203 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
202 | 204 | } | |
203 | - | if (( | |
204 | - | then $Tuple5( | |
205 | + | if ((aC == aC)) | |
206 | + | then $Tuple5(ay, az, aB, aC, aA) | |
205 | 207 | else throw("Strict value is not equal to itself.") | |
206 | 208 | } | |
207 | 209 | else throw("Strict value is not equal to itself.") | |
210 | 212 | } | |
211 | 213 | ||
212 | 214 | ||
213 | - | func | |
214 | - | then | |
215 | - | else if (( | |
216 | - | then au | |
215 | + | func aD (au,aE) = if ((aE == a)) | |
216 | + | then at(au) | |
217 | + | else if ((aE == b)) | |
218 | + | then av(au) | |
217 | 219 | else throw("Wrong pool type") | |
218 | 220 | ||
219 | 221 | ||
220 | - | func | |
221 | - | then valueOrErrorMessage(getInteger( | |
222 | - | else if (( | |
223 | - | then valueOrErrorMessage(assetInfo(fromBase58String( | |
222 | + | func aF (au,aE,aA) = if ((aE == a)) | |
223 | + | then valueOrErrorMessage(getInteger(au, s), "Can't get share asset supply") | |
224 | + | else if ((aE == b)) | |
225 | + | then valueOrErrorMessage(assetInfo(fromBase58String(aA)), "Wrong ShareId").quantity | |
224 | 226 | else throw("Wrong pool type") | |
225 | 227 | ||
226 | 228 | ||
227 | - | func | |
229 | + | func aG (aH) = valueOrElse(getInteger(this, (aH + A)), 0) | |
228 | 230 | ||
229 | 231 | ||
230 | - | func | |
232 | + | func aI (aH) = valueOrElse(getInteger(this, (aH + B)), 0) | |
231 | 233 | ||
232 | 234 | ||
233 | - | func | |
235 | + | func aJ (aK) = (valueOrElse(getInteger(this, (aK + y)), 0) + 1) | |
234 | 236 | ||
235 | 237 | ||
236 | - | func | |
237 | - | then getIntegerValue(this, ( | |
238 | - | else if (( | |
239 | - | then getIntegerValue(this, ( | |
240 | - | else if (( | |
241 | - | then getIntegerValue(this, ( | |
242 | - | else if (( | |
243 | - | then getIntegerValue(this, ( | |
244 | - | else if (( | |
238 | + | func aL (aH,aM) = if ((aM == d)) | |
239 | + | then getIntegerValue(this, (aH + I)) | |
240 | + | else if ((aM == c)) | |
241 | + | then getIntegerValue(this, (aH + H)) | |
242 | + | else if ((aM == g)) | |
243 | + | then getIntegerValue(this, (aH + G)) | |
244 | + | else if ((aM == h)) | |
245 | + | then getIntegerValue(this, (aH + F)) | |
246 | + | else if ((aM == i)) | |
245 | 247 | then 0 | |
246 | 248 | else throw("Wrong fee type") | |
247 | 249 | ||
248 | 250 | ||
249 | - | func | |
251 | + | func aN () = Address(fromBase58String(valueOrErrorMessage(getString(this, U), "Can't get swopfi farming addr"))) | |
250 | 252 | ||
251 | 253 | ||
252 | - | func | |
253 | - | let | |
254 | - | let | |
255 | - | Address(fromBase58String( | |
254 | + | func aO (au) = { | |
255 | + | let aP = Address(fromBase58String(valueOrErrorMessage(getString(au, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
256 | + | let aQ = split(valueOrErrorMessage(getString(aP, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
257 | + | Address(fromBase58String(aQ[1])) | |
256 | 258 | } | |
257 | 259 | ||
258 | 260 | ||
259 | - | func | |
260 | - | let | |
261 | - | if ($isInstanceOf( | |
261 | + | func aR (ap) = { | |
262 | + | let aq = ap | |
263 | + | if ($isInstanceOf(aq, "ByteVector")) | |
262 | 264 | then { | |
263 | - | let | |
264 | - | toBase58String( | |
265 | + | let ar = aq | |
266 | + | toBase58String(ar) | |
265 | 267 | } | |
266 | - | else if ($isInstanceOf( | |
268 | + | else if ($isInstanceOf(aq, "Unit")) | |
267 | 269 | then { | |
268 | - | let | |
270 | + | let as = aq | |
269 | 271 | "WAVES" | |
270 | 272 | } | |
271 | 273 | else throw("Not Asset id") | |
272 | 274 | } | |
273 | 275 | ||
274 | 276 | ||
275 | - | func | |
277 | + | func aS (ap) = if ((ap == "WAVES")) | |
276 | 278 | then unit | |
277 | - | else fromBase58String( | |
279 | + | else fromBase58String(ap) | |
278 | 280 | ||
279 | 281 | ||
280 | - | func | |
282 | + | func aT (ap) = if ((ap == "WAVES")) | |
281 | 283 | then 8 | |
282 | 284 | else { | |
283 | - | let | |
284 | - | if ($isInstanceOf( | |
285 | + | let aq = assetInfo(fromBase58String(ap)) | |
286 | + | if ($isInstanceOf(aq, "Asset")) | |
285 | 287 | then { | |
286 | - | let | |
287 | - | | |
288 | + | let aU = aq | |
289 | + | aU.decimals | |
288 | 290 | } | |
289 | 291 | else throw("Can't find asset") | |
290 | 292 | } | |
291 | 293 | ||
292 | 294 | ||
293 | - | func | |
295 | + | func aV (ap) = pow(10, 0, aT(ap), 0, 0, DOWN) | |
294 | 296 | ||
295 | 297 | ||
296 | - | func aV (aW) = { | |
297 | - | func aX (aY,ao) = { | |
298 | - | let aZ = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
299 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
300 | - | then aw | |
301 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
302 | - | (aY :+ aZ) | |
298 | + | func aW (aX) = { | |
299 | + | func aY (aZ,ap) = { | |
300 | + | let ba = getIntegerValue(ae, (ap + R)) | |
301 | + | (aZ :+ ba) | |
303 | 302 | } | |
304 | 303 | ||
305 | - | let | |
306 | - | let | |
307 | - | let | |
308 | - | func | |
309 | - | then | |
310 | - | else | |
304 | + | let bb = aX | |
305 | + | let bc = size(bb) | |
306 | + | let bd = nil | |
307 | + | func be (bf,bg) = if ((bg >= bc)) | |
308 | + | then bf | |
309 | + | else aY(bf, bb[bg]) | |
311 | 310 | ||
312 | - | func | |
313 | - | then | |
311 | + | func bh (bf,bg) = if ((bg >= bc)) | |
312 | + | then bf | |
314 | 313 | else throw("List size exceeds 50") | |
315 | 314 | ||
316 | - | | |
315 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 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), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
317 | 316 | } | |
318 | 317 | ||
319 | 318 | ||
320 | - | func bh (az) = { | |
321 | - | let aG = valueOrErrorMessage(getString(this, (az + O)), "Can't find pool addr by share id") | |
322 | - | let at = Address(fromBase58String(aG)) | |
323 | - | let bi = valueOrErrorMessage(getString(this, (N + aG)), "Pool is not inited") | |
324 | - | let bj = aC(at, bi) | |
325 | - | let ax = bj._1 | |
326 | - | let ay = bj._2 | |
327 | - | let bk = bj._3 | |
328 | - | let bl = bj._4 | |
329 | - | let bm = ( let aw = invoke(ad, "getTWAP60", [ax, false], nil) | |
330 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
331 | - | then aw | |
332 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
333 | - | let bn = ( let aw = invoke(ad, "getTWAP60", [ay, false], nil) | |
334 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
335 | - | then aw | |
336 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
337 | - | let bo = aE(at, bi, az) | |
338 | - | let bp = pow(10, 0, aS(ax), 0, 0, DOWN) | |
339 | - | let bq = pow(10, 0, aS(ay), 0, 0, DOWN) | |
340 | - | let br = pow(10, 0, aS(az), 0, 0, DOWN) | |
341 | - | let bs = (fraction(bk, bm, bp) + fraction(bl, bn, bq)) | |
342 | - | fraction(bs, br, bo) | |
319 | + | func bi (aA) = { | |
320 | + | let aH = valueOrErrorMessage(getString(this, (aA + O)), "Can't find pool addr by share id") | |
321 | + | let au = Address(fromBase58String(aH)) | |
322 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
323 | + | let bk = aD(au, bj) | |
324 | + | let ay = bk._1 | |
325 | + | let az = bk._2 | |
326 | + | let bl = bk._3 | |
327 | + | let bm = bk._4 | |
328 | + | let bn = getIntegerValue(ae, (ay + R)) | |
329 | + | let bo = getIntegerValue(ae, (az + R)) | |
330 | + | let bp = aF(au, bj, aA) | |
331 | + | let bq = pow(10, 0, aT(ay), 0, 0, DOWN) | |
332 | + | let br = pow(10, 0, aT(az), 0, 0, DOWN) | |
333 | + | let bs = pow(10, 0, aT(aA), 0, 0, DOWN) | |
334 | + | let bt = (fraction(bl, bn, bq) + fraction(bm, bo, br)) | |
335 | + | fraction(bt, bs, bp) | |
343 | 336 | } | |
344 | 337 | ||
345 | 338 | ||
346 | - | func | |
347 | - | func | |
339 | + | func bu (bv) = { | |
340 | + | func aY (aZ,aA) = (aZ :+ bi(aA)) | |
348 | 341 | ||
349 | - | let | |
350 | - | let | |
351 | - | let | |
352 | - | func | |
353 | - | then | |
354 | - | else | |
342 | + | let bb = bv | |
343 | + | let bc = size(bb) | |
344 | + | let bd = nil | |
345 | + | func be (bf,bg) = if ((bg >= bc)) | |
346 | + | then bf | |
347 | + | else aY(bf, bb[bg]) | |
355 | 348 | ||
356 | - | func | |
357 | - | then | |
349 | + | func bh (bf,bg) = if ((bg >= bc)) | |
350 | + | then bf | |
358 | 351 | else throw("List size exceeds 20") | |
359 | 352 | ||
360 | - | | |
353 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
361 | 354 | } | |
362 | 355 | ||
363 | 356 | ||
364 | - | func | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | [StringEntry(Q, makeString( | |
357 | + | func bw (ay,az,aA) = { | |
358 | + | let bx = aW([ay, az]) | |
359 | + | let by = bi(aA) | |
360 | + | let bz = [toString(bx[0]), toString(bx[1]), toString(by)] | |
361 | + | [StringEntry(Q, makeString(bz, ","))] | |
369 | 362 | } | |
370 | 363 | ||
371 | 364 | ||
372 | - | func | |
365 | + | func bA (bj,au,bB,ay,bC,az,aB,aC) = if ((bj == a)) | |
373 | 366 | then { | |
374 | - | let | |
375 | - | let | |
376 | - | if ($isInstanceOf( | |
377 | - | then | |
378 | - | else throw(($getType( | |
367 | + | let bD = { | |
368 | + | let ax = invoke(au, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(bB), toString(bC)]], nil) | |
369 | + | if ($isInstanceOf(ax, "List[Any]")) | |
370 | + | then ax | |
371 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
379 | 372 | } | |
380 | - | if (( | |
373 | + | if ((bD == bD)) | |
381 | 374 | then $Tuple5({ | |
382 | - | let | |
383 | - | if ($isInstanceOf( | |
384 | - | then | |
385 | - | else throw(($getType( | |
375 | + | let ax = bD[3] | |
376 | + | if ($isInstanceOf(ax, "Int")) | |
377 | + | then ax | |
378 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
386 | 379 | }, { | |
387 | - | let | |
388 | - | if ($isInstanceOf( | |
389 | - | then | |
390 | - | else throw(($getType( | |
380 | + | let ax = bD[4] | |
381 | + | if ($isInstanceOf(ax, "Int")) | |
382 | + | then ax | |
383 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
391 | 384 | }, { | |
392 | - | let | |
393 | - | if ($isInstanceOf( | |
394 | - | then | |
395 | - | else throw(($getType( | |
396 | - | }, | |
397 | - | let | |
398 | - | if ($isInstanceOf( | |
399 | - | then | |
400 | - | else throw(($getType( | |
385 | + | let ax = bD[1] | |
386 | + | if ($isInstanceOf(ax, "Int")) | |
387 | + | then ax | |
388 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
389 | + | }, aR(bD[2]), { | |
390 | + | let ax = bD[0] | |
391 | + | if ($isInstanceOf(ax, "Int")) | |
392 | + | then ax | |
393 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
401 | 394 | }) | |
402 | 395 | else throw("Strict value is not equal to itself.") | |
403 | 396 | } | |
404 | 397 | else { | |
405 | - | let | |
406 | - | let | |
407 | - | if ($isInstanceOf( | |
408 | - | then | |
409 | - | else throw(($getType( | |
398 | + | let bE = $Tuple2(split({ | |
399 | + | let ax = invoke(au, "evaluatePutByAmountAssetREADONLY", [bB], nil) | |
400 | + | if ($isInstanceOf(ax, "String")) | |
401 | + | then ax | |
402 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
410 | 403 | }, "__"), split({ | |
411 | - | let | |
412 | - | if ($isInstanceOf( | |
413 | - | then | |
414 | - | else throw(($getType( | |
404 | + | let ax = invoke(au, "evaluatePutByPriceAssetREADONLY", [bC], nil) | |
405 | + | if ($isInstanceOf(ax, "String")) | |
406 | + | then ax | |
407 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
415 | 408 | }, "__")) | |
416 | - | if (( | |
409 | + | if ((bE == bE)) | |
417 | 410 | then { | |
418 | - | let | |
419 | - | let | |
420 | - | let | |
421 | - | let | |
422 | - | if (( | |
411 | + | let bF = bE._2 | |
412 | + | let bG = bE._1 | |
413 | + | let bH = parseIntValue(bG[1]) | |
414 | + | let bI = parseIntValue(bF[1]) | |
415 | + | if ((bI > bH)) | |
423 | 416 | then { | |
424 | - | let | |
425 | - | $Tuple5( | |
417 | + | let bJ = parseIntValue(bG[8]) | |
418 | + | $Tuple5(bB, bJ, (bC - bJ), az, bI) | |
426 | 419 | } | |
427 | 420 | else { | |
428 | - | let | |
429 | - | $Tuple5( | |
421 | + | let bJ = parseIntValue(bG[8]) | |
422 | + | $Tuple5(bJ, bC, (bB - bJ), ay, bH) | |
430 | 423 | } | |
431 | 424 | } | |
432 | 425 | else throw("Strict value is not equal to itself.") | |
433 | 426 | } | |
434 | 427 | ||
435 | 428 | ||
436 | - | func | |
437 | - | let | |
438 | - | if (( | |
439 | - | then invoke( | |
440 | - | else invoke( | |
429 | + | func bK (au,bj,bB,ay,bC,az) = { | |
430 | + | let bL = [AttachedPayment(aS(ay), bB), AttachedPayment(aS(az), bC)] | |
431 | + | if ((bj == a)) | |
432 | + | then invoke(au, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], bL) | |
433 | + | else invoke(au, "put", [1000000, false], bL) | |
441 | 434 | } | |
442 | 435 | ||
443 | 436 | ||
444 | - | func | |
445 | - | let | |
446 | - | if (( | |
447 | - | then invoke( | |
448 | - | else invoke( | |
437 | + | func bM (au,bj,bJ,bN) = { | |
438 | + | let bL = [AttachedPayment(aS(bN), bJ)] | |
439 | + | if ((bj == a)) | |
440 | + | then invoke(au, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], bL) | |
441 | + | else invoke(au, "putOneTkn", [0, false], bL) | |
449 | 442 | } | |
450 | 443 | ||
451 | 444 | ||
452 | - | func | |
453 | - | let | |
454 | - | if (( | |
455 | - | then invoke( | |
456 | - | else invoke( | |
445 | + | func bO (aH,bj,aA,bP) = { | |
446 | + | let bL = [AttachedPayment(fromBase58String(aA), bP)] | |
447 | + | if ((bj == a)) | |
448 | + | then invoke(aN(), "lockShareTokens", [aH, 0], bL) | |
449 | + | else invoke(aO(addressFromStringValue(aH)), "stake", nil, bL) | |
457 | 450 | } | |
458 | 451 | ||
459 | 452 | ||
460 | - | func | |
461 | - | let | |
462 | - | then $Tuple3( | |
463 | - | else if (( | |
464 | - | then $Tuple3( | |
453 | + | func bQ (aH,bj,aA,bP) = { | |
454 | + | let bR = if ((bj == a)) | |
455 | + | then $Tuple3(aN(), "withdrawShareTokens", [aH, bP]) | |
456 | + | else if ((bj == b)) | |
457 | + | then $Tuple3(aO(Address(fromBase58String(aH))), "unstake", [aA, bP]) | |
465 | 458 | else throw("Wrong pool type") | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | if (( | |
471 | - | then | |
459 | + | let bS = bR._1 | |
460 | + | let bT = bR._2 | |
461 | + | let bU = bR._3 | |
462 | + | let bV = invoke(bS, bT, bU, nil) | |
463 | + | if ((bV == bV)) | |
464 | + | then bP | |
472 | 465 | else throw("Strict value is not equal to itself.") | |
473 | 466 | } | |
474 | 467 | ||
475 | 468 | ||
476 | - | func | |
477 | - | let | |
478 | - | let | |
479 | - | let | |
480 | - | let | |
481 | - | let | |
469 | + | func bW (aH,bX,bY,aB,aC,bZ,ca) = { | |
470 | + | let au = Address(fromBase58String(aH)) | |
471 | + | let cb = 1000000 | |
472 | + | let cc = getIntegerValue(au, t) | |
473 | + | let cd = fraction(bZ, cb, (cb - cc)) | |
474 | + | let ce = if ((ca == bX)) | |
482 | 475 | then { | |
483 | - | let | |
484 | - | $Tuple2( | |
476 | + | let cf = fraction(cd, aC, (aB - cd)) | |
477 | + | $Tuple2(cf, bY) | |
485 | 478 | } | |
486 | 479 | else { | |
487 | - | let | |
488 | - | $Tuple2( | |
480 | + | let cf = fraction(cd, aB, (aC - cd)) | |
481 | + | $Tuple2(cf, bX) | |
489 | 482 | } | |
490 | - | let | |
491 | - | let | |
492 | - | $Tuple2( | |
483 | + | let cf = ce._1 | |
484 | + | let cg = ce._2 | |
485 | + | $Tuple2(cg, cf) | |
493 | 486 | } | |
494 | 487 | ||
495 | 488 | ||
496 | - | func | |
497 | - | let | |
498 | - | let | |
499 | - | let | |
500 | - | let | |
489 | + | func ch (aH,bX,bY,aB,aC,bZ,ca) = { | |
490 | + | let ci = getIntegerValue(af, "%s__protocolFee") | |
491 | + | let cj = getIntegerValue(af, "%s__poolFee") | |
492 | + | let ck = toBigInt(100000000) | |
493 | + | let cl = if ((ca == bX)) | |
501 | 494 | then { | |
502 | - | let | |
503 | - | $Tuple2( | |
495 | + | let cf = fraction(bZ, aC, (aB - bZ)) | |
496 | + | $Tuple2(cf, bY) | |
504 | 497 | } | |
505 | 498 | else { | |
506 | - | let | |
507 | - | $Tuple2( | |
499 | + | let cf = fraction(bZ, aB, (aC - bZ)) | |
500 | + | $Tuple2(cf, bX) | |
508 | 501 | } | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | $Tuple2( | |
502 | + | let cf = cl._1 | |
503 | + | let cg = cl._2 | |
504 | + | let cm = toInt(fraction(toBigInt(cf), ck, (ck - toBigInt((ci + cj))), CEILING)) | |
505 | + | $Tuple2(cg, fraction(cm, 102, 100)) | |
513 | 506 | } | |
514 | 507 | ||
515 | 508 | ||
516 | - | func | |
509 | + | func cn (aE,aH,bX,bY,aB,aC,bZ,ca) = if ((aE == a)) | |
517 | 510 | then { | |
518 | - | let | |
519 | - | let | |
520 | - | let | |
521 | - | invoke(addressFromStringValue( | |
511 | + | let co = bW(aH, bX, bY, aB, aC, bZ, ca) | |
512 | + | let cg = co._1 | |
513 | + | let cf = co._2 | |
514 | + | invoke(addressFromStringValue(aH), "callFunction", ["exchange", [toString(bZ)]], [AttachedPayment(aS(cg), cf)]) | |
522 | 515 | } | |
523 | 516 | else { | |
524 | - | let | |
525 | - | let | |
526 | - | let | |
527 | - | invoke( | |
517 | + | let cp = ch(aH, bX, bY, aB, aC, bZ, ca) | |
518 | + | let cg = cp._1 | |
519 | + | let cf = cp._2 | |
520 | + | invoke(af, "swap", [bZ, ca, toString(this)], [AttachedPayment(aS(cg), cf)]) | |
528 | 521 | } | |
529 | 522 | ||
530 | 523 | ||
531 | - | func | |
532 | - | let | |
533 | - | if (( | |
524 | + | func cq (bj,aH,bB,ay,bC,az,aB,aC) = { | |
525 | + | let au = addressFromStringValue(aH) | |
526 | + | if ((bj == a)) | |
534 | 527 | then { | |
535 | - | let | |
536 | - | let | |
537 | - | if ($isInstanceOf( | |
538 | - | then | |
539 | - | else throw(($getType( | |
528 | + | let bV = { | |
529 | + | let ax = invoke(au, "callFunction", ["calcLPReplenishDiffPropREADONLY", [toString(bB), toString(bC), "0"]], nil) | |
530 | + | if ($isInstanceOf(ax, "List[Any]")) | |
531 | + | then ax | |
532 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
540 | 533 | } | |
541 | - | if (( | |
534 | + | if ((bV == bV)) | |
542 | 535 | then $Tuple2({ | |
543 | - | let | |
544 | - | if ($isInstanceOf( | |
545 | - | then | |
546 | - | else throw(($getType( | |
536 | + | let ax = bV[0] | |
537 | + | if ($isInstanceOf(ax, "Int")) | |
538 | + | then ax | |
539 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
547 | 540 | }, { | |
548 | - | let | |
549 | - | if ($isInstanceOf( | |
550 | - | then | |
551 | - | else throw(($getType( | |
541 | + | let ax = bV[1] | |
542 | + | if ($isInstanceOf(ax, "Int")) | |
543 | + | then ax | |
544 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
552 | 545 | }) | |
553 | 546 | else throw("Strict value is not equal to itself.") | |
554 | 547 | } | |
555 | - | else if (( | |
548 | + | else if ((bj == b)) | |
556 | 549 | then { | |
557 | - | let | |
558 | - | then ( | |
550 | + | let cr = if (if ((bB > 0)) | |
551 | + | then (bC > 0) | |
559 | 552 | else false) | |
560 | 553 | then { | |
561 | - | let | |
562 | - | let | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | let | |
567 | - | $Tuple3( | |
554 | + | let cs = bA(bj, au, bB, ay, bC, az, aB, aC) | |
555 | + | let ct = cs._1 | |
556 | + | let cu = cs._2 | |
557 | + | let cv = cs._3 | |
558 | + | let cw = cs._4 | |
559 | + | let cx = cs._5 | |
560 | + | $Tuple3(cv, cw, cx) | |
568 | 561 | } | |
569 | - | else if (( | |
570 | - | then $Tuple3( | |
571 | - | else $Tuple3( | |
572 | - | let | |
573 | - | let | |
574 | - | let | |
575 | - | let | |
562 | + | else if ((bB > 0)) | |
563 | + | then $Tuple3(bB, ay, 0) | |
564 | + | else $Tuple3(bC, az, 0) | |
565 | + | let cv = cr._1 | |
566 | + | let cw = cr._2 | |
567 | + | let cy = cr._3 | |
568 | + | let cz = if ((cv > 0)) | |
576 | 569 | then { | |
577 | - | let | |
578 | - | let | |
579 | - | if ($isInstanceOf( | |
580 | - | then | |
581 | - | else throw(($getType( | |
570 | + | let bV = { | |
571 | + | let ax = invoke(au, "putOneTknREADONLY", [cw, cv], nil) | |
572 | + | if ($isInstanceOf(ax, "(Int, Int, Int)")) | |
573 | + | then ax | |
574 | + | else throw(($getType(ax) + " couldn't be cast to (Int, Int, Int)")) | |
582 | 575 | } | |
583 | - | if (( | |
584 | - | then $Tuple2( | |
576 | + | if ((bV == bV)) | |
577 | + | then $Tuple2(bV._1, bV._3) | |
585 | 578 | else throw("Strict value is not equal to itself.") | |
586 | 579 | } | |
587 | 580 | else $Tuple2(0, 0) | |
588 | - | let | |
589 | - | let | |
590 | - | $Tuple2(( | |
581 | + | let cA = cz._1 | |
582 | + | let cB = cz._2 | |
583 | + | $Tuple2((cy + cA), cB) | |
591 | 584 | } | |
592 | 585 | else throw("Wrong pool type") | |
593 | 586 | } | |
594 | 587 | ||
595 | 588 | ||
596 | - | func | |
597 | - | let | |
598 | - | let | |
589 | + | func cC (bj,aH,cx,aA,ay,az,aB,aC,cD,cE) = { | |
590 | + | let au = addressFromStringValue(aH) | |
591 | + | let cF = if ((bj == a)) | |
599 | 592 | then { | |
600 | - | let | |
601 | - | let | |
602 | - | if ($isInstanceOf( | |
603 | - | then | |
604 | - | else throw(($getType( | |
593 | + | let bV = { | |
594 | + | let ax = invoke(au, "callFunction", ["withdrawREADONLY", [toString(cx), toString(aB), toString(aC)]], nil) | |
595 | + | if ($isInstanceOf(ax, "List[Any]")) | |
596 | + | then ax | |
597 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
605 | 598 | } | |
606 | - | if (( | |
599 | + | if ((bV == bV)) | |
607 | 600 | then $Tuple2({ | |
608 | - | let | |
609 | - | if ($isInstanceOf( | |
610 | - | then | |
611 | - | else throw(($getType( | |
601 | + | let ax = bV[0] | |
602 | + | if ($isInstanceOf(ax, "Int")) | |
603 | + | then ax | |
604 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
612 | 605 | }, { | |
613 | - | let | |
614 | - | if ($isInstanceOf( | |
615 | - | then | |
616 | - | else throw(($getType( | |
606 | + | let ax = bV[1] | |
607 | + | if ($isInstanceOf(ax, "Int")) | |
608 | + | then ax | |
609 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
617 | 610 | }) | |
618 | 611 | else throw("Strict value is not equal to itself.") | |
619 | 612 | } | |
620 | - | else if (( | |
613 | + | else if ((bj == b)) | |
621 | 614 | then { | |
622 | - | let | |
623 | - | let | |
624 | - | if ($isInstanceOf( | |
625 | - | then | |
626 | - | else throw(($getType( | |
615 | + | let cG = split({ | |
616 | + | let ax = invoke(au, "evaluateGetREADONLY", [aA, cx], nil) | |
617 | + | if ($isInstanceOf(ax, "String")) | |
618 | + | then ax | |
619 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
627 | 620 | }, "__") | |
628 | - | if (( | |
629 | - | then $Tuple2(parseIntValue( | |
621 | + | if ((cG == cG)) | |
622 | + | then $Tuple2(parseIntValue(cG[1]), parseIntValue(cG[2])) | |
630 | 623 | else throw("Strict value is not equal to itself.") | |
631 | 624 | } | |
632 | 625 | else throw("Wrong pool type") | |
633 | - | let | |
634 | - | let | |
635 | - | if (( | |
626 | + | let cH = cF._1 | |
627 | + | let cI = cF._2 | |
628 | + | if ((cD > 0)) | |
636 | 629 | then { | |
637 | - | let | |
638 | - | then ( | |
630 | + | let cJ = if (if ((cE == ay)) | |
631 | + | then (cD > cH) | |
639 | 632 | else false) | |
640 | - | then ( | |
641 | - | else if (if (( | |
642 | - | then ( | |
633 | + | then (cD - cH) | |
634 | + | else if (if ((cE == az)) | |
635 | + | then (cD > cI) | |
643 | 636 | else false) | |
644 | - | then ( | |
637 | + | then (cD - cI) | |
645 | 638 | else 0 | |
646 | - | let | |
647 | - | then if (( | |
648 | - | then | |
649 | - | else | |
639 | + | let cK = if ((cJ > 0)) | |
640 | + | then if ((bj == a)) | |
641 | + | then bW(aH, ay, az, aB, aC, cJ, cE) | |
642 | + | else ch(aH, ay, az, aB, aC, cJ, cE) | |
650 | 643 | else $Tuple2("", 0) | |
651 | - | let | |
652 | - | let | |
653 | - | if (( | |
654 | - | then $Tuple2((( | |
655 | - | else $Tuple2(( | |
644 | + | let cg = cK._1 | |
645 | + | let cf = cK._2 | |
646 | + | if ((cE == ay)) | |
647 | + | then $Tuple2(((cH + cJ) - cD), (cI - cf)) | |
648 | + | else $Tuple2((cH - cf), ((cI + cJ) - cD)) | |
656 | 649 | } | |
657 | - | else $Tuple2( | |
650 | + | else $Tuple2(cH, cI) | |
658 | 651 | } | |
659 | 652 | ||
660 | 653 | ||
661 | - | func | |
654 | + | func cL (aE,aH) = if ((aE == a)) | |
662 | 655 | then { | |
663 | - | let | |
664 | - | if (( | |
656 | + | let cM = ao(ag) | |
657 | + | if ((cM == cM)) | |
665 | 658 | then { | |
666 | - | let | |
667 | - | if (( | |
659 | + | let bV = invoke(aN(), "claim", [aH], nil) | |
660 | + | if ((bV == bV)) | |
668 | 661 | then { | |
669 | - | let | |
670 | - | $Tuple2(( | |
662 | + | let cN = ao(ag) | |
663 | + | $Tuple2((cN - cM), ag) | |
671 | 664 | } | |
672 | 665 | else throw("Strict value is not equal to itself.") | |
673 | 666 | } | |
674 | 667 | else throw("Strict value is not equal to itself.") | |
675 | 668 | } | |
676 | - | else if (( | |
669 | + | else if ((aE == b)) | |
677 | 670 | then { | |
678 | - | let | |
679 | - | if (( | |
671 | + | let cM = ao(ah) | |
672 | + | if ((cM == cM)) | |
680 | 673 | then { | |
681 | - | let | |
682 | - | if (( | |
674 | + | let bV = invoke(aO(Address(fromBase58String(aH))), "claimWX", [aH], nil) | |
675 | + | if ((bV == bV)) | |
683 | 676 | then { | |
684 | - | let | |
685 | - | $Tuple2(( | |
677 | + | let cN = ao(ah) | |
678 | + | $Tuple2((cN - cM), ah) | |
686 | 679 | } | |
687 | 680 | else throw("Strict value is not equal to itself.") | |
688 | 681 | } | |
691 | 684 | else throw("Wrong pool type") | |
692 | 685 | ||
693 | 686 | ||
694 | - | func | |
695 | - | let | |
696 | - | if (( | |
687 | + | func cO (bj,aH,aM,bB,ay,bC,az,aB,aC,cP) = { | |
688 | + | let cQ = ao(fromBase58String(cP)) | |
689 | + | if ((cQ == cQ)) | |
697 | 690 | then { | |
698 | - | let | |
699 | - | let | |
700 | - | then ( | |
691 | + | let au = addressFromStringValue(aH) | |
692 | + | let cR = if (if ((bB > 0)) | |
693 | + | then (bC > 0) | |
701 | 694 | else false) | |
702 | 695 | then { | |
703 | - | let | |
704 | - | let | |
705 | - | let | |
706 | - | let | |
707 | - | let | |
708 | - | let | |
709 | - | if (( | |
710 | - | then $Tuple2( | |
696 | + | let cS = bA(bj, au, bB, ay, bC, az, aB, aC) | |
697 | + | let ct = cS._1 | |
698 | + | let cu = cS._2 | |
699 | + | let cv = cS._3 | |
700 | + | let cw = cS._4 | |
701 | + | let bV = bK(au, bj, ct, ay, cu, az) | |
702 | + | if ((bV == bV)) | |
703 | + | then $Tuple2(cv, cw) | |
711 | 704 | else throw("Strict value is not equal to itself.") | |
712 | 705 | } | |
713 | - | else if (( | |
714 | - | then $Tuple2( | |
715 | - | else if (( | |
716 | - | then $Tuple2( | |
706 | + | else if ((bB > 0)) | |
707 | + | then $Tuple2(bB, ay) | |
708 | + | else if ((bC > 0)) | |
709 | + | then $Tuple2(bC, az) | |
717 | 710 | else throw("pmts must be > 0") | |
718 | - | let | |
719 | - | let | |
720 | - | let | |
721 | - | then | |
711 | + | let cv = cR._1 | |
712 | + | let cw = cR._2 | |
713 | + | let bV = if ((cv > 0)) | |
714 | + | then bM(au, bj, cv, cw) | |
722 | 715 | else nil | |
723 | - | if (( | |
716 | + | if ((bV == bV)) | |
724 | 717 | then { | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | if ((0 >= | |
718 | + | let cT = ao(fromBase58String(cP)) | |
719 | + | let cU = (cT - cQ) | |
720 | + | let cV = fraction(cU, aL(aH, aM), m) | |
721 | + | let cW = (cU - cV) | |
722 | + | if ((0 >= cW)) | |
730 | 723 | then throw("amount of staked sharetokens must be > 0") | |
731 | 724 | else { | |
732 | - | let | |
733 | - | if (( | |
734 | - | then $Tuple2( | |
725 | + | let cX = bO(aH, bj, cP, cW) | |
726 | + | if ((cX == cX)) | |
727 | + | then $Tuple2(cW, cV) | |
735 | 728 | else throw("Strict value is not equal to itself.") | |
736 | 729 | } | |
737 | 730 | } | |
741 | 734 | } | |
742 | 735 | ||
743 | 736 | ||
744 | - | func | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | then $Tuple2(getIntegerValue(this, ( | |
749 | - | else $Tuple2(getIntegerValue(this, ( | |
750 | - | let | |
751 | - | let | |
752 | - | [IntegerEntry(( | |
737 | + | func cY (aH,aK,cZ,cV,da,aA,aE,db) = { | |
738 | + | let dc = aG(aH) | |
739 | + | let dd = aI(aH) | |
740 | + | let de = if (db) | |
741 | + | then $Tuple2(getIntegerValue(this, (aH + C)), (dd + cZ)) | |
742 | + | else $Tuple2(getIntegerValue(this, (aH + D)), dd) | |
743 | + | let df = de._1 | |
744 | + | let dg = de._2 | |
745 | + | [IntegerEntry((aH + A), (dc + cZ)), IntegerEntry((aH + B), dg), IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + u), cZ), IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + z), df), StringEntry((((aK + "_") + toString(da)) + v), aH), IntegerEntry((aK + y), da), ScriptTransfer(ac, cV, fromBase58String(aA))] | |
753 | 746 | } | |
754 | 747 | ||
755 | 748 | ||
756 | - | func | |
757 | - | let | |
758 | - | if (( | |
749 | + | func dh (di,dj,dk,dl,dm,dn,do,dp,dq,dr) = { | |
750 | + | let ds = ao(aS(di)) | |
751 | + | if ((ds == ds)) | |
759 | 752 | then { | |
760 | - | let | |
761 | - | if (( | |
762 | - | then ( | |
753 | + | let bV = invoke(ad, "swap", [dl, dm, dn, do, dp, dq, dr], [AttachedPayment(dk, dj)]) | |
754 | + | if ((bV == bV)) | |
755 | + | then (ao(aS(di)) - ds) | |
763 | 756 | else throw("Strict value is not equal to itself.") | |
764 | 757 | } | |
765 | 758 | else throw("Strict value is not equal to itself.") | |
766 | 759 | } | |
767 | 760 | ||
768 | 761 | ||
769 | - | func | |
770 | - | let | |
771 | - | if (( | |
762 | + | func dt (di,dj,dk,du,dv,dr) = { | |
763 | + | let ds = ao(aS(di)) | |
764 | + | if ((ds == ds)) | |
772 | 765 | then { | |
773 | - | let | |
774 | - | if (( | |
775 | - | then ( | |
766 | + | let bV = invoke(ad, "puzzleSwap", [du, dv, dr], [AttachedPayment(dk, dj)]) | |
767 | + | if ((bV == bV)) | |
768 | + | then (ao(aS(di)) - ds) | |
776 | 769 | else throw("Strict value is not equal to itself.") | |
777 | 770 | } | |
778 | 771 | else throw("Strict value is not equal to itself.") | |
779 | 772 | } | |
780 | 773 | ||
781 | 774 | ||
782 | - | func | |
783 | - | let | |
784 | - | if (( | |
775 | + | func dw (di,dj,dk,dx,dy,dz,dA,dB,dC,dr) = { | |
776 | + | let ds = ao(aS(di)) | |
777 | + | if ((ds == ds)) | |
785 | 778 | then { | |
786 | - | let | |
787 | - | if (( | |
788 | - | then ( | |
779 | + | let bV = invoke(ad, "swopfiSwap", [dx, dy, dz, dA, dB, dC, dr], [AttachedPayment(dk, dj)]) | |
780 | + | if ((bV == bV)) | |
781 | + | then (ao(aS(di)) - ds) | |
789 | 782 | else throw("Strict value is not equal to itself.") | |
790 | 783 | } | |
791 | 784 | else throw("Strict value is not equal to itself.") | |
792 | 785 | } | |
793 | 786 | ||
794 | 787 | ||
795 | - | func | |
796 | - | let | |
797 | - | let | |
798 | - | let | |
799 | - | let | |
800 | - | let | |
801 | - | let | |
802 | - | let | |
803 | - | if (if (( | |
804 | - | then ( | |
788 | + | func dD (aH,bj,dE,dF) = { | |
789 | + | let au = Address(fromBase58String(aH)) | |
790 | + | let dG = aD(au, bj) | |
791 | + | let dH = dG._1 | |
792 | + | let dI = dG._2 | |
793 | + | let aB = dG._3 | |
794 | + | let aC = dG._4 | |
795 | + | let aA = dG._5 | |
796 | + | if (if ((dE != dH)) | |
797 | + | then (dE != dI) | |
805 | 798 | else false) | |
806 | 799 | then throw("Wrong asset") | |
807 | 800 | else { | |
808 | - | let | |
809 | - | then $Tuple2( | |
810 | - | else $Tuple2(0, | |
811 | - | let | |
812 | - | let | |
813 | - | let | |
814 | - | let | |
815 | - | let | |
816 | - | let | |
817 | - | let | |
818 | - | let | |
819 | - | let | |
820 | - | let | |
821 | - | let | |
822 | - | let | |
823 | - | let | |
824 | - | then ( | |
801 | + | let dJ = if ((dE == dH)) | |
802 | + | then $Tuple2(dF, 0) | |
803 | + | else $Tuple2(0, dF) | |
804 | + | let bB = dJ._1 | |
805 | + | let bC = dJ._2 | |
806 | + | let dK = cO(bj, aH, i, bB, dH, bC, dI, aB, aC, aA) | |
807 | + | let cZ = dK._1 | |
808 | + | let dL = dK._2 | |
809 | + | let dM = valueOrElse(getInteger(this, (aH + C)), 0) | |
810 | + | let dN = valueOrElse(getInteger(this, (aH + D)), 0) | |
811 | + | let dO = aG(aH) | |
812 | + | let dP = aI(aH) | |
813 | + | let dQ = fraction(dP, j, dO) | |
814 | + | let dR = fraction(cZ, dQ, j) | |
815 | + | let dS = (cZ - dR) | |
816 | + | let dT = if ((dP > 0)) | |
817 | + | then (dM + fraction(dR, k, dP)) | |
825 | 818 | else 0 | |
826 | - | let | |
827 | - | then ( | |
819 | + | let dU = if (((dO - dP) > 0)) | |
820 | + | then (dN + fraction(dS, k, (dO - dP))) | |
828 | 821 | else 0 | |
829 | - | let | |
830 | - | let | |
831 | - | let | |
832 | - | if (( | |
833 | - | then ([IntegerEntry(( | |
822 | + | let dV = fraction(dR, aL(aH, d), m) | |
823 | + | let dW = fraction(dS, aL(aH, c), m) | |
824 | + | let dX = bQ(aH, bj, aA, (dV + dW)) | |
825 | + | if ((dX == dX)) | |
826 | + | then ([IntegerEntry((aH + C), dT), IntegerEntry((aH + D), dU), IntegerEntry((aH + A), ((dO + cZ) - dX)), IntegerEntry((aH + B), ((dP + dR) - dV)), ScriptTransfer(ac, (dV + dW), fromBase58String(aA))] ++ bw(dH, dI, aA)) | |
834 | 827 | else throw("Strict value is not equal to itself.") | |
835 | 828 | } | |
836 | 829 | } | |
837 | 830 | ||
838 | 831 | ||
839 | - | func | |
840 | - | let | |
841 | - | let | |
842 | - | let | |
843 | - | let | |
844 | - | let | |
845 | - | let | |
846 | - | let | |
847 | - | let | |
848 | - | let | |
849 | - | if (( | |
832 | + | func dY (aH,dZ,ea,eb) = { | |
833 | + | let au = Address(fromBase58String(aH)) | |
834 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Unknown pool") | |
835 | + | let ec = aD(au, bj) | |
836 | + | let bX = ec._1 | |
837 | + | let bY = ec._2 | |
838 | + | let aB = ec._3 | |
839 | + | let aC = ec._4 | |
840 | + | let aA = ec._5 | |
841 | + | let ed = ao(aS(bX)) | |
842 | + | if ((ed == ed)) | |
850 | 843 | then { | |
851 | - | let | |
852 | - | if (( | |
844 | + | let ee = ao(aS(bY)) | |
845 | + | if ((ee == ee)) | |
853 | 846 | then { | |
854 | - | let | |
855 | - | then invoke( | |
847 | + | let bV = if ((bj == a)) | |
848 | + | then invoke(au, "callFunction", ["withdraw", [toString(dZ)]], nil) | |
856 | 849 | else { | |
857 | - | let | |
858 | - | if (( | |
859 | - | then invoke( | |
850 | + | let bV = bQ(aH, bj, aA, dZ) | |
851 | + | if ((bV == bV)) | |
852 | + | then invoke(au, "get", nil, [AttachedPayment(aS(aA), dZ)]) | |
860 | 853 | else throw("Strict value is not equal to itself.") | |
861 | 854 | } | |
862 | - | if (( | |
855 | + | if ((bV == bV)) | |
863 | 856 | then { | |
864 | - | let | |
865 | - | let | |
866 | - | let | |
867 | - | let | |
868 | - | let | |
869 | - | let | |
857 | + | let ef = ao(aS(bX)) | |
858 | + | let eg = ao(aS(bY)) | |
859 | + | let eh = $Tuple2((ef - ed), (eg - ee)) | |
860 | + | let ei = eh._1 | |
861 | + | let ej = eh._2 | |
862 | + | let ek = if ((ea > 0)) | |
870 | 863 | then { | |
871 | - | let | |
872 | - | then ( | |
864 | + | let cJ = if (if ((eb == bX)) | |
865 | + | then (ea > ei) | |
873 | 866 | else false) | |
874 | - | then ( | |
875 | - | else if (if (( | |
876 | - | then ( | |
867 | + | then (ea - ei) | |
868 | + | else if (if ((eb == bY)) | |
869 | + | then (ea > ej) | |
877 | 870 | else false) | |
878 | - | then ( | |
871 | + | then (ea - ej) | |
879 | 872 | else 0 | |
880 | - | let | |
881 | - | then | |
873 | + | let el = if ((cJ > 0)) | |
874 | + | then cn(bj, aH, bX, bY, aB, aC, cJ, eb) | |
882 | 875 | else 0 | |
883 | - | if (( | |
876 | + | if ((el == el)) | |
884 | 877 | then { | |
885 | - | let | |
886 | - | let | |
887 | - | if (( | |
888 | - | then $Tuple2((( | |
889 | - | else $Tuple2(( | |
878 | + | let em = ao(aS(bX)) | |
879 | + | let en = ao(aS(bY)) | |
880 | + | if ((eb == bX)) | |
881 | + | then $Tuple2(((em - ed) - ea), (en - ee)) | |
882 | + | else $Tuple2((em - ed), ((en - ee) - ea)) | |
890 | 883 | } | |
891 | 884 | else throw("Strict value is not equal to itself.") | |
892 | 885 | } | |
893 | - | else $Tuple2( | |
894 | - | let | |
895 | - | let | |
896 | - | $Tuple7( | |
886 | + | else $Tuple2(ei, ej) | |
887 | + | let eo = ek._1 | |
888 | + | let ep = ek._2 | |
889 | + | $Tuple7(eo, bX, ep, bY, ef, eg, aA) | |
897 | 890 | } | |
898 | 891 | else throw("Strict value is not equal to itself.") | |
899 | 892 | } | |
903 | 896 | } | |
904 | 897 | ||
905 | 898 | ||
906 | - | func | |
907 | - | let | |
908 | - | let | |
909 | - | let | |
910 | - | then getIntegerValue(this, ( | |
911 | - | else getIntegerValue(this, ( | |
912 | - | ( | |
899 | + | func eq (aK,aH,er,es) = { | |
900 | + | let et = valueOrErrorMessage(getInteger(this, (((((aH + "_") + aK) + "_") + er) + u)), "Unknown position") | |
901 | + | let eu = getIntegerValue(this, (((((aH + "_") + aK) + "_") + er) + z)) | |
902 | + | let ev = if (es) | |
903 | + | then getIntegerValue(this, (aH + C)) | |
904 | + | else getIntegerValue(this, (aH + D)) | |
905 | + | (et + fraction(et, (ev - eu), k)) | |
913 | 906 | } | |
914 | 907 | ||
915 | 908 | ||
916 | - | func | |
917 | - | let | |
918 | - | let | |
919 | - | let | |
920 | - | let | |
921 | - | let | |
922 | - | let | |
923 | - | let | |
909 | + | func ew (aK,aH,er,ex) = { | |
910 | + | let et = valueOrErrorMessage(getInteger(this, (((((aH + "_") + aK) + "_") + er) + u)), "Unknown position") | |
911 | + | let cD = valueOrElse(getInteger(this, (((((aH + "_") + aK) + "_") + er) + w)), 0) | |
912 | + | let dZ = eq(aK, aH, er, (cD > 0)) | |
913 | + | let ey = aG(aH) | |
914 | + | let ez = Address(fromBase58String(aK)) | |
915 | + | let eb = valueOrElse(getString(this, (((((aH + "_") + aK) + "_") + er) + x)), "") | |
916 | + | let ea = if ((cD > 0)) | |
924 | 917 | then { | |
925 | - | let | |
926 | - | if ($isInstanceOf( | |
927 | - | then | |
928 | - | else throw(($getType( | |
918 | + | let ax = invoke(ai(), "getAssetDebt", [false, ((aK + "_") + er), eb], nil) | |
919 | + | if ($isInstanceOf(ax, "Int")) | |
920 | + | then ax | |
921 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
929 | 922 | } | |
930 | 923 | else 0 | |
931 | - | let | |
932 | - | if (( | |
924 | + | let eA = dY(aH, dZ, ea, eb) | |
925 | + | if ((eA == eA)) | |
933 | 926 | then { | |
934 | - | let | |
935 | - | let | |
936 | - | let | |
937 | - | let | |
938 | - | let | |
939 | - | let | |
940 | - | let | |
941 | - | let | |
942 | - | then invoke( | |
927 | + | let aA = eA._7 | |
928 | + | let eg = eA._6 | |
929 | + | let ef = eA._5 | |
930 | + | let bY = eA._4 | |
931 | + | let eB = eA._3 | |
932 | + | let bX = eA._2 | |
933 | + | let eC = eA._1 | |
934 | + | let eD = if ((ea > 0)) | |
935 | + | then invoke(ai(), "repayFor", [((aK + "_") + er)], [AttachedPayment(aS(eb), ea)]) | |
943 | 936 | else 0 | |
944 | - | if (( | |
945 | - | then ([DeleteEntry(((((( | |
937 | + | if ((eD == eD)) | |
938 | + | then ([DeleteEntry((((((aH + "_") + aK) + "_") + er) + u)), DeleteEntry((((((aH + "_") + aK) + "_") + er) + z)), IntegerEntry((aH + A), (ey - dZ)), ScriptTransfer(ez, eC, aS(bX)), ScriptTransfer(ez, eB, aS(bY))] ++ bw(bX, bY, aA)) | |
946 | 939 | else throw("Strict value is not equal to itself.") | |
947 | 940 | } | |
948 | 941 | else throw("Strict value is not equal to itself.") | |
949 | 942 | } | |
950 | 943 | ||
951 | 944 | ||
952 | - | func | |
953 | - | let | |
954 | - | let | |
955 | - | let | |
956 | - | let | |
957 | - | let | |
958 | - | let | |
959 | - | let | |
960 | - | let | |
961 | - | let | |
962 | - | let | |
963 | - | let | |
964 | - | let | |
965 | - | $Tuple11( | |
945 | + | func eE (eF) = { | |
946 | + | let eG = split(valueOrErrorMessage(getString(this, (eF + L)), ("No request with id " + eF)), ",") | |
947 | + | let aK = eG[0] | |
948 | + | let aH = eG[1] | |
949 | + | let bB = parseIntValue(eG[2]) | |
950 | + | let dH = eG[3] | |
951 | + | let bC = parseIntValue(eG[4]) | |
952 | + | let dI = eG[5] | |
953 | + | let aB = parseIntValue(eG[6]) | |
954 | + | let aC = parseIntValue(eG[7]) | |
955 | + | let aA = eG[8] | |
956 | + | let eH = eG[9] | |
957 | + | let eI = parseIntValue(eG[10]) | |
958 | + | $Tuple11(aK, aH, bB, dH, bC, dI, aB, aC, aA, eH, eI) | |
966 | 959 | } | |
967 | 960 | ||
968 | 961 | ||
969 | - | func eI (bA,bB,ax,ay,eJ,eK) = { | |
970 | - | let bm = ( let aw = invoke(ad, "getTWAP60", [ax, false], nil) | |
971 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
972 | - | then aw | |
973 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
974 | - | let bn = ( let aw = invoke(ad, "getTWAP60", [ay, false], nil) | |
975 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
976 | - | then aw | |
977 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
978 | - | let eL = pow(10, 0, aS(ax), 0, 0, DOWN) | |
979 | - | let eM = pow(10, 0, aS(ay), 0, 0, DOWN) | |
980 | - | let eN = (fraction(bm, bA, eL) + fraction(bn, bB, eM)) | |
981 | - | let eO = if ((eK == ax)) | |
982 | - | then $Tuple2(bm, eL) | |
983 | - | else $Tuple2(bn, eM) | |
984 | - | let eP = eO._1 | |
985 | - | let eQ = eO._2 | |
986 | - | fraction(fraction(eN, (eJ - 100), 100), eQ, eP) | |
962 | + | func eJ (bB,bC,ay,az,eK,eL) = { | |
963 | + | let bn = getIntegerValue(ae, (ay + R)) | |
964 | + | let bo = getIntegerValue(ae, (az + R)) | |
965 | + | let eM = pow(10, 0, aT(ay), 0, 0, DOWN) | |
966 | + | let eN = pow(10, 0, aT(az), 0, 0, DOWN) | |
967 | + | let eO = (fraction(bn, bB, eM) + fraction(bo, bC, eN)) | |
968 | + | let eP = if ((eL == ay)) | |
969 | + | then $Tuple2(bn, eM) | |
970 | + | else $Tuple2(bo, eN) | |
971 | + | let eQ = eP._1 | |
972 | + | let eR = eP._2 | |
973 | + | fraction(fraction(eO, (eK - 100), 100), eR, eQ) | |
987 | 974 | } | |
988 | 975 | ||
989 | 976 | ||
990 | - | @Callable( | |
991 | - | func calcPriceImpactEVALONLY ( | |
977 | + | @Callable(al) | |
978 | + | func calcPriceImpactEVALONLY (aH,eK,eL,bB,bC) = if (if ((100 > eK)) | |
992 | 979 | then true | |
993 | - | else ( | |
980 | + | else (eK > 300)) | |
994 | 981 | then throw("Leverage can't be <100 and >300") | |
995 | 982 | else { | |
996 | - | let | |
997 | - | let | |
998 | - | let | |
999 | - | let | |
1000 | - | let | |
1001 | - | let | |
1002 | - | let | |
1003 | - | let | |
1004 | - | then | |
983 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
984 | + | let eS = aD(Address(fromBase58String(aH)), bj) | |
985 | + | let dH = eS._1 | |
986 | + | let dI = eS._2 | |
987 | + | let aB = eS._3 | |
988 | + | let aC = eS._4 | |
989 | + | let aA = eS._5 | |
990 | + | let cD = if ((eK > 100)) | |
991 | + | then eJ(bB, bC, dH, dI, eK, eL) | |
1005 | 992 | else 0 | |
1006 | - | let | |
1007 | - | then $Tuple2(( | |
1008 | - | else $Tuple2( | |
1009 | - | let | |
1010 | - | let | |
1011 | - | let | |
1012 | - | let | |
1013 | - | let | |
1014 | - | let | |
1015 | - | then ( | |
1016 | - | else | |
1017 | - | $Tuple2(nil, [ | |
993 | + | let eT = if ((eL == dH)) | |
994 | + | then $Tuple2((bB + cD), bC) | |
995 | + | else $Tuple2(bB, (bC + cD)) | |
996 | + | let eU = eT._1 | |
997 | + | let eV = eT._2 | |
998 | + | let eW = cq(bj, aH, eU, dH, eV, dI, aB, aC) | |
999 | + | let cx = eW._1 | |
1000 | + | let cB = eW._2 | |
1001 | + | let eX = if ((0 > cB)) | |
1002 | + | then (cB * -1) | |
1003 | + | else cB | |
1004 | + | $Tuple2(nil, [eX]) | |
1018 | 1005 | } | |
1019 | 1006 | ||
1020 | 1007 | ||
1021 | 1008 | ||
1022 | - | @Callable( | |
1023 | - | func getShareAssetPriceREADONLY ( | |
1024 | - | let | |
1025 | - | $Tuple2(nil, | |
1009 | + | @Callable(al) | |
1010 | + | func getShareAssetPriceREADONLY (aA) = { | |
1011 | + | let eY = bi(aA) | |
1012 | + | $Tuple2(nil, eY) | |
1026 | 1013 | } | |
1027 | 1014 | ||
1028 | 1015 | ||
1029 | 1016 | ||
1030 | - | @Callable( | |
1031 | - | func getUserPositionShareAmountREADONLY ( | |
1032 | - | let | |
1033 | - | let | |
1034 | - | let | |
1035 | - | $Tuple2(nil, | |
1017 | + | @Callable(al) | |
1018 | + | func getUserPositionShareAmountREADONLY (aK,da) = { | |
1019 | + | let aH = valueOrErrorMessage(getString(this, (((aK + "_") + da) + v)), "Unknown position") | |
1020 | + | let cD = getIntegerValue(this, (((((aH + "_") + aK) + "_") + da) + w)) | |
1021 | + | let dZ = eq(aK, aH, da, (cD > 0)) | |
1022 | + | $Tuple2(nil, dZ) | |
1036 | 1023 | } | |
1037 | 1024 | ||
1038 | 1025 | ||
1039 | 1026 | ||
1040 | - | @Callable( | |
1041 | - | func getUserPositionInDollarsREADONLY ( | |
1042 | - | func | |
1043 | - | let | |
1044 | - | let | |
1045 | - | let | |
1046 | - | let | |
1047 | - | let | |
1048 | - | let | |
1049 | - | let | |
1050 | - | let | |
1051 | - | let | |
1052 | - | let | |
1053 | - | let | |
1054 | - | let | |
1055 | - | let | |
1056 | - | let | |
1057 | - | let | |
1058 | - | let | |
1059 | - | if (( | |
1060 | - | then $Tuple3(( | |
1027 | + | @Callable(al) | |
1028 | + | func getUserPositionInDollarsREADONLY (aK,eZ,da) = { | |
1029 | + | func fa (aZ,aH) = { | |
1030 | + | let fb = aZ | |
1031 | + | let fc = fb._1 | |
1032 | + | let fd = fb._2 | |
1033 | + | let fe = fb._3 | |
1034 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1035 | + | let ff = aD(Address(fromBase58String(aH)), bj) | |
1036 | + | let dH = ff._1 | |
1037 | + | let dI = ff._2 | |
1038 | + | let aB = ff._3 | |
1039 | + | let aC = ff._4 | |
1040 | + | let aA = ff._5 | |
1041 | + | let cD = valueOrElse(getInteger(this, (((((aH + "_") + aK) + "_") + da[fe]) + w)), 0) | |
1042 | + | let dZ = eq(aK, aH, da[fe], (cD > 0)) | |
1043 | + | let eY = bi(aA) | |
1044 | + | let fg = pow(10, 0, aT(aA), 0, 0, DOWN) | |
1045 | + | let fh = fraction(dZ, eY, fg) | |
1046 | + | if ((cD == 0)) | |
1047 | + | then $Tuple3((fc :+ fh), (fd :+ 0), (fe + 1)) | |
1061 | 1048 | else { | |
1062 | - | let | |
1063 | - | let | |
1064 | - | let | |
1065 | - | if ($isInstanceOf( | |
1066 | - | then | |
1067 | - | else throw(($getType( | |
1049 | + | let eb = getStringValue(this, (((((aH + "_") + aK) + "_") + da[fe]) + x)) | |
1050 | + | let ea = { | |
1051 | + | let ax = invoke(ai(), "getAssetDebt", [false, ((aK + "_") + da[fe]), eb], nil) | |
1052 | + | if ($isInstanceOf(ax, "Int")) | |
1053 | + | then ax | |
1054 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
1068 | 1055 | } | |
1069 | - | let fh = ( let aw = invoke(ad, "getTWAP60", [ea, false], nil) | |
1070 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1071 | - | then aw | |
1072 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1073 | - | let fi = pow(10, 0, aS(ea), 0, 0, DOWN) | |
1074 | - | let fj = fraction(dZ, fh, fi) | |
1075 | - | $Tuple3((fb :+ fg), (fc :+ fj), (fd + 1)) | |
1056 | + | let fi = getIntegerValue(ae, (eb + R)) | |
1057 | + | let fj = pow(10, 0, aT(eb), 0, 0, DOWN) | |
1058 | + | let fk = fraction(ea, fi, fj) | |
1059 | + | $Tuple3((fc :+ fh), (fd :+ fk), (fe + 1)) | |
1076 | 1060 | } | |
1077 | 1061 | } | |
1078 | 1062 | ||
1079 | - | let | |
1080 | - | let | |
1081 | - | let | |
1082 | - | let | |
1083 | - | func | |
1084 | - | then | |
1085 | - | else | |
1063 | + | let fl = { | |
1064 | + | let bb = eZ | |
1065 | + | let bc = size(bb) | |
1066 | + | let bd = $Tuple3(nil, nil, 0) | |
1067 | + | func be (bf,bg) = if ((bg >= bc)) | |
1068 | + | then bf | |
1069 | + | else fa(bf, bb[bg]) | |
1086 | 1070 | ||
1087 | - | func | |
1088 | - | then | |
1071 | + | func bh (bf,bg) = if ((bg >= bc)) | |
1072 | + | then bf | |
1089 | 1073 | else throw("List size exceeds 20") | |
1090 | 1074 | ||
1091 | - | | |
1075 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1092 | 1076 | } | |
1093 | - | let | |
1094 | - | let | |
1095 | - | $Tuple2(nil, $Tuple2( | |
1077 | + | let fm = fl._1 | |
1078 | + | let ea = fl._2 | |
1079 | + | $Tuple2(nil, $Tuple2(fm, ea)) | |
1096 | 1080 | } | |
1097 | 1081 | ||
1098 | 1082 | ||
1099 | 1083 | ||
1100 | - | @Callable( | |
1101 | - | func replenish ( | |
1084 | + | @Callable(al) | |
1085 | + | func replenish (aH,eK,eL) = if (if ((100 > eK)) | |
1102 | 1086 | then true | |
1103 | - | else ( | |
1087 | + | else (eK > 300)) | |
1104 | 1088 | then throw("Leverage can't be <100 and >300") | |
1105 | - | else if (if (!(getBooleanValue(this, ( | |
1106 | - | then ( | |
1089 | + | else if (if (!(getBooleanValue(this, (aH + E)))) | |
1090 | + | then (eK > 100) | |
1107 | 1091 | else false) | |
1108 | 1092 | then throw("You can't borrow in this pool") | |
1109 | 1093 | else { | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | let | |
1117 | - | let | |
1118 | - | then if (( | |
1094 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1095 | + | let fn = aD(Address(fromBase58String(aH)), bj) | |
1096 | + | let dH = fn._1 | |
1097 | + | let dI = fn._2 | |
1098 | + | let aB = fn._3 | |
1099 | + | let aC = fn._4 | |
1100 | + | let aA = fn._5 | |
1101 | + | let fo = if ((size(al.payments) == 2)) | |
1102 | + | then if ((aR(al.payments[0].assetId) != dH)) | |
1119 | 1103 | then throw("Wrong payment asset A") | |
1120 | - | else if (( | |
1104 | + | else if ((aR(al.payments[1].assetId) != dI)) | |
1121 | 1105 | then throw("Wrong payment asset B") | |
1122 | - | else $Tuple4( | |
1123 | - | else if ((size( | |
1124 | - | then if (( | |
1125 | - | then $Tuple4( | |
1126 | - | else if (( | |
1127 | - | then $Tuple4(0, | |
1106 | + | else $Tuple4(al.payments[0].amount, dH, al.payments[1].amount, dI) | |
1107 | + | else if ((size(al.payments) == 1)) | |
1108 | + | then if ((aR(al.payments[0].assetId) == dH)) | |
1109 | + | then $Tuple4(al.payments[0].amount, dH, 0, dI) | |
1110 | + | else if ((aR(al.payments[0].assetId) == dI)) | |
1111 | + | then $Tuple4(0, dH, al.payments[0].amount, dI) | |
1128 | 1112 | else throw("Wrong payment") | |
1129 | 1113 | else throw("One or two payments expected") | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | if (( | |
1114 | + | let bB = fo._1 | |
1115 | + | let fp = fo._2 | |
1116 | + | let bC = fo._3 | |
1117 | + | let fq = fo._4 | |
1118 | + | let fr = aJ(toString(al.caller)) | |
1119 | + | if ((eK > 100)) | |
1136 | 1120 | then { | |
1137 | - | let | |
1138 | - | let | |
1139 | - | let | |
1140 | - | let | |
1141 | - | if ($isInstanceOf( | |
1142 | - | then | |
1143 | - | else throw(($getType( | |
1121 | + | let cD = eJ(bB, bC, fp, fq, eK, eL) | |
1122 | + | let eG = makeString([toString(al.caller), aH, toString(bB), fp, toString(bC), fq, toString(aB), toString(aC), aA, eL, toString(cD)], ",") | |
1123 | + | let fs = { | |
1124 | + | let ax = invoke(this, "createNewRequest", [eG], nil) | |
1125 | + | if ($isInstanceOf(ax, "Int")) | |
1126 | + | then ax | |
1127 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
1144 | 1128 | } | |
1145 | - | if (( | |
1129 | + | if ((fs == fs)) | |
1146 | 1130 | then { | |
1147 | - | let | |
1148 | - | let | |
1149 | - | if (( | |
1131 | + | let ft = [((toString(al.caller) + "_") + toString(fr)), aA, eL, cD, toString(this), "replenishFromLand", toString(valueOrErrorMessage(fs, "Can't create new request"))] | |
1132 | + | let bV = reentrantInvoke(ai(), "flashPosition", ft, nil) | |
1133 | + | if ((bV == bV)) | |
1150 | 1134 | then nil | |
1151 | 1135 | else throw("Strict value is not equal to itself.") | |
1152 | 1136 | } | |
1153 | 1137 | else throw("Strict value is not equal to itself.") | |
1154 | 1138 | } | |
1155 | 1139 | else { | |
1156 | - | let | |
1157 | - | let | |
1158 | - | let | |
1159 | - | ( | |
1140 | + | let fu = cO(bj, aH, h, bB, dH, bC, dI, aB, aC, aA) | |
1141 | + | let fv = fu._1 | |
1142 | + | let dX = fu._2 | |
1143 | + | (cY(aH, toString(al.caller), fv, dX, fr, aA, bj, false) ++ bw(dH, dI, aA)) | |
1160 | 1144 | } | |
1161 | 1145 | } | |
1162 | 1146 | ||
1163 | 1147 | ||
1164 | 1148 | ||
1165 | - | @Callable( | |
1166 | - | func withdraw ( | |
1149 | + | @Callable(al) | |
1150 | + | func withdraw (aH,er) = ew(toString(al.caller), aH, toString(er), false) | |
1167 | 1151 | ||
1168 | 1152 | ||
1169 | 1153 | ||
1170 | - | @Callable(ak) | |
1171 | - | func createUpdateStopLoss (eq,fv,ao,fw) = { | |
1172 | - | let fx = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
1173 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1174 | - | then aw | |
1175 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1176 | - | if (!(isDefined(getInteger(this, (((((fv + "_") + toString(ak.caller)) + "_") + toString(eq)) + u))))) | |
1154 | + | @Callable(al) | |
1155 | + | func createUpdateStopLoss (er,fw,ap,fx) = { | |
1156 | + | let fy = getIntegerValue(ae, (ap + R)) | |
1157 | + | if (!(isDefined(getInteger(this, (((((fw + "_") + toString(al.caller)) + "_") + toString(er)) + u))))) | |
1177 | 1158 | then throw("There are no user position") | |
1178 | - | else if ((0 >= | |
1159 | + | else if ((0 >= fx)) | |
1179 | 1160 | then throw("Price must be greater than 0") | |
1180 | - | else if (( | |
1161 | + | else if ((fx > fy)) | |
1181 | 1162 | then throw("Price must be less than current token price") | |
1182 | - | else [IntegerEntry((((((((toString( | |
1163 | + | else [IntegerEntry((((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S), fx)] | |
1183 | 1164 | } | |
1184 | 1165 | ||
1185 | 1166 | ||
1186 | 1167 | ||
1187 | - | @Callable( | |
1188 | - | func deleteStopLoss ( | |
1168 | + | @Callable(al) | |
1169 | + | func deleteStopLoss (er,fw,ap) = if (!(isDefined(getInteger(this, (((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S))))) | |
1189 | 1170 | then throw("No entry") | |
1190 | - | else [DeleteEntry((((((((toString( | |
1171 | + | else [DeleteEntry((((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S))] | |
1191 | 1172 | ||
1192 | 1173 | ||
1193 | 1174 | ||
1194 | - | @Callable( | |
1195 | - | func init ( | |
1175 | + | @Callable(al) | |
1176 | + | func init (fz,fA,fB,ae,fC,af,fD,fE,fF) = if (isDefined(getString(T))) | |
1196 | 1177 | then throw("Already inited") | |
1197 | - | else [ | |
1178 | + | else [StringEntry(T, fz), StringEntry(U, fA), StringEntry(V, fB), StringEntry(X, ae), StringEntry(Y, fC), StringEntry(Z, af), StringEntry(aa, fD), StringEntry(ab, fE), StringEntry(W, fF)] | |
1198 | 1179 | ||
1199 | 1180 | ||
1200 | 1181 | ||
1201 | - | @Callable( | |
1202 | - | func createNewRequest ( | |
1203 | - | let | |
1204 | - | $Tuple2([StringEntry((toString( | |
1182 | + | @Callable(al) | |
1183 | + | func createNewRequest (bU) = valueOrElse(am(al), { | |
1184 | + | let fs = (valueOrElse(getInteger(this, M), 0) + 1) | |
1185 | + | $Tuple2([StringEntry((toString(fs) + L), bU), IntegerEntry(M, fs)], fs) | |
1205 | 1186 | }) | |
1206 | 1187 | ||
1207 | 1188 | ||
1208 | 1189 | ||
1209 | - | @Callable( | |
1210 | - | func replenishFromLand ( | |
1211 | - | let | |
1212 | - | let | |
1213 | - | let | |
1214 | - | let | |
1215 | - | let | |
1216 | - | let | |
1217 | - | let | |
1218 | - | let | |
1219 | - | let | |
1220 | - | let | |
1221 | - | let | |
1222 | - | let | |
1223 | - | if ((size( | |
1190 | + | @Callable(al) | |
1191 | + | func replenishFromLand (eF) = valueOrElse(an(al), { | |
1192 | + | let fG = eE(eF) | |
1193 | + | let aK = fG._1 | |
1194 | + | let aH = fG._2 | |
1195 | + | let bB = fG._3 | |
1196 | + | let dH = fG._4 | |
1197 | + | let bC = fG._5 | |
1198 | + | let dI = fG._6 | |
1199 | + | let aB = fG._7 | |
1200 | + | let aC = fG._8 | |
1201 | + | let aA = fG._9 | |
1202 | + | let eH = fG._10 | |
1203 | + | let eI = fG._11 | |
1204 | + | if ((size(al.payments) != 1)) | |
1224 | 1205 | then throw("Wrong payment size") | |
1225 | - | else if (if (( | |
1206 | + | else if (if ((aR(al.payments[0].assetId) != eH)) | |
1226 | 1207 | then true | |
1227 | - | else ( | |
1208 | + | else (al.payments[0].amount != eI)) | |
1228 | 1209 | then throw("Wrong payment") | |
1229 | 1210 | else { | |
1230 | - | let | |
1231 | - | then $Tuple2(( | |
1232 | - | else $Tuple2( | |
1233 | - | let | |
1234 | - | let | |
1235 | - | let | |
1236 | - | let | |
1237 | - | let | |
1238 | - | let | |
1239 | - | let | |
1240 | - | let | |
1241 | - | let | |
1242 | - | $Tuple2(((( | |
1211 | + | let fH = if ((dH == eH)) | |
1212 | + | then $Tuple2((bB + al.payments[0].amount), bC) | |
1213 | + | else $Tuple2(bB, (bC + al.payments[0].amount)) | |
1214 | + | let fI = fH._1 | |
1215 | + | let fJ = fH._2 | |
1216 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Unknown pool") | |
1217 | + | let fK = cO(bj, aH, g, fI, dH, fJ, dI, aB, aC, aA) | |
1218 | + | let fv = fK._1 | |
1219 | + | let dX = fK._2 | |
1220 | + | let da = aJ(aK) | |
1221 | + | let fL = [IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + w), eI), StringEntry((((((aH + "_") + aK) + "_") + toString(da)) + x), eH)] | |
1222 | + | let fM = cY(aH, aK, fv, dX, da, aA, bj, true) | |
1223 | + | $Tuple2((((fM ++ bw(dH, dI, aA)) ++ fL) :+ DeleteEntry((eF + L))), fv) | |
1243 | 1224 | } | |
1244 | 1225 | }) | |
1245 | 1226 | ||
1246 | 1227 | ||
1247 | 1228 | ||
1248 | - | @Callable( | |
1249 | - | func liquidate ( | |
1250 | - | let | |
1251 | - | let | |
1252 | - | let | |
1253 | - | let | |
1254 | - | let | |
1255 | - | let | |
1256 | - | let | |
1257 | - | let | |
1258 | - | let | |
1259 | - | let | |
1260 | - | let | |
1261 | - | let | |
1262 | - | if (( | |
1229 | + | @Callable(al) | |
1230 | + | func liquidate (aK,er,fN) = valueOrElse(an(al), { | |
1231 | + | let aH = valueOrErrorMessage(getString(this, (((aK + "_") + er) + v)), "no position") | |
1232 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1233 | + | let fO = aD(Address(fromBase58String(aH)), bj) | |
1234 | + | let dH = fO._1 | |
1235 | + | let dI = fO._2 | |
1236 | + | let aB = fO._3 | |
1237 | + | let aC = fO._4 | |
1238 | + | let aA = fO._5 | |
1239 | + | let bP = bQ(aH, bj, aA, fN) | |
1240 | + | let cD = getIntegerValue(this, (((((aH + "_") + aK) + "_") + er) + w)) | |
1241 | + | let eb = getStringValue(this, (((((aH + "_") + aK) + "_") + er) + x)) | |
1242 | + | let dZ = eq(aK, aH, er, (cD > 0)) | |
1243 | + | if ((cD == 0)) | |
1263 | 1244 | then throw("You can't liquidate position without borrow") | |
1264 | - | else [IntegerEntry(((((( | |
1245 | + | else [IntegerEntry((((((aH + "_") + aK) + "_") + er) + z), getIntegerValue(this, (aH + C))), IntegerEntry((aH + B), (aI(aH) - fN)), IntegerEntry((aH + A), (aG(aH) - fN)), IntegerEntry((((((aH + "_") + aK) + "_") + er) + u), (dZ - fN)), ScriptTransfer(al.caller, bP, fromBase58String(aA))] | |
1265 | 1246 | }) | |
1266 | 1247 | ||
1267 | 1248 | ||
1268 | 1249 | ||
1269 | - | @Callable(ak) | |
1270 | - | func stopLoss (aJ,eq,aG,ao) = valueOrElse(aj(ak), { | |
1271 | - | let fx = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
1272 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1273 | - | then aw | |
1274 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1275 | - | if (!(isDefined(getInteger(this, (((((((aJ + "_") + toString(eq)) + "_") + aG) + "_") + ao) + R))))) | |
1250 | + | @Callable(al) | |
1251 | + | func stopLoss (aK,er,aH,ap) = valueOrElse(ak(al), { | |
1252 | + | let fy = getIntegerValue(ae, (ap + R)) | |
1253 | + | if (!(isDefined(getInteger(this, (((((((aK + "_") + toString(er)) + "_") + aH) + "_") + ap) + S))))) | |
1276 | 1254 | then throw("No entry") | |
1277 | - | else ( | |
1255 | + | else (ew(toString(al.caller), aH, toString(er), true) :+ DeleteEntry((((((((aK + "_") + toString(er)) + "_") + aH) + "_") + ap) + S))) | |
1278 | 1256 | }) | |
1279 | 1257 | ||
1280 | 1258 | ||
1281 | 1259 | ||
1282 | - | @Callable( | |
1283 | - | func capitalizeExKeeper ( | |
1284 | - | let | |
1285 | - | then | |
1260 | + | @Callable(al) | |
1261 | + | func capitalizeExKeeper (aH,aE,fP,fQ,fR,dl,dm,dn,do,dp,dq,dr) = valueOrElse(ak(al), { | |
1262 | + | let fS = if (fR) | |
1263 | + | then cL(aE, aH) | |
1286 | 1264 | else { | |
1287 | - | let | |
1288 | - | then | |
1289 | - | else | |
1290 | - | $Tuple2( | |
1265 | + | let fT = if ((aE == a)) | |
1266 | + | then ag | |
1267 | + | else ah | |
1268 | + | $Tuple2(fQ, fT) | |
1291 | 1269 | } | |
1292 | - | let | |
1293 | - | let | |
1294 | - | let | |
1295 | - | let | |
1296 | - | let | |
1297 | - | then [IntegerEntry(( | |
1270 | + | let fU = fS._1 | |
1271 | + | let fT = fS._2 | |
1272 | + | let fV = dh(fP, fQ, fT, dl, dm, dn, do, dp, dq, dr) | |
1273 | + | let cv = (fU - fQ) | |
1274 | + | let fW = if ((cv > 0)) | |
1275 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1298 | 1276 | else nil | |
1299 | - | ( | |
1277 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1300 | 1278 | }) | |
1301 | 1279 | ||
1302 | 1280 | ||
1303 | 1281 | ||
1304 | - | @Callable( | |
1305 | - | func capitalizeExPuzzle ( | |
1306 | - | let | |
1307 | - | then | |
1282 | + | @Callable(al) | |
1283 | + | func capitalizeExPuzzle (aH,aE,fP,fQ,fR,du,dv,dr) = valueOrElse(ak(al), { | |
1284 | + | let fX = if (fR) | |
1285 | + | then cL(aE, aH) | |
1308 | 1286 | else { | |
1309 | - | let | |
1310 | - | then | |
1311 | - | else | |
1312 | - | $Tuple2( | |
1287 | + | let fT = if ((aE == a)) | |
1288 | + | then ag | |
1289 | + | else ah | |
1290 | + | $Tuple2(fQ, fT) | |
1313 | 1291 | } | |
1314 | - | let | |
1315 | - | let | |
1316 | - | let | |
1317 | - | let | |
1318 | - | let | |
1319 | - | then [IntegerEntry(( | |
1292 | + | let fU = fX._1 | |
1293 | + | let fT = fX._2 | |
1294 | + | let fV = dt(fP, fQ, fT, du, dv, dr) | |
1295 | + | let cv = (fU - fQ) | |
1296 | + | let fW = if ((cv > 0)) | |
1297 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1320 | 1298 | else nil | |
1321 | - | ( | |
1299 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1322 | 1300 | }) | |
1323 | 1301 | ||
1324 | 1302 | ||
1325 | 1303 | ||
1326 | - | @Callable( | |
1327 | - | func capitalizeExSwopFi ( | |
1328 | - | let | |
1329 | - | then | |
1304 | + | @Callable(al) | |
1305 | + | func capitalizeExSwopFi (aH,aE,fP,fQ,fR,dx,dy,dz,dA,dB,dC,dr) = valueOrElse(ak(al), { | |
1306 | + | let fY = if (fR) | |
1307 | + | then cL(aE, aH) | |
1330 | 1308 | else { | |
1331 | - | let | |
1332 | - | then | |
1333 | - | else | |
1334 | - | $Tuple2( | |
1309 | + | let fT = if ((aE == a)) | |
1310 | + | then ag | |
1311 | + | else ah | |
1312 | + | $Tuple2(fQ, fT) | |
1335 | 1313 | } | |
1336 | - | let | |
1337 | - | let | |
1338 | - | let | |
1339 | - | let | |
1340 | - | let | |
1341 | - | then [IntegerEntry(( | |
1314 | + | let fU = fY._1 | |
1315 | + | let fT = fY._2 | |
1316 | + | let fV = dw(fP, fQ, fT, dx, dy, dz, dA, dB, dC, dr) | |
1317 | + | let cv = (fU - fQ) | |
1318 | + | let fW = if ((cv > 0)) | |
1319 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1342 | 1320 | else nil | |
1343 | - | ( | |
1321 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1344 | 1322 | }) | |
1345 | 1323 | ||
1346 | 1324 | ||
1347 | 1325 | ||
1348 | - | @Callable( | |
1349 | - | func initNewPool ( | |
1350 | - | then ( | |
1326 | + | @Callable(al) | |
1327 | + | func initNewPool (aE,au,fZ,ga,gb,gc,gd,ge,gf) = valueOrElse(ak(al), if (if ((aE != a)) | |
1328 | + | then (aE != b) | |
1351 | 1329 | else false) | |
1352 | 1330 | then throw("Wrong type") | |
1353 | 1331 | else { | |
1354 | - | let | |
1355 | - | let | |
1356 | - | let | |
1357 | - | let | |
1358 | - | let | |
1359 | - | let | |
1360 | - | [IntegerEntry(( | |
1332 | + | let gg = aD(Address(fromBase58String(au)), aE) | |
1333 | + | let ay = gg._1 | |
1334 | + | let az = gg._2 | |
1335 | + | let gh = gg._3 | |
1336 | + | let gi = gg._4 | |
1337 | + | let aA = gg._5 | |
1338 | + | [IntegerEntry((au + F), fZ), IntegerEntry((au + G), ga), IntegerEntry((au + H), gb), IntegerEntry((au + I), gc), IntegerEntry((au + J), gd), IntegerEntry((au + K), ge), IntegerEntry((au + C), 0), IntegerEntry((au + D), 0), StringEntry((N + au), aE), StringEntry((aA + O), au), BooleanEntry((au + E), gf)] | |
1361 | 1339 | }) | |
1362 | 1340 | ||
1363 | 1341 | ||
1364 | - | @Verifier( | |
1365 | - | func | |
1342 | + | @Verifier(gj) | |
1343 | + | func gk () = sigVerify(gj.bodyBytes, gj.proofs[0], gj.senderPublicKey) | |
1366 | 1344 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "SF" | |
5 | 5 | ||
6 | 6 | let b = "WX" | |
7 | 7 | ||
8 | 8 | let c = "capNoLoan" | |
9 | 9 | ||
10 | 10 | let d = "capLoan" | |
11 | 11 | ||
12 | 12 | let e = "stopLossNoLoan" | |
13 | 13 | ||
14 | 14 | let f = "stopLossLoan" | |
15 | 15 | ||
16 | 16 | let g = "loan" | |
17 | 17 | ||
18 | 18 | let h = "noLoan" | |
19 | 19 | ||
20 | 20 | let i = "noFee" | |
21 | 21 | ||
22 | 22 | let j = 100000000 | |
23 | 23 | ||
24 | 24 | let k = 10000000000 | |
25 | 25 | ||
26 | 26 | let l = toBigInt(10000000000000000) | |
27 | 27 | ||
28 | 28 | let m = 1000000 | |
29 | 29 | ||
30 | 30 | let n = "A_asset_balance" | |
31 | 31 | ||
32 | 32 | let o = "B_asset_balance" | |
33 | 33 | ||
34 | 34 | let p = "A_asset_id" | |
35 | 35 | ||
36 | 36 | let q = "B_asset_id" | |
37 | 37 | ||
38 | 38 | let r = "share_asset_id" | |
39 | 39 | ||
40 | 40 | let s = "share_asset_supply" | |
41 | 41 | ||
42 | 42 | let t = "commission" | |
43 | 43 | ||
44 | 44 | let u = "_user_position" | |
45 | 45 | ||
46 | 46 | let v = "_user_position_pool" | |
47 | 47 | ||
48 | 48 | let w = "_user_position_borrow_amount" | |
49 | 49 | ||
50 | 50 | let x = "_user_position_borrow_asset_id" | |
51 | 51 | ||
52 | 52 | let y = "_user_position_number" | |
53 | 53 | ||
54 | 54 | let z = "_user_position_interest" | |
55 | 55 | ||
56 | 56 | let A = "_pool_total" | |
57 | 57 | ||
58 | 58 | let B = "_pool_total_loan" | |
59 | 59 | ||
60 | 60 | let C = "_pool_interest_loan" | |
61 | 61 | ||
62 | 62 | let D = "_pool_interest_no_loan" | |
63 | 63 | ||
64 | 64 | let E = "_pool_can_borrow" | |
65 | 65 | ||
66 | 66 | let F = "_axly_fee_without_loan" | |
67 | 67 | ||
68 | 68 | let G = "_axly_fee_with_loan" | |
69 | 69 | ||
70 | 70 | let H = "_axly_fee_cap_with_loan" | |
71 | 71 | ||
72 | 72 | let I = "_axly_fee_cap_no_loan" | |
73 | 73 | ||
74 | 74 | let J = "_axly_fee_stoploss_with_loan" | |
75 | 75 | ||
76 | 76 | let K = "_axly_fee_stoploss_no_loan" | |
77 | 77 | ||
78 | 78 | let L = "_request_id" | |
79 | 79 | ||
80 | 80 | let M = "requests_iter" | |
81 | 81 | ||
82 | 82 | let N = "pool_" | |
83 | 83 | ||
84 | 84 | let O = "_pool_share_id" | |
85 | 85 | ||
86 | 86 | let P = "_pool_cap_change" | |
87 | 87 | ||
88 | 88 | let Q = "last_price" | |
89 | 89 | ||
90 | - | let R = "_ | |
90 | + | let R = "_twap5B" | |
91 | 91 | ||
92 | - | let S = " | |
92 | + | let S = "_stop_loss" | |
93 | 93 | ||
94 | - | let T = " | |
94 | + | let T = "axly_money_box" | |
95 | 95 | ||
96 | - | let U = " | |
96 | + | let U = "swopfi_farming_addr" | |
97 | 97 | ||
98 | - | let V = " | |
98 | + | let V = "lend_service_addr" | |
99 | 99 | ||
100 | - | let W = " | |
100 | + | let W = "admin_call_pub_key" | |
101 | 101 | ||
102 | - | let X = " | |
102 | + | let X = "price_oracle" | |
103 | 103 | ||
104 | - | let Y = " | |
104 | + | let Y = "exchange_contract" | |
105 | 105 | ||
106 | - | let Z = " | |
106 | + | let Z = "wx_swap_contract" | |
107 | 107 | ||
108 | - | let aa = " | |
108 | + | let aa = "swop_id" | |
109 | 109 | ||
110 | - | let ab = | |
110 | + | let ab = "wx_id" | |
111 | 111 | ||
112 | - | let ac = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
112 | + | let ac = Address(fromBase58String(valueOrErrorMessage(getString(this, T), "No axly moneyBox address"))) | |
113 | 113 | ||
114 | - | let ad = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
114 | + | let ad = Address(fromBase58String(valueOrErrorMessage(getString(this, Y), "No exchange contract address"))) | |
115 | 115 | ||
116 | - | let ae = Address(fromBase58String(valueOrErrorMessage(getString(this, | |
116 | + | let ae = Address(fromBase58String(valueOrErrorMessage(getString(this, X), "No price oracle address"))) | |
117 | 117 | ||
118 | - | let af = fromBase58String(valueOrErrorMessage(getString(this, Z), "No | |
118 | + | let af = Address(fromBase58String(valueOrErrorMessage(getString(this, Z), "No wx swap address"))) | |
119 | 119 | ||
120 | - | let ag = fromBase58String(valueOrErrorMessage(getString(this, aa), "No | |
120 | + | let ag = fromBase58String(valueOrErrorMessage(getString(this, aa), "No swop id")) | |
121 | 121 | ||
122 | - | func ah () = Address(fromBase58String(valueOrErrorMessage(getString(this, U), "Can't get lend service addr"))) | |
122 | + | let ah = fromBase58String(valueOrErrorMessage(getString(this, ab), "No wx id")) | |
123 | + | ||
124 | + | func ai () = Address(fromBase58String(valueOrErrorMessage(getString(this, V), "Can't get lend service addr"))) | |
123 | 125 | ||
124 | 126 | ||
125 | - | func | |
127 | + | func aj () = addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, W), "Can't get admin addr"))) | |
126 | 128 | ||
127 | 129 | ||
128 | - | func | |
130 | + | func ak (al) = if ((al.caller == aj())) | |
129 | 131 | then unit | |
130 | 132 | else throw("Only admin can call this function") | |
131 | 133 | ||
132 | 134 | ||
133 | - | func | |
135 | + | func am (al) = if ((al.caller == this)) | |
134 | 136 | then unit | |
135 | 137 | else throw("Only contract itself can call this function") | |
136 | 138 | ||
137 | 139 | ||
138 | - | func | |
140 | + | func an (al) = if ((al.caller == ai())) | |
139 | 141 | then unit | |
140 | 142 | else throw("Only land contract can call this function") | |
141 | 143 | ||
142 | 144 | ||
143 | - | func | |
144 | - | let | |
145 | - | if ($isInstanceOf( | |
145 | + | func ao (ap) = { | |
146 | + | let aq = ap | |
147 | + | if ($isInstanceOf(aq, "ByteVector")) | |
146 | 148 | then { | |
147 | - | let | |
148 | - | assetBalance(this, | |
149 | + | let ar = aq | |
150 | + | assetBalance(this, ar) | |
149 | 151 | } | |
150 | - | else if ($isInstanceOf( | |
152 | + | else if ($isInstanceOf(aq, "Unit")) | |
151 | 153 | then { | |
152 | - | let | |
154 | + | let as = aq | |
153 | 155 | wavesBalance(this).available | |
154 | 156 | } | |
155 | 157 | else throw("Match error") | |
156 | 158 | } | |
157 | 159 | ||
158 | 160 | ||
159 | - | func | |
161 | + | func at (au) = $Tuple5(valueOrErrorMessage(getString(au, p), "Can't get pool A asset id"), valueOrErrorMessage(getString(au, q), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(au, n), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(au, o), "Can't get pool B asset balance"), valueOrErrorMessage(getString(au, r), "Can't get share asset id")) | |
160 | 162 | ||
161 | 163 | ||
162 | - | func | |
163 | - | let | |
164 | - | let | |
165 | - | if ($isInstanceOf( | |
166 | - | then | |
167 | - | else throw(($getType( | |
164 | + | func av (au) = { | |
165 | + | let aw = { | |
166 | + | let ax = invoke(au, "getPoolConfigWrapperREADONLY", nil, nil) | |
167 | + | if ($isInstanceOf(ax, "List[Any]")) | |
168 | + | then ax | |
169 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
168 | 170 | } | |
169 | - | if (( | |
171 | + | if ((aw == aw)) | |
170 | 172 | then { | |
171 | - | let | |
172 | - | let | |
173 | - | if ($isInstanceOf( | |
174 | - | then | |
173 | + | let ay = valueOrErrorMessage({ | |
174 | + | let ax = aw[4] | |
175 | + | if ($isInstanceOf(ax, "String")) | |
176 | + | then ax | |
175 | 177 | else unit | |
176 | 178 | }, "Can't get pool A asset id") | |
177 | - | let | |
178 | - | let | |
179 | - | if ($isInstanceOf( | |
180 | - | then | |
179 | + | let az = valueOrErrorMessage({ | |
180 | + | let ax = aw[5] | |
181 | + | if ($isInstanceOf(ax, "String")) | |
182 | + | then ax | |
181 | 183 | else unit | |
182 | 184 | }, "Can't get pool B asset id") | |
183 | - | let | |
184 | - | let | |
185 | - | if ($isInstanceOf( | |
186 | - | then | |
185 | + | let aA = valueOrErrorMessage({ | |
186 | + | let ax = aw[3] | |
187 | + | if ($isInstanceOf(ax, "String")) | |
188 | + | then ax | |
187 | 189 | else unit | |
188 | 190 | }, "Can't get pool LP asset id") | |
189 | - | let | |
190 | - | let | |
191 | - | if ($isInstanceOf( | |
192 | - | then | |
193 | - | else throw(($getType( | |
191 | + | let aB = { | |
192 | + | let ax = invoke(au, "getAccBalanceWrapperREADONLY", [ay], nil) | |
193 | + | if ($isInstanceOf(ax, "Int")) | |
194 | + | then ax | |
195 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
194 | 196 | } | |
195 | - | if (( | |
197 | + | if ((aB == aB)) | |
196 | 198 | then { | |
197 | - | let | |
198 | - | let | |
199 | - | if ($isInstanceOf( | |
200 | - | then | |
201 | - | else throw(($getType( | |
199 | + | let aC = { | |
200 | + | let ax = invoke(au, "getAccBalanceWrapperREADONLY", [az], nil) | |
201 | + | if ($isInstanceOf(ax, "Int")) | |
202 | + | then ax | |
203 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
202 | 204 | } | |
203 | - | if (( | |
204 | - | then $Tuple5( | |
205 | + | if ((aC == aC)) | |
206 | + | then $Tuple5(ay, az, aB, aC, aA) | |
205 | 207 | else throw("Strict value is not equal to itself.") | |
206 | 208 | } | |
207 | 209 | else throw("Strict value is not equal to itself.") | |
208 | 210 | } | |
209 | 211 | else throw("Strict value is not equal to itself.") | |
210 | 212 | } | |
211 | 213 | ||
212 | 214 | ||
213 | - | func | |
214 | - | then | |
215 | - | else if (( | |
216 | - | then au | |
215 | + | func aD (au,aE) = if ((aE == a)) | |
216 | + | then at(au) | |
217 | + | else if ((aE == b)) | |
218 | + | then av(au) | |
217 | 219 | else throw("Wrong pool type") | |
218 | 220 | ||
219 | 221 | ||
220 | - | func | |
221 | - | then valueOrErrorMessage(getInteger( | |
222 | - | else if (( | |
223 | - | then valueOrErrorMessage(assetInfo(fromBase58String( | |
222 | + | func aF (au,aE,aA) = if ((aE == a)) | |
223 | + | then valueOrErrorMessage(getInteger(au, s), "Can't get share asset supply") | |
224 | + | else if ((aE == b)) | |
225 | + | then valueOrErrorMessage(assetInfo(fromBase58String(aA)), "Wrong ShareId").quantity | |
224 | 226 | else throw("Wrong pool type") | |
225 | 227 | ||
226 | 228 | ||
227 | - | func | |
229 | + | func aG (aH) = valueOrElse(getInteger(this, (aH + A)), 0) | |
228 | 230 | ||
229 | 231 | ||
230 | - | func | |
232 | + | func aI (aH) = valueOrElse(getInteger(this, (aH + B)), 0) | |
231 | 233 | ||
232 | 234 | ||
233 | - | func | |
235 | + | func aJ (aK) = (valueOrElse(getInteger(this, (aK + y)), 0) + 1) | |
234 | 236 | ||
235 | 237 | ||
236 | - | func | |
237 | - | then getIntegerValue(this, ( | |
238 | - | else if (( | |
239 | - | then getIntegerValue(this, ( | |
240 | - | else if (( | |
241 | - | then getIntegerValue(this, ( | |
242 | - | else if (( | |
243 | - | then getIntegerValue(this, ( | |
244 | - | else if (( | |
238 | + | func aL (aH,aM) = if ((aM == d)) | |
239 | + | then getIntegerValue(this, (aH + I)) | |
240 | + | else if ((aM == c)) | |
241 | + | then getIntegerValue(this, (aH + H)) | |
242 | + | else if ((aM == g)) | |
243 | + | then getIntegerValue(this, (aH + G)) | |
244 | + | else if ((aM == h)) | |
245 | + | then getIntegerValue(this, (aH + F)) | |
246 | + | else if ((aM == i)) | |
245 | 247 | then 0 | |
246 | 248 | else throw("Wrong fee type") | |
247 | 249 | ||
248 | 250 | ||
249 | - | func | |
251 | + | func aN () = Address(fromBase58String(valueOrErrorMessage(getString(this, U), "Can't get swopfi farming addr"))) | |
250 | 252 | ||
251 | 253 | ||
252 | - | func | |
253 | - | let | |
254 | - | let | |
255 | - | Address(fromBase58String( | |
254 | + | func aO (au) = { | |
255 | + | let aP = Address(fromBase58String(valueOrErrorMessage(getString(au, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
256 | + | let aQ = split(valueOrErrorMessage(getString(aP, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
257 | + | Address(fromBase58String(aQ[1])) | |
256 | 258 | } | |
257 | 259 | ||
258 | 260 | ||
259 | - | func | |
260 | - | let | |
261 | - | if ($isInstanceOf( | |
261 | + | func aR (ap) = { | |
262 | + | let aq = ap | |
263 | + | if ($isInstanceOf(aq, "ByteVector")) | |
262 | 264 | then { | |
263 | - | let | |
264 | - | toBase58String( | |
265 | + | let ar = aq | |
266 | + | toBase58String(ar) | |
265 | 267 | } | |
266 | - | else if ($isInstanceOf( | |
268 | + | else if ($isInstanceOf(aq, "Unit")) | |
267 | 269 | then { | |
268 | - | let | |
270 | + | let as = aq | |
269 | 271 | "WAVES" | |
270 | 272 | } | |
271 | 273 | else throw("Not Asset id") | |
272 | 274 | } | |
273 | 275 | ||
274 | 276 | ||
275 | - | func | |
277 | + | func aS (ap) = if ((ap == "WAVES")) | |
276 | 278 | then unit | |
277 | - | else fromBase58String( | |
279 | + | else fromBase58String(ap) | |
278 | 280 | ||
279 | 281 | ||
280 | - | func | |
282 | + | func aT (ap) = if ((ap == "WAVES")) | |
281 | 283 | then 8 | |
282 | 284 | else { | |
283 | - | let | |
284 | - | if ($isInstanceOf( | |
285 | + | let aq = assetInfo(fromBase58String(ap)) | |
286 | + | if ($isInstanceOf(aq, "Asset")) | |
285 | 287 | then { | |
286 | - | let | |
287 | - | | |
288 | + | let aU = aq | |
289 | + | aU.decimals | |
288 | 290 | } | |
289 | 291 | else throw("Can't find asset") | |
290 | 292 | } | |
291 | 293 | ||
292 | 294 | ||
293 | - | func | |
295 | + | func aV (ap) = pow(10, 0, aT(ap), 0, 0, DOWN) | |
294 | 296 | ||
295 | 297 | ||
296 | - | func aV (aW) = { | |
297 | - | func aX (aY,ao) = { | |
298 | - | let aZ = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
299 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
300 | - | then aw | |
301 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
302 | - | (aY :+ aZ) | |
298 | + | func aW (aX) = { | |
299 | + | func aY (aZ,ap) = { | |
300 | + | let ba = getIntegerValue(ae, (ap + R)) | |
301 | + | (aZ :+ ba) | |
303 | 302 | } | |
304 | 303 | ||
305 | - | let | |
306 | - | let | |
307 | - | let | |
308 | - | func | |
309 | - | then | |
310 | - | else | |
304 | + | let bb = aX | |
305 | + | let bc = size(bb) | |
306 | + | let bd = nil | |
307 | + | func be (bf,bg) = if ((bg >= bc)) | |
308 | + | then bf | |
309 | + | else aY(bf, bb[bg]) | |
311 | 310 | ||
312 | - | func | |
313 | - | then | |
311 | + | func bh (bf,bg) = if ((bg >= bc)) | |
312 | + | then bf | |
314 | 313 | else throw("List size exceeds 50") | |
315 | 314 | ||
316 | - | | |
315 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 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), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
317 | 316 | } | |
318 | 317 | ||
319 | 318 | ||
320 | - | func bh (az) = { | |
321 | - | let aG = valueOrErrorMessage(getString(this, (az + O)), "Can't find pool addr by share id") | |
322 | - | let at = Address(fromBase58String(aG)) | |
323 | - | let bi = valueOrErrorMessage(getString(this, (N + aG)), "Pool is not inited") | |
324 | - | let bj = aC(at, bi) | |
325 | - | let ax = bj._1 | |
326 | - | let ay = bj._2 | |
327 | - | let bk = bj._3 | |
328 | - | let bl = bj._4 | |
329 | - | let bm = ( let aw = invoke(ad, "getTWAP60", [ax, false], nil) | |
330 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
331 | - | then aw | |
332 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
333 | - | let bn = ( let aw = invoke(ad, "getTWAP60", [ay, false], nil) | |
334 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
335 | - | then aw | |
336 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
337 | - | let bo = aE(at, bi, az) | |
338 | - | let bp = pow(10, 0, aS(ax), 0, 0, DOWN) | |
339 | - | let bq = pow(10, 0, aS(ay), 0, 0, DOWN) | |
340 | - | let br = pow(10, 0, aS(az), 0, 0, DOWN) | |
341 | - | let bs = (fraction(bk, bm, bp) + fraction(bl, bn, bq)) | |
342 | - | fraction(bs, br, bo) | |
319 | + | func bi (aA) = { | |
320 | + | let aH = valueOrErrorMessage(getString(this, (aA + O)), "Can't find pool addr by share id") | |
321 | + | let au = Address(fromBase58String(aH)) | |
322 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
323 | + | let bk = aD(au, bj) | |
324 | + | let ay = bk._1 | |
325 | + | let az = bk._2 | |
326 | + | let bl = bk._3 | |
327 | + | let bm = bk._4 | |
328 | + | let bn = getIntegerValue(ae, (ay + R)) | |
329 | + | let bo = getIntegerValue(ae, (az + R)) | |
330 | + | let bp = aF(au, bj, aA) | |
331 | + | let bq = pow(10, 0, aT(ay), 0, 0, DOWN) | |
332 | + | let br = pow(10, 0, aT(az), 0, 0, DOWN) | |
333 | + | let bs = pow(10, 0, aT(aA), 0, 0, DOWN) | |
334 | + | let bt = (fraction(bl, bn, bq) + fraction(bm, bo, br)) | |
335 | + | fraction(bt, bs, bp) | |
343 | 336 | } | |
344 | 337 | ||
345 | 338 | ||
346 | - | func | |
347 | - | func | |
339 | + | func bu (bv) = { | |
340 | + | func aY (aZ,aA) = (aZ :+ bi(aA)) | |
348 | 341 | ||
349 | - | let | |
350 | - | let | |
351 | - | let | |
352 | - | func | |
353 | - | then | |
354 | - | else | |
342 | + | let bb = bv | |
343 | + | let bc = size(bb) | |
344 | + | let bd = nil | |
345 | + | func be (bf,bg) = if ((bg >= bc)) | |
346 | + | then bf | |
347 | + | else aY(bf, bb[bg]) | |
355 | 348 | ||
356 | - | func | |
357 | - | then | |
349 | + | func bh (bf,bg) = if ((bg >= bc)) | |
350 | + | then bf | |
358 | 351 | else throw("List size exceeds 20") | |
359 | 352 | ||
360 | - | | |
353 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
361 | 354 | } | |
362 | 355 | ||
363 | 356 | ||
364 | - | func | |
365 | - | let | |
366 | - | let | |
367 | - | let | |
368 | - | [StringEntry(Q, makeString( | |
357 | + | func bw (ay,az,aA) = { | |
358 | + | let bx = aW([ay, az]) | |
359 | + | let by = bi(aA) | |
360 | + | let bz = [toString(bx[0]), toString(bx[1]), toString(by)] | |
361 | + | [StringEntry(Q, makeString(bz, ","))] | |
369 | 362 | } | |
370 | 363 | ||
371 | 364 | ||
372 | - | func | |
365 | + | func bA (bj,au,bB,ay,bC,az,aB,aC) = if ((bj == a)) | |
373 | 366 | then { | |
374 | - | let | |
375 | - | let | |
376 | - | if ($isInstanceOf( | |
377 | - | then | |
378 | - | else throw(($getType( | |
367 | + | let bD = { | |
368 | + | let ax = invoke(au, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(bB), toString(bC)]], nil) | |
369 | + | if ($isInstanceOf(ax, "List[Any]")) | |
370 | + | then ax | |
371 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
379 | 372 | } | |
380 | - | if (( | |
373 | + | if ((bD == bD)) | |
381 | 374 | then $Tuple5({ | |
382 | - | let | |
383 | - | if ($isInstanceOf( | |
384 | - | then | |
385 | - | else throw(($getType( | |
375 | + | let ax = bD[3] | |
376 | + | if ($isInstanceOf(ax, "Int")) | |
377 | + | then ax | |
378 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
386 | 379 | }, { | |
387 | - | let | |
388 | - | if ($isInstanceOf( | |
389 | - | then | |
390 | - | else throw(($getType( | |
380 | + | let ax = bD[4] | |
381 | + | if ($isInstanceOf(ax, "Int")) | |
382 | + | then ax | |
383 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
391 | 384 | }, { | |
392 | - | let | |
393 | - | if ($isInstanceOf( | |
394 | - | then | |
395 | - | else throw(($getType( | |
396 | - | }, | |
397 | - | let | |
398 | - | if ($isInstanceOf( | |
399 | - | then | |
400 | - | else throw(($getType( | |
385 | + | let ax = bD[1] | |
386 | + | if ($isInstanceOf(ax, "Int")) | |
387 | + | then ax | |
388 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
389 | + | }, aR(bD[2]), { | |
390 | + | let ax = bD[0] | |
391 | + | if ($isInstanceOf(ax, "Int")) | |
392 | + | then ax | |
393 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
401 | 394 | }) | |
402 | 395 | else throw("Strict value is not equal to itself.") | |
403 | 396 | } | |
404 | 397 | else { | |
405 | - | let | |
406 | - | let | |
407 | - | if ($isInstanceOf( | |
408 | - | then | |
409 | - | else throw(($getType( | |
398 | + | let bE = $Tuple2(split({ | |
399 | + | let ax = invoke(au, "evaluatePutByAmountAssetREADONLY", [bB], nil) | |
400 | + | if ($isInstanceOf(ax, "String")) | |
401 | + | then ax | |
402 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
410 | 403 | }, "__"), split({ | |
411 | - | let | |
412 | - | if ($isInstanceOf( | |
413 | - | then | |
414 | - | else throw(($getType( | |
404 | + | let ax = invoke(au, "evaluatePutByPriceAssetREADONLY", [bC], nil) | |
405 | + | if ($isInstanceOf(ax, "String")) | |
406 | + | then ax | |
407 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
415 | 408 | }, "__")) | |
416 | - | if (( | |
409 | + | if ((bE == bE)) | |
417 | 410 | then { | |
418 | - | let | |
419 | - | let | |
420 | - | let | |
421 | - | let | |
422 | - | if (( | |
411 | + | let bF = bE._2 | |
412 | + | let bG = bE._1 | |
413 | + | let bH = parseIntValue(bG[1]) | |
414 | + | let bI = parseIntValue(bF[1]) | |
415 | + | if ((bI > bH)) | |
423 | 416 | then { | |
424 | - | let | |
425 | - | $Tuple5( | |
417 | + | let bJ = parseIntValue(bG[8]) | |
418 | + | $Tuple5(bB, bJ, (bC - bJ), az, bI) | |
426 | 419 | } | |
427 | 420 | else { | |
428 | - | let | |
429 | - | $Tuple5( | |
421 | + | let bJ = parseIntValue(bG[8]) | |
422 | + | $Tuple5(bJ, bC, (bB - bJ), ay, bH) | |
430 | 423 | } | |
431 | 424 | } | |
432 | 425 | else throw("Strict value is not equal to itself.") | |
433 | 426 | } | |
434 | 427 | ||
435 | 428 | ||
436 | - | func | |
437 | - | let | |
438 | - | if (( | |
439 | - | then invoke( | |
440 | - | else invoke( | |
429 | + | func bK (au,bj,bB,ay,bC,az) = { | |
430 | + | let bL = [AttachedPayment(aS(ay), bB), AttachedPayment(aS(az), bC)] | |
431 | + | if ((bj == a)) | |
432 | + | then invoke(au, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], bL) | |
433 | + | else invoke(au, "put", [1000000, false], bL) | |
441 | 434 | } | |
442 | 435 | ||
443 | 436 | ||
444 | - | func | |
445 | - | let | |
446 | - | if (( | |
447 | - | then invoke( | |
448 | - | else invoke( | |
437 | + | func bM (au,bj,bJ,bN) = { | |
438 | + | let bL = [AttachedPayment(aS(bN), bJ)] | |
439 | + | if ((bj == a)) | |
440 | + | then invoke(au, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], bL) | |
441 | + | else invoke(au, "putOneTkn", [0, false], bL) | |
449 | 442 | } | |
450 | 443 | ||
451 | 444 | ||
452 | - | func | |
453 | - | let | |
454 | - | if (( | |
455 | - | then invoke( | |
456 | - | else invoke( | |
445 | + | func bO (aH,bj,aA,bP) = { | |
446 | + | let bL = [AttachedPayment(fromBase58String(aA), bP)] | |
447 | + | if ((bj == a)) | |
448 | + | then invoke(aN(), "lockShareTokens", [aH, 0], bL) | |
449 | + | else invoke(aO(addressFromStringValue(aH)), "stake", nil, bL) | |
457 | 450 | } | |
458 | 451 | ||
459 | 452 | ||
460 | - | func | |
461 | - | let | |
462 | - | then $Tuple3( | |
463 | - | else if (( | |
464 | - | then $Tuple3( | |
453 | + | func bQ (aH,bj,aA,bP) = { | |
454 | + | let bR = if ((bj == a)) | |
455 | + | then $Tuple3(aN(), "withdrawShareTokens", [aH, bP]) | |
456 | + | else if ((bj == b)) | |
457 | + | then $Tuple3(aO(Address(fromBase58String(aH))), "unstake", [aA, bP]) | |
465 | 458 | else throw("Wrong pool type") | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | if (( | |
471 | - | then | |
459 | + | let bS = bR._1 | |
460 | + | let bT = bR._2 | |
461 | + | let bU = bR._3 | |
462 | + | let bV = invoke(bS, bT, bU, nil) | |
463 | + | if ((bV == bV)) | |
464 | + | then bP | |
472 | 465 | else throw("Strict value is not equal to itself.") | |
473 | 466 | } | |
474 | 467 | ||
475 | 468 | ||
476 | - | func | |
477 | - | let | |
478 | - | let | |
479 | - | let | |
480 | - | let | |
481 | - | let | |
469 | + | func bW (aH,bX,bY,aB,aC,bZ,ca) = { | |
470 | + | let au = Address(fromBase58String(aH)) | |
471 | + | let cb = 1000000 | |
472 | + | let cc = getIntegerValue(au, t) | |
473 | + | let cd = fraction(bZ, cb, (cb - cc)) | |
474 | + | let ce = if ((ca == bX)) | |
482 | 475 | then { | |
483 | - | let | |
484 | - | $Tuple2( | |
476 | + | let cf = fraction(cd, aC, (aB - cd)) | |
477 | + | $Tuple2(cf, bY) | |
485 | 478 | } | |
486 | 479 | else { | |
487 | - | let | |
488 | - | $Tuple2( | |
480 | + | let cf = fraction(cd, aB, (aC - cd)) | |
481 | + | $Tuple2(cf, bX) | |
489 | 482 | } | |
490 | - | let | |
491 | - | let | |
492 | - | $Tuple2( | |
483 | + | let cf = ce._1 | |
484 | + | let cg = ce._2 | |
485 | + | $Tuple2(cg, cf) | |
493 | 486 | } | |
494 | 487 | ||
495 | 488 | ||
496 | - | func | |
497 | - | let | |
498 | - | let | |
499 | - | let | |
500 | - | let | |
489 | + | func ch (aH,bX,bY,aB,aC,bZ,ca) = { | |
490 | + | let ci = getIntegerValue(af, "%s__protocolFee") | |
491 | + | let cj = getIntegerValue(af, "%s__poolFee") | |
492 | + | let ck = toBigInt(100000000) | |
493 | + | let cl = if ((ca == bX)) | |
501 | 494 | then { | |
502 | - | let | |
503 | - | $Tuple2( | |
495 | + | let cf = fraction(bZ, aC, (aB - bZ)) | |
496 | + | $Tuple2(cf, bY) | |
504 | 497 | } | |
505 | 498 | else { | |
506 | - | let | |
507 | - | $Tuple2( | |
499 | + | let cf = fraction(bZ, aB, (aC - bZ)) | |
500 | + | $Tuple2(cf, bX) | |
508 | 501 | } | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | $Tuple2( | |
502 | + | let cf = cl._1 | |
503 | + | let cg = cl._2 | |
504 | + | let cm = toInt(fraction(toBigInt(cf), ck, (ck - toBigInt((ci + cj))), CEILING)) | |
505 | + | $Tuple2(cg, fraction(cm, 102, 100)) | |
513 | 506 | } | |
514 | 507 | ||
515 | 508 | ||
516 | - | func | |
509 | + | func cn (aE,aH,bX,bY,aB,aC,bZ,ca) = if ((aE == a)) | |
517 | 510 | then { | |
518 | - | let | |
519 | - | let | |
520 | - | let | |
521 | - | invoke(addressFromStringValue( | |
511 | + | let co = bW(aH, bX, bY, aB, aC, bZ, ca) | |
512 | + | let cg = co._1 | |
513 | + | let cf = co._2 | |
514 | + | invoke(addressFromStringValue(aH), "callFunction", ["exchange", [toString(bZ)]], [AttachedPayment(aS(cg), cf)]) | |
522 | 515 | } | |
523 | 516 | else { | |
524 | - | let | |
525 | - | let | |
526 | - | let | |
527 | - | invoke( | |
517 | + | let cp = ch(aH, bX, bY, aB, aC, bZ, ca) | |
518 | + | let cg = cp._1 | |
519 | + | let cf = cp._2 | |
520 | + | invoke(af, "swap", [bZ, ca, toString(this)], [AttachedPayment(aS(cg), cf)]) | |
528 | 521 | } | |
529 | 522 | ||
530 | 523 | ||
531 | - | func | |
532 | - | let | |
533 | - | if (( | |
524 | + | func cq (bj,aH,bB,ay,bC,az,aB,aC) = { | |
525 | + | let au = addressFromStringValue(aH) | |
526 | + | if ((bj == a)) | |
534 | 527 | then { | |
535 | - | let | |
536 | - | let | |
537 | - | if ($isInstanceOf( | |
538 | - | then | |
539 | - | else throw(($getType( | |
528 | + | let bV = { | |
529 | + | let ax = invoke(au, "callFunction", ["calcLPReplenishDiffPropREADONLY", [toString(bB), toString(bC), "0"]], nil) | |
530 | + | if ($isInstanceOf(ax, "List[Any]")) | |
531 | + | then ax | |
532 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
540 | 533 | } | |
541 | - | if (( | |
534 | + | if ((bV == bV)) | |
542 | 535 | then $Tuple2({ | |
543 | - | let | |
544 | - | if ($isInstanceOf( | |
545 | - | then | |
546 | - | else throw(($getType( | |
536 | + | let ax = bV[0] | |
537 | + | if ($isInstanceOf(ax, "Int")) | |
538 | + | then ax | |
539 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
547 | 540 | }, { | |
548 | - | let | |
549 | - | if ($isInstanceOf( | |
550 | - | then | |
551 | - | else throw(($getType( | |
541 | + | let ax = bV[1] | |
542 | + | if ($isInstanceOf(ax, "Int")) | |
543 | + | then ax | |
544 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
552 | 545 | }) | |
553 | 546 | else throw("Strict value is not equal to itself.") | |
554 | 547 | } | |
555 | - | else if (( | |
548 | + | else if ((bj == b)) | |
556 | 549 | then { | |
557 | - | let | |
558 | - | then ( | |
550 | + | let cr = if (if ((bB > 0)) | |
551 | + | then (bC > 0) | |
559 | 552 | else false) | |
560 | 553 | then { | |
561 | - | let | |
562 | - | let | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | let | |
567 | - | $Tuple3( | |
554 | + | let cs = bA(bj, au, bB, ay, bC, az, aB, aC) | |
555 | + | let ct = cs._1 | |
556 | + | let cu = cs._2 | |
557 | + | let cv = cs._3 | |
558 | + | let cw = cs._4 | |
559 | + | let cx = cs._5 | |
560 | + | $Tuple3(cv, cw, cx) | |
568 | 561 | } | |
569 | - | else if (( | |
570 | - | then $Tuple3( | |
571 | - | else $Tuple3( | |
572 | - | let | |
573 | - | let | |
574 | - | let | |
575 | - | let | |
562 | + | else if ((bB > 0)) | |
563 | + | then $Tuple3(bB, ay, 0) | |
564 | + | else $Tuple3(bC, az, 0) | |
565 | + | let cv = cr._1 | |
566 | + | let cw = cr._2 | |
567 | + | let cy = cr._3 | |
568 | + | let cz = if ((cv > 0)) | |
576 | 569 | then { | |
577 | - | let | |
578 | - | let | |
579 | - | if ($isInstanceOf( | |
580 | - | then | |
581 | - | else throw(($getType( | |
570 | + | let bV = { | |
571 | + | let ax = invoke(au, "putOneTknREADONLY", [cw, cv], nil) | |
572 | + | if ($isInstanceOf(ax, "(Int, Int, Int)")) | |
573 | + | then ax | |
574 | + | else throw(($getType(ax) + " couldn't be cast to (Int, Int, Int)")) | |
582 | 575 | } | |
583 | - | if (( | |
584 | - | then $Tuple2( | |
576 | + | if ((bV == bV)) | |
577 | + | then $Tuple2(bV._1, bV._3) | |
585 | 578 | else throw("Strict value is not equal to itself.") | |
586 | 579 | } | |
587 | 580 | else $Tuple2(0, 0) | |
588 | - | let | |
589 | - | let | |
590 | - | $Tuple2(( | |
581 | + | let cA = cz._1 | |
582 | + | let cB = cz._2 | |
583 | + | $Tuple2((cy + cA), cB) | |
591 | 584 | } | |
592 | 585 | else throw("Wrong pool type") | |
593 | 586 | } | |
594 | 587 | ||
595 | 588 | ||
596 | - | func | |
597 | - | let | |
598 | - | let | |
589 | + | func cC (bj,aH,cx,aA,ay,az,aB,aC,cD,cE) = { | |
590 | + | let au = addressFromStringValue(aH) | |
591 | + | let cF = if ((bj == a)) | |
599 | 592 | then { | |
600 | - | let | |
601 | - | let | |
602 | - | if ($isInstanceOf( | |
603 | - | then | |
604 | - | else throw(($getType( | |
593 | + | let bV = { | |
594 | + | let ax = invoke(au, "callFunction", ["withdrawREADONLY", [toString(cx), toString(aB), toString(aC)]], nil) | |
595 | + | if ($isInstanceOf(ax, "List[Any]")) | |
596 | + | then ax | |
597 | + | else throw(($getType(ax) + " couldn't be cast to List[Any]")) | |
605 | 598 | } | |
606 | - | if (( | |
599 | + | if ((bV == bV)) | |
607 | 600 | then $Tuple2({ | |
608 | - | let | |
609 | - | if ($isInstanceOf( | |
610 | - | then | |
611 | - | else throw(($getType( | |
601 | + | let ax = bV[0] | |
602 | + | if ($isInstanceOf(ax, "Int")) | |
603 | + | then ax | |
604 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
612 | 605 | }, { | |
613 | - | let | |
614 | - | if ($isInstanceOf( | |
615 | - | then | |
616 | - | else throw(($getType( | |
606 | + | let ax = bV[1] | |
607 | + | if ($isInstanceOf(ax, "Int")) | |
608 | + | then ax | |
609 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
617 | 610 | }) | |
618 | 611 | else throw("Strict value is not equal to itself.") | |
619 | 612 | } | |
620 | - | else if (( | |
613 | + | else if ((bj == b)) | |
621 | 614 | then { | |
622 | - | let | |
623 | - | let | |
624 | - | if ($isInstanceOf( | |
625 | - | then | |
626 | - | else throw(($getType( | |
615 | + | let cG = split({ | |
616 | + | let ax = invoke(au, "evaluateGetREADONLY", [aA, cx], nil) | |
617 | + | if ($isInstanceOf(ax, "String")) | |
618 | + | then ax | |
619 | + | else throw(($getType(ax) + " couldn't be cast to String")) | |
627 | 620 | }, "__") | |
628 | - | if (( | |
629 | - | then $Tuple2(parseIntValue( | |
621 | + | if ((cG == cG)) | |
622 | + | then $Tuple2(parseIntValue(cG[1]), parseIntValue(cG[2])) | |
630 | 623 | else throw("Strict value is not equal to itself.") | |
631 | 624 | } | |
632 | 625 | else throw("Wrong pool type") | |
633 | - | let | |
634 | - | let | |
635 | - | if (( | |
626 | + | let cH = cF._1 | |
627 | + | let cI = cF._2 | |
628 | + | if ((cD > 0)) | |
636 | 629 | then { | |
637 | - | let | |
638 | - | then ( | |
630 | + | let cJ = if (if ((cE == ay)) | |
631 | + | then (cD > cH) | |
639 | 632 | else false) | |
640 | - | then ( | |
641 | - | else if (if (( | |
642 | - | then ( | |
633 | + | then (cD - cH) | |
634 | + | else if (if ((cE == az)) | |
635 | + | then (cD > cI) | |
643 | 636 | else false) | |
644 | - | then ( | |
637 | + | then (cD - cI) | |
645 | 638 | else 0 | |
646 | - | let | |
647 | - | then if (( | |
648 | - | then | |
649 | - | else | |
639 | + | let cK = if ((cJ > 0)) | |
640 | + | then if ((bj == a)) | |
641 | + | then bW(aH, ay, az, aB, aC, cJ, cE) | |
642 | + | else ch(aH, ay, az, aB, aC, cJ, cE) | |
650 | 643 | else $Tuple2("", 0) | |
651 | - | let | |
652 | - | let | |
653 | - | if (( | |
654 | - | then $Tuple2((( | |
655 | - | else $Tuple2(( | |
644 | + | let cg = cK._1 | |
645 | + | let cf = cK._2 | |
646 | + | if ((cE == ay)) | |
647 | + | then $Tuple2(((cH + cJ) - cD), (cI - cf)) | |
648 | + | else $Tuple2((cH - cf), ((cI + cJ) - cD)) | |
656 | 649 | } | |
657 | - | else $Tuple2( | |
650 | + | else $Tuple2(cH, cI) | |
658 | 651 | } | |
659 | 652 | ||
660 | 653 | ||
661 | - | func | |
654 | + | func cL (aE,aH) = if ((aE == a)) | |
662 | 655 | then { | |
663 | - | let | |
664 | - | if (( | |
656 | + | let cM = ao(ag) | |
657 | + | if ((cM == cM)) | |
665 | 658 | then { | |
666 | - | let | |
667 | - | if (( | |
659 | + | let bV = invoke(aN(), "claim", [aH], nil) | |
660 | + | if ((bV == bV)) | |
668 | 661 | then { | |
669 | - | let | |
670 | - | $Tuple2(( | |
662 | + | let cN = ao(ag) | |
663 | + | $Tuple2((cN - cM), ag) | |
671 | 664 | } | |
672 | 665 | else throw("Strict value is not equal to itself.") | |
673 | 666 | } | |
674 | 667 | else throw("Strict value is not equal to itself.") | |
675 | 668 | } | |
676 | - | else if (( | |
669 | + | else if ((aE == b)) | |
677 | 670 | then { | |
678 | - | let | |
679 | - | if (( | |
671 | + | let cM = ao(ah) | |
672 | + | if ((cM == cM)) | |
680 | 673 | then { | |
681 | - | let | |
682 | - | if (( | |
674 | + | let bV = invoke(aO(Address(fromBase58String(aH))), "claimWX", [aH], nil) | |
675 | + | if ((bV == bV)) | |
683 | 676 | then { | |
684 | - | let | |
685 | - | $Tuple2(( | |
677 | + | let cN = ao(ah) | |
678 | + | $Tuple2((cN - cM), ah) | |
686 | 679 | } | |
687 | 680 | else throw("Strict value is not equal to itself.") | |
688 | 681 | } | |
689 | 682 | else throw("Strict value is not equal to itself.") | |
690 | 683 | } | |
691 | 684 | else throw("Wrong pool type") | |
692 | 685 | ||
693 | 686 | ||
694 | - | func | |
695 | - | let | |
696 | - | if (( | |
687 | + | func cO (bj,aH,aM,bB,ay,bC,az,aB,aC,cP) = { | |
688 | + | let cQ = ao(fromBase58String(cP)) | |
689 | + | if ((cQ == cQ)) | |
697 | 690 | then { | |
698 | - | let | |
699 | - | let | |
700 | - | then ( | |
691 | + | let au = addressFromStringValue(aH) | |
692 | + | let cR = if (if ((bB > 0)) | |
693 | + | then (bC > 0) | |
701 | 694 | else false) | |
702 | 695 | then { | |
703 | - | let | |
704 | - | let | |
705 | - | let | |
706 | - | let | |
707 | - | let | |
708 | - | let | |
709 | - | if (( | |
710 | - | then $Tuple2( | |
696 | + | let cS = bA(bj, au, bB, ay, bC, az, aB, aC) | |
697 | + | let ct = cS._1 | |
698 | + | let cu = cS._2 | |
699 | + | let cv = cS._3 | |
700 | + | let cw = cS._4 | |
701 | + | let bV = bK(au, bj, ct, ay, cu, az) | |
702 | + | if ((bV == bV)) | |
703 | + | then $Tuple2(cv, cw) | |
711 | 704 | else throw("Strict value is not equal to itself.") | |
712 | 705 | } | |
713 | - | else if (( | |
714 | - | then $Tuple2( | |
715 | - | else if (( | |
716 | - | then $Tuple2( | |
706 | + | else if ((bB > 0)) | |
707 | + | then $Tuple2(bB, ay) | |
708 | + | else if ((bC > 0)) | |
709 | + | then $Tuple2(bC, az) | |
717 | 710 | else throw("pmts must be > 0") | |
718 | - | let | |
719 | - | let | |
720 | - | let | |
721 | - | then | |
711 | + | let cv = cR._1 | |
712 | + | let cw = cR._2 | |
713 | + | let bV = if ((cv > 0)) | |
714 | + | then bM(au, bj, cv, cw) | |
722 | 715 | else nil | |
723 | - | if (( | |
716 | + | if ((bV == bV)) | |
724 | 717 | then { | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | if ((0 >= | |
718 | + | let cT = ao(fromBase58String(cP)) | |
719 | + | let cU = (cT - cQ) | |
720 | + | let cV = fraction(cU, aL(aH, aM), m) | |
721 | + | let cW = (cU - cV) | |
722 | + | if ((0 >= cW)) | |
730 | 723 | then throw("amount of staked sharetokens must be > 0") | |
731 | 724 | else { | |
732 | - | let | |
733 | - | if (( | |
734 | - | then $Tuple2( | |
725 | + | let cX = bO(aH, bj, cP, cW) | |
726 | + | if ((cX == cX)) | |
727 | + | then $Tuple2(cW, cV) | |
735 | 728 | else throw("Strict value is not equal to itself.") | |
736 | 729 | } | |
737 | 730 | } | |
738 | 731 | else throw("Strict value is not equal to itself.") | |
739 | 732 | } | |
740 | 733 | else throw("Strict value is not equal to itself.") | |
741 | 734 | } | |
742 | 735 | ||
743 | 736 | ||
744 | - | func | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | then $Tuple2(getIntegerValue(this, ( | |
749 | - | else $Tuple2(getIntegerValue(this, ( | |
750 | - | let | |
751 | - | let | |
752 | - | [IntegerEntry(( | |
737 | + | func cY (aH,aK,cZ,cV,da,aA,aE,db) = { | |
738 | + | let dc = aG(aH) | |
739 | + | let dd = aI(aH) | |
740 | + | let de = if (db) | |
741 | + | then $Tuple2(getIntegerValue(this, (aH + C)), (dd + cZ)) | |
742 | + | else $Tuple2(getIntegerValue(this, (aH + D)), dd) | |
743 | + | let df = de._1 | |
744 | + | let dg = de._2 | |
745 | + | [IntegerEntry((aH + A), (dc + cZ)), IntegerEntry((aH + B), dg), IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + u), cZ), IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + z), df), StringEntry((((aK + "_") + toString(da)) + v), aH), IntegerEntry((aK + y), da), ScriptTransfer(ac, cV, fromBase58String(aA))] | |
753 | 746 | } | |
754 | 747 | ||
755 | 748 | ||
756 | - | func | |
757 | - | let | |
758 | - | if (( | |
749 | + | func dh (di,dj,dk,dl,dm,dn,do,dp,dq,dr) = { | |
750 | + | let ds = ao(aS(di)) | |
751 | + | if ((ds == ds)) | |
759 | 752 | then { | |
760 | - | let | |
761 | - | if (( | |
762 | - | then ( | |
753 | + | let bV = invoke(ad, "swap", [dl, dm, dn, do, dp, dq, dr], [AttachedPayment(dk, dj)]) | |
754 | + | if ((bV == bV)) | |
755 | + | then (ao(aS(di)) - ds) | |
763 | 756 | else throw("Strict value is not equal to itself.") | |
764 | 757 | } | |
765 | 758 | else throw("Strict value is not equal to itself.") | |
766 | 759 | } | |
767 | 760 | ||
768 | 761 | ||
769 | - | func | |
770 | - | let | |
771 | - | if (( | |
762 | + | func dt (di,dj,dk,du,dv,dr) = { | |
763 | + | let ds = ao(aS(di)) | |
764 | + | if ((ds == ds)) | |
772 | 765 | then { | |
773 | - | let | |
774 | - | if (( | |
775 | - | then ( | |
766 | + | let bV = invoke(ad, "puzzleSwap", [du, dv, dr], [AttachedPayment(dk, dj)]) | |
767 | + | if ((bV == bV)) | |
768 | + | then (ao(aS(di)) - ds) | |
776 | 769 | else throw("Strict value is not equal to itself.") | |
777 | 770 | } | |
778 | 771 | else throw("Strict value is not equal to itself.") | |
779 | 772 | } | |
780 | 773 | ||
781 | 774 | ||
782 | - | func | |
783 | - | let | |
784 | - | if (( | |
775 | + | func dw (di,dj,dk,dx,dy,dz,dA,dB,dC,dr) = { | |
776 | + | let ds = ao(aS(di)) | |
777 | + | if ((ds == ds)) | |
785 | 778 | then { | |
786 | - | let | |
787 | - | if (( | |
788 | - | then ( | |
779 | + | let bV = invoke(ad, "swopfiSwap", [dx, dy, dz, dA, dB, dC, dr], [AttachedPayment(dk, dj)]) | |
780 | + | if ((bV == bV)) | |
781 | + | then (ao(aS(di)) - ds) | |
789 | 782 | else throw("Strict value is not equal to itself.") | |
790 | 783 | } | |
791 | 784 | else throw("Strict value is not equal to itself.") | |
792 | 785 | } | |
793 | 786 | ||
794 | 787 | ||
795 | - | func | |
796 | - | let | |
797 | - | let | |
798 | - | let | |
799 | - | let | |
800 | - | let | |
801 | - | let | |
802 | - | let | |
803 | - | if (if (( | |
804 | - | then ( | |
788 | + | func dD (aH,bj,dE,dF) = { | |
789 | + | let au = Address(fromBase58String(aH)) | |
790 | + | let dG = aD(au, bj) | |
791 | + | let dH = dG._1 | |
792 | + | let dI = dG._2 | |
793 | + | let aB = dG._3 | |
794 | + | let aC = dG._4 | |
795 | + | let aA = dG._5 | |
796 | + | if (if ((dE != dH)) | |
797 | + | then (dE != dI) | |
805 | 798 | else false) | |
806 | 799 | then throw("Wrong asset") | |
807 | 800 | else { | |
808 | - | let | |
809 | - | then $Tuple2( | |
810 | - | else $Tuple2(0, | |
811 | - | let | |
812 | - | let | |
813 | - | let | |
814 | - | let | |
815 | - | let | |
816 | - | let | |
817 | - | let | |
818 | - | let | |
819 | - | let | |
820 | - | let | |
821 | - | let | |
822 | - | let | |
823 | - | let | |
824 | - | then ( | |
801 | + | let dJ = if ((dE == dH)) | |
802 | + | then $Tuple2(dF, 0) | |
803 | + | else $Tuple2(0, dF) | |
804 | + | let bB = dJ._1 | |
805 | + | let bC = dJ._2 | |
806 | + | let dK = cO(bj, aH, i, bB, dH, bC, dI, aB, aC, aA) | |
807 | + | let cZ = dK._1 | |
808 | + | let dL = dK._2 | |
809 | + | let dM = valueOrElse(getInteger(this, (aH + C)), 0) | |
810 | + | let dN = valueOrElse(getInteger(this, (aH + D)), 0) | |
811 | + | let dO = aG(aH) | |
812 | + | let dP = aI(aH) | |
813 | + | let dQ = fraction(dP, j, dO) | |
814 | + | let dR = fraction(cZ, dQ, j) | |
815 | + | let dS = (cZ - dR) | |
816 | + | let dT = if ((dP > 0)) | |
817 | + | then (dM + fraction(dR, k, dP)) | |
825 | 818 | else 0 | |
826 | - | let | |
827 | - | then ( | |
819 | + | let dU = if (((dO - dP) > 0)) | |
820 | + | then (dN + fraction(dS, k, (dO - dP))) | |
828 | 821 | else 0 | |
829 | - | let | |
830 | - | let | |
831 | - | let | |
832 | - | if (( | |
833 | - | then ([IntegerEntry(( | |
822 | + | let dV = fraction(dR, aL(aH, d), m) | |
823 | + | let dW = fraction(dS, aL(aH, c), m) | |
824 | + | let dX = bQ(aH, bj, aA, (dV + dW)) | |
825 | + | if ((dX == dX)) | |
826 | + | then ([IntegerEntry((aH + C), dT), IntegerEntry((aH + D), dU), IntegerEntry((aH + A), ((dO + cZ) - dX)), IntegerEntry((aH + B), ((dP + dR) - dV)), ScriptTransfer(ac, (dV + dW), fromBase58String(aA))] ++ bw(dH, dI, aA)) | |
834 | 827 | else throw("Strict value is not equal to itself.") | |
835 | 828 | } | |
836 | 829 | } | |
837 | 830 | ||
838 | 831 | ||
839 | - | func | |
840 | - | let | |
841 | - | let | |
842 | - | let | |
843 | - | let | |
844 | - | let | |
845 | - | let | |
846 | - | let | |
847 | - | let | |
848 | - | let | |
849 | - | if (( | |
832 | + | func dY (aH,dZ,ea,eb) = { | |
833 | + | let au = Address(fromBase58String(aH)) | |
834 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Unknown pool") | |
835 | + | let ec = aD(au, bj) | |
836 | + | let bX = ec._1 | |
837 | + | let bY = ec._2 | |
838 | + | let aB = ec._3 | |
839 | + | let aC = ec._4 | |
840 | + | let aA = ec._5 | |
841 | + | let ed = ao(aS(bX)) | |
842 | + | if ((ed == ed)) | |
850 | 843 | then { | |
851 | - | let | |
852 | - | if (( | |
844 | + | let ee = ao(aS(bY)) | |
845 | + | if ((ee == ee)) | |
853 | 846 | then { | |
854 | - | let | |
855 | - | then invoke( | |
847 | + | let bV = if ((bj == a)) | |
848 | + | then invoke(au, "callFunction", ["withdraw", [toString(dZ)]], nil) | |
856 | 849 | else { | |
857 | - | let | |
858 | - | if (( | |
859 | - | then invoke( | |
850 | + | let bV = bQ(aH, bj, aA, dZ) | |
851 | + | if ((bV == bV)) | |
852 | + | then invoke(au, "get", nil, [AttachedPayment(aS(aA), dZ)]) | |
860 | 853 | else throw("Strict value is not equal to itself.") | |
861 | 854 | } | |
862 | - | if (( | |
855 | + | if ((bV == bV)) | |
863 | 856 | then { | |
864 | - | let | |
865 | - | let | |
866 | - | let | |
867 | - | let | |
868 | - | let | |
869 | - | let | |
857 | + | let ef = ao(aS(bX)) | |
858 | + | let eg = ao(aS(bY)) | |
859 | + | let eh = $Tuple2((ef - ed), (eg - ee)) | |
860 | + | let ei = eh._1 | |
861 | + | let ej = eh._2 | |
862 | + | let ek = if ((ea > 0)) | |
870 | 863 | then { | |
871 | - | let | |
872 | - | then ( | |
864 | + | let cJ = if (if ((eb == bX)) | |
865 | + | then (ea > ei) | |
873 | 866 | else false) | |
874 | - | then ( | |
875 | - | else if (if (( | |
876 | - | then ( | |
867 | + | then (ea - ei) | |
868 | + | else if (if ((eb == bY)) | |
869 | + | then (ea > ej) | |
877 | 870 | else false) | |
878 | - | then ( | |
871 | + | then (ea - ej) | |
879 | 872 | else 0 | |
880 | - | let | |
881 | - | then | |
873 | + | let el = if ((cJ > 0)) | |
874 | + | then cn(bj, aH, bX, bY, aB, aC, cJ, eb) | |
882 | 875 | else 0 | |
883 | - | if (( | |
876 | + | if ((el == el)) | |
884 | 877 | then { | |
885 | - | let | |
886 | - | let | |
887 | - | if (( | |
888 | - | then $Tuple2((( | |
889 | - | else $Tuple2(( | |
878 | + | let em = ao(aS(bX)) | |
879 | + | let en = ao(aS(bY)) | |
880 | + | if ((eb == bX)) | |
881 | + | then $Tuple2(((em - ed) - ea), (en - ee)) | |
882 | + | else $Tuple2((em - ed), ((en - ee) - ea)) | |
890 | 883 | } | |
891 | 884 | else throw("Strict value is not equal to itself.") | |
892 | 885 | } | |
893 | - | else $Tuple2( | |
894 | - | let | |
895 | - | let | |
896 | - | $Tuple7( | |
886 | + | else $Tuple2(ei, ej) | |
887 | + | let eo = ek._1 | |
888 | + | let ep = ek._2 | |
889 | + | $Tuple7(eo, bX, ep, bY, ef, eg, aA) | |
897 | 890 | } | |
898 | 891 | else throw("Strict value is not equal to itself.") | |
899 | 892 | } | |
900 | 893 | else throw("Strict value is not equal to itself.") | |
901 | 894 | } | |
902 | 895 | else throw("Strict value is not equal to itself.") | |
903 | 896 | } | |
904 | 897 | ||
905 | 898 | ||
906 | - | func | |
907 | - | let | |
908 | - | let | |
909 | - | let | |
910 | - | then getIntegerValue(this, ( | |
911 | - | else getIntegerValue(this, ( | |
912 | - | ( | |
899 | + | func eq (aK,aH,er,es) = { | |
900 | + | let et = valueOrErrorMessage(getInteger(this, (((((aH + "_") + aK) + "_") + er) + u)), "Unknown position") | |
901 | + | let eu = getIntegerValue(this, (((((aH + "_") + aK) + "_") + er) + z)) | |
902 | + | let ev = if (es) | |
903 | + | then getIntegerValue(this, (aH + C)) | |
904 | + | else getIntegerValue(this, (aH + D)) | |
905 | + | (et + fraction(et, (ev - eu), k)) | |
913 | 906 | } | |
914 | 907 | ||
915 | 908 | ||
916 | - | func | |
917 | - | let | |
918 | - | let | |
919 | - | let | |
920 | - | let | |
921 | - | let | |
922 | - | let | |
923 | - | let | |
909 | + | func ew (aK,aH,er,ex) = { | |
910 | + | let et = valueOrErrorMessage(getInteger(this, (((((aH + "_") + aK) + "_") + er) + u)), "Unknown position") | |
911 | + | let cD = valueOrElse(getInteger(this, (((((aH + "_") + aK) + "_") + er) + w)), 0) | |
912 | + | let dZ = eq(aK, aH, er, (cD > 0)) | |
913 | + | let ey = aG(aH) | |
914 | + | let ez = Address(fromBase58String(aK)) | |
915 | + | let eb = valueOrElse(getString(this, (((((aH + "_") + aK) + "_") + er) + x)), "") | |
916 | + | let ea = if ((cD > 0)) | |
924 | 917 | then { | |
925 | - | let | |
926 | - | if ($isInstanceOf( | |
927 | - | then | |
928 | - | else throw(($getType( | |
918 | + | let ax = invoke(ai(), "getAssetDebt", [false, ((aK + "_") + er), eb], nil) | |
919 | + | if ($isInstanceOf(ax, "Int")) | |
920 | + | then ax | |
921 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
929 | 922 | } | |
930 | 923 | else 0 | |
931 | - | let | |
932 | - | if (( | |
924 | + | let eA = dY(aH, dZ, ea, eb) | |
925 | + | if ((eA == eA)) | |
933 | 926 | then { | |
934 | - | let | |
935 | - | let | |
936 | - | let | |
937 | - | let | |
938 | - | let | |
939 | - | let | |
940 | - | let | |
941 | - | let | |
942 | - | then invoke( | |
927 | + | let aA = eA._7 | |
928 | + | let eg = eA._6 | |
929 | + | let ef = eA._5 | |
930 | + | let bY = eA._4 | |
931 | + | let eB = eA._3 | |
932 | + | let bX = eA._2 | |
933 | + | let eC = eA._1 | |
934 | + | let eD = if ((ea > 0)) | |
935 | + | then invoke(ai(), "repayFor", [((aK + "_") + er)], [AttachedPayment(aS(eb), ea)]) | |
943 | 936 | else 0 | |
944 | - | if (( | |
945 | - | then ([DeleteEntry(((((( | |
937 | + | if ((eD == eD)) | |
938 | + | then ([DeleteEntry((((((aH + "_") + aK) + "_") + er) + u)), DeleteEntry((((((aH + "_") + aK) + "_") + er) + z)), IntegerEntry((aH + A), (ey - dZ)), ScriptTransfer(ez, eC, aS(bX)), ScriptTransfer(ez, eB, aS(bY))] ++ bw(bX, bY, aA)) | |
946 | 939 | else throw("Strict value is not equal to itself.") | |
947 | 940 | } | |
948 | 941 | else throw("Strict value is not equal to itself.") | |
949 | 942 | } | |
950 | 943 | ||
951 | 944 | ||
952 | - | func | |
953 | - | let | |
954 | - | let | |
955 | - | let | |
956 | - | let | |
957 | - | let | |
958 | - | let | |
959 | - | let | |
960 | - | let | |
961 | - | let | |
962 | - | let | |
963 | - | let | |
964 | - | let | |
965 | - | $Tuple11( | |
945 | + | func eE (eF) = { | |
946 | + | let eG = split(valueOrErrorMessage(getString(this, (eF + L)), ("No request with id " + eF)), ",") | |
947 | + | let aK = eG[0] | |
948 | + | let aH = eG[1] | |
949 | + | let bB = parseIntValue(eG[2]) | |
950 | + | let dH = eG[3] | |
951 | + | let bC = parseIntValue(eG[4]) | |
952 | + | let dI = eG[5] | |
953 | + | let aB = parseIntValue(eG[6]) | |
954 | + | let aC = parseIntValue(eG[7]) | |
955 | + | let aA = eG[8] | |
956 | + | let eH = eG[9] | |
957 | + | let eI = parseIntValue(eG[10]) | |
958 | + | $Tuple11(aK, aH, bB, dH, bC, dI, aB, aC, aA, eH, eI) | |
966 | 959 | } | |
967 | 960 | ||
968 | 961 | ||
969 | - | func eI (bA,bB,ax,ay,eJ,eK) = { | |
970 | - | let bm = ( let aw = invoke(ad, "getTWAP60", [ax, false], nil) | |
971 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
972 | - | then aw | |
973 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
974 | - | let bn = ( let aw = invoke(ad, "getTWAP60", [ay, false], nil) | |
975 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
976 | - | then aw | |
977 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._2 | |
978 | - | let eL = pow(10, 0, aS(ax), 0, 0, DOWN) | |
979 | - | let eM = pow(10, 0, aS(ay), 0, 0, DOWN) | |
980 | - | let eN = (fraction(bm, bA, eL) + fraction(bn, bB, eM)) | |
981 | - | let eO = if ((eK == ax)) | |
982 | - | then $Tuple2(bm, eL) | |
983 | - | else $Tuple2(bn, eM) | |
984 | - | let eP = eO._1 | |
985 | - | let eQ = eO._2 | |
986 | - | fraction(fraction(eN, (eJ - 100), 100), eQ, eP) | |
962 | + | func eJ (bB,bC,ay,az,eK,eL) = { | |
963 | + | let bn = getIntegerValue(ae, (ay + R)) | |
964 | + | let bo = getIntegerValue(ae, (az + R)) | |
965 | + | let eM = pow(10, 0, aT(ay), 0, 0, DOWN) | |
966 | + | let eN = pow(10, 0, aT(az), 0, 0, DOWN) | |
967 | + | let eO = (fraction(bn, bB, eM) + fraction(bo, bC, eN)) | |
968 | + | let eP = if ((eL == ay)) | |
969 | + | then $Tuple2(bn, eM) | |
970 | + | else $Tuple2(bo, eN) | |
971 | + | let eQ = eP._1 | |
972 | + | let eR = eP._2 | |
973 | + | fraction(fraction(eO, (eK - 100), 100), eR, eQ) | |
987 | 974 | } | |
988 | 975 | ||
989 | 976 | ||
990 | - | @Callable( | |
991 | - | func calcPriceImpactEVALONLY ( | |
977 | + | @Callable(al) | |
978 | + | func calcPriceImpactEVALONLY (aH,eK,eL,bB,bC) = if (if ((100 > eK)) | |
992 | 979 | then true | |
993 | - | else ( | |
980 | + | else (eK > 300)) | |
994 | 981 | then throw("Leverage can't be <100 and >300") | |
995 | 982 | else { | |
996 | - | let | |
997 | - | let | |
998 | - | let | |
999 | - | let | |
1000 | - | let | |
1001 | - | let | |
1002 | - | let | |
1003 | - | let | |
1004 | - | then | |
983 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
984 | + | let eS = aD(Address(fromBase58String(aH)), bj) | |
985 | + | let dH = eS._1 | |
986 | + | let dI = eS._2 | |
987 | + | let aB = eS._3 | |
988 | + | let aC = eS._4 | |
989 | + | let aA = eS._5 | |
990 | + | let cD = if ((eK > 100)) | |
991 | + | then eJ(bB, bC, dH, dI, eK, eL) | |
1005 | 992 | else 0 | |
1006 | - | let | |
1007 | - | then $Tuple2(( | |
1008 | - | else $Tuple2( | |
1009 | - | let | |
1010 | - | let | |
1011 | - | let | |
1012 | - | let | |
1013 | - | let | |
1014 | - | let | |
1015 | - | then ( | |
1016 | - | else | |
1017 | - | $Tuple2(nil, [ | |
993 | + | let eT = if ((eL == dH)) | |
994 | + | then $Tuple2((bB + cD), bC) | |
995 | + | else $Tuple2(bB, (bC + cD)) | |
996 | + | let eU = eT._1 | |
997 | + | let eV = eT._2 | |
998 | + | let eW = cq(bj, aH, eU, dH, eV, dI, aB, aC) | |
999 | + | let cx = eW._1 | |
1000 | + | let cB = eW._2 | |
1001 | + | let eX = if ((0 > cB)) | |
1002 | + | then (cB * -1) | |
1003 | + | else cB | |
1004 | + | $Tuple2(nil, [eX]) | |
1018 | 1005 | } | |
1019 | 1006 | ||
1020 | 1007 | ||
1021 | 1008 | ||
1022 | - | @Callable( | |
1023 | - | func getShareAssetPriceREADONLY ( | |
1024 | - | let | |
1025 | - | $Tuple2(nil, | |
1009 | + | @Callable(al) | |
1010 | + | func getShareAssetPriceREADONLY (aA) = { | |
1011 | + | let eY = bi(aA) | |
1012 | + | $Tuple2(nil, eY) | |
1026 | 1013 | } | |
1027 | 1014 | ||
1028 | 1015 | ||
1029 | 1016 | ||
1030 | - | @Callable( | |
1031 | - | func getUserPositionShareAmountREADONLY ( | |
1032 | - | let | |
1033 | - | let | |
1034 | - | let | |
1035 | - | $Tuple2(nil, | |
1017 | + | @Callable(al) | |
1018 | + | func getUserPositionShareAmountREADONLY (aK,da) = { | |
1019 | + | let aH = valueOrErrorMessage(getString(this, (((aK + "_") + da) + v)), "Unknown position") | |
1020 | + | let cD = getIntegerValue(this, (((((aH + "_") + aK) + "_") + da) + w)) | |
1021 | + | let dZ = eq(aK, aH, da, (cD > 0)) | |
1022 | + | $Tuple2(nil, dZ) | |
1036 | 1023 | } | |
1037 | 1024 | ||
1038 | 1025 | ||
1039 | 1026 | ||
1040 | - | @Callable( | |
1041 | - | func getUserPositionInDollarsREADONLY ( | |
1042 | - | func | |
1043 | - | let | |
1044 | - | let | |
1045 | - | let | |
1046 | - | let | |
1047 | - | let | |
1048 | - | let | |
1049 | - | let | |
1050 | - | let | |
1051 | - | let | |
1052 | - | let | |
1053 | - | let | |
1054 | - | let | |
1055 | - | let | |
1056 | - | let | |
1057 | - | let | |
1058 | - | let | |
1059 | - | if (( | |
1060 | - | then $Tuple3(( | |
1027 | + | @Callable(al) | |
1028 | + | func getUserPositionInDollarsREADONLY (aK,eZ,da) = { | |
1029 | + | func fa (aZ,aH) = { | |
1030 | + | let fb = aZ | |
1031 | + | let fc = fb._1 | |
1032 | + | let fd = fb._2 | |
1033 | + | let fe = fb._3 | |
1034 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1035 | + | let ff = aD(Address(fromBase58String(aH)), bj) | |
1036 | + | let dH = ff._1 | |
1037 | + | let dI = ff._2 | |
1038 | + | let aB = ff._3 | |
1039 | + | let aC = ff._4 | |
1040 | + | let aA = ff._5 | |
1041 | + | let cD = valueOrElse(getInteger(this, (((((aH + "_") + aK) + "_") + da[fe]) + w)), 0) | |
1042 | + | let dZ = eq(aK, aH, da[fe], (cD > 0)) | |
1043 | + | let eY = bi(aA) | |
1044 | + | let fg = pow(10, 0, aT(aA), 0, 0, DOWN) | |
1045 | + | let fh = fraction(dZ, eY, fg) | |
1046 | + | if ((cD == 0)) | |
1047 | + | then $Tuple3((fc :+ fh), (fd :+ 0), (fe + 1)) | |
1061 | 1048 | else { | |
1062 | - | let | |
1063 | - | let | |
1064 | - | let | |
1065 | - | if ($isInstanceOf( | |
1066 | - | then | |
1067 | - | else throw(($getType( | |
1049 | + | let eb = getStringValue(this, (((((aH + "_") + aK) + "_") + da[fe]) + x)) | |
1050 | + | let ea = { | |
1051 | + | let ax = invoke(ai(), "getAssetDebt", [false, ((aK + "_") + da[fe]), eb], nil) | |
1052 | + | if ($isInstanceOf(ax, "Int")) | |
1053 | + | then ax | |
1054 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
1068 | 1055 | } | |
1069 | - | let fh = ( let aw = invoke(ad, "getTWAP60", [ea, false], nil) | |
1070 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1071 | - | then aw | |
1072 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1073 | - | let fi = pow(10, 0, aS(ea), 0, 0, DOWN) | |
1074 | - | let fj = fraction(dZ, fh, fi) | |
1075 | - | $Tuple3((fb :+ fg), (fc :+ fj), (fd + 1)) | |
1056 | + | let fi = getIntegerValue(ae, (eb + R)) | |
1057 | + | let fj = pow(10, 0, aT(eb), 0, 0, DOWN) | |
1058 | + | let fk = fraction(ea, fi, fj) | |
1059 | + | $Tuple3((fc :+ fh), (fd :+ fk), (fe + 1)) | |
1076 | 1060 | } | |
1077 | 1061 | } | |
1078 | 1062 | ||
1079 | - | let | |
1080 | - | let | |
1081 | - | let | |
1082 | - | let | |
1083 | - | func | |
1084 | - | then | |
1085 | - | else | |
1063 | + | let fl = { | |
1064 | + | let bb = eZ | |
1065 | + | let bc = size(bb) | |
1066 | + | let bd = $Tuple3(nil, nil, 0) | |
1067 | + | func be (bf,bg) = if ((bg >= bc)) | |
1068 | + | then bf | |
1069 | + | else fa(bf, bb[bg]) | |
1086 | 1070 | ||
1087 | - | func | |
1088 | - | then | |
1071 | + | func bh (bf,bg) = if ((bg >= bc)) | |
1072 | + | then bf | |
1089 | 1073 | else throw("List size exceeds 20") | |
1090 | 1074 | ||
1091 | - | | |
1075 | + | bh(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(be(bd, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1092 | 1076 | } | |
1093 | - | let | |
1094 | - | let | |
1095 | - | $Tuple2(nil, $Tuple2( | |
1077 | + | let fm = fl._1 | |
1078 | + | let ea = fl._2 | |
1079 | + | $Tuple2(nil, $Tuple2(fm, ea)) | |
1096 | 1080 | } | |
1097 | 1081 | ||
1098 | 1082 | ||
1099 | 1083 | ||
1100 | - | @Callable( | |
1101 | - | func replenish ( | |
1084 | + | @Callable(al) | |
1085 | + | func replenish (aH,eK,eL) = if (if ((100 > eK)) | |
1102 | 1086 | then true | |
1103 | - | else ( | |
1087 | + | else (eK > 300)) | |
1104 | 1088 | then throw("Leverage can't be <100 and >300") | |
1105 | - | else if (if (!(getBooleanValue(this, ( | |
1106 | - | then ( | |
1089 | + | else if (if (!(getBooleanValue(this, (aH + E)))) | |
1090 | + | then (eK > 100) | |
1107 | 1091 | else false) | |
1108 | 1092 | then throw("You can't borrow in this pool") | |
1109 | 1093 | else { | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | let | |
1117 | - | let | |
1118 | - | then if (( | |
1094 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1095 | + | let fn = aD(Address(fromBase58String(aH)), bj) | |
1096 | + | let dH = fn._1 | |
1097 | + | let dI = fn._2 | |
1098 | + | let aB = fn._3 | |
1099 | + | let aC = fn._4 | |
1100 | + | let aA = fn._5 | |
1101 | + | let fo = if ((size(al.payments) == 2)) | |
1102 | + | then if ((aR(al.payments[0].assetId) != dH)) | |
1119 | 1103 | then throw("Wrong payment asset A") | |
1120 | - | else if (( | |
1104 | + | else if ((aR(al.payments[1].assetId) != dI)) | |
1121 | 1105 | then throw("Wrong payment asset B") | |
1122 | - | else $Tuple4( | |
1123 | - | else if ((size( | |
1124 | - | then if (( | |
1125 | - | then $Tuple4( | |
1126 | - | else if (( | |
1127 | - | then $Tuple4(0, | |
1106 | + | else $Tuple4(al.payments[0].amount, dH, al.payments[1].amount, dI) | |
1107 | + | else if ((size(al.payments) == 1)) | |
1108 | + | then if ((aR(al.payments[0].assetId) == dH)) | |
1109 | + | then $Tuple4(al.payments[0].amount, dH, 0, dI) | |
1110 | + | else if ((aR(al.payments[0].assetId) == dI)) | |
1111 | + | then $Tuple4(0, dH, al.payments[0].amount, dI) | |
1128 | 1112 | else throw("Wrong payment") | |
1129 | 1113 | else throw("One or two payments expected") | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | if (( | |
1114 | + | let bB = fo._1 | |
1115 | + | let fp = fo._2 | |
1116 | + | let bC = fo._3 | |
1117 | + | let fq = fo._4 | |
1118 | + | let fr = aJ(toString(al.caller)) | |
1119 | + | if ((eK > 100)) | |
1136 | 1120 | then { | |
1137 | - | let | |
1138 | - | let | |
1139 | - | let | |
1140 | - | let | |
1141 | - | if ($isInstanceOf( | |
1142 | - | then | |
1143 | - | else throw(($getType( | |
1121 | + | let cD = eJ(bB, bC, fp, fq, eK, eL) | |
1122 | + | let eG = makeString([toString(al.caller), aH, toString(bB), fp, toString(bC), fq, toString(aB), toString(aC), aA, eL, toString(cD)], ",") | |
1123 | + | let fs = { | |
1124 | + | let ax = invoke(this, "createNewRequest", [eG], nil) | |
1125 | + | if ($isInstanceOf(ax, "Int")) | |
1126 | + | then ax | |
1127 | + | else throw(($getType(ax) + " couldn't be cast to Int")) | |
1144 | 1128 | } | |
1145 | - | if (( | |
1129 | + | if ((fs == fs)) | |
1146 | 1130 | then { | |
1147 | - | let | |
1148 | - | let | |
1149 | - | if (( | |
1131 | + | let ft = [((toString(al.caller) + "_") + toString(fr)), aA, eL, cD, toString(this), "replenishFromLand", toString(valueOrErrorMessage(fs, "Can't create new request"))] | |
1132 | + | let bV = reentrantInvoke(ai(), "flashPosition", ft, nil) | |
1133 | + | if ((bV == bV)) | |
1150 | 1134 | then nil | |
1151 | 1135 | else throw("Strict value is not equal to itself.") | |
1152 | 1136 | } | |
1153 | 1137 | else throw("Strict value is not equal to itself.") | |
1154 | 1138 | } | |
1155 | 1139 | else { | |
1156 | - | let | |
1157 | - | let | |
1158 | - | let | |
1159 | - | ( | |
1140 | + | let fu = cO(bj, aH, h, bB, dH, bC, dI, aB, aC, aA) | |
1141 | + | let fv = fu._1 | |
1142 | + | let dX = fu._2 | |
1143 | + | (cY(aH, toString(al.caller), fv, dX, fr, aA, bj, false) ++ bw(dH, dI, aA)) | |
1160 | 1144 | } | |
1161 | 1145 | } | |
1162 | 1146 | ||
1163 | 1147 | ||
1164 | 1148 | ||
1165 | - | @Callable( | |
1166 | - | func withdraw ( | |
1149 | + | @Callable(al) | |
1150 | + | func withdraw (aH,er) = ew(toString(al.caller), aH, toString(er), false) | |
1167 | 1151 | ||
1168 | 1152 | ||
1169 | 1153 | ||
1170 | - | @Callable(ak) | |
1171 | - | func createUpdateStopLoss (eq,fv,ao,fw) = { | |
1172 | - | let fx = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
1173 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1174 | - | then aw | |
1175 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1176 | - | if (!(isDefined(getInteger(this, (((((fv + "_") + toString(ak.caller)) + "_") + toString(eq)) + u))))) | |
1154 | + | @Callable(al) | |
1155 | + | func createUpdateStopLoss (er,fw,ap,fx) = { | |
1156 | + | let fy = getIntegerValue(ae, (ap + R)) | |
1157 | + | if (!(isDefined(getInteger(this, (((((fw + "_") + toString(al.caller)) + "_") + toString(er)) + u))))) | |
1177 | 1158 | then throw("There are no user position") | |
1178 | - | else if ((0 >= | |
1159 | + | else if ((0 >= fx)) | |
1179 | 1160 | then throw("Price must be greater than 0") | |
1180 | - | else if (( | |
1161 | + | else if ((fx > fy)) | |
1181 | 1162 | then throw("Price must be less than current token price") | |
1182 | - | else [IntegerEntry((((((((toString( | |
1163 | + | else [IntegerEntry((((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S), fx)] | |
1183 | 1164 | } | |
1184 | 1165 | ||
1185 | 1166 | ||
1186 | 1167 | ||
1187 | - | @Callable( | |
1188 | - | func deleteStopLoss ( | |
1168 | + | @Callable(al) | |
1169 | + | func deleteStopLoss (er,fw,ap) = if (!(isDefined(getInteger(this, (((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S))))) | |
1189 | 1170 | then throw("No entry") | |
1190 | - | else [DeleteEntry((((((((toString( | |
1171 | + | else [DeleteEntry((((((((toString(al.caller) + "_") + toString(er)) + "_") + fw) + "_") + ap) + S))] | |
1191 | 1172 | ||
1192 | 1173 | ||
1193 | 1174 | ||
1194 | - | @Callable( | |
1195 | - | func init ( | |
1175 | + | @Callable(al) | |
1176 | + | func init (fz,fA,fB,ae,fC,af,fD,fE,fF) = if (isDefined(getString(T))) | |
1196 | 1177 | then throw("Already inited") | |
1197 | - | else [ | |
1178 | + | else [StringEntry(T, fz), StringEntry(U, fA), StringEntry(V, fB), StringEntry(X, ae), StringEntry(Y, fC), StringEntry(Z, af), StringEntry(aa, fD), StringEntry(ab, fE), StringEntry(W, fF)] | |
1198 | 1179 | ||
1199 | 1180 | ||
1200 | 1181 | ||
1201 | - | @Callable( | |
1202 | - | func createNewRequest ( | |
1203 | - | let | |
1204 | - | $Tuple2([StringEntry((toString( | |
1182 | + | @Callable(al) | |
1183 | + | func createNewRequest (bU) = valueOrElse(am(al), { | |
1184 | + | let fs = (valueOrElse(getInteger(this, M), 0) + 1) | |
1185 | + | $Tuple2([StringEntry((toString(fs) + L), bU), IntegerEntry(M, fs)], fs) | |
1205 | 1186 | }) | |
1206 | 1187 | ||
1207 | 1188 | ||
1208 | 1189 | ||
1209 | - | @Callable( | |
1210 | - | func replenishFromLand ( | |
1211 | - | let | |
1212 | - | let | |
1213 | - | let | |
1214 | - | let | |
1215 | - | let | |
1216 | - | let | |
1217 | - | let | |
1218 | - | let | |
1219 | - | let | |
1220 | - | let | |
1221 | - | let | |
1222 | - | let | |
1223 | - | if ((size( | |
1190 | + | @Callable(al) | |
1191 | + | func replenishFromLand (eF) = valueOrElse(an(al), { | |
1192 | + | let fG = eE(eF) | |
1193 | + | let aK = fG._1 | |
1194 | + | let aH = fG._2 | |
1195 | + | let bB = fG._3 | |
1196 | + | let dH = fG._4 | |
1197 | + | let bC = fG._5 | |
1198 | + | let dI = fG._6 | |
1199 | + | let aB = fG._7 | |
1200 | + | let aC = fG._8 | |
1201 | + | let aA = fG._9 | |
1202 | + | let eH = fG._10 | |
1203 | + | let eI = fG._11 | |
1204 | + | if ((size(al.payments) != 1)) | |
1224 | 1205 | then throw("Wrong payment size") | |
1225 | - | else if (if (( | |
1206 | + | else if (if ((aR(al.payments[0].assetId) != eH)) | |
1226 | 1207 | then true | |
1227 | - | else ( | |
1208 | + | else (al.payments[0].amount != eI)) | |
1228 | 1209 | then throw("Wrong payment") | |
1229 | 1210 | else { | |
1230 | - | let | |
1231 | - | then $Tuple2(( | |
1232 | - | else $Tuple2( | |
1233 | - | let | |
1234 | - | let | |
1235 | - | let | |
1236 | - | let | |
1237 | - | let | |
1238 | - | let | |
1239 | - | let | |
1240 | - | let | |
1241 | - | let | |
1242 | - | $Tuple2(((( | |
1211 | + | let fH = if ((dH == eH)) | |
1212 | + | then $Tuple2((bB + al.payments[0].amount), bC) | |
1213 | + | else $Tuple2(bB, (bC + al.payments[0].amount)) | |
1214 | + | let fI = fH._1 | |
1215 | + | let fJ = fH._2 | |
1216 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Unknown pool") | |
1217 | + | let fK = cO(bj, aH, g, fI, dH, fJ, dI, aB, aC, aA) | |
1218 | + | let fv = fK._1 | |
1219 | + | let dX = fK._2 | |
1220 | + | let da = aJ(aK) | |
1221 | + | let fL = [IntegerEntry((((((aH + "_") + aK) + "_") + toString(da)) + w), eI), StringEntry((((((aH + "_") + aK) + "_") + toString(da)) + x), eH)] | |
1222 | + | let fM = cY(aH, aK, fv, dX, da, aA, bj, true) | |
1223 | + | $Tuple2((((fM ++ bw(dH, dI, aA)) ++ fL) :+ DeleteEntry((eF + L))), fv) | |
1243 | 1224 | } | |
1244 | 1225 | }) | |
1245 | 1226 | ||
1246 | 1227 | ||
1247 | 1228 | ||
1248 | - | @Callable( | |
1249 | - | func liquidate ( | |
1250 | - | let | |
1251 | - | let | |
1252 | - | let | |
1253 | - | let | |
1254 | - | let | |
1255 | - | let | |
1256 | - | let | |
1257 | - | let | |
1258 | - | let | |
1259 | - | let | |
1260 | - | let | |
1261 | - | let | |
1262 | - | if (( | |
1229 | + | @Callable(al) | |
1230 | + | func liquidate (aK,er,fN) = valueOrElse(an(al), { | |
1231 | + | let aH = valueOrErrorMessage(getString(this, (((aK + "_") + er) + v)), "no position") | |
1232 | + | let bj = valueOrErrorMessage(getString(this, (N + aH)), "Pool is not inited") | |
1233 | + | let fO = aD(Address(fromBase58String(aH)), bj) | |
1234 | + | let dH = fO._1 | |
1235 | + | let dI = fO._2 | |
1236 | + | let aB = fO._3 | |
1237 | + | let aC = fO._4 | |
1238 | + | let aA = fO._5 | |
1239 | + | let bP = bQ(aH, bj, aA, fN) | |
1240 | + | let cD = getIntegerValue(this, (((((aH + "_") + aK) + "_") + er) + w)) | |
1241 | + | let eb = getStringValue(this, (((((aH + "_") + aK) + "_") + er) + x)) | |
1242 | + | let dZ = eq(aK, aH, er, (cD > 0)) | |
1243 | + | if ((cD == 0)) | |
1263 | 1244 | then throw("You can't liquidate position without borrow") | |
1264 | - | else [IntegerEntry(((((( | |
1245 | + | else [IntegerEntry((((((aH + "_") + aK) + "_") + er) + z), getIntegerValue(this, (aH + C))), IntegerEntry((aH + B), (aI(aH) - fN)), IntegerEntry((aH + A), (aG(aH) - fN)), IntegerEntry((((((aH + "_") + aK) + "_") + er) + u), (dZ - fN)), ScriptTransfer(al.caller, bP, fromBase58String(aA))] | |
1265 | 1246 | }) | |
1266 | 1247 | ||
1267 | 1248 | ||
1268 | 1249 | ||
1269 | - | @Callable(ak) | |
1270 | - | func stopLoss (aJ,eq,aG,ao) = valueOrElse(aj(ak), { | |
1271 | - | let fx = ( let aw = invoke(ad, "getTWAP60", [ao, false], nil) | |
1272 | - | if ($isInstanceOf(aw, "(Int, Int)")) | |
1273 | - | then aw | |
1274 | - | else throw(($getType(aw) + " couldn't be cast to (Int, Int)")))._1 | |
1275 | - | if (!(isDefined(getInteger(this, (((((((aJ + "_") + toString(eq)) + "_") + aG) + "_") + ao) + R))))) | |
1250 | + | @Callable(al) | |
1251 | + | func stopLoss (aK,er,aH,ap) = valueOrElse(ak(al), { | |
1252 | + | let fy = getIntegerValue(ae, (ap + R)) | |
1253 | + | if (!(isDefined(getInteger(this, (((((((aK + "_") + toString(er)) + "_") + aH) + "_") + ap) + S))))) | |
1276 | 1254 | then throw("No entry") | |
1277 | - | else ( | |
1255 | + | else (ew(toString(al.caller), aH, toString(er), true) :+ DeleteEntry((((((((aK + "_") + toString(er)) + "_") + aH) + "_") + ap) + S))) | |
1278 | 1256 | }) | |
1279 | 1257 | ||
1280 | 1258 | ||
1281 | 1259 | ||
1282 | - | @Callable( | |
1283 | - | func capitalizeExKeeper ( | |
1284 | - | let | |
1285 | - | then | |
1260 | + | @Callable(al) | |
1261 | + | func capitalizeExKeeper (aH,aE,fP,fQ,fR,dl,dm,dn,do,dp,dq,dr) = valueOrElse(ak(al), { | |
1262 | + | let fS = if (fR) | |
1263 | + | then cL(aE, aH) | |
1286 | 1264 | else { | |
1287 | - | let | |
1288 | - | then | |
1289 | - | else | |
1290 | - | $Tuple2( | |
1265 | + | let fT = if ((aE == a)) | |
1266 | + | then ag | |
1267 | + | else ah | |
1268 | + | $Tuple2(fQ, fT) | |
1291 | 1269 | } | |
1292 | - | let | |
1293 | - | let | |
1294 | - | let | |
1295 | - | let | |
1296 | - | let | |
1297 | - | then [IntegerEntry(( | |
1270 | + | let fU = fS._1 | |
1271 | + | let fT = fS._2 | |
1272 | + | let fV = dh(fP, fQ, fT, dl, dm, dn, do, dp, dq, dr) | |
1273 | + | let cv = (fU - fQ) | |
1274 | + | let fW = if ((cv > 0)) | |
1275 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1298 | 1276 | else nil | |
1299 | - | ( | |
1277 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1300 | 1278 | }) | |
1301 | 1279 | ||
1302 | 1280 | ||
1303 | 1281 | ||
1304 | - | @Callable( | |
1305 | - | func capitalizeExPuzzle ( | |
1306 | - | let | |
1307 | - | then | |
1282 | + | @Callable(al) | |
1283 | + | func capitalizeExPuzzle (aH,aE,fP,fQ,fR,du,dv,dr) = valueOrElse(ak(al), { | |
1284 | + | let fX = if (fR) | |
1285 | + | then cL(aE, aH) | |
1308 | 1286 | else { | |
1309 | - | let | |
1310 | - | then | |
1311 | - | else | |
1312 | - | $Tuple2( | |
1287 | + | let fT = if ((aE == a)) | |
1288 | + | then ag | |
1289 | + | else ah | |
1290 | + | $Tuple2(fQ, fT) | |
1313 | 1291 | } | |
1314 | - | let | |
1315 | - | let | |
1316 | - | let | |
1317 | - | let | |
1318 | - | let | |
1319 | - | then [IntegerEntry(( | |
1292 | + | let fU = fX._1 | |
1293 | + | let fT = fX._2 | |
1294 | + | let fV = dt(fP, fQ, fT, du, dv, dr) | |
1295 | + | let cv = (fU - fQ) | |
1296 | + | let fW = if ((cv > 0)) | |
1297 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1320 | 1298 | else nil | |
1321 | - | ( | |
1299 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1322 | 1300 | }) | |
1323 | 1301 | ||
1324 | 1302 | ||
1325 | 1303 | ||
1326 | - | @Callable( | |
1327 | - | func capitalizeExSwopFi ( | |
1328 | - | let | |
1329 | - | then | |
1304 | + | @Callable(al) | |
1305 | + | func capitalizeExSwopFi (aH,aE,fP,fQ,fR,dx,dy,dz,dA,dB,dC,dr) = valueOrElse(ak(al), { | |
1306 | + | let fY = if (fR) | |
1307 | + | then cL(aE, aH) | |
1330 | 1308 | else { | |
1331 | - | let | |
1332 | - | then | |
1333 | - | else | |
1334 | - | $Tuple2( | |
1309 | + | let fT = if ((aE == a)) | |
1310 | + | then ag | |
1311 | + | else ah | |
1312 | + | $Tuple2(fQ, fT) | |
1335 | 1313 | } | |
1336 | - | let | |
1337 | - | let | |
1338 | - | let | |
1339 | - | let | |
1340 | - | let | |
1341 | - | then [IntegerEntry(( | |
1314 | + | let fU = fY._1 | |
1315 | + | let fT = fY._2 | |
1316 | + | let fV = dw(fP, fQ, fT, dx, dy, dz, dA, dB, dC, dr) | |
1317 | + | let cv = (fU - fQ) | |
1318 | + | let fW = if ((cv > 0)) | |
1319 | + | then [IntegerEntry((aH + P), (cv + valueOrElse(getInteger(this, (aH + P)), 0)))] | |
1342 | 1320 | else nil | |
1343 | - | ( | |
1321 | + | (dD(aH, aE, fP, fV) ++ fW) | |
1344 | 1322 | }) | |
1345 | 1323 | ||
1346 | 1324 | ||
1347 | 1325 | ||
1348 | - | @Callable( | |
1349 | - | func initNewPool ( | |
1350 | - | then ( | |
1326 | + | @Callable(al) | |
1327 | + | func initNewPool (aE,au,fZ,ga,gb,gc,gd,ge,gf) = valueOrElse(ak(al), if (if ((aE != a)) | |
1328 | + | then (aE != b) | |
1351 | 1329 | else false) | |
1352 | 1330 | then throw("Wrong type") | |
1353 | 1331 | else { | |
1354 | - | let | |
1355 | - | let | |
1356 | - | let | |
1357 | - | let | |
1358 | - | let | |
1359 | - | let | |
1360 | - | [IntegerEntry(( | |
1332 | + | let gg = aD(Address(fromBase58String(au)), aE) | |
1333 | + | let ay = gg._1 | |
1334 | + | let az = gg._2 | |
1335 | + | let gh = gg._3 | |
1336 | + | let gi = gg._4 | |
1337 | + | let aA = gg._5 | |
1338 | + | [IntegerEntry((au + F), fZ), IntegerEntry((au + G), ga), IntegerEntry((au + H), gb), IntegerEntry((au + I), gc), IntegerEntry((au + J), gd), IntegerEntry((au + K), ge), IntegerEntry((au + C), 0), IntegerEntry((au + D), 0), StringEntry((N + au), aE), StringEntry((aA + O), au), BooleanEntry((au + E), gf)] | |
1361 | 1339 | }) | |
1362 | 1340 | ||
1363 | 1341 | ||
1364 | - | @Verifier( | |
1365 | - | func | |
1342 | + | @Verifier(gj) | |
1343 | + | func gk () = sigVerify(gj.bodyBytes, gj.proofs[0], gj.senderPublicKey) | |
1366 | 1344 |
github/deemru/w8io/026f985 504.98 ms ◑