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