tx · 4DFiukmYwHTe1G8UzAn8FbnajE8LfPhkoXJyenxpdBJP 3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS: -0.10000000 Waves 2023.01.24 12:05 [2418837] smart account 3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS > SELF 0.00000000 Waves
{ "type": 13, "id": "4DFiukmYwHTe1G8UzAn8FbnajE8LfPhkoXJyenxpdBJP", "fee": 10000000, "feeAssetId": null, "timestamp": 1674551203526, "version": 2, "chainId": 84, "sender": "3MxWgDbE9EmjQj8b3LfFwa91FZizptyeQXS", "senderPublicKey": "C7xgcYqQ8qV8rmvzAjhQWq4cz82F6VJfXMNygvrTXsfW", "proofs": [ "4dt6ioSAsqj9CU9vLWSNJ7sQuVCbXgmGPuiYYSJz1xb95BxqSfqJ2TCvxg4SLUMmVGj2fFKGkNWk394wtaYicWUt", "3ZbLFWnSYrjZzdxG7gJACMJCBeBFHoTi66GM79Gq31B6DtTN3mUAyEAEvU7KMRDeotA2XCKb5z7D14LCNZHtRbkJ" ], "script": "base64:BgJmCAISBAoCEQESBQoDCAEBEgUKAwEEARIECgIRCBIDCgEBEgYKBAgIAQgSBAoCCAESAwoBERIECgIRARIFCgMBCAgSBAoCCAESBQoDCAEBEgASABIECgIRBBIECgIBARIAEgASABIAXwAJUFJFQ0lTSU9OAMCEPQAFTUFYX0EAwIQ9AAxNQVhfQV9DSEFOR0UACgAIREVDSU1BTFMABgANTUlOX1JBTVBfVElNRQkAaQIAgKMFADwAB3ZlcnNpb24CBTMuMC4wAAhrVmVyc2lvbgIHdmVyc2lvbgAHa0Fzc2V0cwIJYXNzZXRfaWRzAA1rQXNzZXRCYWxhbmNlAghfYmFsYW5jZQAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMAC2tEZXByZWNhdGVkAgtkZXByZWNhdGVkXwAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQANa1NoYXJlQXNzZXRJ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kbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBANpbnYFByRtYXRjaDAEE2NhbGxUYWtlSW50b0FjY291bnQDCQAAAggFA2ludgRkQXBwBQR0aGlzCQAAAggFA2ludghmdW5jdGlvbgIZdGFrZUludG9BY2NvdW50RXh0cmFGdW5kcwcEDXNpZ25lZEJ5QWRtaW4DAwMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MgYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MwYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFEWFkbWluUHViS2V5SW52b2tlAwMFE2NhbGxUYWtlSW50b0FjY291bnQFDXNpZ25lZEJ5QWRtaW4HBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWlucy2FIkY=", "height": 2418837, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6qhLkDFqMWisAhKUqnDMTwSTqtb6G7RCXdQuQytgVba5 Next: 21Pqs7asD3hspdVaKqbXq3g3CHDzTX7fRkED1NnrG4rN Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | let kActive = "active" | |
23 | 23 | ||
24 | 24 | let kActiveGlob = "active_all_contracts" | |
25 | + | ||
26 | + | let kDeprecated = "deprecated_" | |
25 | 27 | ||
26 | 28 | let kCause = "shutdown_cause" | |
27 | 29 | ||
91 | 93 | ||
92 | 94 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
93 | 95 | ||
94 | - | let USDN = base58' | |
96 | + | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
95 | 97 | ||
96 | 98 | let stakingAssets = [toBase58String(USDN)] | |
97 | 99 | ||
98 | 100 | let active = getBooleanValue(this, kActive) | |
99 | 101 | ||
100 | 102 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
103 | + | ||
104 | + | let deprecatedPool = valueOrElse(getBoolean(oracle, (kDeprecated + toString(this))), false) | |
101 | 105 | ||
102 | 106 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
103 | 107 | ||
132 | 136 | else false) | |
133 | 137 | then unit | |
134 | 138 | else throw("DApp is inactive at this moment") | |
139 | + | ||
140 | + | ||
141 | + | func isDepricated () = if (!(deprecatedPool)) | |
142 | + | then unit | |
143 | + | else throw("Pool is deprecated. Only withdraw action allowed.") | |
135 | 144 | ||
136 | 145 | ||
137 | 146 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
294 | 303 | else $Tuple2(D, false) | |
295 | 304 | } | |
296 | 305 | ||
297 | - | let $ | |
306 | + | let $t068206886 = { | |
298 | 307 | let $l = iter15 | |
299 | 308 | let $s = size($l) | |
300 | 309 | let $acc0 = $Tuple2(toBigInt(S), false) | |
308 | 317 | ||
309 | 318 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
310 | 319 | } | |
311 | - | let D = $ | |
312 | - | let finished = $ | |
320 | + | let D = $t068206886._1 | |
321 | + | let finished = $t068206886._2 | |
313 | 322 | if ((finished == false)) | |
314 | 323 | then throw(("get_D() not finished with " + toString(D))) | |
315 | 324 | else toInt(D) | |
335 | 344 | let D = get_D(xp_, amp) | |
336 | 345 | let Ann = (amp * nCoins) | |
337 | 346 | func S_c (acc,i) = { | |
338 | - | let $ | |
339 | - | let S_ = $ | |
340 | - | let c = $ | |
347 | + | let $t074577474 = acc | |
348 | + | let S_ = $t074577474._1 | |
349 | + | let c = $t074577474._2 | |
341 | 350 | let x_ = if ((in == i)) | |
342 | 351 | then x | |
343 | 352 | else xp_[i] | |
348 | 357 | else $Tuple2(S_, c) | |
349 | 358 | } | |
350 | 359 | ||
351 | - | let $ | |
360 | + | let $t076827737 = { | |
352 | 361 | let $l = iter10 | |
353 | 362 | let $s = size($l) | |
354 | 363 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
362 | 371 | ||
363 | 372 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
364 | 373 | } | |
365 | - | let S_ = $ | |
366 | - | let c_ = $ | |
374 | + | let S_ = $t076827737._1 | |
375 | + | let c_ = $t076827737._2 | |
367 | 376 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
368 | 377 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
369 | 378 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
380 | 389 | else $Tuple2(y, false) | |
381 | 390 | } | |
382 | 391 | ||
383 | - | let $ | |
392 | + | let $t082198286 = { | |
384 | 393 | let $l = iter16 | |
385 | 394 | let $s = size($l) | |
386 | 395 | let $acc0 = $Tuple2(toBigInt(D), false) | |
394 | 403 | ||
395 | 404 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
396 | 405 | } | |
397 | - | let y = $ | |
398 | - | let finished = $ | |
406 | + | let y = $t082198286._1 | |
407 | + | let finished = $t082198286._2 | |
399 | 408 | if ((finished == false)) | |
400 | 409 | then throw(("getY() not finished with " + toString(y))) | |
401 | 410 | else toInt(y) | |
409 | 418 | else { | |
410 | 419 | let Ann = (A_ * nCoins) | |
411 | 420 | func S_c (acc,i) = { | |
412 | - | let $ | |
413 | - | let S_ = $ | |
414 | - | let c = $ | |
421 | + | let $t086658682 = acc | |
422 | + | let S_ = $t086658682._1 | |
423 | + | let c = $t086658682._2 | |
415 | 424 | let x_ = if (if ((in != i)) | |
416 | 425 | then (nCoins > i) | |
417 | 426 | else false) | |
424 | 433 | else $Tuple2(S_, c) | |
425 | 434 | } | |
426 | 435 | ||
427 | - | let $ | |
436 | + | let $t089028957 = { | |
428 | 437 | let $l = iter10 | |
429 | 438 | let $s = size($l) | |
430 | 439 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
438 | 447 | ||
439 | 448 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
440 | 449 | } | |
441 | - | let S_ = $ | |
442 | - | let c_ = $ | |
450 | + | let S_ = $t089028957._1 | |
451 | + | let c_ = $t089028957._2 | |
443 | 452 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
444 | 453 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
445 | 454 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
456 | 465 | else $Tuple2(y, false) | |
457 | 466 | } | |
458 | 467 | ||
459 | - | let $ | |
468 | + | let $t094409509 = { | |
460 | 469 | let $l = iter16 | |
461 | 470 | let $s = size($l) | |
462 | 471 | let $acc0 = $Tuple2(toBigInt(D), false) | |
470 | 479 | ||
471 | 480 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
472 | 481 | } | |
473 | - | let y = $ | |
474 | - | let finished = $ | |
482 | + | let y = $t094409509._1 | |
483 | + | let finished = $t094409509._2 | |
475 | 484 | if ((finished == false)) | |
476 | 485 | then throw(("get_y_D() not finished with " + toString(y))) | |
477 | 486 | else toInt(y) | |
488 | 497 | let new_y = get_y_D(amp, i, xp, D1) | |
489 | 498 | let dy_0 = (xp[i] - new_y) | |
490 | 499 | func xp_reduced_proc (acc,xp_j) = { | |
491 | - | let $ | |
492 | - | let xp_reduced = $ | |
493 | - | let index = $ | |
500 | + | let $t01015010179 = acc | |
501 | + | let xp_reduced = $t01015010179._1 | |
502 | + | let index = $t01015010179._2 | |
494 | 503 | let dx_expected = if ((index == i)) | |
495 | 504 | then (fraction(xp_j, D1, D0) - new_y) | |
496 | 505 | else (xp_j - fraction(xp_j, D1, D0)) | |
497 | 506 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
498 | 507 | } | |
499 | 508 | ||
500 | - | let $ | |
509 | + | let $t01044110505 = { | |
501 | 510 | let $l = xp | |
502 | 511 | let $s = size($l) | |
503 | 512 | let $acc0 = $Tuple2(nil, 0) | |
511 | 520 | ||
512 | 521 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
513 | 522 | } | |
514 | - | let xp_reduced = $ | |
515 | - | let index = $ | |
523 | + | let xp_reduced = $t01044110505._1 | |
524 | + | let index = $t01044110505._2 | |
516 | 525 | let xp_reduced_i = xp_reduced[i] | |
517 | 526 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
518 | 527 | $Tuple2(dy, (dy_0 - dy)) | |
536 | 545 | ||
537 | 546 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
538 | 547 | then { | |
539 | - | let $ | |
540 | - | let call = $ | |
541 | - | let stakingAddr = $ | |
548 | + | let $t01106911135 = calcStakingFuncAndAddres(stake, assetId) | |
549 | + | let call = $t01106911135._1 | |
550 | + | let stakingAddr = $t01106911135._2 | |
542 | 551 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
543 | 552 | } | |
544 | 553 | else { | |
545 | - | let $ | |
546 | - | let call = $ | |
547 | - | let stakingAddr = $ | |
554 | + | let $t01122111287 = calcStakingFuncAndAddres(stake, assetId) | |
555 | + | let call = $t01122111287._1 | |
556 | + | let stakingAddr = $t01122111287._2 | |
548 | 557 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
549 | 558 | } | |
550 | 559 | ||
551 | 560 | ||
552 | 561 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
553 | 562 | then { | |
554 | - | let $ | |
555 | - | let call = $ | |
556 | - | let addr = $ | |
557 | - | let params = $ | |
558 | - | let payments = $ | |
563 | + | let $t01147411576 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
564 | + | let call = $t01147411576._1 | |
565 | + | let addr = $t01147411576._2 | |
566 | + | let params = $t01147411576._3 | |
567 | + | let payments = $t01147411576._4 | |
559 | 568 | invoke(addr, call, params, payments) | |
560 | 569 | } | |
561 | 570 | else 0 | |
563 | 572 | ||
564 | 573 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
565 | 574 | then { | |
566 | - | let $ | |
567 | - | let call = $ | |
568 | - | let addr = $ | |
569 | - | let params = $ | |
570 | - | let payments = $ | |
575 | + | let $t01176111864 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
576 | + | let call = $t01176111864._1 | |
577 | + | let addr = $t01176111864._2 | |
578 | + | let params = $t01176111864._3 | |
579 | + | let payments = $t01176111864._4 | |
571 | 580 | invoke(addr, call, params, payments) | |
572 | 581 | } | |
573 | 582 | else 0 | |
596 | 605 | func checkSuspicious () = { | |
597 | 606 | let contractBalances = _xp() | |
598 | 607 | func checkBalance (acc,assetId) = { | |
599 | - | let $ | |
600 | - | let suspicious = $ | |
601 | - | let i = $ | |
608 | + | let $t01247512500 = acc | |
609 | + | let suspicious = $t01247512500._1 | |
610 | + | let i = $t01247512500._2 | |
602 | 611 | if (suspicious) | |
603 | 612 | then $Tuple2(suspicious, i) | |
604 | 613 | else { | |
703 | 712 | else 0 | |
704 | 713 | let withdrawAmount = (pmtAmount + unlockAmount) | |
705 | 714 | func calcScriptActions (acc,balance) = { | |
706 | - | let $ | |
707 | - | let scriptActions = $ | |
708 | - | let i = $ | |
715 | + | let $t01491614944 = acc | |
716 | + | let scriptActions = $t01491614944._1 | |
717 | + | let i = $t01491614944._2 | |
709 | 718 | let wAmount = fraction(balance, withdrawAmount, shareSupply) | |
710 | 719 | if (assert((wAmount >= minAmounts[i]))) | |
711 | 720 | then throw("Withdrawal resulted in fewer coins than expected") | |
717 | 726 | } | |
718 | 727 | } | |
719 | 728 | ||
720 | - | let $ | |
729 | + | let $t01543315501 = { | |
721 | 730 | let $l = _xp() | |
722 | 731 | let $s = size($l) | |
723 | 732 | let $acc0 = $Tuple2(nil, 0) | |
731 | 740 | ||
732 | 741 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
733 | 742 | } | |
734 | - | let scriptActions = $ | |
735 | - | let i = $ | |
743 | + | let scriptActions = $t01543315501._1 | |
744 | + | let i = $t01543315501._2 | |
736 | 745 | (scriptActions ++ [Burn(shareAssetId, withdrawAmount), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))]) | |
737 | 746 | } | |
738 | 747 | } | |
755 | 764 | let tokenOutB58 = fromBase58String(tokenOut) | |
756 | 765 | let withdrawAmount = (pmtAmount + unlockAmount) | |
757 | 766 | let xp = _xp() | |
758 | - | let $ | |
759 | - | let dy = $ | |
760 | - | let dy_fee = $ | |
767 | + | let $t01636316450 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
768 | + | let dy = $t01636316450._1 | |
769 | + | let dy_fee = $t01636316450._2 | |
761 | 770 | if (assert((dy >= minAmount))) | |
762 | 771 | then throw("Not enough coins removed") | |
763 | 772 | else { | |
764 | 773 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
765 | 774 | let dy_and_fee = (dy + dy_fee) | |
766 | 775 | func makeNewBalances (acc,tokenBalance) = { | |
767 | - | let $ | |
768 | - | let newBalances = $ | |
769 | - | let i = $ | |
776 | + | let $t01670816734 = acc | |
777 | + | let newBalances = $t01670816734._1 | |
778 | + | let i = $t01670816734._2 | |
770 | 779 | if ((i == outIndex)) | |
771 | 780 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
772 | 781 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
773 | 782 | } | |
774 | 783 | ||
775 | - | let $ | |
784 | + | let $t01690116962 = { | |
776 | 785 | let $l = xp | |
777 | 786 | let $s = size($l) | |
778 | 787 | let $acc0 = $Tuple2(nil, 0) | |
786 | 795 | ||
787 | 796 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
788 | 797 | } | |
789 | - | let newBalances = $ | |
790 | - | let v = $ | |
798 | + | let newBalances = $t01690116962._1 | |
799 | + | let v = $t01690116962._2 | |
791 | 800 | if (checkDAppThreshold(newBalances)) | |
792 | 801 | then throw() | |
793 | 802 | else { | |
837 | 846 | ||
838 | 847 | ||
839 | 848 | @Callable(msg) | |
840 | - | func addLiquidity (minMintAmount,stakeFarming,lockType) = valueOrElse(isActive(), { | |
849 | + | func addLiquidity (minMintAmount,stakeFarming,lockType) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
841 | 850 | let amp = _A() | |
842 | 851 | let xp = _xp() | |
843 | 852 | let D0 = if ((shareSupply == 0)) | |
844 | 853 | then 0 | |
845 | 854 | else getDMem(xp, amp) | |
846 | - | let $ | |
855 | + | let $t01913119385 = if (if ((lockType > 0)) | |
847 | 856 | then (msg.payments[(size(msg.payments) - 1)].assetId == unit) | |
848 | 857 | else false) | |
849 | 858 | then $Tuple2(removeByIndex(msg.payments, (size(msg.payments) - 1)), [msg.payments[(size(msg.payments) - 1)]]) | |
850 | 859 | else $Tuple2(msg.payments, nil) | |
851 | - | let payments = $ | |
852 | - | let lockFee = $ | |
860 | + | let payments = $t01913119385._1 | |
861 | + | let lockFee = $t01913119385._2 | |
853 | 862 | let paymentsSize = size(payments) | |
854 | 863 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
855 | 864 | then throw(("payments size > " + toString(nCoins))) | |
886 | 895 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
887 | 896 | else { | |
888 | 897 | func parsePayments (acc,assetId) = { | |
889 | - | let $ | |
890 | - | let newBalances = $ | |
891 | - | let i = $ | |
898 | + | let $t02025520281 = acc | |
899 | + | let newBalances = $t02025520281._1 | |
900 | + | let i = $t02025520281._2 | |
892 | 901 | func parsePayment (newBalance,payment) = if ((getStrAssetId(payment.assetId) == assetId)) | |
893 | 902 | then (newBalance + payment.amount) | |
894 | 903 | else newBalance | |
910 | 919 | $Tuple2((newBalances :+ newBalace), (i + 1)) | |
911 | 920 | } | |
912 | 921 | ||
913 | - | let $ | |
922 | + | let $t02063120698 = { | |
914 | 923 | let $l = assetIds | |
915 | 924 | let $s = size($l) | |
916 | 925 | let $acc0 = $Tuple2(nil, 0) | |
924 | 933 | ||
925 | 934 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
926 | 935 | } | |
927 | - | let newBalances = $ | |
928 | - | let k = $ | |
936 | + | let newBalances = $t02063120698._1 | |
937 | + | let k = $t02063120698._2 | |
929 | 938 | if (checkDAppThreshold(newBalances)) | |
930 | 939 | then throw() | |
931 | 940 | else { | |
935 | 944 | else { | |
936 | 945 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
937 | 946 | func calcScriptActions (acc,newBalance) = { | |
938 | - | let $ | |
939 | - | let invBalances = $ | |
940 | - | let scriptActions = $ | |
941 | - | let i = $ | |
947 | + | let $t02101821059 = acc | |
948 | + | let invBalances = $t02101821059._1 | |
949 | + | let scriptActions = $t02101821059._2 | |
950 | + | let i = $t02101821059._3 | |
942 | 951 | if ((shareSupply > 0)) | |
943 | 952 | then { | |
944 | 953 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
976 | 985 | } | |
977 | 986 | } | |
978 | 987 | ||
979 | - | let $ | |
988 | + | let $t02276422852 = { | |
980 | 989 | let $l = newBalances | |
981 | 990 | let $s = size($l) | |
982 | 991 | let $acc0 = $Tuple3(nil, nil, 0) | |
990 | 999 | ||
991 | 1000 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
992 | 1001 | } | |
993 | - | let invBalances = $ | |
994 | - | let scriptActions = $ | |
1002 | + | let invBalances = $t02276422852._1 | |
1003 | + | let scriptActions = $t02276422852._2 | |
995 | 1004 | let D2 = getDMem(invBalances, amp) | |
996 | 1005 | let mint_amount = if ((shareSupply == 0)) | |
997 | 1006 | then D1 | |
1015 | 1024 | } | |
1016 | 1025 | } | |
1017 | 1026 | } | |
1018 | - | }) | |
1027 | + | })) | |
1019 | 1028 | ||
1020 | 1029 | ||
1021 | 1030 | ||
1030 | 1039 | let D0 = getDMem(xp, amp) | |
1031 | 1040 | let feeDiscount = calculateFeeDiscount(user) | |
1032 | 1041 | func calcInvBalances (acc,newBalance) = { | |
1033 | - | let $ | |
1034 | - | let invBalances = $ | |
1035 | - | let i = $ | |
1042 | + | let $t02413024156 = acc | |
1043 | + | let invBalances = $t02413024156._1 | |
1044 | + | let i = $t02413024156._2 | |
1036 | 1045 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
1037 | 1046 | let fees = { | |
1038 | 1047 | let idealBalance = fraction(D1, xp[i], D0) | |
1045 | 1054 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
1046 | 1055 | } | |
1047 | 1056 | ||
1048 | - | let $ | |
1057 | + | let $t02475824828 = { | |
1049 | 1058 | let $l = newBalances | |
1050 | 1059 | let $s = size($l) | |
1051 | 1060 | let $acc0 = $Tuple2(nil, 0) | |
1059 | 1068 | ||
1060 | 1069 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1061 | 1070 | } | |
1062 | - | let invBalances = $ | |
1063 | - | let k = $ | |
1071 | + | let invBalances = $t02475824828._1 | |
1072 | + | let k = $t02475824828._2 | |
1064 | 1073 | let D2 = getDMem(invBalances, amp) | |
1065 | 1074 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
1066 | 1075 | $Tuple2(nil, mintAmount) | |
1090 | 1099 | ||
1091 | 1100 | ||
1092 | 1101 | @Callable(msg) | |
1093 | - | func exchange (tokenOut,min_dy) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1102 | + | func exchange (tokenOut,min_dy) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1094 | 1103 | then throw("size(payments) != 1") | |
1095 | 1104 | else { | |
1096 | 1105 | let suspicious = checkSuspicious() | |
1115 | 1124 | then throw("Exchange resulted in fewer coins than expected") | |
1116 | 1125 | else { | |
1117 | 1126 | func makeNewBalances (acc,tokenBalance) = { | |
1118 | - | let $ | |
1119 | - | let newBalances = $ | |
1120 | - | let i = $ | |
1127 | + | let $t02699827024 = acc | |
1128 | + | let newBalances = $t02699827024._1 | |
1129 | + | let i = $t02699827024._2 | |
1121 | 1130 | if ((i == fromIndex)) | |
1122 | 1131 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
1123 | 1132 | else if ((i == toIndex)) | |
1125 | 1134 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1126 | 1135 | } | |
1127 | 1136 | ||
1128 | - | let $ | |
1137 | + | let $t02730727368 = { | |
1129 | 1138 | let $l = xp | |
1130 | 1139 | let $s = size($l) | |
1131 | 1140 | let $acc0 = $Tuple2(nil, 0) | |
1139 | 1148 | ||
1140 | 1149 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1141 | 1150 | } | |
1142 | - | let newBalances = $ | |
1143 | - | let i = $ | |
1151 | + | let newBalances = $t02730727368._1 | |
1152 | + | let i = $t02730727368._2 | |
1144 | 1153 | if (checkDAppThreshold(newBalances)) | |
1145 | 1154 | then throw() | |
1146 | 1155 | else { | |
1164 | 1173 | } | |
1165 | 1174 | } | |
1166 | 1175 | } | |
1167 | - | }) | |
1176 | + | })) | |
1168 | 1177 | ||
1169 | 1178 | ||
1170 | 1179 | ||
1196 | 1205 | ||
1197 | 1206 | ||
1198 | 1207 | @Callable(msg) | |
1199 | - | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1208 | + | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1200 | 1209 | then throw("size(payments) != 1") | |
1201 | - | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1210 | + | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0))) | |
1202 | 1211 | ||
1203 | 1212 | ||
1204 | 1213 | ||
1205 | 1214 | @Callable(msg) | |
1206 | - | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isActive(), if ((0 > unlockAmount)) | |
1215 | + | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((0 > unlockAmount)) | |
1207 | 1216 | then throw("Unlock amount must be positive") | |
1208 | 1217 | else { | |
1209 | 1218 | let unlock = invoke(farmingAddress, "withdrawShareTokensFromPool", [msg.caller.bytes, toString(this), unlockAmount], nil) | |
1210 | 1219 | if ((unlock == unlock)) | |
1211 | 1220 | then calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, unlockAmount) | |
1212 | 1221 | else throw("Strict value is not equal to itself.") | |
1213 | - | }) | |
1222 | + | })) | |
1214 | 1223 | ||
1215 | 1224 | ||
1216 | 1225 | ||
1233 | 1242 | let balances = _xp() | |
1234 | 1243 | let D0 = getDMem(balances, amp) | |
1235 | 1244 | func calcNewBalances (acc,balance) = { | |
1236 | - | let $ | |
1237 | - | let newBalances = $ | |
1238 | - | let i = $ | |
1245 | + | let $t03015830184 = acc | |
1246 | + | let newBalances = $t03015830184._1 | |
1247 | + | let i = $t03015830184._2 | |
1239 | 1248 | let newBalance = (balance + (if (deposit) | |
1240 | 1249 | then amounts[i] | |
1241 | 1250 | else -(amounts[i]))) | |
1310 | 1319 | ||
1311 | 1320 | ||
1312 | 1321 | @Callable(msg) | |
1313 | - | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), if ((msg.caller != moneyBoxAddress)) | |
1314 | - | then throw("Only the wallet can call this function") | |
1315 | - | else { | |
1316 | - | let balances = _xp() | |
1317 | - | func takeExtraFunds (acc,assetId) = { | |
1318 | - | let $t03188331901 = acc | |
1319 | - | let sum = $t03188331901._1 | |
1320 | - | let i = $t03188331901._2 | |
1321 | - | let tokenB58 = fromBase58String(assetId) | |
1322 | - | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1323 | - | let enrollAmount = (rBalance - balances[i]) | |
1324 | - | if ((0 > enrollAmount)) | |
1325 | - | then suspend(("Enroll amount negative for asset" + assetId)) | |
1326 | - | else { | |
1327 | - | let airdrop = if ((enrollAmount > 0)) | |
1328 | - | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1329 | - | else 0 | |
1330 | - | if ((airdrop == airdrop)) | |
1331 | - | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1332 | - | else throw("Strict value is not equal to itself.") | |
1322 | + | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
1323 | + | let claim = if (containsElement(assetIds, toBase58String(USDN))) | |
1324 | + | then invoke(stakingUSDNAddress, "claimRewards", nil, nil) | |
1325 | + | else 0 | |
1326 | + | if ((claim == claim)) | |
1327 | + | then if ((msg.caller != moneyBoxAddress)) | |
1328 | + | then throw("Only the wallet can call this function") | |
1329 | + | else { | |
1330 | + | let balances = _xp() | |
1331 | + | func takeExtraFunds (acc,assetId) = { | |
1332 | + | let $t03276932787 = acc | |
1333 | + | let sum = $t03276932787._1 | |
1334 | + | let i = $t03276932787._2 | |
1335 | + | let tokenB58 = fromBase58String(assetId) | |
1336 | + | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1337 | + | let enrollAmount = (rBalance - balances[i]) | |
1338 | + | if ((0 > enrollAmount)) | |
1339 | + | then suspend(("Enroll amount negative for asset" + assetId)) | |
1340 | + | else { | |
1341 | + | let airdrop = if ((enrollAmount > 0)) | |
1342 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1343 | + | else 0 | |
1344 | + | if ((airdrop == airdrop)) | |
1345 | + | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1346 | + | else throw("Strict value is not equal to itself.") | |
1347 | + | } | |
1333 | 1348 | } | |
1334 | - | } | |
1335 | 1349 | ||
1336 | - | let k = { | |
1337 | - | let $l = assetIds | |
1338 | - | let $s = size($l) | |
1339 | - | let $acc0 = $Tuple2(0, 0) | |
1340 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1341 | - | then $a | |
1342 | - | else takeExtraFunds($a, $l[$i]) | |
1350 | + | let k = { | |
1351 | + | let $l = assetIds | |
1352 | + | let $s = size($l) | |
1353 | + | let $acc0 = $Tuple2(0, 0) | |
1354 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1355 | + | then $a | |
1356 | + | else takeExtraFunds($a, $l[$i]) | |
1343 | 1357 | ||
1344 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1345 | - | then $a | |
1346 | - | else throw("List size exceeds 10") | |
1358 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1359 | + | then $a | |
1360 | + | else throw("List size exceeds 10") | |
1347 | 1361 | ||
1348 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1349 | - | } | |
1350 | - | if ((k._1 == 0)) | |
1351 | - | then throw("No money to take") | |
1352 | - | else nil | |
1353 | - | }) | |
1362 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1363 | + | } | |
1364 | + | if ((k._1 == 0)) | |
1365 | + | then throw("No money to take") | |
1366 | + | else nil | |
1367 | + | } | |
1368 | + | else throw("Strict value is not equal to itself.") | |
1369 | + | }) | |
1354 | 1370 | ||
1355 | 1371 | ||
1356 | 1372 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRECISION = 1000000 | |
5 | 5 | ||
6 | 6 | let MAX_A = 1000000 | |
7 | 7 | ||
8 | 8 | let MAX_A_CHANGE = 10 | |
9 | 9 | ||
10 | 10 | let DECIMALS = 6 | |
11 | 11 | ||
12 | 12 | let MIN_RAMP_TIME = (86400 / 60) | |
13 | 13 | ||
14 | 14 | let version = "3.0.0" | |
15 | 15 | ||
16 | 16 | let kVersion = "version" | |
17 | 17 | ||
18 | 18 | let kAssets = "asset_ids" | |
19 | 19 | ||
20 | 20 | let kAssetBalance = "_balance" | |
21 | 21 | ||
22 | 22 | let kActive = "active" | |
23 | 23 | ||
24 | 24 | let kActiveGlob = "active_all_contracts" | |
25 | + | ||
26 | + | let kDeprecated = "deprecated_" | |
25 | 27 | ||
26 | 28 | let kCause = "shutdown_cause" | |
27 | 29 | ||
28 | 30 | let kShareAssetId = "share_asset_id" | |
29 | 31 | ||
30 | 32 | let kShareAssetSupply = "share_asset_supply" | |
31 | 33 | ||
32 | 34 | let kFee = "commission" | |
33 | 35 | ||
34 | 36 | let kDAppThresholdCoef = "dAppThresholdCoef" | |
35 | 37 | ||
36 | 38 | let kUSDNAddress = "staking_usdnnsbt_address" | |
37 | 39 | ||
38 | 40 | let kDiscounts = "discounts" | |
39 | 41 | ||
40 | 42 | let kDiscountValues = "discount_values" | |
41 | 43 | ||
42 | 44 | let kUserSwopInGov = "_SWOP_amount" | |
43 | 45 | ||
44 | 46 | let kUserGSwopInGov = "_GSwop_amount" | |
45 | 47 | ||
46 | 48 | let kAdminPubKey1 = "admin_pub_1" | |
47 | 49 | ||
48 | 50 | let kAdminPubKey2 = "admin_pub_2" | |
49 | 51 | ||
50 | 52 | let kAdminPubKey3 = "admin_pub_3" | |
51 | 53 | ||
52 | 54 | let kAdminInvokePubKey = "admin_invoke_pub" | |
53 | 55 | ||
54 | 56 | let kMoneyBoxAddress = "money_box_address" | |
55 | 57 | ||
56 | 58 | let kGovAddress = "governance_address" | |
57 | 59 | ||
58 | 60 | let kVotingAddress = "voting_address" | |
59 | 61 | ||
60 | 62 | let kFarmingAddress = "farming_address" | |
61 | 63 | ||
62 | 64 | let kLPFarmingAddress = "lp_farming" | |
63 | 65 | ||
64 | 66 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
65 | 67 | ||
66 | 68 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
67 | 69 | case string: String => | |
68 | 70 | fromBase58String(string) | |
69 | 71 | case nothing => | |
70 | 72 | throw((key + "is empty")) | |
71 | 73 | } | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
75 | 77 | ||
76 | 78 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
77 | 79 | ||
78 | 80 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
79 | 81 | ||
80 | 82 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
81 | 83 | ||
82 | 84 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
83 | 85 | ||
84 | 86 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
85 | 87 | ||
86 | 88 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
87 | 89 | ||
88 | 90 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
89 | 91 | ||
90 | 92 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
91 | 93 | ||
92 | 94 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
93 | 95 | ||
94 | - | let USDN = base58' | |
96 | + | let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
95 | 97 | ||
96 | 98 | let stakingAssets = [toBase58String(USDN)] | |
97 | 99 | ||
98 | 100 | let active = getBooleanValue(this, kActive) | |
99 | 101 | ||
100 | 102 | let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true) | |
103 | + | ||
104 | + | let deprecatedPool = valueOrElse(getBoolean(oracle, (kDeprecated + toString(this))), false) | |
101 | 105 | ||
102 | 106 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
103 | 107 | ||
104 | 108 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
105 | 109 | ||
106 | 110 | let feeScale6 = 1000000 | |
107 | 111 | ||
108 | 112 | let fee = getIntegerValue(this, kFee) | |
109 | 113 | ||
110 | 114 | let feeGovernance = fraction(40, feeScale6, 100) | |
111 | 115 | ||
112 | 116 | let initial_A = getIntegerValue(this, "initial_A") | |
113 | 117 | ||
114 | 118 | let future_A = getIntegerValue(this, "future_A") | |
115 | 119 | ||
116 | 120 | let initial_A_time = valueOrElse(getInteger(this, "initial_A_time"), 0) | |
117 | 121 | ||
118 | 122 | let future_A_time = valueOrElse(getInteger(this, "future_A_time"), 0) | |
119 | 123 | ||
120 | 124 | let assetIds = split(getStringValue(this, kAssets), ",") | |
121 | 125 | ||
122 | 126 | let nCoins = size(assetIds) | |
123 | 127 | ||
124 | 128 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
125 | 129 | ||
126 | 130 | ||
127 | 131 | func throwIsActive () = throw("DApp is already active") | |
128 | 132 | ||
129 | 133 | ||
130 | 134 | func isActive () = if (if (active) | |
131 | 135 | then activeGlob | |
132 | 136 | else false) | |
133 | 137 | then unit | |
134 | 138 | else throw("DApp is inactive at this moment") | |
139 | + | ||
140 | + | ||
141 | + | func isDepricated () = if (!(deprecatedPool)) | |
142 | + | then unit | |
143 | + | else throw("Pool is deprecated. Only withdraw action allowed.") | |
135 | 144 | ||
136 | 145 | ||
137 | 146 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
138 | 147 | then unit | |
139 | 148 | else throw("Only admin can call this function") | |
140 | 149 | ||
141 | 150 | ||
142 | 151 | func isSelfCall (i) = if ((this == i.caller)) | |
143 | 152 | then unit | |
144 | 153 | else throw("Only contract itself can call this function") | |
145 | 154 | ||
146 | 155 | ||
147 | 156 | let big2 = toBigInt(2) | |
148 | 157 | ||
149 | 158 | let iter10 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
150 | 159 | ||
151 | 160 | let iter15 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
152 | 161 | ||
153 | 162 | let iter16 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
154 | 163 | ||
155 | 164 | let blockTimestamp = height | |
156 | 165 | ||
157 | 166 | func assert (a) = if (a) | |
158 | 167 | then false | |
159 | 168 | else true | |
160 | 169 | ||
161 | 170 | ||
162 | 171 | func calculateFeeDiscount (userAddr) = { | |
163 | 172 | let user = match userAddr { | |
164 | 173 | case u: Address => | |
165 | 174 | toString(u) | |
166 | 175 | case u: String => | |
167 | 176 | u | |
168 | 177 | case _ => | |
169 | 178 | throw("Unknow type of user Addr") | |
170 | 179 | } | |
171 | 180 | let swopAmount = valueOrElse(getInteger(govAddress, (user + kUserGSwopInGov)), 0) | |
172 | 181 | let gSwopAmount = valueOrElse(getInteger(govAddress, (user + kUserGSwopInGov)), swopAmount) | |
173 | 182 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
174 | 183 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
175 | 184 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
176 | 185 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
177 | 186 | else false) | |
178 | 187 | then (feeScale6 - parseIntValue(discounts[0])) | |
179 | 188 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
180 | 189 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
181 | 190 | else false) | |
182 | 191 | then (feeScale6 - parseIntValue(discounts[1])) | |
183 | 192 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
184 | 193 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
185 | 194 | else false) | |
186 | 195 | then (feeScale6 - parseIntValue(discounts[2])) | |
187 | 196 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
188 | 197 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
189 | 198 | else false) | |
190 | 199 | then (feeScale6 - parseIntValue(discounts[3])) | |
191 | 200 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
192 | 201 | then (feeScale6 - parseIntValue(discounts[4])) | |
193 | 202 | else feeScale6 | |
194 | 203 | } | |
195 | 204 | ||
196 | 205 | ||
197 | 206 | func _A () = { | |
198 | 207 | let t1 = future_A_time | |
199 | 208 | let A1 = future_A | |
200 | 209 | if ((t1 > blockTimestamp)) | |
201 | 210 | then { | |
202 | 211 | let A0 = initial_A | |
203 | 212 | let t0 = initial_A_time | |
204 | 213 | if ((A1 > A0)) | |
205 | 214 | then (A0 + (((A1 - A0) * (blockTimestamp - t0)) / (t1 - t0))) | |
206 | 215 | else (A0 - (((A0 - A1) * (blockTimestamp - t0)) / (t1 - t0))) | |
207 | 216 | } | |
208 | 217 | else A1 | |
209 | 218 | } | |
210 | 219 | ||
211 | 220 | ||
212 | 221 | func _xp () = { | |
213 | 222 | func assetBalances (acc,assetId) = (acc :+ valueOrElse(getInteger(this, (assetId + kAssetBalance)), 0)) | |
214 | 223 | ||
215 | 224 | let $l = assetIds | |
216 | 225 | let $s = size($l) | |
217 | 226 | let $acc0 = nil | |
218 | 227 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
219 | 228 | then $a | |
220 | 229 | else assetBalances($a, $l[$i]) | |
221 | 230 | ||
222 | 231 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
223 | 232 | then $a | |
224 | 233 | else throw("List size exceeds 10") | |
225 | 234 | ||
226 | 235 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
227 | 236 | } | |
228 | 237 | ||
229 | 238 | ||
230 | 239 | func _xp_mem (xp) = xp | |
231 | 240 | ||
232 | 241 | ||
233 | 242 | func sumList (acc,element) = (acc + element) | |
234 | 243 | ||
235 | 244 | ||
236 | 245 | func get_D (xp,amp) = { | |
237 | 246 | let @ = invoke(this, "D", [xp, amp], nil) | |
238 | 247 | if ($isInstanceOf(@, "Int")) | |
239 | 248 | then @ | |
240 | 249 | else throw(($getType(@) + " couldn't be cast to Int")) | |
241 | 250 | } | |
242 | 251 | ||
243 | 252 | ||
244 | 253 | func get_D_internal (xp,amp) = { | |
245 | 254 | let S = { | |
246 | 255 | let $l = xp | |
247 | 256 | let $s = size($l) | |
248 | 257 | let $acc0 = 0 | |
249 | 258 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
250 | 259 | then $a | |
251 | 260 | else sumList($a, $l[$i]) | |
252 | 261 | ||
253 | 262 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
254 | 263 | then $a | |
255 | 264 | else throw("List size exceeds 10") | |
256 | 265 | ||
257 | 266 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
258 | 267 | } | |
259 | 268 | if ((S == 0)) | |
260 | 269 | then 0 | |
261 | 270 | else { | |
262 | 271 | let Ann = (amp * nCoins) | |
263 | 272 | let AnnS = (toBigInt(Ann) * toBigInt(S)) | |
264 | 273 | let Ann1 = toBigInt((Ann - 1)) | |
265 | 274 | func Dproc (acc,i) = if ((acc._2 == true)) | |
266 | 275 | then acc | |
267 | 276 | else { | |
268 | 277 | let Dprev = acc._1 | |
269 | 278 | func D_PProc (D_P,i) = if ((nCoins > i)) | |
270 | 279 | then ((D_P * Dprev) / (toBigInt(xp[i]) * toBigInt(nCoins))) | |
271 | 280 | else D_P | |
272 | 281 | ||
273 | 282 | let D_P = { | |
274 | 283 | let $l = iter10 | |
275 | 284 | let $s = size($l) | |
276 | 285 | let $acc0 = Dprev | |
277 | 286 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
278 | 287 | then $a | |
279 | 288 | else D_PProc($a, $l[$i]) | |
280 | 289 | ||
281 | 290 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
282 | 291 | then $a | |
283 | 292 | else throw("List size exceeds 10") | |
284 | 293 | ||
285 | 294 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
286 | 295 | } | |
287 | 296 | let D = fraction((AnnS + (toBigInt(nCoins) * D_P)), Dprev, ((Ann1 * Dprev) + (toBigInt((nCoins + 1)) * D_P))) | |
288 | 297 | if ((D > Dprev)) | |
289 | 298 | then if ((1 >= toInt((D - Dprev)))) | |
290 | 299 | then $Tuple2(D, true) | |
291 | 300 | else $Tuple2(D, false) | |
292 | 301 | else if ((1 >= toInt((Dprev - D)))) | |
293 | 302 | then $Tuple2(D, true) | |
294 | 303 | else $Tuple2(D, false) | |
295 | 304 | } | |
296 | 305 | ||
297 | - | let $ | |
306 | + | let $t068206886 = { | |
298 | 307 | let $l = iter15 | |
299 | 308 | let $s = size($l) | |
300 | 309 | let $acc0 = $Tuple2(toBigInt(S), false) | |
301 | 310 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
302 | 311 | then $a | |
303 | 312 | else Dproc($a, $l[$i]) | |
304 | 313 | ||
305 | 314 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
306 | 315 | then $a | |
307 | 316 | else throw("List size exceeds 15") | |
308 | 317 | ||
309 | 318 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
310 | 319 | } | |
311 | - | let D = $ | |
312 | - | let finished = $ | |
320 | + | let D = $t068206886._1 | |
321 | + | let finished = $t068206886._2 | |
313 | 322 | if ((finished == false)) | |
314 | 323 | then throw(("get_D() not finished with " + toString(D))) | |
315 | 324 | else toInt(D) | |
316 | 325 | } | |
317 | 326 | } | |
318 | 327 | ||
319 | 328 | ||
320 | 329 | func getDMem (xp,amp) = get_D(_xp_mem(xp), amp) | |
321 | 330 | ||
322 | 331 | ||
323 | 332 | func getY (in,out,x,xp_) = if (assert((in != out))) | |
324 | 333 | then throw("same coin") | |
325 | 334 | else if (assert(if ((out >= 0)) | |
326 | 335 | then (in >= 0) | |
327 | 336 | else false)) | |
328 | 337 | then throw("below zero") | |
329 | 338 | else if (assert(if ((nCoins > out)) | |
330 | 339 | then (nCoins > in) | |
331 | 340 | else false)) | |
332 | 341 | then throw("above N_COINS") | |
333 | 342 | else { | |
334 | 343 | let amp = _A() | |
335 | 344 | let D = get_D(xp_, amp) | |
336 | 345 | let Ann = (amp * nCoins) | |
337 | 346 | func S_c (acc,i) = { | |
338 | - | let $ | |
339 | - | let S_ = $ | |
340 | - | let c = $ | |
347 | + | let $t074577474 = acc | |
348 | + | let S_ = $t074577474._1 | |
349 | + | let c = $t074577474._2 | |
341 | 350 | let x_ = if ((in == i)) | |
342 | 351 | then x | |
343 | 352 | else xp_[i] | |
344 | 353 | if (if ((i != out)) | |
345 | 354 | then (nCoins > i) | |
346 | 355 | else false) | |
347 | 356 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
348 | 357 | else $Tuple2(S_, c) | |
349 | 358 | } | |
350 | 359 | ||
351 | - | let $ | |
360 | + | let $t076827737 = { | |
352 | 361 | let $l = iter10 | |
353 | 362 | let $s = size($l) | |
354 | 363 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
355 | 364 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
356 | 365 | then $a | |
357 | 366 | else S_c($a, $l[$i]) | |
358 | 367 | ||
359 | 368 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
360 | 369 | then $a | |
361 | 370 | else throw("List size exceeds 10") | |
362 | 371 | ||
363 | 372 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
364 | 373 | } | |
365 | - | let S_ = $ | |
366 | - | let c_ = $ | |
374 | + | let S_ = $t076827737._1 | |
375 | + | let c_ = $t076827737._2 | |
367 | 376 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
368 | 377 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
369 | 378 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
370 | 379 | then acc | |
371 | 380 | else { | |
372 | 381 | let y_prev = acc._1 | |
373 | 382 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
374 | 383 | if ((y > y_prev)) | |
375 | 384 | then if ((1 >= toInt((y - y_prev)))) | |
376 | 385 | then $Tuple2(y, true) | |
377 | 386 | else $Tuple2(y, false) | |
378 | 387 | else if ((1 >= toInt((y_prev - y)))) | |
379 | 388 | then $Tuple2(y, true) | |
380 | 389 | else $Tuple2(y, false) | |
381 | 390 | } | |
382 | 391 | ||
383 | - | let $ | |
392 | + | let $t082198286 = { | |
384 | 393 | let $l = iter16 | |
385 | 394 | let $s = size($l) | |
386 | 395 | let $acc0 = $Tuple2(toBigInt(D), false) | |
387 | 396 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
388 | 397 | then $a | |
389 | 398 | else y_proc($a, $l[$i]) | |
390 | 399 | ||
391 | 400 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
392 | 401 | then $a | |
393 | 402 | else throw("List size exceeds 16") | |
394 | 403 | ||
395 | 404 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
396 | 405 | } | |
397 | - | let y = $ | |
398 | - | let finished = $ | |
406 | + | let y = $t082198286._1 | |
407 | + | let finished = $t082198286._2 | |
399 | 408 | if ((finished == false)) | |
400 | 409 | then throw(("getY() not finished with " + toString(y))) | |
401 | 410 | else toInt(y) | |
402 | 411 | } | |
403 | 412 | ||
404 | 413 | ||
405 | 414 | func get_y_D (A_,in,xp,D) = if (assert((in >= 0))) | |
406 | 415 | then throw("i below zero") | |
407 | 416 | else if (assert((nCoins > in))) | |
408 | 417 | then throw("i above N_COINS") | |
409 | 418 | else { | |
410 | 419 | let Ann = (A_ * nCoins) | |
411 | 420 | func S_c (acc,i) = { | |
412 | - | let $ | |
413 | - | let S_ = $ | |
414 | - | let c = $ | |
421 | + | let $t086658682 = acc | |
422 | + | let S_ = $t086658682._1 | |
423 | + | let c = $t086658682._2 | |
415 | 424 | let x_ = if (if ((in != i)) | |
416 | 425 | then (nCoins > i) | |
417 | 426 | else false) | |
418 | 427 | then xp[i] | |
419 | 428 | else 0 | |
420 | 429 | if (if ((nCoins > i)) | |
421 | 430 | then (in != i) | |
422 | 431 | else false) | |
423 | 432 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
424 | 433 | else $Tuple2(S_, c) | |
425 | 434 | } | |
426 | 435 | ||
427 | - | let $ | |
436 | + | let $t089028957 = { | |
428 | 437 | let $l = iter10 | |
429 | 438 | let $s = size($l) | |
430 | 439 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
431 | 440 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
432 | 441 | then $a | |
433 | 442 | else S_c($a, $l[$i]) | |
434 | 443 | ||
435 | 444 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
436 | 445 | then $a | |
437 | 446 | else throw("List size exceeds 10") | |
438 | 447 | ||
439 | 448 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
440 | 449 | } | |
441 | - | let S_ = $ | |
442 | - | let c_ = $ | |
450 | + | let S_ = $t089028957._1 | |
451 | + | let c_ = $t089028957._2 | |
443 | 452 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
444 | 453 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
445 | 454 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
446 | 455 | then acc | |
447 | 456 | else { | |
448 | 457 | let y_prev = acc._1 | |
449 | 458 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
450 | 459 | if ((y > y_prev)) | |
451 | 460 | then if ((1 >= toInt((y - y_prev)))) | |
452 | 461 | then $Tuple2(y, true) | |
453 | 462 | else $Tuple2(y, false) | |
454 | 463 | else if ((1 >= toInt((y_prev - y)))) | |
455 | 464 | then $Tuple2(y, true) | |
456 | 465 | else $Tuple2(y, false) | |
457 | 466 | } | |
458 | 467 | ||
459 | - | let $ | |
468 | + | let $t094409509 = { | |
460 | 469 | let $l = iter16 | |
461 | 470 | let $s = size($l) | |
462 | 471 | let $acc0 = $Tuple2(toBigInt(D), false) | |
463 | 472 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
464 | 473 | then $a | |
465 | 474 | else y_D_proc($a, $l[$i]) | |
466 | 475 | ||
467 | 476 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
468 | 477 | then $a | |
469 | 478 | else throw("List size exceeds 16") | |
470 | 479 | ||
471 | 480 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
472 | 481 | } | |
473 | - | let y = $ | |
474 | - | let finished = $ | |
482 | + | let y = $t094409509._1 | |
483 | + | let finished = $t094409509._2 | |
475 | 484 | if ((finished == false)) | |
476 | 485 | then throw(("get_y_D() not finished with " + toString(y))) | |
477 | 486 | else toInt(y) | |
478 | 487 | } | |
479 | 488 | ||
480 | 489 | ||
481 | 490 | func _calcWithdrawOneCoin (xp,_token_amount,i,caller) = { | |
482 | 491 | let feeDiscount = calculateFeeDiscount(caller) | |
483 | 492 | let amp = _A() | |
484 | 493 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
485 | 494 | let total_supply = shareSupply | |
486 | 495 | let D0 = get_D(xp, amp) | |
487 | 496 | let D1 = (D0 - fraction(_token_amount, D0, total_supply)) | |
488 | 497 | let new_y = get_y_D(amp, i, xp, D1) | |
489 | 498 | let dy_0 = (xp[i] - new_y) | |
490 | 499 | func xp_reduced_proc (acc,xp_j) = { | |
491 | - | let $ | |
492 | - | let xp_reduced = $ | |
493 | - | let index = $ | |
500 | + | let $t01015010179 = acc | |
501 | + | let xp_reduced = $t01015010179._1 | |
502 | + | let index = $t01015010179._2 | |
494 | 503 | let dx_expected = if ((index == i)) | |
495 | 504 | then (fraction(xp_j, D1, D0) - new_y) | |
496 | 505 | else (xp_j - fraction(xp_j, D1, D0)) | |
497 | 506 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
498 | 507 | } | |
499 | 508 | ||
500 | - | let $ | |
509 | + | let $t01044110505 = { | |
501 | 510 | let $l = xp | |
502 | 511 | let $s = size($l) | |
503 | 512 | let $acc0 = $Tuple2(nil, 0) | |
504 | 513 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
505 | 514 | then $a | |
506 | 515 | else xp_reduced_proc($a, $l[$i]) | |
507 | 516 | ||
508 | 517 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
509 | 518 | then $a | |
510 | 519 | else throw("List size exceeds 10") | |
511 | 520 | ||
512 | 521 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
513 | 522 | } | |
514 | - | let xp_reduced = $ | |
515 | - | let index = $ | |
523 | + | let xp_reduced = $t01044110505._1 | |
524 | + | let index = $t01044110505._2 | |
516 | 525 | let xp_reduced_i = xp_reduced[i] | |
517 | 526 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
518 | 527 | $Tuple2(dy, (dy_0 - dy)) | |
519 | 528 | } | |
520 | 529 | ||
521 | 530 | ||
522 | 531 | func getStrAssetId (assetId) = match assetId { | |
523 | 532 | case id: ByteVector => | |
524 | 533 | toBase58String(id) | |
525 | 534 | case waves: Unit => | |
526 | 535 | "WAVES" | |
527 | 536 | case _ => | |
528 | 537 | throw("Match error") | |
529 | 538 | } | |
530 | 539 | ||
531 | 540 | ||
532 | 541 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
533 | 542 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
534 | 543 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
535 | 544 | ||
536 | 545 | ||
537 | 546 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
538 | 547 | then { | |
539 | - | let $ | |
540 | - | let call = $ | |
541 | - | let stakingAddr = $ | |
548 | + | let $t01106911135 = calcStakingFuncAndAddres(stake, assetId) | |
549 | + | let call = $t01106911135._1 | |
550 | + | let stakingAddr = $t01106911135._2 | |
542 | 551 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
543 | 552 | } | |
544 | 553 | else { | |
545 | - | let $ | |
546 | - | let call = $ | |
547 | - | let stakingAddr = $ | |
554 | + | let $t01122111287 = calcStakingFuncAndAddres(stake, assetId) | |
555 | + | let call = $t01122111287._1 | |
556 | + | let stakingAddr = $t01122111287._2 | |
548 | 557 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
549 | 558 | } | |
550 | 559 | ||
551 | 560 | ||
552 | 561 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
553 | 562 | then { | |
554 | - | let $ | |
555 | - | let call = $ | |
556 | - | let addr = $ | |
557 | - | let params = $ | |
558 | - | let payments = $ | |
563 | + | let $t01147411576 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
564 | + | let call = $t01147411576._1 | |
565 | + | let addr = $t01147411576._2 | |
566 | + | let params = $t01147411576._3 | |
567 | + | let payments = $t01147411576._4 | |
559 | 568 | invoke(addr, call, params, payments) | |
560 | 569 | } | |
561 | 570 | else 0 | |
562 | 571 | ||
563 | 572 | ||
564 | 573 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
565 | 574 | then { | |
566 | - | let $ | |
567 | - | let call = $ | |
568 | - | let addr = $ | |
569 | - | let params = $ | |
570 | - | let payments = $ | |
575 | + | let $t01176111864 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
576 | + | let call = $t01176111864._1 | |
577 | + | let addr = $t01176111864._2 | |
578 | + | let params = $t01176111864._3 | |
579 | + | let payments = $t01176111864._4 | |
571 | 580 | invoke(addr, call, params, payments) | |
572 | 581 | } | |
573 | 582 | else 0 | |
574 | 583 | ||
575 | 584 | ||
576 | 585 | func stakedAmount (assetId) = { | |
577 | 586 | let stakedAmountCalculated = match assetId { | |
578 | 587 | case aId: ByteVector => | |
579 | 588 | if ((aId == USDN)) | |
580 | 589 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
581 | 590 | else 0 | |
582 | 591 | case _: Unit => | |
583 | 592 | 0 | |
584 | 593 | case _ => | |
585 | 594 | throw("Match error") | |
586 | 595 | } | |
587 | 596 | match stakedAmountCalculated { | |
588 | 597 | case i: Int => | |
589 | 598 | i | |
590 | 599 | case _ => | |
591 | 600 | 0 | |
592 | 601 | } | |
593 | 602 | } | |
594 | 603 | ||
595 | 604 | ||
596 | 605 | func checkSuspicious () = { | |
597 | 606 | let contractBalances = _xp() | |
598 | 607 | func checkBalance (acc,assetId) = { | |
599 | - | let $ | |
600 | - | let suspicious = $ | |
601 | - | let i = $ | |
608 | + | let $t01247512500 = acc | |
609 | + | let suspicious = $t01247512500._1 | |
610 | + | let i = $t01247512500._2 | |
602 | 611 | if (suspicious) | |
603 | 612 | then $Tuple2(suspicious, i) | |
604 | 613 | else { | |
605 | 614 | let aBalance = (assetBalance(this, fromBase58String(assetId)) + stakedAmount(fromBase58String(assetId))) | |
606 | 615 | if ((contractBalances[i] > aBalance)) | |
607 | 616 | then $Tuple2(true, i) | |
608 | 617 | else $Tuple2(false, (i + 1)) | |
609 | 618 | } | |
610 | 619 | } | |
611 | 620 | ||
612 | 621 | let $l = assetIds | |
613 | 622 | let $s = size($l) | |
614 | 623 | let $acc0 = $Tuple2(false, 0) | |
615 | 624 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
616 | 625 | then $a | |
617 | 626 | else checkBalance($a, $l[$i]) | |
618 | 627 | ||
619 | 628 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
620 | 629 | then $a | |
621 | 630 | else throw("List size exceeds 10") | |
622 | 631 | ||
623 | 632 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
624 | 633 | } | |
625 | 634 | ||
626 | 635 | ||
627 | 636 | func suspendSuspicious (i) = suspend(("Suspicious state with asset: " + assetIds[i])) | |
628 | 637 | ||
629 | 638 | ||
630 | 639 | func returnPayments (caller,payments) = { | |
631 | 640 | func parsePayments (acc,payment) = (acc :+ ScriptTransfer(caller, payment.amount, payment.assetId)) | |
632 | 641 | ||
633 | 642 | let $l = payments | |
634 | 643 | let $s = size($l) | |
635 | 644 | let $acc0 = nil | |
636 | 645 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
637 | 646 | then $a | |
638 | 647 | else parsePayments($a, $l[$i]) | |
639 | 648 | ||
640 | 649 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
641 | 650 | then $a | |
642 | 651 | else throw("List size exceeds 10") | |
643 | 652 | ||
644 | 653 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
645 | 654 | } | |
646 | 655 | ||
647 | 656 | ||
648 | 657 | func checkDAppThreshold (newBalances) = { | |
649 | 658 | let dAppThresholdCoef = valueOrErrorMessage(getInteger(this, kDAppThresholdCoef), "No dAppThresholdCoef key") | |
650 | 659 | let thresholdScale = 10000 | |
651 | 660 | let maxBalance = max(newBalances) | |
652 | 661 | let minBalance = min(newBalances) | |
653 | 662 | let ratio = fraction(maxBalance, thresholdScale, minBalance) | |
654 | 663 | if ((ratio > (dAppThresholdCoef * thresholdScale))) | |
655 | 664 | then throw("New balance in assets of the DApp is less than threshold") | |
656 | 665 | else false | |
657 | 666 | } | |
658 | 667 | ||
659 | 668 | ||
660 | 669 | func checkCoins (assetIds) = { | |
661 | 670 | let coins = split(assetIds, ",") | |
662 | 671 | if ((size(coins) > 10)) | |
663 | 672 | then throw("To many coins, max coins size 10") | |
664 | 673 | else { | |
665 | 674 | func checkCoin (error,assetId) = { | |
666 | 675 | let asset = valueOrErrorMessage(fromBase58String(assetId), ("fromBase58String: " + assetId)) | |
667 | 676 | let decimals = valueOrErrorMessage(assetInfo(asset), ("assetInfo: " + assetId)).decimals | |
668 | 677 | if ((decimals != DECIMALS)) | |
669 | 678 | then throw("wrong decimals") | |
670 | 679 | else false | |
671 | 680 | } | |
672 | 681 | ||
673 | 682 | let $l = coins | |
674 | 683 | let $s = size($l) | |
675 | 684 | let $acc0 = false | |
676 | 685 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
677 | 686 | then $a | |
678 | 687 | else checkCoin($a, $l[$i]) | |
679 | 688 | ||
680 | 689 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
681 | 690 | then $a | |
682 | 691 | else throw("List size exceeds 10") | |
683 | 692 | ||
684 | 693 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
685 | 694 | } | |
686 | 695 | } | |
687 | 696 | ||
688 | 697 | ||
689 | 698 | func calcWithdraw (msg,minAmounts,unlockAmount) = { | |
690 | 699 | let suspicious = checkSuspicious() | |
691 | 700 | if (suspicious._1) | |
692 | 701 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
693 | 702 | else { | |
694 | 703 | let pmtAmount = if ((size(msg.payments) > 0)) | |
695 | 704 | then if ((size(msg.payments) != 1)) | |
696 | 705 | then throw("size(payments) != 1") | |
697 | 706 | else { | |
698 | 707 | let pmtAssetId = msg.payments[0].assetId | |
699 | 708 | if ((shareAssetId != pmtAssetId)) | |
700 | 709 | then throw("unknown payment token") | |
701 | 710 | else msg.payments[0].amount | |
702 | 711 | } | |
703 | 712 | else 0 | |
704 | 713 | let withdrawAmount = (pmtAmount + unlockAmount) | |
705 | 714 | func calcScriptActions (acc,balance) = { | |
706 | - | let $ | |
707 | - | let scriptActions = $ | |
708 | - | let i = $ | |
715 | + | let $t01491614944 = acc | |
716 | + | let scriptActions = $t01491614944._1 | |
717 | + | let i = $t01491614944._2 | |
709 | 718 | let wAmount = fraction(balance, withdrawAmount, shareSupply) | |
710 | 719 | if (assert((wAmount >= minAmounts[i]))) | |
711 | 720 | then throw("Withdrawal resulted in fewer coins than expected") | |
712 | 721 | else { | |
713 | 722 | let us = unstake(wAmount, assetIds[i]) | |
714 | 723 | if ((us == us)) | |
715 | 724 | then $Tuple2((scriptActions ++ [IntegerEntry((assetIds[i] + kAssetBalance), (balance - wAmount)), ScriptTransfer(msg.caller, wAmount, fromBase58String(assetIds[i]))]), (i + 1)) | |
716 | 725 | else throw("Strict value is not equal to itself.") | |
717 | 726 | } | |
718 | 727 | } | |
719 | 728 | ||
720 | - | let $ | |
729 | + | let $t01543315501 = { | |
721 | 730 | let $l = _xp() | |
722 | 731 | let $s = size($l) | |
723 | 732 | let $acc0 = $Tuple2(nil, 0) | |
724 | 733 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
725 | 734 | then $a | |
726 | 735 | else calcScriptActions($a, $l[$i]) | |
727 | 736 | ||
728 | 737 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
729 | 738 | then $a | |
730 | 739 | else throw("List size exceeds 10") | |
731 | 740 | ||
732 | 741 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
733 | 742 | } | |
734 | - | let scriptActions = $ | |
735 | - | let i = $ | |
743 | + | let scriptActions = $t01543315501._1 | |
744 | + | let i = $t01543315501._2 | |
736 | 745 | (scriptActions ++ [Burn(shareAssetId, withdrawAmount), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))]) | |
737 | 746 | } | |
738 | 747 | } | |
739 | 748 | ||
740 | 749 | ||
741 | 750 | func calcWithdrawOneCoinEntries (msg,tokenOut,minAmount,unlockAmount) = { | |
742 | 751 | let suspicious = checkSuspicious() | |
743 | 752 | if (suspicious._1) | |
744 | 753 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
745 | 754 | else { | |
746 | 755 | let pmtAmount = if ((size(msg.payments) > 0)) | |
747 | 756 | then { | |
748 | 757 | let pmtAssetId = msg.payments[0].assetId | |
749 | 758 | if ((shareAssetId != pmtAssetId)) | |
750 | 759 | then throw("unknown payment token") | |
751 | 760 | else msg.payments[0].amount | |
752 | 761 | } | |
753 | 762 | else 0 | |
754 | 763 | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
755 | 764 | let tokenOutB58 = fromBase58String(tokenOut) | |
756 | 765 | let withdrawAmount = (pmtAmount + unlockAmount) | |
757 | 766 | let xp = _xp() | |
758 | - | let $ | |
759 | - | let dy = $ | |
760 | - | let dy_fee = $ | |
767 | + | let $t01636316450 = _calcWithdrawOneCoin(xp, withdrawAmount, outIndex, msg.originCaller) | |
768 | + | let dy = $t01636316450._1 | |
769 | + | let dy_fee = $t01636316450._2 | |
761 | 770 | if (assert((dy >= minAmount))) | |
762 | 771 | then throw("Not enough coins removed") | |
763 | 772 | else { | |
764 | 773 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
765 | 774 | let dy_and_fee = (dy + dy_fee) | |
766 | 775 | func makeNewBalances (acc,tokenBalance) = { | |
767 | - | let $ | |
768 | - | let newBalances = $ | |
769 | - | let i = $ | |
776 | + | let $t01670816734 = acc | |
777 | + | let newBalances = $t01670816734._1 | |
778 | + | let i = $t01670816734._2 | |
770 | 779 | if ((i == outIndex)) | |
771 | 780 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
772 | 781 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
773 | 782 | } | |
774 | 783 | ||
775 | - | let $ | |
784 | + | let $t01690116962 = { | |
776 | 785 | let $l = xp | |
777 | 786 | let $s = size($l) | |
778 | 787 | let $acc0 = $Tuple2(nil, 0) | |
779 | 788 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
780 | 789 | then $a | |
781 | 790 | else makeNewBalances($a, $l[$i]) | |
782 | 791 | ||
783 | 792 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
784 | 793 | then $a | |
785 | 794 | else throw("List size exceeds 10") | |
786 | 795 | ||
787 | 796 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
788 | 797 | } | |
789 | - | let newBalances = $ | |
790 | - | let v = $ | |
798 | + | let newBalances = $t01690116962._1 | |
799 | + | let v = $t01690116962._2 | |
791 | 800 | if (checkDAppThreshold(newBalances)) | |
792 | 801 | then throw() | |
793 | 802 | else { | |
794 | 803 | let us = unstake(dy_and_fee, tokenOut) | |
795 | 804 | if ((us == us)) | |
796 | 805 | then { | |
797 | 806 | let lpFees = (dy_fee - governanceFees) | |
798 | 807 | let airdrop = if ((lpFees > 0)) | |
799 | 808 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
800 | 809 | else 0 | |
801 | 810 | if ((airdrop == airdrop)) | |
802 | 811 | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - withdrawAmount))] | |
803 | 812 | else throw("Strict value is not equal to itself.") | |
804 | 813 | } | |
805 | 814 | else throw("Strict value is not equal to itself.") | |
806 | 815 | } | |
807 | 816 | } | |
808 | 817 | } | |
809 | 818 | } | |
810 | 819 | ||
811 | 820 | ||
812 | 821 | @Callable(msg) | |
813 | 822 | func D (xp,amp) = { | |
814 | 823 | let D = get_D_internal(xp, amp) | |
815 | 824 | $Tuple2([IntegerEntry("D", D)], D) | |
816 | 825 | } | |
817 | 826 | ||
818 | 827 | ||
819 | 828 | ||
820 | 829 | @Callable(msg) | |
821 | 830 | func init (assetIds,_A,_dAppThresholdCoef) = if (!(isDataStorageUntouched(this))) | |
822 | 831 | then throw("Already initialized") | |
823 | 832 | else if ((0 >= _A)) | |
824 | 833 | then throw("Amp must be must > 0") | |
825 | 834 | else if ((0 >= _dAppThresholdCoef)) | |
826 | 835 | then throw("dApp Threshold Coef must be > 0") | |
827 | 836 | else { | |
828 | 837 | let shareName = "s_Multi_USD" | |
829 | 838 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
830 | 839 | let issueToken = Issue(shareName, shareDescription, 0, 6, true) | |
831 | 840 | let tokenId = calculateAssetId(issueToken) | |
832 | 841 | if (checkCoins(assetIds)) | |
833 | 842 | then throw() | |
834 | 843 | else [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
835 | 844 | } | |
836 | 845 | ||
837 | 846 | ||
838 | 847 | ||
839 | 848 | @Callable(msg) | |
840 | - | func addLiquidity (minMintAmount,stakeFarming,lockType) = valueOrElse(isActive(), { | |
849 | + | func addLiquidity (minMintAmount,stakeFarming,lockType) = valueOrElse(isActive(), valueOrElse(isDepricated(), { | |
841 | 850 | let amp = _A() | |
842 | 851 | let xp = _xp() | |
843 | 852 | let D0 = if ((shareSupply == 0)) | |
844 | 853 | then 0 | |
845 | 854 | else getDMem(xp, amp) | |
846 | - | let $ | |
855 | + | let $t01913119385 = if (if ((lockType > 0)) | |
847 | 856 | then (msg.payments[(size(msg.payments) - 1)].assetId == unit) | |
848 | 857 | else false) | |
849 | 858 | then $Tuple2(removeByIndex(msg.payments, (size(msg.payments) - 1)), [msg.payments[(size(msg.payments) - 1)]]) | |
850 | 859 | else $Tuple2(msg.payments, nil) | |
851 | - | let payments = $ | |
852 | - | let lockFee = $ | |
860 | + | let payments = $t01913119385._1 | |
861 | + | let lockFee = $t01913119385._2 | |
853 | 862 | let paymentsSize = size(payments) | |
854 | 863 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
855 | 864 | then throw(("payments size > " + toString(nCoins))) | |
856 | 865 | else if ((1 > paymentsSize)) | |
857 | 866 | then throw("payments size < 1") | |
858 | 867 | else if (if ((shareSupply == 0)) | |
859 | 868 | then (nCoins != paymentsSize) | |
860 | 869 | else false) | |
861 | 870 | then throw("initial deposit requires all coins") | |
862 | 871 | else { | |
863 | 872 | func paymantValid (acc,payment) = if (containsElement(assetIds, getStrAssetId(payment.assetId))) | |
864 | 873 | then true | |
865 | 874 | else throw("Invalid asset in payment") | |
866 | 875 | ||
867 | 876 | let $l = payments | |
868 | 877 | let $s = size($l) | |
869 | 878 | let $acc0 = false | |
870 | 879 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
871 | 880 | then $a | |
872 | 881 | else paymantValid($a, $l[$i]) | |
873 | 882 | ||
874 | 883 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
875 | 884 | then $a | |
876 | 885 | else throw("List size exceeds 10") | |
877 | 886 | ||
878 | 887 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
879 | 888 | } | |
880 | 889 | ||
881 | 890 | if (!(validPayments(paymentsSize))) | |
882 | 891 | then throw() | |
883 | 892 | else { | |
884 | 893 | let suspicious = checkSuspicious() | |
885 | 894 | if (suspicious._1) | |
886 | 895 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
887 | 896 | else { | |
888 | 897 | func parsePayments (acc,assetId) = { | |
889 | - | let $ | |
890 | - | let newBalances = $ | |
891 | - | let i = $ | |
898 | + | let $t02025520281 = acc | |
899 | + | let newBalances = $t02025520281._1 | |
900 | + | let i = $t02025520281._2 | |
892 | 901 | func parsePayment (newBalance,payment) = if ((getStrAssetId(payment.assetId) == assetId)) | |
893 | 902 | then (newBalance + payment.amount) | |
894 | 903 | else newBalance | |
895 | 904 | ||
896 | 905 | let newBalace = { | |
897 | 906 | let $l = payments | |
898 | 907 | let $s = size($l) | |
899 | 908 | let $acc0 = xp[i] | |
900 | 909 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
901 | 910 | then $a | |
902 | 911 | else parsePayment($a, $l[$i]) | |
903 | 912 | ||
904 | 913 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
905 | 914 | then $a | |
906 | 915 | else throw("List size exceeds 10") | |
907 | 916 | ||
908 | 917 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
909 | 918 | } | |
910 | 919 | $Tuple2((newBalances :+ newBalace), (i + 1)) | |
911 | 920 | } | |
912 | 921 | ||
913 | - | let $ | |
922 | + | let $t02063120698 = { | |
914 | 923 | let $l = assetIds | |
915 | 924 | let $s = size($l) | |
916 | 925 | let $acc0 = $Tuple2(nil, 0) | |
917 | 926 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
918 | 927 | then $a | |
919 | 928 | else parsePayments($a, $l[$i]) | |
920 | 929 | ||
921 | 930 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
922 | 931 | then $a | |
923 | 932 | else throw("List size exceeds 10") | |
924 | 933 | ||
925 | 934 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
926 | 935 | } | |
927 | - | let newBalances = $ | |
928 | - | let k = $ | |
936 | + | let newBalances = $t02063120698._1 | |
937 | + | let k = $t02063120698._2 | |
929 | 938 | if (checkDAppThreshold(newBalances)) | |
930 | 939 | then throw() | |
931 | 940 | else { | |
932 | 941 | let D1 = getDMem(newBalances, amp) | |
933 | 942 | if (assert((D1 > D0))) | |
934 | 943 | then throw("D1 > D0") | |
935 | 944 | else { | |
936 | 945 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
937 | 946 | func calcScriptActions (acc,newBalance) = { | |
938 | - | let $ | |
939 | - | let invBalances = $ | |
940 | - | let scriptActions = $ | |
941 | - | let i = $ | |
947 | + | let $t02101821059 = acc | |
948 | + | let invBalances = $t02101821059._1 | |
949 | + | let scriptActions = $t02101821059._2 | |
950 | + | let i = $t02101821059._3 | |
942 | 951 | if ((shareSupply > 0)) | |
943 | 952 | then { | |
944 | 953 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
945 | 954 | let fees = { | |
946 | 955 | let idealBalance = fraction(D1, xp[i], D0) | |
947 | 956 | let difference = if ((idealBalance > newBalance)) | |
948 | 957 | then (idealBalance - newBalance) | |
949 | 958 | else (newBalance - idealBalance) | |
950 | 959 | fraction(_fee, difference, feeScale6) | |
951 | 960 | } | |
952 | 961 | let governanceFees = fraction(fees, feeGovernance, feeScale6) | |
953 | 962 | let finalBalance = (newBalance - fees) | |
954 | 963 | let invariantBalance = (newBalance - fees) | |
955 | 964 | let pmt = (newBalance - xp[i]) | |
956 | 965 | let lpFees = (fees - governanceFees) | |
957 | 966 | let inv = if ((pmt > 0)) | |
958 | 967 | then stake((pmt - fees), assetIds[i]) | |
959 | 968 | else unstake(fees, assetIds[i]) | |
960 | 969 | if ((inv == inv)) | |
961 | 970 | then { | |
962 | 971 | let airdrop = if ((lpFees > 0)) | |
963 | 972 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(fromBase58String(assetIds[i]), lpFees)]) | |
964 | 973 | else 0 | |
965 | 974 | if ((airdrop == airdrop)) | |
966 | 975 | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
967 | 976 | else throw("Strict value is not equal to itself.") | |
968 | 977 | } | |
969 | 978 | else throw("Strict value is not equal to itself.") | |
970 | 979 | } | |
971 | 980 | else { | |
972 | 981 | let inv = stake(newBalance, assetIds[i]) | |
973 | 982 | if ((inv == inv)) | |
974 | 983 | then $Tuple3((invBalances :+ newBalance), (scriptActions :+ IntegerEntry((assetIds[i] + kAssetBalance), newBalance)), (i + 1)) | |
975 | 984 | else throw("Strict value is not equal to itself.") | |
976 | 985 | } | |
977 | 986 | } | |
978 | 987 | ||
979 | - | let $ | |
988 | + | let $t02276422852 = { | |
980 | 989 | let $l = newBalances | |
981 | 990 | let $s = size($l) | |
982 | 991 | let $acc0 = $Tuple3(nil, nil, 0) | |
983 | 992 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
984 | 993 | then $a | |
985 | 994 | else calcScriptActions($a, $l[$i]) | |
986 | 995 | ||
987 | 996 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
988 | 997 | then $a | |
989 | 998 | else throw("List size exceeds 10") | |
990 | 999 | ||
991 | 1000 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
992 | 1001 | } | |
993 | - | let invBalances = $ | |
994 | - | let scriptActions = $ | |
1002 | + | let invBalances = $t02276422852._1 | |
1003 | + | let scriptActions = $t02276422852._2 | |
995 | 1004 | let D2 = getDMem(invBalances, amp) | |
996 | 1005 | let mint_amount = if ((shareSupply == 0)) | |
997 | 1006 | then D1 | |
998 | 1007 | else fraction(shareSupply, (D2 - D0), D0) | |
999 | 1008 | if (assert((mint_amount >= minMintAmount))) | |
1000 | 1009 | then throw("Slippage screwed you") | |
1001 | 1010 | else if (stakeFarming) | |
1002 | 1011 | then { | |
1003 | 1012 | let re = invoke(this, "reissueShare", [mint_amount], nil) | |
1004 | 1013 | if ((re == re)) | |
1005 | 1014 | then { | |
1006 | 1015 | let s = invoke(farmingAddress, "lockShareTokensFromPool", [msg.caller.bytes, toString(this), lockType], ([AttachedPayment(shareAssetId, mint_amount)] ++ lockFee)) | |
1007 | 1016 | if ((s == s)) | |
1008 | 1017 | then (scriptActions :+ IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))) | |
1009 | 1018 | else throw("Strict value is not equal to itself.") | |
1010 | 1019 | } | |
1011 | 1020 | else throw("Strict value is not equal to itself.") | |
1012 | 1021 | } | |
1013 | 1022 | else (scriptActions ++ [Reissue(shareAssetId, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))]) | |
1014 | 1023 | } | |
1015 | 1024 | } | |
1016 | 1025 | } | |
1017 | 1026 | } | |
1018 | - | }) | |
1027 | + | })) | |
1019 | 1028 | ||
1020 | 1029 | ||
1021 | 1030 | ||
1022 | 1031 | @Callable(msg) | |
1023 | 1032 | func calcMintAmount (newBalances,user) = { | |
1024 | 1033 | let amp = _A() | |
1025 | 1034 | let xp = _xp() | |
1026 | 1035 | let D1 = getDMem(newBalances, amp) | |
1027 | 1036 | if ((shareSupply == 0)) | |
1028 | 1037 | then $Tuple2(nil, D1) | |
1029 | 1038 | else { | |
1030 | 1039 | let D0 = getDMem(xp, amp) | |
1031 | 1040 | let feeDiscount = calculateFeeDiscount(user) | |
1032 | 1041 | func calcInvBalances (acc,newBalance) = { | |
1033 | - | let $ | |
1034 | - | let invBalances = $ | |
1035 | - | let i = $ | |
1042 | + | let $t02413024156 = acc | |
1043 | + | let invBalances = $t02413024156._1 | |
1044 | + | let i = $t02413024156._2 | |
1036 | 1045 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
1037 | 1046 | let fees = { | |
1038 | 1047 | let idealBalance = fraction(D1, xp[i], D0) | |
1039 | 1048 | let difference = if ((idealBalance > newBalance)) | |
1040 | 1049 | then (idealBalance - newBalance) | |
1041 | 1050 | else (newBalance - idealBalance) | |
1042 | 1051 | fraction(_fee, difference, feeScale6) | |
1043 | 1052 | } | |
1044 | 1053 | let invariantBalance = (newBalance - fees) | |
1045 | 1054 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
1046 | 1055 | } | |
1047 | 1056 | ||
1048 | - | let $ | |
1057 | + | let $t02475824828 = { | |
1049 | 1058 | let $l = newBalances | |
1050 | 1059 | let $s = size($l) | |
1051 | 1060 | let $acc0 = $Tuple2(nil, 0) | |
1052 | 1061 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1053 | 1062 | then $a | |
1054 | 1063 | else calcInvBalances($a, $l[$i]) | |
1055 | 1064 | ||
1056 | 1065 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1057 | 1066 | then $a | |
1058 | 1067 | else throw("List size exceeds 10") | |
1059 | 1068 | ||
1060 | 1069 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1061 | 1070 | } | |
1062 | - | let invBalances = $ | |
1063 | - | let k = $ | |
1071 | + | let invBalances = $t02475824828._1 | |
1072 | + | let k = $t02475824828._2 | |
1064 | 1073 | let D2 = getDMem(invBalances, amp) | |
1065 | 1074 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
1066 | 1075 | $Tuple2(nil, mintAmount) | |
1067 | 1076 | } | |
1068 | 1077 | } | |
1069 | 1078 | ||
1070 | 1079 | ||
1071 | 1080 | ||
1072 | 1081 | @Callable(msg) | |
1073 | 1082 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
1074 | 1083 | ||
1075 | 1084 | ||
1076 | 1085 | ||
1077 | 1086 | @Callable(msg) | |
1078 | 1087 | func getDy (assetFrom,assetTo,dx,userAddress) = { | |
1079 | 1088 | let xp = _xp() | |
1080 | 1089 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, assetFrom), "unknown token in") | |
1081 | 1090 | let toIndex = valueOrErrorMessage(indexOf(assetIds, assetTo), "unknown token out") | |
1082 | 1091 | let x = (xp[fromIndex] + dx) | |
1083 | 1092 | let y = getY(fromIndex, toIndex, x, xp) | |
1084 | 1093 | let dy = ((xp[toIndex] - y) - 1) | |
1085 | 1094 | let feeDiscount = calculateFeeDiscount(Address(fromBase58String(userAddress))) | |
1086 | 1095 | let _fee = fraction(fraction(fee, feeDiscount, feeScale6, CEILING), dy, feeScale6) | |
1087 | 1096 | $Tuple2(nil, $Tuple2((dy - _fee), _fee)) | |
1088 | 1097 | } | |
1089 | 1098 | ||
1090 | 1099 | ||
1091 | 1100 | ||
1092 | 1101 | @Callable(msg) | |
1093 | - | func exchange (tokenOut,min_dy) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1102 | + | func exchange (tokenOut,min_dy) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1094 | 1103 | then throw("size(payments) != 1") | |
1095 | 1104 | else { | |
1096 | 1105 | let suspicious = checkSuspicious() | |
1097 | 1106 | if (suspicious._1) | |
1098 | 1107 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1099 | 1108 | else { | |
1100 | 1109 | let payment = msg.payments[0] | |
1101 | 1110 | let tokenIn = getStrAssetId(payment.assetId) | |
1102 | 1111 | let tokenOutB58 = fromBase58String(tokenOut) | |
1103 | 1112 | let dx = payment.amount | |
1104 | 1113 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, tokenIn), "unknown token in") | |
1105 | 1114 | let toIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1106 | 1115 | let xp = _xp() | |
1107 | 1116 | let x = (xp[fromIndex] + dx) | |
1108 | 1117 | let y = getY(fromIndex, toIndex, x, xp) | |
1109 | 1118 | let _dy = ((xp[toIndex] - y) - 1) | |
1110 | 1119 | let feeDiscount = calculateFeeDiscount(msg.originCaller) | |
1111 | 1120 | let _fee = fraction(_dy, fraction(fee, feeDiscount, feeScale6, CEILING), feeScale6) | |
1112 | 1121 | let dy = (_dy - _fee) | |
1113 | 1122 | let governanceFees = fraction(_fee, feeGovernance, feeScale6) | |
1114 | 1123 | if (assert((dy >= min_dy))) | |
1115 | 1124 | then throw("Exchange resulted in fewer coins than expected") | |
1116 | 1125 | else { | |
1117 | 1126 | func makeNewBalances (acc,tokenBalance) = { | |
1118 | - | let $ | |
1119 | - | let newBalances = $ | |
1120 | - | let i = $ | |
1127 | + | let $t02699827024 = acc | |
1128 | + | let newBalances = $t02699827024._1 | |
1129 | + | let i = $t02699827024._2 | |
1121 | 1130 | if ((i == fromIndex)) | |
1122 | 1131 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
1123 | 1132 | else if ((i == toIndex)) | |
1124 | 1133 | then $Tuple2((newBalances :+ (tokenBalance - _dy)), (i + 1)) | |
1125 | 1134 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1126 | 1135 | } | |
1127 | 1136 | ||
1128 | - | let $ | |
1137 | + | let $t02730727368 = { | |
1129 | 1138 | let $l = xp | |
1130 | 1139 | let $s = size($l) | |
1131 | 1140 | let $acc0 = $Tuple2(nil, 0) | |
1132 | 1141 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1133 | 1142 | then $a | |
1134 | 1143 | else makeNewBalances($a, $l[$i]) | |
1135 | 1144 | ||
1136 | 1145 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1137 | 1146 | then $a | |
1138 | 1147 | else throw("List size exceeds 10") | |
1139 | 1148 | ||
1140 | 1149 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1141 | 1150 | } | |
1142 | - | let newBalances = $ | |
1143 | - | let i = $ | |
1151 | + | let newBalances = $t02730727368._1 | |
1152 | + | let i = $t02730727368._2 | |
1144 | 1153 | if (checkDAppThreshold(newBalances)) | |
1145 | 1154 | then throw() | |
1146 | 1155 | else { | |
1147 | 1156 | let s = stake(payment.amount, getStrAssetId(payment.assetId)) | |
1148 | 1157 | if ((s == s)) | |
1149 | 1158 | then { | |
1150 | 1159 | let us = unstake(_dy, tokenOut) | |
1151 | 1160 | if ((us == us)) | |
1152 | 1161 | then { | |
1153 | 1162 | let lpFees = (_fee - governanceFees) | |
1154 | 1163 | let airdrop = if ((lpFees > 0)) | |
1155 | 1164 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1156 | 1165 | else 0 | |
1157 | 1166 | if ((airdrop == airdrop)) | |
1158 | 1167 | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58)], [dy, tokenOutB58]) | |
1159 | 1168 | else throw("Strict value is not equal to itself.") | |
1160 | 1169 | } | |
1161 | 1170 | else throw("Strict value is not equal to itself.") | |
1162 | 1171 | } | |
1163 | 1172 | else throw("Strict value is not equal to itself.") | |
1164 | 1173 | } | |
1165 | 1174 | } | |
1166 | 1175 | } | |
1167 | - | }) | |
1176 | + | })) | |
1168 | 1177 | ||
1169 | 1178 | ||
1170 | 1179 | ||
1171 | 1180 | @Callable(msg) | |
1172 | 1181 | func withdraw (minAmounts) = valueOrElse(isActive(), calcWithdraw(msg, minAmounts, 0)) | |
1173 | 1182 | ||
1174 | 1183 | ||
1175 | 1184 | ||
1176 | 1185 | @Callable(msg) | |
1177 | 1186 | func withdrawWithUnlock (minAmounts,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1178 | 1187 | then throw("Unlock amount must be positive") | |
1179 | 1188 | else { | |
1180 | 1189 | let unlock = invoke(farmingAddress, "withdrawShareTokensFromPool", [msg.caller.bytes, toString(this), unlockAmount], nil) | |
1181 | 1190 | if ((unlock == unlock)) | |
1182 | 1191 | then calcWithdraw(msg, minAmounts, unlockAmount) | |
1183 | 1192 | else throw("Strict value is not equal to itself.") | |
1184 | 1193 | }) | |
1185 | 1194 | ||
1186 | 1195 | ||
1187 | 1196 | ||
1188 | 1197 | @Callable(msg) | |
1189 | 1198 | func calcWithdrawOneCoin (tokenAmount,tokenOut,user) = if ((0 >= tokenAmount)) | |
1190 | 1199 | then throw("Amount must be positive") | |
1191 | 1200 | else { | |
1192 | 1201 | let i = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1193 | 1202 | $Tuple2(nil, _calcWithdrawOneCoin(_xp(), tokenAmount, i, Address(fromBase58String(user)))._1) | |
1194 | 1203 | } | |
1195 | 1204 | ||
1196 | 1205 | ||
1197 | 1206 | ||
1198 | 1207 | @Callable(msg) | |
1199 | - | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1208 | + | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1200 | 1209 | then throw("size(payments) != 1") | |
1201 | - | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0)) | |
1210 | + | else calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, 0))) | |
1202 | 1211 | ||
1203 | 1212 | ||
1204 | 1213 | ||
1205 | 1214 | @Callable(msg) | |
1206 | - | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isActive(), if ((0 > unlockAmount)) | |
1215 | + | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isDepricated(), valueOrElse(isActive(), if ((0 > unlockAmount)) | |
1207 | 1216 | then throw("Unlock amount must be positive") | |
1208 | 1217 | else { | |
1209 | 1218 | let unlock = invoke(farmingAddress, "withdrawShareTokensFromPool", [msg.caller.bytes, toString(this), unlockAmount], nil) | |
1210 | 1219 | if ((unlock == unlock)) | |
1211 | 1220 | then calcWithdrawOneCoinEntries(msg, tokenOut, minAmount, unlockAmount) | |
1212 | 1221 | else throw("Strict value is not equal to itself.") | |
1213 | - | }) | |
1222 | + | })) | |
1214 | 1223 | ||
1215 | 1224 | ||
1216 | 1225 | ||
1217 | 1226 | @Callable(msg) | |
1218 | 1227 | func A () = $Tuple2(nil, _A()) | |
1219 | 1228 | ||
1220 | 1229 | ||
1221 | 1230 | ||
1222 | 1231 | @Callable(msg) | |
1223 | 1232 | func getVirtualPrice () = { | |
1224 | 1233 | let D = get_D(_xp(), _A()) | |
1225 | 1234 | $Tuple2(nil, fraction(D, PRECISION, shareSupply)) | |
1226 | 1235 | } | |
1227 | 1236 | ||
1228 | 1237 | ||
1229 | 1238 | ||
1230 | 1239 | @Callable(msg) | |
1231 | 1240 | func calcTokenAmount (amounts,deposit) = { | |
1232 | 1241 | let amp = _A() | |
1233 | 1242 | let balances = _xp() | |
1234 | 1243 | let D0 = getDMem(balances, amp) | |
1235 | 1244 | func calcNewBalances (acc,balance) = { | |
1236 | - | let $ | |
1237 | - | let newBalances = $ | |
1238 | - | let i = $ | |
1245 | + | let $t03015830184 = acc | |
1246 | + | let newBalances = $t03015830184._1 | |
1247 | + | let i = $t03015830184._2 | |
1239 | 1248 | let newBalance = (balance + (if (deposit) | |
1240 | 1249 | then amounts[i] | |
1241 | 1250 | else -(amounts[i]))) | |
1242 | 1251 | $Tuple2((newBalances :+ newBalance), (i + 1)) | |
1243 | 1252 | } | |
1244 | 1253 | ||
1245 | 1254 | let newBalances = ( let $l = balances | |
1246 | 1255 | let $s = size($l) | |
1247 | 1256 | let $acc0 = $Tuple2(nil, 0) | |
1248 | 1257 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1249 | 1258 | then $a | |
1250 | 1259 | else calcNewBalances($a, $l[$i]) | |
1251 | 1260 | ||
1252 | 1261 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1253 | 1262 | then $a | |
1254 | 1263 | else throw("List size exceeds 10") | |
1255 | 1264 | ||
1256 | 1265 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10))._1 | |
1257 | 1266 | let D1 = getDMem(newBalances, amp) | |
1258 | 1267 | let diff = if (deposit) | |
1259 | 1268 | then (D1 - D0) | |
1260 | 1269 | else (D0 - D1) | |
1261 | 1270 | $Tuple2(nil, fraction(diff, shareSupply, D0)) | |
1262 | 1271 | } | |
1263 | 1272 | ||
1264 | 1273 | ||
1265 | 1274 | ||
1266 | 1275 | @Callable(msg) | |
1267 | 1276 | func rampA (_futureA,_futureTime) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), if (assert((blockTimestamp >= (initial_A_time + MIN_RAMP_TIME)))) | |
1268 | 1277 | then throw("too often") | |
1269 | 1278 | else if (assert((_futureTime >= (blockTimestamp + MIN_RAMP_TIME)))) | |
1270 | 1279 | then throw("insufficient time") | |
1271 | 1280 | else { | |
1272 | 1281 | let _initial_A = _A() | |
1273 | 1282 | if (assert(if ((_futureA > 0)) | |
1274 | 1283 | then (MAX_A > _futureA) | |
1275 | 1284 | else false)) | |
1276 | 1285 | then throw("out of base range") | |
1277 | 1286 | else if (assert(if (if ((_futureA >= _initial_A)) | |
1278 | 1287 | then ((_initial_A * MAX_A_CHANGE) >= _futureA) | |
1279 | 1288 | else false) | |
1280 | 1289 | then true | |
1281 | 1290 | else if ((_initial_A > _futureA)) | |
1282 | 1291 | then ((_futureA * MAX_A_CHANGE) >= _initial_A) | |
1283 | 1292 | else false)) | |
1284 | 1293 | then throw("out of range") | |
1285 | 1294 | else [IntegerEntry("initial_A", _initial_A), IntegerEntry("future_A", _futureA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", _futureTime)] | |
1286 | 1295 | })) | |
1287 | 1296 | ||
1288 | 1297 | ||
1289 | 1298 | ||
1290 | 1299 | @Callable(msg) | |
1291 | 1300 | func stopRampA () = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), { | |
1292 | 1301 | let currentA = _A() | |
1293 | 1302 | [IntegerEntry("initial_A", currentA), IntegerEntry("future_A", currentA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", blockTimestamp)] | |
1294 | 1303 | })) | |
1295 | 1304 | ||
1296 | 1305 | ||
1297 | 1306 | ||
1298 | 1307 | @Callable(msg) | |
1299 | 1308 | func shutdown () = valueOrElse(isAdminCall(msg), if (!(active)) | |
1300 | 1309 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
1301 | 1310 | else suspend("Paused by admin")) | |
1302 | 1311 | ||
1303 | 1312 | ||
1304 | 1313 | ||
1305 | 1314 | @Callable(msg) | |
1306 | 1315 | func activate () = valueOrElse(isAdminCall(msg), if (active) | |
1307 | 1316 | then throwIsActive() | |
1308 | 1317 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
1309 | 1318 | ||
1310 | 1319 | ||
1311 | 1320 | ||
1312 | 1321 | @Callable(msg) | |
1313 | - | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), if ((msg.caller != moneyBoxAddress)) | |
1314 | - | then throw("Only the wallet can call this function") | |
1315 | - | else { | |
1316 | - | let balances = _xp() | |
1317 | - | func takeExtraFunds (acc,assetId) = { | |
1318 | - | let $t03188331901 = acc | |
1319 | - | let sum = $t03188331901._1 | |
1320 | - | let i = $t03188331901._2 | |
1321 | - | let tokenB58 = fromBase58String(assetId) | |
1322 | - | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1323 | - | let enrollAmount = (rBalance - balances[i]) | |
1324 | - | if ((0 > enrollAmount)) | |
1325 | - | then suspend(("Enroll amount negative for asset" + assetId)) | |
1326 | - | else { | |
1327 | - | let airdrop = if ((enrollAmount > 0)) | |
1328 | - | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1329 | - | else 0 | |
1330 | - | if ((airdrop == airdrop)) | |
1331 | - | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1332 | - | else throw("Strict value is not equal to itself.") | |
1322 | + | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), { | |
1323 | + | let claim = if (containsElement(assetIds, toBase58String(USDN))) | |
1324 | + | then invoke(stakingUSDNAddress, "claimRewards", nil, nil) | |
1325 | + | else 0 | |
1326 | + | if ((claim == claim)) | |
1327 | + | then if ((msg.caller != moneyBoxAddress)) | |
1328 | + | then throw("Only the wallet can call this function") | |
1329 | + | else { | |
1330 | + | let balances = _xp() | |
1331 | + | func takeExtraFunds (acc,assetId) = { | |
1332 | + | let $t03276932787 = acc | |
1333 | + | let sum = $t03276932787._1 | |
1334 | + | let i = $t03276932787._2 | |
1335 | + | let tokenB58 = fromBase58String(assetId) | |
1336 | + | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1337 | + | let enrollAmount = (rBalance - balances[i]) | |
1338 | + | if ((0 > enrollAmount)) | |
1339 | + | then suspend(("Enroll amount negative for asset" + assetId)) | |
1340 | + | else { | |
1341 | + | let airdrop = if ((enrollAmount > 0)) | |
1342 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1343 | + | else 0 | |
1344 | + | if ((airdrop == airdrop)) | |
1345 | + | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1346 | + | else throw("Strict value is not equal to itself.") | |
1347 | + | } | |
1333 | 1348 | } | |
1334 | - | } | |
1335 | 1349 | ||
1336 | - | let k = { | |
1337 | - | let $l = assetIds | |
1338 | - | let $s = size($l) | |
1339 | - | let $acc0 = $Tuple2(0, 0) | |
1340 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1341 | - | then $a | |
1342 | - | else takeExtraFunds($a, $l[$i]) | |
1350 | + | let k = { | |
1351 | + | let $l = assetIds | |
1352 | + | let $s = size($l) | |
1353 | + | let $acc0 = $Tuple2(0, 0) | |
1354 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1355 | + | then $a | |
1356 | + | else takeExtraFunds($a, $l[$i]) | |
1343 | 1357 | ||
1344 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1345 | - | then $a | |
1346 | - | else throw("List size exceeds 10") | |
1358 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1359 | + | then $a | |
1360 | + | else throw("List size exceeds 10") | |
1347 | 1361 | ||
1348 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1349 | - | } | |
1350 | - | if ((k._1 == 0)) | |
1351 | - | then throw("No money to take") | |
1352 | - | else nil | |
1353 | - | }) | |
1362 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
1363 | + | } | |
1364 | + | if ((k._1 == 0)) | |
1365 | + | then throw("No money to take") | |
1366 | + | else nil | |
1367 | + | } | |
1368 | + | else throw("Strict value is not equal to itself.") | |
1369 | + | }) | |
1354 | 1370 | ||
1355 | 1371 | ||
1356 | 1372 | @Verifier(tx) | |
1357 | 1373 | func verify () = { | |
1358 | 1374 | let multiSignedByAdmins = { | |
1359 | 1375 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1360 | 1376 | then 1 | |
1361 | 1377 | else 0 | |
1362 | 1378 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
1363 | 1379 | then 1 | |
1364 | 1380 | else 0 | |
1365 | 1381 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
1366 | 1382 | then 1 | |
1367 | 1383 | else 0 | |
1368 | 1384 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
1369 | 1385 | } | |
1370 | 1386 | match tx { | |
1371 | 1387 | case inv: InvokeScriptTransaction => | |
1372 | 1388 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
1373 | 1389 | then (inv.function == "takeIntoAccountExtraFunds") | |
1374 | 1390 | else false | |
1375 | 1391 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1376 | 1392 | then true | |
1377 | 1393 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
1378 | 1394 | then true | |
1379 | 1395 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
1380 | 1396 | then true | |
1381 | 1397 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
1382 | 1398 | if (if (callTakeIntoAccount) | |
1383 | 1399 | then signedByAdmin | |
1384 | 1400 | else false) | |
1385 | 1401 | then true | |
1386 | 1402 | else multiSignedByAdmins | |
1387 | 1403 | case _ => | |
1388 | 1404 | multiSignedByAdmins | |
1389 | 1405 | } | |
1390 | 1406 | } | |
1391 | 1407 |
github/deemru/w8io/026f985 193.91 ms ◑