tx · 9xen3XhdXaU3SrhxQvgjmu2C2FMfQ4mick9keM1Ce2N4 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.54000000 Waves 2023.10.20 15:24 [2806897] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "9xen3XhdXaU3SrhxQvgjmu2C2FMfQ4mick9keM1Ce2N4", "fee": 54000000, "feeAssetId": null, "timestamp": 1697804708150, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "5hRJTuunkcEj7ZgYihehgdMuz4avNswBkZRjKpQwJt6mvyzgsCUWX1iXUda4R2fAnAKmNsMzMoqTiMXzu3TdzaE4", "5NDtNC7n4gEqr6oXqhK9GzcrVrQL19Txnx3u2KoSaqys5GSzyjtvCFWW9E1134S6xQn3UhGWgkx1En7o1118QfAb" ], "script": "base64:BgKiAQgCEgMKAQgSAwoBCBIECgIICBIFCgMIGBgSBQoDCAEIEgQKAggBEgYKBAEICAESBQoDAQgIEg8KDQgICAgICAgICAgICAgSAwoBCBIDCgEIEgUKAwgIARIGCgQIAQgIEgcKBQgICAEEEgUKAwgEARIMCgoICAgBAQEBAQEEEgkKBwgBAQEBAQESABIAEgASABIAEgASABIAEgMKAQgSAwoBCIgBAARDT05GCQERQGV4dHJOYXRpdmUoMTA2MikBCQERQGV4dHJOYXRpdmUoMTA1MykCBQR0aGlzAgZjb25maWcAB1NGX1BPT0wCAlNGAAdXWF9QT09MAgJXWAAEQ1BNTQIEY3BtbQAERkxBVAIEZmxhdAAPQ0FQX0ZFRV9OT19MT0FOAgljYXBOb0xvYW4ADENBUF9GRUVfTE9BTgIHY2FwTG9hbgAUU1RPUExPU1NfRkVFX05PX0xPQU4CDnN0b3BMb3NzTm9Mb2FuAA1TVE9QTE9TU19MT0F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plexity": 0 } View: original | compacted Prev: 5XNh4ePEYR6x3AQF8QDp4tz7AbM2fQ28sfL9JeKAfE2C Next: none Diff:
Old | New | Differences | |
---|---|---|---|
445 | 445 | } | |
446 | 446 | ||
447 | 447 | ||
448 | - | func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
448 | + | func calcReplenishByTwoTokens (pType,poolAddr,LPId,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
449 | 449 | then { | |
450 | 450 | let repl = { | |
451 | 451 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil) | |
479 | 479 | } | |
480 | 480 | else if ((pType == WX_POOL)) | |
481 | 481 | then { | |
482 | - | let $ | |
483 | - | let @ = invoke( | |
482 | + | let $t01369013948 = $Tuple2(split({ | |
483 | + | let @ = invoke(wxRest, "evaluatePutByAmountAssetREADONLY", [LPId, pmtA], nil) | |
484 | 484 | if ($isInstanceOf(@, "String")) | |
485 | 485 | then @ | |
486 | 486 | else throw(($getType(@) + " couldn't be cast to String")) | |
487 | 487 | }, "__"), split({ | |
488 | - | let @ = invoke( | |
488 | + | let @ = invoke(wxRest, "evaluatePutByPriceAssetREADONLY", [LPId, pmtB], nil) | |
489 | 489 | if ($isInstanceOf(@, "String")) | |
490 | 490 | then @ | |
491 | 491 | else throw(($getType(@) + " couldn't be cast to String")) | |
492 | 492 | }, "__")) | |
493 | - | if (($ | |
493 | + | if (($t01369013948 == $t01369013948)) | |
494 | 494 | then { | |
495 | - | let evalPutInB = $ | |
496 | - | let evalPutInA = $ | |
495 | + | let evalPutInB = $t01369013948._2 | |
496 | + | let evalPutInA = $t01369013948._1 | |
497 | 497 | let lpInA = parseIntValue(evalPutInA[1]) | |
498 | 498 | let lpInB = parseIntValue(evalPutInB[1]) | |
499 | 499 | if ((lpInB > lpInA)) | |
547 | 547 | ||
548 | 548 | ||
549 | 549 | func unstakeLP (pool,pType,shareId,amount) = { | |
550 | - | let $ | |
550 | + | let $t01572616076 = if ((pType == SF_POOL)) | |
551 | 551 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
552 | 552 | else if ((pType == WX_POOL)) | |
553 | 553 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
554 | 554 | else unknownPoolType() | |
555 | - | let farmAddr = $ | |
556 | - | let fName = $ | |
557 | - | let params = $ | |
555 | + | let farmAddr = $t01572616076._1 | |
556 | + | let fName = $t01572616076._2 | |
557 | + | let params = $t01572616076._3 | |
558 | 558 | let inv = invoke(farmAddr, fName, params, nil) | |
559 | 559 | if ((inv == inv)) | |
560 | 560 | then amount | |
567 | 567 | let feeScale6 = 1000000 | |
568 | 568 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
569 | 569 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING) | |
570 | - | let $ | |
570 | + | let $t01649816804 = if ((assetTokenToGet == assetIdA)) | |
571 | 571 | then { | |
572 | 572 | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING) | |
573 | 573 | $Tuple2(amountToPay, assetIdB) | |
576 | 576 | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING) | |
577 | 577 | $Tuple2(amountToPay, assetIdA) | |
578 | 578 | } | |
579 | - | let amountToPay = $ | |
580 | - | let assetToPay = $ | |
579 | + | let amountToPay = $t01649816804._1 | |
580 | + | let assetToPay = $t01649816804._2 | |
581 | 581 | $Tuple2(assetToPay, amountToPay) | |
582 | 582 | } | |
583 | 583 | ||
597 | 597 | ||
598 | 598 | ||
599 | 599 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
600 | - | let $ | |
601 | - | let pFee = $ | |
602 | - | let prFee = $ | |
600 | + | let $t01754417583 = getWXSwapFees(pool) | |
601 | + | let pFee = $t01754417583._1 | |
602 | + | let prFee = $t01754417583._2 | |
603 | 603 | let feeScale = toBigInt(100000000) | |
604 | - | let $ | |
604 | + | let $t01762317931 = if ((assetTokenToGet == assetIdA)) | |
605 | 605 | then { | |
606 | 606 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
607 | 607 | $Tuple2(amountToPay, assetIdB) | |
610 | 610 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
611 | 611 | $Tuple2(amountToPay, assetIdA) | |
612 | 612 | } | |
613 | - | let amountToPay = $ | |
614 | - | let assetToPay = $ | |
613 | + | let amountToPay = $t01762317931._1 | |
614 | + | let assetToPay = $t01762317931._2 | |
615 | 615 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
616 | 616 | $Tuple2(assetToPay, amountToPayWithFee) | |
617 | 617 | } | |
623 | 623 | then true | |
624 | 624 | else (poolFB != "")) | |
625 | 625 | then { | |
626 | - | let $ | |
626 | + | let $t01837218584 = if ((poolFB == "")) | |
627 | 627 | then $Tuple3(balA, balB, pool) | |
628 | 628 | else { | |
629 | - | let $ | |
630 | - | let sfBalA = $ | |
631 | - | let sfBalB = $ | |
629 | + | let $t01847818551 = getSFPoolBalances(addressFromStringValue(poolFB)) | |
630 | + | let sfBalA = $t01847818551._1 | |
631 | + | let sfBalB = $t01847818551._2 | |
632 | 632 | $Tuple3(sfBalA, sfBalB, poolFB) | |
633 | 633 | } | |
634 | - | let pBalA = $ | |
635 | - | let pBalB = $ | |
636 | - | let exPool = $ | |
637 | - | let $ | |
638 | - | let assetToPay = $ | |
639 | - | let amountToPay = $ | |
634 | + | let pBalA = $t01837218584._1 | |
635 | + | let pBalB = $t01837218584._2 | |
636 | + | let exPool = $t01837218584._3 | |
637 | + | let $t01858918715 = calcAmountToPaySF(exPool, assetIdA, assetIdB, pBalA, pBalB, amountTokenToGet, assetTokenToGet) | |
638 | + | let assetToPay = $t01858918715._1 | |
639 | + | let amountToPay = $t01858918715._2 | |
640 | 640 | invoke(addressFromStringValue(exPool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
641 | 641 | } | |
642 | 642 | else if ((pType == WX_POOL)) | |
643 | 643 | then { | |
644 | - | let $ | |
645 | - | let assetToPay = $ | |
646 | - | let amountToPay = $ | |
644 | + | let $t01891719039 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
645 | + | let assetToPay = $t01891719039._1 | |
646 | + | let amountToPay = $t01891719039._2 | |
647 | 647 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
648 | 648 | } | |
649 | 649 | else unknownPoolType() | |
651 | 651 | ||
652 | 652 | ||
653 | 653 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
654 | - | let $ | |
654 | + | let $t01932619799 = if ((pType == SF_POOL)) | |
655 | 655 | then { | |
656 | 656 | let inv = { | |
657 | 657 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
674 | 674 | else throw("Strict value is not equal to itself.") | |
675 | 675 | } | |
676 | 676 | else if ((pType == WX_POOL)) | |
677 | - | then if ((valueOrElse(getString(this, (toString(poolAddr) + kPoolType)), "cpmm") == FLAT)) | |
678 | - | then { | |
679 | - | let inv = invoke(poolAddr, "estimateGetOperationWrapperREADONLY", ["", shareId, userCanWithdraw, toString(this)], nil) | |
680 | - | if ((inv == inv)) | |
681 | - | then { | |
682 | - | let $t01979720294 = match inv { | |
683 | - | case _ => | |
684 | - | if (if (if ($isInstanceOf($match0._1, "Int")) | |
685 | - | then if ($isInstanceOf($match0._2, "Int")) | |
686 | - | then if ($isInstanceOf($match0._5, "Int")) | |
687 | - | then if ($isInstanceOf($match0._6, "Int")) | |
688 | - | then if ($isInstanceOf($match0._7, "Int")) | |
689 | - | then if ($isInstanceOf($match0._8, "String")) | |
690 | - | then $isInstanceOf($match0._9, "String") | |
691 | - | else false | |
692 | - | else false | |
693 | - | else false | |
694 | - | else false | |
695 | - | else false | |
696 | - | else false) | |
697 | - | then (size($match0) == 10) | |
698 | - | else false) | |
699 | - | then { | |
700 | - | let outAmAmt = $match0._1 | |
701 | - | let outPrAmt = $match0._2 | |
702 | - | let amBalance = $match0._5 | |
703 | - | let prBalance = $match0._6 | |
704 | - | let lpEmission = $match0._7 | |
705 | - | let curPrice = $match0._8 | |
706 | - | let poolStatus = $match0._9 | |
707 | - | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
708 | - | } | |
709 | - | else throw("Couldn't cast types") | |
710 | - | } | |
711 | - | let outAmAmt = $t01979720294._1 | |
712 | - | let outPrAmt = $t01979720294._2 | |
713 | - | let amBalance = $t01979720294._3 | |
714 | - | let prBalance = $t01979720294._4 | |
715 | - | let lpEmission = $t01979720294._5 | |
716 | - | let curPrice = $t01979720294._6 | |
717 | - | let poolStatus = $t01979720294._7 | |
718 | - | $Tuple2(outAmAmt, outPrAmt) | |
719 | - | } | |
720 | - | else throw("Strict value is not equal to itself.") | |
721 | - | } | |
722 | - | else { | |
723 | - | let inv = split({ | |
724 | - | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
725 | - | if ($isInstanceOf(@, "String")) | |
726 | - | then @ | |
727 | - | else throw(($getType(@) + " couldn't be cast to String")) | |
728 | - | }, "__") | |
729 | - | if ((inv == inv)) | |
730 | - | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
731 | - | else throw("Strict value is not equal to itself.") | |
732 | - | } | |
677 | + | then { | |
678 | + | let inv = split({ | |
679 | + | let @ = invoke(poolAddr, "poolEvaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
680 | + | if ($isInstanceOf(@, "String")) | |
681 | + | then @ | |
682 | + | else throw(($getType(@) + " couldn't be cast to String")) | |
683 | + | }, "__") | |
684 | + | if ((inv == inv)) | |
685 | + | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
686 | + | else throw("Strict value is not equal to itself.") | |
687 | + | } | |
733 | 688 | else unknownPoolType() | |
734 | - | let amountA = $ | |
735 | - | let amountB = $ | |
689 | + | let amountA = $t01932619799._1 | |
690 | + | let amountB = $t01932619799._2 | |
736 | 691 | $Tuple2(amountA, amountB) | |
737 | 692 | } | |
738 | 693 | ||
754 | 709 | } | |
755 | 710 | else if ((pType == WX_POOL)) | |
756 | 711 | then { | |
757 | - | let $ | |
758 | - | let aId = $ | |
759 | - | let bId = $ | |
760 | - | let aBal = $ | |
761 | - | let bBal = $ | |
762 | - | let lpId = $ | |
712 | + | let $t02016720246 = getWXPoolData(addressFromStringValue(pool)) | |
713 | + | let aId = $t02016720246._1 | |
714 | + | let bId = $t02016720246._2 | |
715 | + | let aBal = $t02016720246._3 | |
716 | + | let bBal = $t02016720246._4 | |
717 | + | let lpId = $t02016720246._5 | |
763 | 718 | let balBefore = accountBalance(WXID) | |
764 | 719 | if ((balBefore == balBefore)) | |
765 | 720 | then { | |
781 | 736 | if ((lpBalanceBefore == lpBalanceBefore)) | |
782 | 737 | then { | |
783 | 738 | let poolAddr = addressFromStringValue(pool) | |
784 | - | let $ | |
739 | + | let $t02084421266 = if (if ((pmtA > 0)) | |
785 | 740 | then (pmtB > 0) | |
786 | 741 | else false) | |
787 | 742 | then { | |
788 | - | let $ | |
789 | - | let pmtInA = $ | |
790 | - | let pmtInB = $ | |
791 | - | let change = $ | |
792 | - | let changeId = $ | |
743 | + | let $t02091021032 = calcReplenishByTwoTokens(pType, poolAddr, LPId, pmtA, aId, pmtB, bId, balA, balB) | |
744 | + | let pmtInA = $t02091021032._1 | |
745 | + | let pmtInB = $t02091021032._2 | |
746 | + | let change = $t02091021032._3 | |
747 | + | let changeId = $t02091021032._4 | |
793 | 748 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
794 | 749 | if ((inv == inv)) | |
795 | 750 | then $Tuple2(change, changeId) | |
800 | 755 | else if ((pmtB > 0)) | |
801 | 756 | then $Tuple2(pmtB, bId) | |
802 | 757 | else throw("pmts must be > 0") | |
803 | - | let change = $ | |
804 | - | let changeId = $ | |
758 | + | let change = $t02084421266._1 | |
759 | + | let changeId = $t02084421266._2 | |
805 | 760 | let inv = if ((change > 0)) | |
806 | 761 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
807 | 762 | else nil | |
829 | 784 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
830 | 785 | let totalAmount = getPoolTotalShare(pool) | |
831 | 786 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
832 | - | let $ | |
787 | + | let $t02212322361 = if (withLoan) | |
833 | 788 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
834 | 789 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
835 | - | let curPoolInterest = $ | |
836 | - | let totalStakedWithLoan = $ | |
790 | + | let curPoolInterest = $t02212322361._1 | |
791 | + | let totalStakedWithLoan = $t02212322361._2 | |
837 | 792 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
838 | 793 | } | |
839 | 794 | ||
914 | 869 | ||
915 | 870 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
916 | 871 | let poolAddr = Address(fromBase58String(pool)) | |
917 | - | let $ | |
918 | - | let AId = $ | |
919 | - | let BId = $ | |
920 | - | let balA = $ | |
921 | - | let balB = $ | |
922 | - | let shareId = $ | |
872 | + | let $t02446824534 = getPoolData(poolAddr, pType) | |
873 | + | let AId = $t02446824534._1 | |
874 | + | let BId = $t02446824534._2 | |
875 | + | let balA = $t02446824534._3 | |
876 | + | let balB = $t02446824534._4 | |
877 | + | let shareId = $t02446824534._5 | |
923 | 878 | if (if ((tokenId != AId)) | |
924 | 879 | then (tokenId != BId) | |
925 | 880 | else false) | |
936 | 891 | let axlyFeeLoan = fraction(tokensForFeeLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
937 | 892 | let axlyFeeNoLoan = fraction(tokensForFeeNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
938 | 893 | let axlyFee = (axlyFeeLoan + axlyFeeNoLoan) | |
939 | - | let $ | |
894 | + | let $t02527925379 = if ((tokenId == AId)) | |
940 | 895 | then $Tuple2((tokenAmount - axlyFee), 0) | |
941 | 896 | else $Tuple2(0, (tokenAmount - axlyFee)) | |
942 | - | let pmtA = $ | |
943 | - | let pmtB = $ | |
944 | - | let $ | |
945 | - | let stakedAmount = $ | |
946 | - | let nf = $ | |
897 | + | let pmtA = $t02527925379._1 | |
898 | + | let pmtB = $t02527925379._2 | |
899 | + | let $t02538225486 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
900 | + | let stakedAmount = $t02538225486._1 | |
901 | + | let nf = $t02538225486._2 | |
947 | 902 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
948 | 903 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
949 | 904 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
989 | 944 | let userAddr = Address(fromBase58String(user)) | |
990 | 945 | let poolAddr = Address(fromBase58String(pool)) | |
991 | 946 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
992 | - | let $ | |
993 | - | let idAStr = $ | |
994 | - | let idBStr = $ | |
995 | - | let balA = $ | |
996 | - | let balB = $ | |
997 | - | let shareId = $ | |
998 | - | let $ | |
999 | - | let idA = $ | |
1000 | - | let idB = $ | |
947 | + | let $t02801528087 = getPoolData(poolAddr, pType) | |
948 | + | let idAStr = $t02801528087._1 | |
949 | + | let idBStr = $t02801528087._2 | |
950 | + | let balA = $t02801528087._3 | |
951 | + | let balB = $t02801528087._4 | |
952 | + | let shareId = $t02801528087._5 | |
953 | + | let $t02809028157 = $Tuple2(assetIdFromStr(idAStr), assetIdFromStr(idBStr)) | |
954 | + | let idA = $t02809028157._1 | |
955 | + | let idB = $t02809028157._2 | |
1001 | 956 | let stopLossFee = calcStopLossFee(pool, isBorrowed, stopLoss, userCanWithdraw) | |
1002 | 957 | let cBalABefore = accountBalance(idA) | |
1003 | 958 | if ((cBalABefore == cBalABefore)) | |
1028 | 983 | let cBalBAfter = accountBalance(idB) | |
1029 | 984 | if ((cBalBAfter == cBalBAfter)) | |
1030 | 985 | then { | |
1031 | - | let $ | |
1032 | - | let tokensAmountA = $ | |
1033 | - | let tokensAmountB = $ | |
1034 | - | let $ | |
986 | + | let $t02885228941 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
987 | + | let tokensAmountA = $t02885228941._1 | |
988 | + | let tokensAmountB = $t02885228941._2 | |
989 | + | let $t02894430180 = if (isBorrowed) | |
1035 | 990 | then { | |
1036 | 991 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1037 | 992 | let debt = { | |
1080 | 1035 | else throw("Strict value is not equal to itself.") | |
1081 | 1036 | } | |
1082 | 1037 | else $Tuple2(tokensAmountA, tokensAmountB) | |
1083 | - | let toUserA = $ | |
1084 | - | let toUserB = $ | |
1038 | + | let toUserA = $t02894430180._1 | |
1039 | + | let toUserB = $t02894430180._2 | |
1085 | 1040 | let poolTotalLoanEntries = if (isBorrowed) | |
1086 | 1041 | then [IntegerEntry((pool + kPoolTotalLoan), ((poolTotalShareLoan - userCanWithdraw) - stopLossFee))] | |
1087 | 1042 | else nil | |
1127 | 1082 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
1128 | 1083 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
1129 | 1084 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
1130 | - | let $ | |
1085 | + | let $t03216232259 = if ((borrowId == aId)) | |
1131 | 1086 | then $Tuple2(dPriceA, decPrA) | |
1132 | 1087 | else $Tuple2(dPriceB, decPrB) | |
1133 | - | let borrowPrice = $ | |
1134 | - | let borrowDecPr = $ | |
1088 | + | let borrowPrice = $t03216232259._1 | |
1089 | + | let borrowDecPr = $t03216232259._2 | |
1135 | 1090 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
1136 | 1091 | } | |
1137 | 1092 | ||
1160 | 1115 | ||
1161 | 1116 | ||
1162 | 1117 | func claimAndCheckAmnt (pool,pType,claim,amount,change) = { | |
1163 | - | let $ | |
1118 | + | let $t03325933521 = if (claim) | |
1164 | 1119 | then claimFarmed(pType, pool) | |
1165 | 1120 | else { | |
1166 | 1121 | let claimedAsset = if ((pType == SF_POOL)) | |
1170 | 1125 | else unknownPoolType() | |
1171 | 1126 | $Tuple2(amount, claimedAsset) | |
1172 | 1127 | } | |
1173 | - | if (($ | |
1128 | + | if (($t03325933521 == $t03325933521)) | |
1174 | 1129 | then { | |
1175 | - | let claimAsset = $ | |
1176 | - | let claimAmount = $ | |
1130 | + | let claimAsset = $t03325933521._2 | |
1131 | + | let claimAmount = $t03325933521._1 | |
1177 | 1132 | let bal = accountBalance(claimAsset) | |
1178 | 1133 | if ((bal == bal)) | |
1179 | 1134 | then if ((amount > bal)) | |
1189 | 1144 | func getPoolInfoREADONLY (pool) = { | |
1190 | 1145 | let poolAddr = addressFromStringValue(pool) | |
1191 | 1146 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1192 | - | let $ | |
1193 | - | let AId = $ | |
1194 | - | let BId = $ | |
1195 | - | let balA = $ | |
1196 | - | let balB = $ | |
1197 | - | let shareId = $ | |
1147 | + | let $t03388833978 = getPoolData(Address(fromBase58String(pool)), pType) | |
1148 | + | let AId = $t03388833978._1 | |
1149 | + | let BId = $t03388833978._2 | |
1150 | + | let balA = $t03388833978._3 | |
1151 | + | let balB = $t03388833978._4 | |
1152 | + | let shareId = $t03388833978._5 | |
1198 | 1153 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
1199 | 1154 | $Tuple2(nil, $Tuple6(AId, BId, shareId, balA, balB, shareSupply)) | |
1200 | 1155 | } | |
1222 | 1177 | @Callable(i) | |
1223 | 1178 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1224 | 1179 | func userPos (a,pool) = { | |
1225 | - | let $ | |
1226 | - | let wAmountsA = $ | |
1227 | - | let wAmountsB = $ | |
1228 | - | let debts = $ | |
1229 | - | let eqWAmountsA = $ | |
1230 | - | let eqWAmountsB = $ | |
1231 | - | let index = $ | |
1180 | + | let $t03485134921 = a | |
1181 | + | let wAmountsA = $t03485134921._1 | |
1182 | + | let wAmountsB = $t03485134921._2 | |
1183 | + | let debts = $t03485134921._3 | |
1184 | + | let eqWAmountsA = $t03485134921._4 | |
1185 | + | let eqWAmountsB = $t03485134921._5 | |
1186 | + | let index = $t03485134921._6 | |
1232 | 1187 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1233 | 1188 | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1234 | 1189 | else { | |
1235 | 1190 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1236 | - | let $ | |
1237 | - | let AId = $ | |
1238 | - | let BId = $ | |
1239 | - | let balA = $ | |
1240 | - | let balB = $ | |
1241 | - | let shareId = $ | |
1191 | + | let $t03520035290 = getPoolData(Address(fromBase58String(pool)), pType) | |
1192 | + | let AId = $t03520035290._1 | |
1193 | + | let BId = $t03520035290._2 | |
1194 | + | let balA = $t03520035290._3 | |
1195 | + | let balB = $t03520035290._4 | |
1196 | + | let shareId = $t03520035290._5 | |
1242 | 1197 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1243 | 1198 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1244 | - | let $ | |
1245 | - | let wAmountA = $ | |
1246 | - | let wAmountB = $ | |
1199 | + | let $t03550635626 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1200 | + | let wAmountA = $t03550635626._1 | |
1201 | + | let wAmountB = $t03550635626._2 | |
1247 | 1202 | if ((borrowAmount > 0)) | |
1248 | 1203 | then { | |
1249 | 1204 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1277 | 1232 | } | |
1278 | 1233 | else unknownPoolType() | |
1279 | 1234 | else 0 | |
1280 | - | let $ | |
1235 | + | let $t03653836757 = if ((borrowAsset == AId)) | |
1281 | 1236 | then $Tuple2(((wAmountA + amountToGetEx) - debt), (wAmountB - amountToPay)) | |
1282 | 1237 | else $Tuple2((wAmountA - amountToPay), ((wAmountB + amountToGetEx) - debt)) | |
1283 | - | let eqWAmountA = $ | |
1284 | - | let eqWAmountB = $ | |
1238 | + | let eqWAmountA = $t03653836757._1 | |
1239 | + | let eqWAmountB = $t03653836757._2 | |
1285 | 1240 | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1286 | 1241 | } | |
1287 | 1242 | else throw("Strict value is not equal to itself.") | |
1290 | 1245 | } | |
1291 | 1246 | } | |
1292 | 1247 | ||
1293 | - | let $ | |
1248 | + | let $t03701237123 = { | |
1294 | 1249 | let $l = pools | |
1295 | 1250 | let $s = size($l) | |
1296 | 1251 | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1304 | 1259 | ||
1305 | 1260 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1306 | 1261 | } | |
1307 | - | let wAmountsA = $ | |
1308 | - | let wAmountsB = $ | |
1309 | - | let debts = $ | |
1310 | - | let eqWAmountsA = $ | |
1311 | - | let eqWAmountsB = $ | |
1262 | + | let wAmountsA = $t03701237123._1 | |
1263 | + | let wAmountsB = $t03701237123._2 | |
1264 | + | let debts = $t03701237123._3 | |
1265 | + | let eqWAmountsA = $t03701237123._4 | |
1266 | + | let eqWAmountsB = $t03701237123._5 | |
1312 | 1267 | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1313 | 1268 | } | |
1314 | 1269 | ||
1328 | 1283 | else false) | |
1329 | 1284 | then throw("You can't borrow in this pool") | |
1330 | 1285 | else { | |
1331 | - | let $ | |
1332 | - | let AId = $ | |
1333 | - | let BId = $ | |
1334 | - | let balA = $ | |
1335 | - | let balB = $ | |
1336 | - | let shareId = $ | |
1286 | + | let $t03772137811 = getPoolData(Address(fromBase58String(pool)), pType) | |
1287 | + | let AId = $t03772137811._1 | |
1288 | + | let BId = $t03772137811._2 | |
1289 | + | let balA = $t03772137811._3 | |
1290 | + | let balB = $t03772137811._4 | |
1291 | + | let shareId = $t03772137811._5 | |
1337 | 1292 | if (if ((borrowId != AId)) | |
1338 | 1293 | then (borrowId != BId) | |
1339 | 1294 | else false) | |
1340 | 1295 | then throw("Wrong borrow asset") | |
1341 | 1296 | else { | |
1342 | - | let $ | |
1343 | - | let pmtA = $ | |
1344 | - | let pmtB = $ | |
1297 | + | let $t03789237951 = parseReplenishPmts(i.payments, AId, BId) | |
1298 | + | let pmtA = $t03789237951._1 | |
1299 | + | let pmtB = $t03789237951._2 | |
1345 | 1300 | let user = toString(i.caller) | |
1346 | 1301 | let newPosNum = getNewUserPositionNumber(user) | |
1347 | 1302 | if ((leverage > 100)) | |
1361 | 1316 | if ((inv == inv)) | |
1362 | 1317 | then { | |
1363 | 1318 | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1364 | - | let $ | |
1365 | - | if (($ | |
1319 | + | let $t03894039034 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1320 | + | if (($t03894039034 == $t03894039034)) | |
1366 | 1321 | then { | |
1367 | - | let newBalB = $ | |
1368 | - | let newBalA = $ | |
1322 | + | let newBalB = $t03894039034._2 | |
1323 | + | let newBalA = $t03894039034._1 | |
1369 | 1324 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1370 | - | let $ | |
1371 | - | let wAmountA = $ | |
1372 | - | let wAmountB = $ | |
1325 | + | let $t03910439219 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1326 | + | let wAmountA = $t03910439219._1 | |
1327 | + | let wAmountB = $t03910439219._2 | |
1373 | 1328 | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1374 | 1329 | } | |
1375 | 1330 | else throw("Strict value is not equal to itself.") | |
1379 | 1334 | else throw("Strict value is not equal to itself.") | |
1380 | 1335 | } | |
1381 | 1336 | else { | |
1382 | - | let $ | |
1383 | - | if (($ | |
1337 | + | let $t03927239387 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1338 | + | if (($t03927239387 == $t03927239387)) | |
1384 | 1339 | then { | |
1385 | - | let axlyFee = $ | |
1386 | - | let userStaked = $ | |
1387 | - | let $ | |
1388 | - | if (($ | |
1340 | + | let axlyFee = $t03927239387._2 | |
1341 | + | let userStaked = $t03927239387._1 | |
1342 | + | let $t03939339487 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1343 | + | if (($t03939339487 == $t03939339487)) | |
1389 | 1344 | then { | |
1390 | - | let newBalB = $ | |
1391 | - | let newBalA = $ | |
1345 | + | let newBalB = $t03939339487._2 | |
1346 | + | let newBalA = $t03939339487._1 | |
1392 | 1347 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1393 | - | let $ | |
1394 | - | let wAmountA = $ | |
1395 | - | let wAmountB = $ | |
1348 | + | let $t03955739672 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1349 | + | let wAmountA = $t03955739672._1 | |
1350 | + | let wAmountB = $t03955739672._2 | |
1396 | 1351 | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1397 | 1352 | } | |
1398 | 1353 | else throw("Strict value is not equal to itself.") | |
1485 | 1440 | ||
1486 | 1441 | @Callable(i) | |
1487 | 1442 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1488 | - | let $ | |
1489 | - | let user = $ | |
1490 | - | let pool = $ | |
1491 | - | let pmtA = $ | |
1492 | - | let AId = $ | |
1493 | - | let pmtB = $ | |
1494 | - | let BId = $ | |
1495 | - | let balA = $ | |
1496 | - | let balB = $ | |
1497 | - | let shareId = $ | |
1498 | - | let bwAsset = $ | |
1499 | - | let bwAmount = $ | |
1443 | + | let $t04451144615 = parseRequest(requestId) | |
1444 | + | let user = $t04451144615._1 | |
1445 | + | let pool = $t04451144615._2 | |
1446 | + | let pmtA = $t04451144615._3 | |
1447 | + | let AId = $t04451144615._4 | |
1448 | + | let pmtB = $t04451144615._5 | |
1449 | + | let BId = $t04451144615._6 | |
1450 | + | let balA = $t04451144615._7 | |
1451 | + | let balB = $t04451144615._8 | |
1452 | + | let shareId = $t04451144615._9 | |
1453 | + | let bwAsset = $t04451144615._10 | |
1454 | + | let bwAmount = $t04451144615._11 | |
1500 | 1455 | if ((size(i.payments) != 1)) | |
1501 | 1456 | then throw("Wrong payment size") | |
1502 | 1457 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1504 | 1459 | else (i.payments[0].amount != bwAmount)) | |
1505 | 1460 | then throw("Wrong payment") | |
1506 | 1461 | else { | |
1507 | - | let $ | |
1462 | + | let $t04480544905 = if ((AId == bwAsset)) | |
1508 | 1463 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1509 | 1464 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1510 | - | let pmtAllA = $ | |
1511 | - | let pmtAllB = $ | |
1465 | + | let pmtAllA = $t04480544905._1 | |
1466 | + | let pmtAllB = $t04480544905._2 | |
1512 | 1467 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1513 | - | let $ | |
1514 | - | let userStaked = $ | |
1515 | - | let axlyFee = $ | |
1468 | + | let $t04498745102 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1469 | + | let userStaked = $t04498745102._1 | |
1470 | + | let axlyFee = $t04498745102._2 | |
1516 | 1471 | let posNum = getNewUserPositionNumber(user) | |
1517 | 1472 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1518 | 1473 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1519 | - | let $ | |
1520 | - | let wAmountA = $ | |
1521 | - | let wAmountB = $ | |
1474 | + | let $t04546245577 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1475 | + | let wAmountA = $t04546245577._1 | |
1476 | + | let wAmountB = $t04546245577._2 | |
1522 | 1477 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1523 | 1478 | } | |
1524 | 1479 | })) | |
1529 | 1484 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1530 | 1485 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1531 | 1486 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1532 | - | let $ | |
1533 | - | let AId = $ | |
1534 | - | let BId = $ | |
1535 | - | let balA = $ | |
1536 | - | let balB = $ | |
1537 | - | let shareId = $ | |
1487 | + | let $t04609846188 = getPoolData(Address(fromBase58String(pool)), pType) | |
1488 | + | let AId = $t04609846188._1 | |
1489 | + | let BId = $t04609846188._2 | |
1490 | + | let balA = $t04609846188._3 | |
1491 | + | let balB = $t04609846188._4 | |
1492 | + | let shareId = $t04609846188._5 | |
1538 | 1493 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1539 | 1494 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1540 | 1495 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1566 | 1521 | func capitalizeEx (pool,route,tokenToId,amountToExchange,claim) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1567 | 1522 | let pType = getStringValue(this, (kPool + pool)) | |
1568 | 1523 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1569 | - | let $ | |
1570 | - | if (($ | |
1524 | + | let $t04815848260 = claimAndCheckAmnt(pool, pType, claim, amountToExchange, change) | |
1525 | + | if (($t04815848260 == $t04815848260)) | |
1571 | 1526 | then { | |
1572 | - | let claimedAsset = $ | |
1573 | - | let claimedAmount = $ | |
1527 | + | let claimedAsset = $t04815848260._2 | |
1528 | + | let claimedAmount = $t04815848260._1 | |
1574 | 1529 | let rArgs = split(route, "__") | |
1575 | 1530 | let exchangedAmount = if ((rArgs[0] == "directSwopfiCPMM")) | |
1576 | 1531 | then directSwopfiCPMM(rArgs, tokenToId) | |
1595 | 1550 | @Callable(i) | |
1596 | 1551 | func capitalizeNoEx (pool,claim,amountFromBalance) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1597 | 1552 | let pType = getStringValue(this, (kPool + pool)) | |
1598 | - | let $ | |
1599 | - | if (($ | |
1553 | + | let $t04894449042 = claimAndCheckAmnt(pool, pType, claim, amountFromBalance, 0) | |
1554 | + | if (($t04894449042 == $t04894449042)) | |
1600 | 1555 | then { | |
1601 | - | let claimedAsset = $ | |
1602 | - | let claimedAmount = $ | |
1556 | + | let claimedAsset = $t04894449042._2 | |
1557 | + | let claimedAmount = $t04894449042._1 | |
1603 | 1558 | capitalize(pool, pType, assetIdToStr(claimedAsset), (claimedAmount + amountFromBalance)) | |
1604 | 1559 | } | |
1605 | 1560 | else throw("Strict value is not equal to itself.") | |
1617 | 1572 | else false) | |
1618 | 1573 | then throw("Wrong pool type") | |
1619 | 1574 | else { | |
1620 | - | let $ | |
1621 | - | let aId = $ | |
1622 | - | let bId = $ | |
1623 | - | let aBal = $ | |
1624 | - | let bBal = $ | |
1625 | - | let shareId = $ | |
1575 | + | let $t04956349657 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1576 | + | let aId = $t04956349657._1 | |
1577 | + | let bId = $t04956349657._2 | |
1578 | + | let aBal = $t04956349657._3 | |
1579 | + | let bBal = $t04956349657._4 | |
1580 | + | let shareId = $t04956349657._5 | |
1626 | 1581 | if ((0 > inFeeNoLoan)) | |
1627 | 1582 | then throw("inFeeNoLoan must be greater than 0") | |
1628 | 1583 | else if ((0 > inFeeLoan)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let CONF = addressFromStringValue(getStringValue(this, "config")) | |
5 | 5 | ||
6 | 6 | let SF_POOL = "SF" | |
7 | 7 | ||
8 | 8 | let WX_POOL = "WX" | |
9 | 9 | ||
10 | 10 | let CPMM = "cpmm" | |
11 | 11 | ||
12 | 12 | let FLAT = "flat" | |
13 | 13 | ||
14 | 14 | let CAP_FEE_NO_LOAN = "capNoLoan" | |
15 | 15 | ||
16 | 16 | let CAP_FEE_LOAN = "capLoan" | |
17 | 17 | ||
18 | 18 | let STOPLOSS_FEE_NO_LOAN = "stopLossNoLoan" | |
19 | 19 | ||
20 | 20 | let STOPLOSS_LOAN = "stopLossLoan" | |
21 | 21 | ||
22 | 22 | let LOAN_FEE = "loan" | |
23 | 23 | ||
24 | 24 | let NO_LOAN_FEE = "noLoan" | |
25 | 25 | ||
26 | 26 | let NO_FEE = "noFee" | |
27 | 27 | ||
28 | 28 | let SCALE8 = 100000000 | |
29 | 29 | ||
30 | 30 | let SCALE10 = 10000000000 | |
31 | 31 | ||
32 | 32 | let SCALE16 = toBigInt(10000000000000000) | |
33 | 33 | ||
34 | 34 | let FEE_SCALE6 = 1000000 | |
35 | 35 | ||
36 | 36 | let kSFPoolAAssetBalance = "A_asset_balance" | |
37 | 37 | ||
38 | 38 | let kSFPoolBAssetBalance = "B_asset_balance" | |
39 | 39 | ||
40 | 40 | let kSFPoolAAssetId = "A_asset_id" | |
41 | 41 | ||
42 | 42 | let kSFPoolBAssetId = "B_asset_id" | |
43 | 43 | ||
44 | 44 | let kSFPoolShareId = "share_asset_id" | |
45 | 45 | ||
46 | 46 | let kSFPoolShareSupply = "share_asset_supply" | |
47 | 47 | ||
48 | 48 | let kSFPoolFee = "commission" | |
49 | 49 | ||
50 | 50 | let kUserPosition = "_userPosition" | |
51 | 51 | ||
52 | 52 | let kUserPositionPool = "_userPositionPool" | |
53 | 53 | ||
54 | 54 | let kUserBorrowAmount = "_userPositionBorrowAmount" | |
55 | 55 | ||
56 | 56 | let kUserBorrowAssetId = "_userPositionBorrowAssetId" | |
57 | 57 | ||
58 | 58 | let kUserPositionNum = "_userPositionNumber" | |
59 | 59 | ||
60 | 60 | let kUserPositionInterest = "_userPositionInterest" | |
61 | 61 | ||
62 | 62 | let kPoolTotal = "_poolTotal" | |
63 | 63 | ||
64 | 64 | let kPoolTotalLoan = "_poolTotalLoan" | |
65 | 65 | ||
66 | 66 | let kPoolInterestLoan = "_poolInterestLoan" | |
67 | 67 | ||
68 | 68 | let kPoolInterestNoLoan = "_poolInterestNoLoan" | |
69 | 69 | ||
70 | 70 | let kPoolCanBorrow = "_poolCanBorrow" | |
71 | 71 | ||
72 | 72 | let kAxlyInFeeWithoutLoan = "_axlyFeeNoLoan" | |
73 | 73 | ||
74 | 74 | let kAxlyInFeeWithLoan = "_axlyFeeWithLoan" | |
75 | 75 | ||
76 | 76 | let kAxlyNoLoanCapFee = "_axlyFeeCapNoLoan" | |
77 | 77 | ||
78 | 78 | let kAxlyWithLoanCapFee = "_axlyFeeCapWithLoan" | |
79 | 79 | ||
80 | 80 | let kAxlyStopLossNoLoanFee = "_axlyFeeStoplossWithLoan" | |
81 | 81 | ||
82 | 82 | let kAxlyStopLossLoanFee = "_axlyFeeStoplossNoLoan" | |
83 | 83 | ||
84 | 84 | let kRequestId = "_request_id" | |
85 | 85 | ||
86 | 86 | let kRequestIter = "requests_iter" | |
87 | 87 | ||
88 | 88 | let kPool = "pool_" | |
89 | 89 | ||
90 | 90 | let kPoolType = "_poolType" | |
91 | 91 | ||
92 | 92 | let kSharePool = "_poolShareId" | |
93 | 93 | ||
94 | 94 | let kPoolCapChange = "_poolCapChange" | |
95 | 95 | ||
96 | 96 | let kTokenLastPrice = "last_price" | |
97 | 97 | ||
98 | 98 | let kPriceInOracle = "_twap5B" | |
99 | 99 | ||
100 | 100 | let kActive = "active" | |
101 | 101 | ||
102 | 102 | let kActiveUsers = "activeUsers" | |
103 | 103 | ||
104 | 104 | let kActiveSFWX = "_active" | |
105 | 105 | ||
106 | 106 | let kPoolActive = "_activePool" | |
107 | 107 | ||
108 | 108 | let kUserStopLoss = "_stopLoss" | |
109 | 109 | ||
110 | 110 | let kFallbackExchangeSwopfi = "_fallbackExchangeSwopfi" | |
111 | 111 | ||
112 | 112 | let kMoneyBox = "axly_money_box" | |
113 | 113 | ||
114 | 114 | let kSFFarmingAddr = "swopfi_farming_addr" | |
115 | 115 | ||
116 | 116 | let kLendService = "lend_service_addr" | |
117 | 117 | ||
118 | 118 | let kOperatorCallPK = "admin_call_pub_key" | |
119 | 119 | ||
120 | 120 | let kPriceOracle = "price_oracle" | |
121 | 121 | ||
122 | 122 | let kExContract = "exchange_contract" | |
123 | 123 | ||
124 | 124 | let kWxSwapContract = "wx_swap_contract" | |
125 | 125 | ||
126 | 126 | let kWxRest = "wx_rest_addr" | |
127 | 127 | ||
128 | 128 | let kSwopId = "swop_id" | |
129 | 129 | ||
130 | 130 | let kWxId = "wx_id" | |
131 | 131 | ||
132 | 132 | let kGroup1Admin1PK = "group1_admin1_pub_key" | |
133 | 133 | ||
134 | 134 | let kGroup1Admin2PK = "group1_admin2_pub_key" | |
135 | 135 | ||
136 | 136 | let kGroup2Admin1PK = "group2_admin1_pub_key" | |
137 | 137 | ||
138 | 138 | let kGroup2Admin2PK = "group2_admin2_pub_key" | |
139 | 139 | ||
140 | 140 | let moneyBox = addressFromStringValue(valueOrErrorMessage(getString(CONF, kMoneyBox), "No axly moneyBox address")) | |
141 | 141 | ||
142 | 142 | let exContract = addressFromStringValue(valueOrErrorMessage(getString(CONF, kExContract), "No exchange contract address")) | |
143 | 143 | ||
144 | 144 | let priceOracleAddr = addressFromStringValue(valueOrErrorMessage(getString(CONF, kPriceOracle), "No price oracle address")) | |
145 | 145 | ||
146 | 146 | let wxSwapContract = addressFromStringValue(valueOrErrorMessage(getString(CONF, kWxSwapContract), "No wx swap address")) | |
147 | 147 | ||
148 | 148 | let wxRest = addressFromStringValue(valueOrErrorMessage(getString(CONF, kWxRest), "No wx rest address")) | |
149 | 149 | ||
150 | 150 | let SWOPID = fromBase58String(valueOrErrorMessage(getString(CONF, kSwopId), "No swop id")) | |
151 | 151 | ||
152 | 152 | let WXID = fromBase58String(valueOrErrorMessage(getString(CONF, kWxId), "No wx id")) | |
153 | 153 | ||
154 | 154 | let group1Admin1PK = fromBase58String(valueOrErrorMessage(getString(CONF, kGroup1Admin1PK), "Can't get kGroup1Admin1PK")) | |
155 | 155 | ||
156 | 156 | let group1Admin2PK = fromBase58String(valueOrErrorMessage(getString(CONF, kGroup1Admin2PK), "Can't get kGroup1Admin2PK")) | |
157 | 157 | ||
158 | 158 | let group2Admin1PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup2Admin1PK), "Can't get kGroup2Admin1PK")) | |
159 | 159 | ||
160 | 160 | let group2Admin2PK = fromBase58String(valueOrErrorMessage(getString(this, kGroup2Admin2PK), "Can't get kGroup2Admin1PK")) | |
161 | 161 | ||
162 | 162 | let operatorPK = fromBase58String(valueOrErrorMessage(getString(CONF, kOperatorCallPK), "Can't get operatorPK")) | |
163 | 163 | ||
164 | 164 | func unknownPoolType () = throw("Wrong pool type") | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func getLendSrvAddr () = addressFromStringValue(valueOrErrorMessage(getString(CONF, kLendService), "Can't get lend service addr")) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func isOperatorCall (i) = if ((i.callerPublicKey == operatorPK)) | |
171 | 171 | then unit | |
172 | 172 | else throw("Only operator can call this function") | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func isAdminCall (i) = if (if ((i.callerPublicKey == group1Admin1PK)) | |
176 | 176 | then true | |
177 | 177 | else (i.callerPublicKey == group1Admin2PK)) | |
178 | 178 | then unit | |
179 | 179 | else throw("Only admin group1 can call this function") | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func isSelfCall (i) = if ((i.caller == this)) | |
183 | 183 | then unit | |
184 | 184 | else throw("Only contract itself can call this function") | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func isLandCall (i) = if ((i.caller == getLendSrvAddr())) | |
188 | 188 | then unit | |
189 | 189 | else throw("Only land contract can call this function") | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func isActive () = if ((valueOrElse(getBoolean(this, kActive), true) == true)) | |
193 | 193 | then unit | |
194 | 194 | else throw("DApp is inactive at this moment") | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func isActiveForUsers () = if (if (valueOrElse(getBoolean(this, kActive), true)) | |
198 | 198 | then (valueOrElse(getBoolean(this, kActiveUsers), true) == true) | |
199 | 199 | else false) | |
200 | 200 | then unit | |
201 | 201 | else throw("DApp is inactive for users at this moment") | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func isPoolActive (pool,type) = { | |
205 | 205 | let WXSFActive = valueOrElse(getBoolean(this, (type + kActiveSFWX)), true) | |
206 | 206 | let poolActive = valueOrElse(getBoolean(this, (pool + kPoolActive)), true) | |
207 | 207 | if (if (WXSFActive) | |
208 | 208 | then poolActive | |
209 | 209 | else false) | |
210 | 210 | then true | |
211 | 211 | else false | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func accountBalance (assetId) = match assetId { | |
216 | 216 | case id: ByteVector => | |
217 | 217 | assetBalance(this, id) | |
218 | 218 | case waves: Unit => | |
219 | 219 | wavesBalance(this).available | |
220 | 220 | case _ => | |
221 | 221 | throw("Match error") | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func getSFPoolBalances (poolAddr) = $Tuple2(valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance")) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func getWXPoolBalances (poolAddr,aId,bId) = $Tuple2({ | |
229 | 229 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [aId], nil) | |
230 | 230 | if ($isInstanceOf(@, "Int")) | |
231 | 231 | then @ | |
232 | 232 | else throw(($getType(@) + " couldn't be cast to Int")) | |
233 | 233 | }, { | |
234 | 234 | let @ = invoke(poolAddr, "getAccBalanceWrapperREADONLY", [bId], nil) | |
235 | 235 | if ($isInstanceOf(@, "Int")) | |
236 | 236 | then @ | |
237 | 237 | else throw(($getType(@) + " couldn't be cast to Int")) | |
238 | 238 | }) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func getPoolBalances (poolAddr,type,aId,bId) = if ((type == SF_POOL)) | |
242 | 242 | then getSFPoolBalances(poolAddr) | |
243 | 243 | else if ((type == WX_POOL)) | |
244 | 244 | then getWXPoolBalances(poolAddr, aId, bId) | |
245 | 245 | else unknownPoolType() | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func getSFPoolData (poolAddr) = { | |
249 | 249 | let $t082738322 = getSFPoolBalances(poolAddr) | |
250 | 250 | if (($t082738322 == $t082738322)) | |
251 | 251 | then { | |
252 | 252 | let balB = $t082738322._2 | |
253 | 253 | let balA = $t082738322._1 | |
254 | 254 | $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), balA, balB, valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
255 | 255 | } | |
256 | 256 | else throw("Strict value is not equal to itself.") | |
257 | 257 | } | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func getWXPoolData (poolAddr) = { | |
261 | 261 | let cfg = { | |
262 | 262 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
263 | 263 | if ($isInstanceOf(@, "List[Any]")) | |
264 | 264 | then @ | |
265 | 265 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
266 | 266 | } | |
267 | 267 | if ((cfg == cfg)) | |
268 | 268 | then { | |
269 | 269 | let aId = valueOrErrorMessage({ | |
270 | 270 | let @ = cfg[4] | |
271 | 271 | if ($isInstanceOf(@, "String")) | |
272 | 272 | then @ | |
273 | 273 | else unit | |
274 | 274 | }, "Can't get pool A asset id") | |
275 | 275 | let bId = valueOrErrorMessage({ | |
276 | 276 | let @ = cfg[5] | |
277 | 277 | if ($isInstanceOf(@, "String")) | |
278 | 278 | then @ | |
279 | 279 | else unit | |
280 | 280 | }, "Can't get pool B asset id") | |
281 | 281 | let shareId = valueOrErrorMessage({ | |
282 | 282 | let @ = cfg[3] | |
283 | 283 | if ($isInstanceOf(@, "String")) | |
284 | 284 | then @ | |
285 | 285 | else unit | |
286 | 286 | }, "Can't get pool LP asset id") | |
287 | 287 | let $t090199078 = getWXPoolBalances(poolAddr, aId, bId) | |
288 | 288 | if (($t090199078 == $t090199078)) | |
289 | 289 | then { | |
290 | 290 | let balB = $t090199078._2 | |
291 | 291 | let balA = $t090199078._1 | |
292 | 292 | $Tuple5(aId, bId, balA, balB, shareId) | |
293 | 293 | } | |
294 | 294 | else throw("Strict value is not equal to itself.") | |
295 | 295 | } | |
296 | 296 | else throw("Strict value is not equal to itself.") | |
297 | 297 | } | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | func getPoolData (poolAddr,type) = if ((type == SF_POOL)) | |
301 | 301 | then getSFPoolData(poolAddr) | |
302 | 302 | else if ((type == WX_POOL)) | |
303 | 303 | then getWXPoolData(poolAddr) | |
304 | 304 | else unknownPoolType() | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func getShareSupply (poolAddr,type,shareId) = if ((type == SF_POOL)) | |
308 | 308 | then valueOrErrorMessage(getInteger(poolAddr, kSFPoolShareSupply), "Can't get share asset supply") | |
309 | 309 | else if ((type == WX_POOL)) | |
310 | 310 | then valueOrErrorMessage(assetInfo(fromBase58String(shareId)), "Wrong ShareId").quantity | |
311 | 311 | else unknownPoolType() | |
312 | 312 | ||
313 | 313 | ||
314 | 314 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | func getPoolTotalShareWithLoan (pool) = valueOrElse(getInteger(this, (pool + kPoolTotalLoan)), 0) | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func getNewUserPositionNumber (user) = (valueOrElse(getInteger(this, (user + kUserPositionNum)), 0) + 1) | |
321 | 321 | ||
322 | 322 | ||
323 | 323 | func getAxlyFee (pool,feeType) = if ((feeType == CAP_FEE_LOAN)) | |
324 | 324 | then getIntegerValue(this, (pool + kAxlyWithLoanCapFee)) | |
325 | 325 | else if ((feeType == CAP_FEE_NO_LOAN)) | |
326 | 326 | then getIntegerValue(this, (pool + kAxlyNoLoanCapFee)) | |
327 | 327 | else if ((feeType == LOAN_FEE)) | |
328 | 328 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
329 | 329 | else if ((feeType == NO_LOAN_FEE)) | |
330 | 330 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
331 | 331 | else if ((feeType == NO_FEE)) | |
332 | 332 | then 0 | |
333 | 333 | else throw("Wrong fee type") | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
337 | 337 | ||
338 | 338 | ||
339 | 339 | func getWXFarmingAddr (poolAddr) = { | |
340 | 340 | let fContract = Address(fromBase58String(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
341 | 341 | let factroyCfg = split(valueOrErrorMessage(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
342 | 342 | Address(fromBase58String(factroyCfg[1])) | |
343 | 343 | } | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | func assetIdToStr (assetId) = match assetId { | |
347 | 347 | case id: ByteVector => | |
348 | 348 | toBase58String(id) | |
349 | 349 | case waves: Unit => | |
350 | 350 | "WAVES" | |
351 | 351 | case _ => | |
352 | 352 | throw("Not Asset id") | |
353 | 353 | } | |
354 | 354 | ||
355 | 355 | ||
356 | 356 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
357 | 357 | then unit | |
358 | 358 | else fromBase58String(assetId) | |
359 | 359 | ||
360 | 360 | ||
361 | 361 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
362 | 362 | then 8 | |
363 | 363 | else match assetInfo(fromBase58String(assetId)) { | |
364 | 364 | case asset: Asset => | |
365 | 365 | asset.decimals | |
366 | 366 | case _ => | |
367 | 367 | throw("Can't find asset") | |
368 | 368 | } | |
369 | 369 | ||
370 | 370 | ||
371 | 371 | func getAssetPrecition (assetId) = pow(10, 0, getAssetDecimals(assetId), 0, 0, DOWN) | |
372 | 372 | ||
373 | 373 | ||
374 | 374 | func getAssetsPrice (assetIds) = { | |
375 | 375 | func getPrices (a,assetId) = { | |
376 | 376 | let assetPrice = valueOrElse(getInteger(priceOracleAddr, (assetId + kPriceInOracle)), -1) | |
377 | 377 | (a :+ assetPrice) | |
378 | 378 | } | |
379 | 379 | ||
380 | 380 | let $l = assetIds | |
381 | 381 | let $s = size($l) | |
382 | 382 | let $acc0 = nil | |
383 | 383 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
384 | 384 | then $a | |
385 | 385 | else getPrices($a, $l[$i]) | |
386 | 386 | ||
387 | 387 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
388 | 388 | then $a | |
389 | 389 | else throw("List size exceeds 50") | |
390 | 390 | ||
391 | 391 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
392 | 392 | } | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | func getSharePrice (shareId) = { | |
396 | 396 | let pool = valueOrErrorMessage(getString(this, (shareId + kSharePool)), "Can't find pool addr by share id") | |
397 | 397 | let poolAddr = Address(fromBase58String(pool)) | |
398 | 398 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
399 | 399 | let $t01206712132 = getPoolData(poolAddr, pType) | |
400 | 400 | let aId = $t01206712132._1 | |
401 | 401 | let bId = $t01206712132._2 | |
402 | 402 | let aBalance = $t01206712132._3 | |
403 | 403 | let bBalance = $t01206712132._4 | |
404 | 404 | let prices = getAssetsPrice([aId, bId]) | |
405 | 405 | let dPriceA = prices[0] | |
406 | 406 | let dPriceB = prices[1] | |
407 | 407 | if (if ((0 > dPriceA)) | |
408 | 408 | then true | |
409 | 409 | else (0 > dPriceB)) | |
410 | 410 | then -1 | |
411 | 411 | else { | |
412 | 412 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
413 | 413 | let APrecision = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
414 | 414 | let BPrecision = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
415 | 415 | let sharePrecision = pow(10, 0, getAssetDecimals(shareId), 0, 0, DOWN) | |
416 | 416 | let sum = (fraction(aBalance, dPriceA, APrecision) + fraction(bBalance, dPriceB, BPrecision)) | |
417 | 417 | fraction(sum, sharePrecision, shareSupply) | |
418 | 418 | } | |
419 | 419 | } | |
420 | 420 | ||
421 | 421 | ||
422 | 422 | func getSharePrices (shareIds) = { | |
423 | 423 | func getPrices (a,shareId) = (a :+ getSharePrice(shareId)) | |
424 | 424 | ||
425 | 425 | let $l = shareIds | |
426 | 426 | let $s = size($l) | |
427 | 427 | let $acc0 = nil | |
428 | 428 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
429 | 429 | then $a | |
430 | 430 | else getPrices($a, $l[$i]) | |
431 | 431 | ||
432 | 432 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
433 | 433 | then $a | |
434 | 434 | else throw("List size exceeds 20") | |
435 | 435 | ||
436 | 436 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
437 | 437 | } | |
438 | 438 | ||
439 | 439 | ||
440 | 440 | func getCursEntries (aId,bId,shareId,wAmounts) = { | |
441 | 441 | let assetsPrices = getAssetsPrice([aId, bId]) | |
442 | 442 | let sharePrice = getSharePrice(shareId) | |
443 | 443 | let prices = ([toString(assetsPrices[0]), toString(assetsPrices[1]), toString(sharePrice)] ++ wAmounts) | |
444 | 444 | [StringEntry(kTokenLastPrice, makeString(prices, ","))] | |
445 | 445 | } | |
446 | 446 | ||
447 | 447 | ||
448 | - | func calcReplenishByTwoTokens (pType,poolAddr,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
448 | + | func calcReplenishByTwoTokens (pType,poolAddr,LPId,pmtA,aId,pmtB,bId,balA,balB) = if ((pType == SF_POOL)) | |
449 | 449 | then { | |
450 | 450 | let repl = { | |
451 | 451 | let @ = invoke(poolAddr, "callFunction", ["calcLPReplenishTwoTokensREADONLY", [toString(pmtA), toString(pmtB)]], nil) | |
452 | 452 | if ($isInstanceOf(@, "List[Any]")) | |
453 | 453 | then @ | |
454 | 454 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
455 | 455 | } | |
456 | 456 | if ((repl == repl)) | |
457 | 457 | then $Tuple5({ | |
458 | 458 | let @ = repl[3] | |
459 | 459 | if ($isInstanceOf(@, "Int")) | |
460 | 460 | then @ | |
461 | 461 | else throw(($getType(@) + " couldn't be cast to Int")) | |
462 | 462 | }, { | |
463 | 463 | let @ = repl[4] | |
464 | 464 | if ($isInstanceOf(@, "Int")) | |
465 | 465 | then @ | |
466 | 466 | else throw(($getType(@) + " couldn't be cast to Int")) | |
467 | 467 | }, { | |
468 | 468 | let @ = repl[1] | |
469 | 469 | if ($isInstanceOf(@, "Int")) | |
470 | 470 | then @ | |
471 | 471 | else throw(($getType(@) + " couldn't be cast to Int")) | |
472 | 472 | }, assetIdToStr(repl[2]), { | |
473 | 473 | let @ = repl[0] | |
474 | 474 | if ($isInstanceOf(@, "Int")) | |
475 | 475 | then @ | |
476 | 476 | else throw(($getType(@) + " couldn't be cast to Int")) | |
477 | 477 | }) | |
478 | 478 | else throw("Strict value is not equal to itself.") | |
479 | 479 | } | |
480 | 480 | else if ((pType == WX_POOL)) | |
481 | 481 | then { | |
482 | - | let $ | |
483 | - | let @ = invoke( | |
482 | + | let $t01369013948 = $Tuple2(split({ | |
483 | + | let @ = invoke(wxRest, "evaluatePutByAmountAssetREADONLY", [LPId, pmtA], nil) | |
484 | 484 | if ($isInstanceOf(@, "String")) | |
485 | 485 | then @ | |
486 | 486 | else throw(($getType(@) + " couldn't be cast to String")) | |
487 | 487 | }, "__"), split({ | |
488 | - | let @ = invoke( | |
488 | + | let @ = invoke(wxRest, "evaluatePutByPriceAssetREADONLY", [LPId, pmtB], nil) | |
489 | 489 | if ($isInstanceOf(@, "String")) | |
490 | 490 | then @ | |
491 | 491 | else throw(($getType(@) + " couldn't be cast to String")) | |
492 | 492 | }, "__")) | |
493 | - | if (($ | |
493 | + | if (($t01369013948 == $t01369013948)) | |
494 | 494 | then { | |
495 | - | let evalPutInB = $ | |
496 | - | let evalPutInA = $ | |
495 | + | let evalPutInB = $t01369013948._2 | |
496 | + | let evalPutInA = $t01369013948._1 | |
497 | 497 | let lpInA = parseIntValue(evalPutInA[1]) | |
498 | 498 | let lpInB = parseIntValue(evalPutInB[1]) | |
499 | 499 | if ((lpInB > lpInA)) | |
500 | 500 | then { | |
501 | 501 | let pmt = parseIntValue(evalPutInA[8]) | |
502 | 502 | $Tuple5(pmtA, pmt, (pmtB - pmt), bId, lpInB) | |
503 | 503 | } | |
504 | 504 | else { | |
505 | 505 | let pmt = parseIntValue(evalPutInB[7]) | |
506 | 506 | $Tuple5(pmt, pmtB, (pmtA - pmt), aId, lpInA) | |
507 | 507 | } | |
508 | 508 | } | |
509 | 509 | else throw("Strict value is not equal to itself.") | |
510 | 510 | } | |
511 | 511 | else unknownPoolType() | |
512 | 512 | ||
513 | 513 | ||
514 | 514 | func replenishTwoTokensByType (poolAddr,pType,pmtA,aId,pmtB,bId) = { | |
515 | 515 | let payments = [AttachedPayment(assetIdFromStr(aId), pmtA), AttachedPayment(assetIdFromStr(bId), pmtB)] | |
516 | 516 | if ((pType == SF_POOL)) | |
517 | 517 | then invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
518 | 518 | else if ((pType == WX_POOL)) | |
519 | 519 | then invoke(poolAddr, "put", [1000000, false], payments) | |
520 | 520 | else unknownPoolType() | |
521 | 521 | } | |
522 | 522 | ||
523 | 523 | ||
524 | 524 | func replenishOneTokenByType (poolAddr,pType,pmt,pmtId) = { | |
525 | 525 | let payments = [AttachedPayment(assetIdFromStr(pmtId), pmt)] | |
526 | 526 | if ((pType == SF_POOL)) | |
527 | 527 | then invoke(poolAddr, "callFunction", ["replenishWithOneToken", ["0", "false", "0"]], payments) | |
528 | 528 | else if ((pType == WX_POOL)) | |
529 | 529 | then { | |
530 | 530 | let fc = if ((valueOrElse(getString(this, (toString(poolAddr) + kPoolType)), "cpmm") == FLAT)) | |
531 | 531 | then "putOneTknV2" | |
532 | 532 | else "putOneTkn" | |
533 | 533 | invoke(poolAddr, fc, [0, false], payments) | |
534 | 534 | } | |
535 | 535 | else unknownPoolType() | |
536 | 536 | } | |
537 | 537 | ||
538 | 538 | ||
539 | 539 | func stakeLP (pool,pType,shareId,amount) = { | |
540 | 540 | let payments = [AttachedPayment(fromBase58String(shareId), amount)] | |
541 | 541 | if ((pType == SF_POOL)) | |
542 | 542 | then invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], payments) | |
543 | 543 | else if ((pType == WX_POOL)) | |
544 | 544 | then invoke(getWXFarmingAddr(addressFromStringValue(pool)), "stake", nil, payments) | |
545 | 545 | else unknownPoolType() | |
546 | 546 | } | |
547 | 547 | ||
548 | 548 | ||
549 | 549 | func unstakeLP (pool,pType,shareId,amount) = { | |
550 | - | let $ | |
550 | + | let $t01572616076 = if ((pType == SF_POOL)) | |
551 | 551 | then $Tuple3(getSFFarmingAddr(), "withdrawShareTokens", [pool, amount]) | |
552 | 552 | else if ((pType == WX_POOL)) | |
553 | 553 | then $Tuple3(getWXFarmingAddr(Address(fromBase58String(pool))), "unstake", [shareId, amount]) | |
554 | 554 | else unknownPoolType() | |
555 | - | let farmAddr = $ | |
556 | - | let fName = $ | |
557 | - | let params = $ | |
555 | + | let farmAddr = $t01572616076._1 | |
556 | + | let fName = $t01572616076._2 | |
557 | + | let params = $t01572616076._3 | |
558 | 558 | let inv = invoke(farmAddr, fName, params, nil) | |
559 | 559 | if ((inv == inv)) | |
560 | 560 | then amount | |
561 | 561 | else throw("Strict value is not equal to itself.") | |
562 | 562 | } | |
563 | 563 | ||
564 | 564 | ||
565 | 565 | func calcAmountToPaySF (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
566 | 566 | let poolAddr = Address(fromBase58String(pool)) | |
567 | 567 | let feeScale6 = 1000000 | |
568 | 568 | let fee = getIntegerValue(poolAddr, kSFPoolFee) | |
569 | 569 | let amntGetNoFee = fraction(amountTokenToGet, feeScale6, (feeScale6 - fee), CEILING) | |
570 | - | let $ | |
570 | + | let $t01649816804 = if ((assetTokenToGet == assetIdA)) | |
571 | 571 | then { | |
572 | 572 | let amountToPay = fraction(amntGetNoFee, balB, (balA - amntGetNoFee), CEILING) | |
573 | 573 | $Tuple2(amountToPay, assetIdB) | |
574 | 574 | } | |
575 | 575 | else { | |
576 | 576 | let amountToPay = fraction(amntGetNoFee, balA, (balB - amntGetNoFee), CEILING) | |
577 | 577 | $Tuple2(amountToPay, assetIdA) | |
578 | 578 | } | |
579 | - | let amountToPay = $ | |
580 | - | let assetToPay = $ | |
579 | + | let amountToPay = $t01649816804._1 | |
580 | + | let assetToPay = $t01649816804._2 | |
581 | 581 | $Tuple2(assetToPay, amountToPay) | |
582 | 582 | } | |
583 | 583 | ||
584 | 584 | ||
585 | 585 | func getWXSwapFees (pool) = { | |
586 | 586 | let poolAddr = addressFromStringValue(pool) | |
587 | 587 | let fContract = addressFromStringValue(valueOrErrorMessage(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr")) | |
588 | 588 | let poolFeeDefault = value(getInteger(wxSwapContract, "%s__poolFee")) | |
589 | 589 | let protocolFeeDefault = value(getInteger(wxSwapContract, "%s__protocolFee")) | |
590 | 590 | match invoke(fContract, "getSwapFeeREADONLY", [toString(poolAddr)], nil) { | |
591 | 591 | case fees: (Int, Int) => | |
592 | 592 | $Tuple2(fees._1, fees._2) | |
593 | 593 | case _ => | |
594 | 594 | $Tuple2(poolFeeDefault, protocolFeeDefault) | |
595 | 595 | } | |
596 | 596 | } | |
597 | 597 | ||
598 | 598 | ||
599 | 599 | func calcAmountToPayWX (pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
600 | - | let $ | |
601 | - | let pFee = $ | |
602 | - | let prFee = $ | |
600 | + | let $t01754417583 = getWXSwapFees(pool) | |
601 | + | let pFee = $t01754417583._1 | |
602 | + | let prFee = $t01754417583._2 | |
603 | 603 | let feeScale = toBigInt(100000000) | |
604 | - | let $ | |
604 | + | let $t01762317931 = if ((assetTokenToGet == assetIdA)) | |
605 | 605 | then { | |
606 | 606 | let amountToPay = fraction(amountTokenToGet, balB, (balA - amountTokenToGet)) | |
607 | 607 | $Tuple2(amountToPay, assetIdB) | |
608 | 608 | } | |
609 | 609 | else { | |
610 | 610 | let amountToPay = fraction(amountTokenToGet, balA, (balB - amountTokenToGet)) | |
611 | 611 | $Tuple2(amountToPay, assetIdA) | |
612 | 612 | } | |
613 | - | let amountToPay = $ | |
614 | - | let assetToPay = $ | |
613 | + | let amountToPay = $t01762317931._1 | |
614 | + | let assetToPay = $t01762317931._2 | |
615 | 615 | let amountToPayWithFee = toInt(fraction(toBigInt(amountToPay), feeScale, (feeScale - toBigInt((prFee + pFee))), CEILING)) | |
616 | 616 | $Tuple2(assetToPay, amountToPayWithFee) | |
617 | 617 | } | |
618 | 618 | ||
619 | 619 | ||
620 | 620 | func exchangeDirectly (pType,pool,assetIdA,assetIdB,balA,balB,amountTokenToGet,assetTokenToGet) = { | |
621 | 621 | let poolFB = valueOrElse(getString(this, (pool + kFallbackExchangeSwopfi)), "") | |
622 | 622 | if (if ((pType == SF_POOL)) | |
623 | 623 | then true | |
624 | 624 | else (poolFB != "")) | |
625 | 625 | then { | |
626 | - | let $ | |
626 | + | let $t01837218584 = if ((poolFB == "")) | |
627 | 627 | then $Tuple3(balA, balB, pool) | |
628 | 628 | else { | |
629 | - | let $ | |
630 | - | let sfBalA = $ | |
631 | - | let sfBalB = $ | |
629 | + | let $t01847818551 = getSFPoolBalances(addressFromStringValue(poolFB)) | |
630 | + | let sfBalA = $t01847818551._1 | |
631 | + | let sfBalB = $t01847818551._2 | |
632 | 632 | $Tuple3(sfBalA, sfBalB, poolFB) | |
633 | 633 | } | |
634 | - | let pBalA = $ | |
635 | - | let pBalB = $ | |
636 | - | let exPool = $ | |
637 | - | let $ | |
638 | - | let assetToPay = $ | |
639 | - | let amountToPay = $ | |
634 | + | let pBalA = $t01837218584._1 | |
635 | + | let pBalB = $t01837218584._2 | |
636 | + | let exPool = $t01837218584._3 | |
637 | + | let $t01858918715 = calcAmountToPaySF(exPool, assetIdA, assetIdB, pBalA, pBalB, amountTokenToGet, assetTokenToGet) | |
638 | + | let assetToPay = $t01858918715._1 | |
639 | + | let amountToPay = $t01858918715._2 | |
640 | 640 | invoke(addressFromStringValue(exPool), "callFunction", ["exchange", [toString(amountTokenToGet)]], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
641 | 641 | } | |
642 | 642 | else if ((pType == WX_POOL)) | |
643 | 643 | then { | |
644 | - | let $ | |
645 | - | let assetToPay = $ | |
646 | - | let amountToPay = $ | |
644 | + | let $t01891719039 = calcAmountToPayWX(pool, assetIdA, assetIdB, balA, balB, amountTokenToGet, assetTokenToGet) | |
645 | + | let assetToPay = $t01891719039._1 | |
646 | + | let amountToPay = $t01891719039._2 | |
647 | 647 | invoke(wxSwapContract, "swap", [amountTokenToGet, assetTokenToGet, toString(this)], [AttachedPayment(assetIdFromStr(assetToPay), amountToPay)]) | |
648 | 648 | } | |
649 | 649 | else unknownPoolType() | |
650 | 650 | } | |
651 | 651 | ||
652 | 652 | ||
653 | 653 | func calcWithdrawLPFromPoolVirt (poolAddr,pType,shareId,userCanWithdraw) = { | |
654 | - | let $ | |
654 | + | let $t01932619799 = if ((pType == SF_POOL)) | |
655 | 655 | then { | |
656 | 656 | let inv = { | |
657 | 657 | let @ = invoke(poolAddr, "callFunction", ["withdrawREADONLY", [toString(userCanWithdraw)]], nil) | |
658 | 658 | if ($isInstanceOf(@, "List[Any]")) | |
659 | 659 | then @ | |
660 | 660 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
661 | 661 | } | |
662 | 662 | if ((inv == inv)) | |
663 | 663 | then $Tuple2({ | |
664 | 664 | let @ = inv[0] | |
665 | 665 | if ($isInstanceOf(@, "Int")) | |
666 | 666 | then @ | |
667 | 667 | else throw(($getType(@) + " couldn't be cast to Int")) | |
668 | 668 | }, { | |
669 | 669 | let @ = inv[1] | |
670 | 670 | if ($isInstanceOf(@, "Int")) | |
671 | 671 | then @ | |
672 | 672 | else throw(($getType(@) + " couldn't be cast to Int")) | |
673 | 673 | }) | |
674 | 674 | else throw("Strict value is not equal to itself.") | |
675 | 675 | } | |
676 | 676 | else if ((pType == WX_POOL)) | |
677 | - | then if ((valueOrElse(getString(this, (toString(poolAddr) + kPoolType)), "cpmm") == FLAT)) | |
678 | - | then { | |
679 | - | let inv = invoke(poolAddr, "estimateGetOperationWrapperREADONLY", ["", shareId, userCanWithdraw, toString(this)], nil) | |
680 | - | if ((inv == inv)) | |
681 | - | then { | |
682 | - | let $t01979720294 = match inv { | |
683 | - | case _ => | |
684 | - | if (if (if ($isInstanceOf($match0._1, "Int")) | |
685 | - | then if ($isInstanceOf($match0._2, "Int")) | |
686 | - | then if ($isInstanceOf($match0._5, "Int")) | |
687 | - | then if ($isInstanceOf($match0._6, "Int")) | |
688 | - | then if ($isInstanceOf($match0._7, "Int")) | |
689 | - | then if ($isInstanceOf($match0._8, "String")) | |
690 | - | then $isInstanceOf($match0._9, "String") | |
691 | - | else false | |
692 | - | else false | |
693 | - | else false | |
694 | - | else false | |
695 | - | else false | |
696 | - | else false) | |
697 | - | then (size($match0) == 10) | |
698 | - | else false) | |
699 | - | then { | |
700 | - | let outAmAmt = $match0._1 | |
701 | - | let outPrAmt = $match0._2 | |
702 | - | let amBalance = $match0._5 | |
703 | - | let prBalance = $match0._6 | |
704 | - | let lpEmission = $match0._7 | |
705 | - | let curPrice = $match0._8 | |
706 | - | let poolStatus = $match0._9 | |
707 | - | $Tuple7(outAmAmt, outPrAmt, amBalance, prBalance, lpEmission, curPrice, poolStatus) | |
708 | - | } | |
709 | - | else throw("Couldn't cast types") | |
710 | - | } | |
711 | - | let outAmAmt = $t01979720294._1 | |
712 | - | let outPrAmt = $t01979720294._2 | |
713 | - | let amBalance = $t01979720294._3 | |
714 | - | let prBalance = $t01979720294._4 | |
715 | - | let lpEmission = $t01979720294._5 | |
716 | - | let curPrice = $t01979720294._6 | |
717 | - | let poolStatus = $t01979720294._7 | |
718 | - | $Tuple2(outAmAmt, outPrAmt) | |
719 | - | } | |
720 | - | else throw("Strict value is not equal to itself.") | |
721 | - | } | |
722 | - | else { | |
723 | - | let inv = split({ | |
724 | - | let @ = invoke(poolAddr, "evaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
725 | - | if ($isInstanceOf(@, "String")) | |
726 | - | then @ | |
727 | - | else throw(($getType(@) + " couldn't be cast to String")) | |
728 | - | }, "__") | |
729 | - | if ((inv == inv)) | |
730 | - | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
731 | - | else throw("Strict value is not equal to itself.") | |
732 | - | } | |
677 | + | then { | |
678 | + | let inv = split({ | |
679 | + | let @ = invoke(poolAddr, "poolEvaluateGetREADONLY", [shareId, userCanWithdraw], nil) | |
680 | + | if ($isInstanceOf(@, "String")) | |
681 | + | then @ | |
682 | + | else throw(($getType(@) + " couldn't be cast to String")) | |
683 | + | }, "__") | |
684 | + | if ((inv == inv)) | |
685 | + | then $Tuple2(parseIntValue(inv[1]), parseIntValue(inv[2])) | |
686 | + | else throw("Strict value is not equal to itself.") | |
687 | + | } | |
733 | 688 | else unknownPoolType() | |
734 | - | let amountA = $ | |
735 | - | let amountB = $ | |
689 | + | let amountA = $t01932619799._1 | |
690 | + | let amountB = $t01932619799._2 | |
736 | 691 | $Tuple2(amountA, amountB) | |
737 | 692 | } | |
738 | 693 | ||
739 | 694 | ||
740 | 695 | func claimFarmed (pType,pool) = if ((pType == SF_POOL)) | |
741 | 696 | then { | |
742 | 697 | let balBefore = accountBalance(SWOPID) | |
743 | 698 | if ((balBefore == balBefore)) | |
744 | 699 | then { | |
745 | 700 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
746 | 701 | if ((inv == inv)) | |
747 | 702 | then { | |
748 | 703 | let balAfter = accountBalance(SWOPID) | |
749 | 704 | $Tuple2((balAfter - balBefore), SWOPID) | |
750 | 705 | } | |
751 | 706 | else throw("Strict value is not equal to itself.") | |
752 | 707 | } | |
753 | 708 | else throw("Strict value is not equal to itself.") | |
754 | 709 | } | |
755 | 710 | else if ((pType == WX_POOL)) | |
756 | 711 | then { | |
757 | - | let $ | |
758 | - | let aId = $ | |
759 | - | let bId = $ | |
760 | - | let aBal = $ | |
761 | - | let bBal = $ | |
762 | - | let lpId = $ | |
712 | + | let $t02016720246 = getWXPoolData(addressFromStringValue(pool)) | |
713 | + | let aId = $t02016720246._1 | |
714 | + | let bId = $t02016720246._2 | |
715 | + | let aBal = $t02016720246._3 | |
716 | + | let bBal = $t02016720246._4 | |
717 | + | let lpId = $t02016720246._5 | |
763 | 718 | let balBefore = accountBalance(WXID) | |
764 | 719 | if ((balBefore == balBefore)) | |
765 | 720 | then { | |
766 | 721 | let inv = invoke(getWXFarmingAddr(addressFromStringValue(pool)), "claimWx", [lpId], nil) | |
767 | 722 | if ((inv == inv)) | |
768 | 723 | then { | |
769 | 724 | let balAfter = accountBalance(WXID) | |
770 | 725 | $Tuple2((balAfter - balBefore), WXID) | |
771 | 726 | } | |
772 | 727 | else throw("Strict value is not equal to itself.") | |
773 | 728 | } | |
774 | 729 | else throw("Strict value is not equal to itself.") | |
775 | 730 | } | |
776 | 731 | else unknownPoolType() | |
777 | 732 | ||
778 | 733 | ||
779 | 734 | func replenishByType (pType,pool,feeType,pmtA,aId,pmtB,bId,balA,balB,LPId) = { | |
780 | 735 | let lpBalanceBefore = accountBalance(fromBase58String(LPId)) | |
781 | 736 | if ((lpBalanceBefore == lpBalanceBefore)) | |
782 | 737 | then { | |
783 | 738 | let poolAddr = addressFromStringValue(pool) | |
784 | - | let $ | |
739 | + | let $t02084421266 = if (if ((pmtA > 0)) | |
785 | 740 | then (pmtB > 0) | |
786 | 741 | else false) | |
787 | 742 | then { | |
788 | - | let $ | |
789 | - | let pmtInA = $ | |
790 | - | let pmtInB = $ | |
791 | - | let change = $ | |
792 | - | let changeId = $ | |
743 | + | let $t02091021032 = calcReplenishByTwoTokens(pType, poolAddr, LPId, pmtA, aId, pmtB, bId, balA, balB) | |
744 | + | let pmtInA = $t02091021032._1 | |
745 | + | let pmtInB = $t02091021032._2 | |
746 | + | let change = $t02091021032._3 | |
747 | + | let changeId = $t02091021032._4 | |
793 | 748 | let inv = replenishTwoTokensByType(poolAddr, pType, pmtInA, aId, pmtInB, bId) | |
794 | 749 | if ((inv == inv)) | |
795 | 750 | then $Tuple2(change, changeId) | |
796 | 751 | else throw("Strict value is not equal to itself.") | |
797 | 752 | } | |
798 | 753 | else if ((pmtA > 0)) | |
799 | 754 | then $Tuple2(pmtA, aId) | |
800 | 755 | else if ((pmtB > 0)) | |
801 | 756 | then $Tuple2(pmtB, bId) | |
802 | 757 | else throw("pmts must be > 0") | |
803 | - | let change = $ | |
804 | - | let changeId = $ | |
758 | + | let change = $t02084421266._1 | |
759 | + | let changeId = $t02084421266._2 | |
805 | 760 | let inv = if ((change > 0)) | |
806 | 761 | then replenishOneTokenByType(poolAddr, pType, change, changeId) | |
807 | 762 | else nil | |
808 | 763 | if ((inv == inv)) | |
809 | 764 | then { | |
810 | 765 | let lpBalanceAfter = accountBalance(fromBase58String(LPId)) | |
811 | 766 | let totalStaked = (lpBalanceAfter - lpBalanceBefore) | |
812 | 767 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
813 | 768 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
814 | 769 | if ((0 >= userShareForStake)) | |
815 | 770 | then throw("amount of staked sharetokens must be > 0") | |
816 | 771 | else { | |
817 | 772 | let invLP = stakeLP(pool, pType, LPId, userShareForStake) | |
818 | 773 | if ((invLP == invLP)) | |
819 | 774 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
820 | 775 | else throw("Strict value is not equal to itself.") | |
821 | 776 | } | |
822 | 777 | } | |
823 | 778 | else throw("Strict value is not equal to itself.") | |
824 | 779 | } | |
825 | 780 | else throw("Strict value is not equal to itself.") | |
826 | 781 | } | |
827 | 782 | ||
828 | 783 | ||
829 | 784 | func replenishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId,type,withLoan) = { | |
830 | 785 | let totalAmount = getPoolTotalShare(pool) | |
831 | 786 | let totalAmountLoan = getPoolTotalShareWithLoan(pool) | |
832 | - | let $ | |
787 | + | let $t02212322361 = if (withLoan) | |
833 | 788 | then $Tuple2(getIntegerValue(this, (pool + kPoolInterestLoan)), (totalAmountLoan + stakedAmount)) | |
834 | 789 | else $Tuple2(getIntegerValue(this, (pool + kPoolInterestNoLoan)), totalAmountLoan) | |
835 | - | let curPoolInterest = $ | |
836 | - | let totalStakedWithLoan = $ | |
790 | + | let curPoolInterest = $t02212322361._1 | |
791 | + | let totalStakedWithLoan = $t02212322361._2 | |
837 | 792 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), totalStakedWithLoan), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), StringEntry((((user + "_") + toString(posNum)) + kUserPositionPool), pool), IntegerEntry((user + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
838 | 793 | } | |
839 | 794 | ||
840 | 795 | ||
841 | 796 | func listToInt (a,item) = (a :+ parseIntValue(item)) | |
842 | 797 | ||
843 | 798 | ||
844 | 799 | func directSwopfiCPMM (rArgs,tokenTo) = { | |
845 | 800 | let dApp = addressFromStringValue(rArgs[1]) | |
846 | 801 | let pmtP = split(rArgs[2], "|") | |
847 | 802 | let tokenBalanceBefore = accountBalance(assetIdFromStr(tokenTo)) | |
848 | 803 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
849 | 804 | then { | |
850 | 805 | let pmt = [AttachedPayment(assetIdFromStr(pmtP[0]), parseIntValue(pmtP[1]))] | |
851 | 806 | let minToRecive = rArgs[3] | |
852 | 807 | let inv = invoke(dApp, "callFunction", ["exchange", [minToRecive]], pmt) | |
853 | 808 | if ((inv == inv)) | |
854 | 809 | then (accountBalance(assetIdFromStr(tokenTo)) - tokenBalanceBefore) | |
855 | 810 | else throw("Strict value is not equal to itself.") | |
856 | 811 | } | |
857 | 812 | else throw("Strict value is not equal to itself.") | |
858 | 813 | } | |
859 | 814 | ||
860 | 815 | ||
861 | 816 | func directRoutingSwopfi (rArgs,tokenTo) = { | |
862 | 817 | let dApp = addressFromStringValue(rArgs[1]) | |
863 | 818 | let tokenBalanceBefore = accountBalance(assetIdFromStr(tokenTo)) | |
864 | 819 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
865 | 820 | then { | |
866 | 821 | let pmt = { | |
867 | 822 | let pmtP = split(rArgs[2], "|") | |
868 | 823 | [AttachedPayment(fromBase58String(pmtP[0]), parseIntValue(pmtP[1]))] | |
869 | 824 | } | |
870 | 825 | let args = { | |
871 | 826 | let eArgs = split(rArgs[3], "|") | |
872 | 827 | let exchangers = split(eArgs[0], ",") | |
873 | 828 | let exchangersType = split(eArgs[1], ",") | |
874 | 829 | let args1 = { | |
875 | 830 | let $l = split(eArgs[2], ",") | |
876 | 831 | let $s = size($l) | |
877 | 832 | let $acc0 = nil | |
878 | 833 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
879 | 834 | then $a | |
880 | 835 | else listToInt($a, $l[$i]) | |
881 | 836 | ||
882 | 837 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
883 | 838 | then $a | |
884 | 839 | else throw("List size exceeds 3") | |
885 | 840 | ||
886 | 841 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
887 | 842 | } | |
888 | 843 | let args2 = { | |
889 | 844 | let $l = split(eArgs[3], ",") | |
890 | 845 | let $s = size($l) | |
891 | 846 | let $acc0 = nil | |
892 | 847 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
893 | 848 | then $a | |
894 | 849 | else listToInt($a, $l[$i]) | |
895 | 850 | ||
896 | 851 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
897 | 852 | then $a | |
898 | 853 | else throw("List size exceeds 3") | |
899 | 854 | ||
900 | 855 | $f1_2($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3) | |
901 | 856 | } | |
902 | 857 | let routingAssetsKeys = split(eArgs[4], ",") | |
903 | 858 | let minToRecive = parseIntValue(eArgs[5]) | |
904 | 859 | [exchangers, exchangersType, args1, args2, routingAssetsKeys, minToRecive] | |
905 | 860 | } | |
906 | 861 | let inv = invoke(dApp, "routingTrade", args, pmt) | |
907 | 862 | if ((inv == inv)) | |
908 | 863 | then (accountBalance(assetIdFromStr(tokenTo)) - tokenBalanceBefore) | |
909 | 864 | else throw("Strict value is not equal to itself.") | |
910 | 865 | } | |
911 | 866 | else throw("Strict value is not equal to itself.") | |
912 | 867 | } | |
913 | 868 | ||
914 | 869 | ||
915 | 870 | func capitalize (pool,pType,tokenId,tokenAmount) = { | |
916 | 871 | let poolAddr = Address(fromBase58String(pool)) | |
917 | - | let $ | |
918 | - | let AId = $ | |
919 | - | let BId = $ | |
920 | - | let balA = $ | |
921 | - | let balB = $ | |
922 | - | let shareId = $ | |
872 | + | let $t02446824534 = getPoolData(poolAddr, pType) | |
873 | + | let AId = $t02446824534._1 | |
874 | + | let BId = $t02446824534._2 | |
875 | + | let balA = $t02446824534._3 | |
876 | + | let balB = $t02446824534._4 | |
877 | + | let shareId = $t02446824534._5 | |
923 | 878 | if (if ((tokenId != AId)) | |
924 | 879 | then (tokenId != BId) | |
925 | 880 | else false) | |
926 | 881 | then throw("Wrong asset") | |
927 | 882 | else { | |
928 | 883 | let totalShareAmount = getPoolTotalShare(pool) | |
929 | 884 | if ((totalShareAmount == 0)) | |
930 | 885 | then [ScriptTransfer(moneyBox, tokenAmount, fromBase58String(tokenId))] | |
931 | 886 | else { | |
932 | 887 | let totalShareAmountWithLoan = getPoolTotalShareWithLoan(pool) | |
933 | 888 | let loanPercent = fraction(totalShareAmountWithLoan, SCALE8, totalShareAmount) | |
934 | 889 | let tokensForFeeLoan = fraction(tokenAmount, loanPercent, SCALE8) | |
935 | 890 | let tokensForFeeNoLoan = (tokenAmount - tokensForFeeLoan) | |
936 | 891 | let axlyFeeLoan = fraction(tokensForFeeLoan, getAxlyFee(pool, CAP_FEE_LOAN), FEE_SCALE6) | |
937 | 892 | let axlyFeeNoLoan = fraction(tokensForFeeNoLoan, getAxlyFee(pool, CAP_FEE_NO_LOAN), FEE_SCALE6) | |
938 | 893 | let axlyFee = (axlyFeeLoan + axlyFeeNoLoan) | |
939 | - | let $ | |
894 | + | let $t02527925379 = if ((tokenId == AId)) | |
940 | 895 | then $Tuple2((tokenAmount - axlyFee), 0) | |
941 | 896 | else $Tuple2(0, (tokenAmount - axlyFee)) | |
942 | - | let pmtA = $ | |
943 | - | let pmtB = $ | |
944 | - | let $ | |
945 | - | let stakedAmount = $ | |
946 | - | let nf = $ | |
897 | + | let pmtA = $t02527925379._1 | |
898 | + | let pmtB = $t02527925379._2 | |
899 | + | let $t02538225486 = replenishByType(pType, pool, NO_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
900 | + | let stakedAmount = $t02538225486._1 | |
901 | + | let nf = $t02538225486._2 | |
947 | 902 | let curPoolInterestLoan = valueOrElse(getInteger(this, (pool + kPoolInterestLoan)), 0) | |
948 | 903 | let curPoolInterestNoLoan = valueOrElse(getInteger(this, (pool + kPoolInterestNoLoan)), 0) | |
949 | 904 | let stakedLoan = fraction(stakedAmount, loanPercent, SCALE8) | |
950 | 905 | let stakedNoLoan = (stakedAmount - stakedLoan) | |
951 | 906 | let newInterestLoan = if ((totalShareAmountWithLoan > 0)) | |
952 | 907 | then (curPoolInterestLoan + fraction(stakedLoan, SCALE10, totalShareAmountWithLoan)) | |
953 | 908 | else 0 | |
954 | 909 | let newInterestNoLoan = if (((totalShareAmount - totalShareAmountWithLoan) > 0)) | |
955 | 910 | then (curPoolInterestNoLoan + fraction(stakedNoLoan, SCALE10, (totalShareAmount - totalShareAmountWithLoan))) | |
956 | 911 | else 0 | |
957 | 912 | ([IntegerEntry((pool + kPoolInterestLoan), newInterestLoan), IntegerEntry((pool + kPoolInterestNoLoan), newInterestNoLoan), IntegerEntry((pool + kPoolTotal), (totalShareAmount + stakedAmount)), IntegerEntry((pool + kPoolTotalLoan), (totalShareAmountWithLoan + stakedLoan)), ScriptTransfer(moneyBox, axlyFee, assetIdFromStr(tokenId))] ++ getCursEntries(AId, BId, shareId, nil)) | |
958 | 913 | } | |
959 | 914 | } | |
960 | 915 | } | |
961 | 916 | ||
962 | 917 | ||
963 | 918 | func userCanWithdrawShareCalc (user,pool,posId,borrowed) = { | |
964 | 919 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
965 | 920 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)) | |
966 | 921 | let poolInterest = if (borrowed) | |
967 | 922 | then getIntegerValue(this, (pool + kPoolInterestLoan)) | |
968 | 923 | else getIntegerValue(this, (pool + kPoolInterestNoLoan)) | |
969 | 924 | (pAmount + fraction(pAmount, (poolInterest - userInterest), SCALE10)) | |
970 | 925 | } | |
971 | 926 | ||
972 | 927 | ||
973 | 928 | func calcStopLossFee (pool,isBorrowed,stopLoss,lpWithdraw) = { | |
974 | 929 | let feeType = if (isBorrowed) | |
975 | 930 | then STOPLOSS_LOAN | |
976 | 931 | else STOPLOSS_FEE_NO_LOAN | |
977 | 932 | if (stopLoss) | |
978 | 933 | then fraction(lpWithdraw, getAxlyFee(pool, feeType), FEE_SCALE6) | |
979 | 934 | else 0 | |
980 | 935 | } | |
981 | 936 | ||
982 | 937 | ||
983 | 938 | func withdrawToUser (user,pool,posId,stopLoss) = { | |
984 | 939 | let pAmount = valueOrErrorMessage(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserPosition)), "Unknown position") | |
985 | 940 | let isBorrowed = (valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), 0) > 0) | |
986 | 941 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, isBorrowed) | |
987 | 942 | let poolTotalShare = getPoolTotalShare(pool) | |
988 | 943 | let poolTotalShareLoan = getPoolTotalShareWithLoan(pool) | |
989 | 944 | let userAddr = Address(fromBase58String(user)) | |
990 | 945 | let poolAddr = Address(fromBase58String(pool)) | |
991 | 946 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
992 | - | let $ | |
993 | - | let idAStr = $ | |
994 | - | let idBStr = $ | |
995 | - | let balA = $ | |
996 | - | let balB = $ | |
997 | - | let shareId = $ | |
998 | - | let $ | |
999 | - | let idA = $ | |
1000 | - | let idB = $ | |
947 | + | let $t02801528087 = getPoolData(poolAddr, pType) | |
948 | + | let idAStr = $t02801528087._1 | |
949 | + | let idBStr = $t02801528087._2 | |
950 | + | let balA = $t02801528087._3 | |
951 | + | let balB = $t02801528087._4 | |
952 | + | let shareId = $t02801528087._5 | |
953 | + | let $t02809028157 = $Tuple2(assetIdFromStr(idAStr), assetIdFromStr(idBStr)) | |
954 | + | let idA = $t02809028157._1 | |
955 | + | let idB = $t02809028157._2 | |
1001 | 956 | let stopLossFee = calcStopLossFee(pool, isBorrowed, stopLoss, userCanWithdraw) | |
1002 | 957 | let cBalABefore = accountBalance(idA) | |
1003 | 958 | if ((cBalABefore == cBalABefore)) | |
1004 | 959 | then { | |
1005 | 960 | let cBalBBefore = accountBalance(idB) | |
1006 | 961 | if ((cBalBBefore == cBalBBefore)) | |
1007 | 962 | then { | |
1008 | 963 | let inv = if ((pType == SF_POOL)) | |
1009 | 964 | then { | |
1010 | 965 | let inv = unstakeLP(pool, pType, shareId, stopLossFee) | |
1011 | 966 | if ((inv == inv)) | |
1012 | 967 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
1013 | 968 | else throw("Strict value is not equal to itself.") | |
1014 | 969 | } | |
1015 | 970 | else if ((pType == WX_POOL)) | |
1016 | 971 | then { | |
1017 | 972 | let inv = unstakeLP(pool, pType, shareId, (userCanWithdraw + stopLossFee)) | |
1018 | 973 | if ((inv == inv)) | |
1019 | 974 | then invoke(poolAddr, "get", nil, [AttachedPayment(assetIdFromStr(shareId), userCanWithdraw)]) | |
1020 | 975 | else throw("Strict value is not equal to itself.") | |
1021 | 976 | } | |
1022 | 977 | else unknownPoolType() | |
1023 | 978 | if ((inv == inv)) | |
1024 | 979 | then { | |
1025 | 980 | let cBalAAfter = accountBalance(idA) | |
1026 | 981 | if ((cBalAAfter == cBalAAfter)) | |
1027 | 982 | then { | |
1028 | 983 | let cBalBAfter = accountBalance(idB) | |
1029 | 984 | if ((cBalBAfter == cBalBAfter)) | |
1030 | 985 | then { | |
1031 | - | let $ | |
1032 | - | let tokensAmountA = $ | |
1033 | - | let tokensAmountB = $ | |
1034 | - | let $ | |
986 | + | let $t02885228941 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
987 | + | let tokensAmountA = $t02885228941._1 | |
988 | + | let tokensAmountB = $t02885228941._2 | |
989 | + | let $t02894430180 = if (isBorrowed) | |
1035 | 990 | then { | |
1036 | 991 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1037 | 992 | let debt = { | |
1038 | 993 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posId), borrowAsset], nil) | |
1039 | 994 | if ($isInstanceOf(@, "Int")) | |
1040 | 995 | then @ | |
1041 | 996 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1042 | 997 | } | |
1043 | 998 | if ((debt == debt)) | |
1044 | 999 | then { | |
1045 | 1000 | let amountToGetEx = if (if ((borrowAsset == idAStr)) | |
1046 | 1001 | then (debt > tokensAmountA) | |
1047 | 1002 | else false) | |
1048 | 1003 | then (debt - tokensAmountA) | |
1049 | 1004 | else if (if ((borrowAsset == idBStr)) | |
1050 | 1005 | then (debt > tokensAmountB) | |
1051 | 1006 | else false) | |
1052 | 1007 | then (debt - tokensAmountB) | |
1053 | 1008 | else 0 | |
1054 | 1009 | let exInv = if ((amountToGetEx > 0)) | |
1055 | 1010 | then exchangeDirectly(pType, pool, idAStr, idBStr, (balA - tokensAmountA), (balB - tokensAmountB), amountToGetEx, borrowAsset) | |
1056 | 1011 | else nil | |
1057 | 1012 | if ((exInv == exInv)) | |
1058 | 1013 | then { | |
1059 | 1014 | let cBalAAfterRepay = accountBalance(idA) | |
1060 | 1015 | if ((cBalAAfterRepay == cBalAAfterRepay)) | |
1061 | 1016 | then { | |
1062 | 1017 | let cBalBAfterRepay = accountBalance(idB) | |
1063 | 1018 | if ((cBalBAfterRepay == cBalBAfterRepay)) | |
1064 | 1019 | then { | |
1065 | 1020 | let closeDbtInv = if ((debt > 0)) | |
1066 | 1021 | then invoke(getLendSrvAddr(), "repayFor", [((user + "_") + posId)], [AttachedPayment(assetIdFromStr(borrowAsset), debt)]) | |
1067 | 1022 | else 0 | |
1068 | 1023 | if ((closeDbtInv == closeDbtInv)) | |
1069 | 1024 | then if ((borrowAsset == idAStr)) | |
1070 | 1025 | then $Tuple2(((cBalAAfterRepay - cBalABefore) - debt), (cBalBAfterRepay - cBalBBefore)) | |
1071 | 1026 | else $Tuple2((cBalAAfterRepay - cBalABefore), ((cBalBAfterRepay - cBalBBefore) - debt)) | |
1072 | 1027 | else throw("Strict value is not equal to itself.") | |
1073 | 1028 | } | |
1074 | 1029 | else throw("Strict value is not equal to itself.") | |
1075 | 1030 | } | |
1076 | 1031 | else throw("Strict value is not equal to itself.") | |
1077 | 1032 | } | |
1078 | 1033 | else throw("Strict value is not equal to itself.") | |
1079 | 1034 | } | |
1080 | 1035 | else throw("Strict value is not equal to itself.") | |
1081 | 1036 | } | |
1082 | 1037 | else $Tuple2(tokensAmountA, tokensAmountB) | |
1083 | - | let toUserA = $ | |
1084 | - | let toUserB = $ | |
1038 | + | let toUserA = $t02894430180._1 | |
1039 | + | let toUserB = $t02894430180._2 | |
1085 | 1040 | let poolTotalLoanEntries = if (isBorrowed) | |
1086 | 1041 | then [IntegerEntry((pool + kPoolTotalLoan), ((poolTotalShareLoan - userCanWithdraw) - stopLossFee))] | |
1087 | 1042 | else nil | |
1088 | 1043 | let entries = (([DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition)), DeleteEntry((((user + "_") + posId) + kUserPositionPool)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)), DeleteEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest)), IntegerEntry((pool + kPoolTotal), ((poolTotalShare - userCanWithdraw) - stopLossFee)), ScriptTransfer(userAddr, toUserA, idA), ScriptTransfer(userAddr, toUserB, idB), ScriptTransfer(moneyBox, stopLossFee, fromBase58String(shareId))] ++ poolTotalLoanEntries) ++ getCursEntries(idAStr, idBStr, shareId, nil)) | |
1089 | 1044 | $Tuple2(entries, [toUserA, toUserB]) | |
1090 | 1045 | } | |
1091 | 1046 | else throw("Strict value is not equal to itself.") | |
1092 | 1047 | } | |
1093 | 1048 | else throw("Strict value is not equal to itself.") | |
1094 | 1049 | } | |
1095 | 1050 | else throw("Strict value is not equal to itself.") | |
1096 | 1051 | } | |
1097 | 1052 | else throw("Strict value is not equal to itself.") | |
1098 | 1053 | } | |
1099 | 1054 | else throw("Strict value is not equal to itself.") | |
1100 | 1055 | } | |
1101 | 1056 | ||
1102 | 1057 | ||
1103 | 1058 | func parseRequest (requestId) = { | |
1104 | 1059 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
1105 | 1060 | let user = request[0] | |
1106 | 1061 | let pool = request[1] | |
1107 | 1062 | let pmtA = parseIntValue(request[2]) | |
1108 | 1063 | let AId = request[3] | |
1109 | 1064 | let pmtB = parseIntValue(request[4]) | |
1110 | 1065 | let BId = request[5] | |
1111 | 1066 | let balA = parseIntValue(request[6]) | |
1112 | 1067 | let balB = parseIntValue(request[7]) | |
1113 | 1068 | let shareId = request[8] | |
1114 | 1069 | let bwAsset = request[9] | |
1115 | 1070 | let bwAmount = parseIntValue(request[10]) | |
1116 | 1071 | $Tuple11(user, pool, pmtA, AId, pmtB, BId, balA, balB, shareId, bwAsset, bwAmount) | |
1117 | 1072 | } | |
1118 | 1073 | ||
1119 | 1074 | ||
1120 | 1075 | func calcBorrowAmount (pmtA,pmtB,aId,bId,leverage,borrowId) = if (if ((borrowId != aId)) | |
1121 | 1076 | then (borrowId != bId) | |
1122 | 1077 | else false) | |
1123 | 1078 | then throw("Wrong borrow asset") | |
1124 | 1079 | else { | |
1125 | 1080 | let dPriceA = getIntegerValue(priceOracleAddr, (aId + kPriceInOracle)) | |
1126 | 1081 | let dPriceB = getIntegerValue(priceOracleAddr, (bId + kPriceInOracle)) | |
1127 | 1082 | let decPrA = pow(10, 0, getAssetDecimals(aId), 0, 0, DOWN) | |
1128 | 1083 | let decPrB = pow(10, 0, getAssetDecimals(bId), 0, 0, DOWN) | |
1129 | 1084 | let paydInDollar = (fraction(dPriceA, pmtA, decPrA) + fraction(dPriceB, pmtB, decPrB)) | |
1130 | - | let $ | |
1085 | + | let $t03216232259 = if ((borrowId == aId)) | |
1131 | 1086 | then $Tuple2(dPriceA, decPrA) | |
1132 | 1087 | else $Tuple2(dPriceB, decPrB) | |
1133 | - | let borrowPrice = $ | |
1134 | - | let borrowDecPr = $ | |
1088 | + | let borrowPrice = $t03216232259._1 | |
1089 | + | let borrowDecPr = $t03216232259._2 | |
1135 | 1090 | fraction(fraction(paydInDollar, (leverage - 100), 100), borrowDecPr, borrowPrice) | |
1136 | 1091 | } | |
1137 | 1092 | ||
1138 | 1093 | ||
1139 | 1094 | func parseReplenishPmts (pmts,AId,BId) = if ((size(pmts) == 2)) | |
1140 | 1095 | then if ((assetIdToStr(pmts[0].assetId) != AId)) | |
1141 | 1096 | then throw("Wrong payment asset A") | |
1142 | 1097 | else if ((assetIdToStr(pmts[1].assetId) != BId)) | |
1143 | 1098 | then throw("Wrong payment asset B") | |
1144 | 1099 | else $Tuple2(pmts[0].amount, pmts[1].amount) | |
1145 | 1100 | else if ((size(pmts) == 1)) | |
1146 | 1101 | then if ((assetIdToStr(pmts[0].assetId) == AId)) | |
1147 | 1102 | then $Tuple2(pmts[0].amount, 0) | |
1148 | 1103 | else if ((assetIdToStr(pmts[0].assetId) == BId)) | |
1149 | 1104 | then $Tuple2(0, pmts[0].amount) | |
1150 | 1105 | else throw("Wrong payment") | |
1151 | 1106 | else throw("One or two payments expected") | |
1152 | 1107 | ||
1153 | 1108 | ||
1154 | 1109 | func calcPriceImpact (balA,balB,newBalA,newBalB) = { | |
1155 | 1110 | let pri = ((SCALE8 - fraction(fraction(balB, SCALE8, balA), SCALE8, fraction(newBalB, SCALE8, newBalA))) * 100) | |
1156 | 1111 | if ((0 > pri)) | |
1157 | 1112 | then (pri * -1) | |
1158 | 1113 | else pri | |
1159 | 1114 | } | |
1160 | 1115 | ||
1161 | 1116 | ||
1162 | 1117 | func claimAndCheckAmnt (pool,pType,claim,amount,change) = { | |
1163 | - | let $ | |
1118 | + | let $t03325933521 = if (claim) | |
1164 | 1119 | then claimFarmed(pType, pool) | |
1165 | 1120 | else { | |
1166 | 1121 | let claimedAsset = if ((pType == SF_POOL)) | |
1167 | 1122 | then SWOPID | |
1168 | 1123 | else if ((pType == WX_POOL)) | |
1169 | 1124 | then WXID | |
1170 | 1125 | else unknownPoolType() | |
1171 | 1126 | $Tuple2(amount, claimedAsset) | |
1172 | 1127 | } | |
1173 | - | if (($ | |
1128 | + | if (($t03325933521 == $t03325933521)) | |
1174 | 1129 | then { | |
1175 | - | let claimAsset = $ | |
1176 | - | let claimAmount = $ | |
1130 | + | let claimAsset = $t03325933521._2 | |
1131 | + | let claimAmount = $t03325933521._1 | |
1177 | 1132 | let bal = accountBalance(claimAsset) | |
1178 | 1133 | if ((bal == bal)) | |
1179 | 1134 | then if ((amount > bal)) | |
1180 | 1135 | then throw("To big amount to exchange") | |
1181 | 1136 | else $Tuple2(claimAmount, claimAsset) | |
1182 | 1137 | else throw("Strict value is not equal to itself.") | |
1183 | 1138 | } | |
1184 | 1139 | else throw("Strict value is not equal to itself.") | |
1185 | 1140 | } | |
1186 | 1141 | ||
1187 | 1142 | ||
1188 | 1143 | @Callable(i) | |
1189 | 1144 | func getPoolInfoREADONLY (pool) = { | |
1190 | 1145 | let poolAddr = addressFromStringValue(pool) | |
1191 | 1146 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1192 | - | let $ | |
1193 | - | let AId = $ | |
1194 | - | let BId = $ | |
1195 | - | let balA = $ | |
1196 | - | let balB = $ | |
1197 | - | let shareId = $ | |
1147 | + | let $t03388833978 = getPoolData(Address(fromBase58String(pool)), pType) | |
1148 | + | let AId = $t03388833978._1 | |
1149 | + | let BId = $t03388833978._2 | |
1150 | + | let balA = $t03388833978._3 | |
1151 | + | let balB = $t03388833978._4 | |
1152 | + | let shareId = $t03388833978._5 | |
1198 | 1153 | let shareSupply = getShareSupply(poolAddr, pType, shareId) | |
1199 | 1154 | $Tuple2(nil, $Tuple6(AId, BId, shareId, balA, balB, shareSupply)) | |
1200 | 1155 | } | |
1201 | 1156 | ||
1202 | 1157 | ||
1203 | 1158 | ||
1204 | 1159 | @Callable(i) | |
1205 | 1160 | func getShareAssetPriceREADONLY (shareId) = { | |
1206 | 1161 | let sharePrices = getSharePrice(shareId) | |
1207 | 1162 | $Tuple2(nil, sharePrices) | |
1208 | 1163 | } | |
1209 | 1164 | ||
1210 | 1165 | ||
1211 | 1166 | ||
1212 | 1167 | @Callable(i) | |
1213 | 1168 | func getUserPositionShareAmountREADONLY (user,posNum) = { | |
1214 | 1169 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posNum) + kUserPositionPool)), "Unknown position") | |
1215 | 1170 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posNum) + kUserBorrowAmount)) | |
1216 | 1171 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum, (borrowAmount > 0)) | |
1217 | 1172 | $Tuple2(nil, userCanWithdraw) | |
1218 | 1173 | } | |
1219 | 1174 | ||
1220 | 1175 | ||
1221 | 1176 | ||
1222 | 1177 | @Callable(i) | |
1223 | 1178 | func getUserPositionREADONLY (user,pools,posNum) = { | |
1224 | 1179 | func userPos (a,pool) = { | |
1225 | - | let $ | |
1226 | - | let wAmountsA = $ | |
1227 | - | let wAmountsB = $ | |
1228 | - | let debts = $ | |
1229 | - | let eqWAmountsA = $ | |
1230 | - | let eqWAmountsB = $ | |
1231 | - | let index = $ | |
1180 | + | let $t03485134921 = a | |
1181 | + | let wAmountsA = $t03485134921._1 | |
1182 | + | let wAmountsB = $t03485134921._2 | |
1183 | + | let debts = $t03485134921._3 | |
1184 | + | let eqWAmountsA = $t03485134921._4 | |
1185 | + | let eqWAmountsB = $t03485134921._5 | |
1186 | + | let index = $t03485134921._6 | |
1232 | 1187 | if (!(isDefined(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserPosition))))) | |
1233 | 1188 | then $Tuple6((wAmountsA :+ 0), (wAmountsB :+ 0), (debts :+ 0), (eqWAmountsA :+ 0), (eqWAmountsB :+ 0), (index + 1)) | |
1234 | 1189 | else { | |
1235 | 1190 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1236 | - | let $ | |
1237 | - | let AId = $ | |
1238 | - | let BId = $ | |
1239 | - | let balA = $ | |
1240 | - | let balB = $ | |
1241 | - | let shareId = $ | |
1191 | + | let $t03520035290 = getPoolData(Address(fromBase58String(pool)), pType) | |
1192 | + | let AId = $t03520035290._1 | |
1193 | + | let BId = $t03520035290._2 | |
1194 | + | let balA = $t03520035290._3 | |
1195 | + | let balB = $t03520035290._4 | |
1196 | + | let shareId = $t03520035290._5 | |
1242 | 1197 | let borrowAmount = valueOrElse(getInteger(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAmount)), 0) | |
1243 | 1198 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posNum[index], (borrowAmount > 0)) | |
1244 | - | let $ | |
1245 | - | let wAmountA = $ | |
1246 | - | let wAmountB = $ | |
1199 | + | let $t03550635626 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userCanWithdraw) | |
1200 | + | let wAmountA = $t03550635626._1 | |
1201 | + | let wAmountB = $t03550635626._2 | |
1247 | 1202 | if ((borrowAmount > 0)) | |
1248 | 1203 | then { | |
1249 | 1204 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posNum[index]) + kUserBorrowAssetId)) | |
1250 | 1205 | let debt = { | |
1251 | 1206 | let @ = invoke(getLendSrvAddr(), "getAssetDebt", [false, ((user + "_") + posNum[index]), borrowAsset], nil) | |
1252 | 1207 | if ($isInstanceOf(@, "Int")) | |
1253 | 1208 | then @ | |
1254 | 1209 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1255 | 1210 | } | |
1256 | 1211 | if ((debt == debt)) | |
1257 | 1212 | then { | |
1258 | 1213 | let amountToGetEx = if (if ((borrowAsset == AId)) | |
1259 | 1214 | then (debt > wAmountA) | |
1260 | 1215 | else false) | |
1261 | 1216 | then (debt - wAmountA) | |
1262 | 1217 | else if (if ((borrowAsset == BId)) | |
1263 | 1218 | then (debt > wAmountB) | |
1264 | 1219 | else false) | |
1265 | 1220 | then (debt - wAmountB) | |
1266 | 1221 | else 0 | |
1267 | 1222 | let amountToPay = if ((amountToGetEx > 0)) | |
1268 | 1223 | then if ((pType == SF_POOL)) | |
1269 | 1224 | then { | |
1270 | 1225 | let ex = calcAmountToPaySF(pool, AId, BId, balA, balB, amountToGetEx, borrowAsset) | |
1271 | 1226 | ex._2 | |
1272 | 1227 | } | |
1273 | 1228 | else if ((pType == WX_POOL)) | |
1274 | 1229 | then { | |
1275 | 1230 | let ex = calcAmountToPayWX(pool, AId, BId, balA, balB, amountToGetEx, borrowAsset) | |
1276 | 1231 | ex._2 | |
1277 | 1232 | } | |
1278 | 1233 | else unknownPoolType() | |
1279 | 1234 | else 0 | |
1280 | - | let $ | |
1235 | + | let $t03653836757 = if ((borrowAsset == AId)) | |
1281 | 1236 | then $Tuple2(((wAmountA + amountToGetEx) - debt), (wAmountB - amountToPay)) | |
1282 | 1237 | else $Tuple2((wAmountA - amountToPay), ((wAmountB + amountToGetEx) - debt)) | |
1283 | - | let eqWAmountA = $ | |
1284 | - | let eqWAmountB = $ | |
1238 | + | let eqWAmountA = $t03653836757._1 | |
1239 | + | let eqWAmountB = $t03653836757._2 | |
1285 | 1240 | $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (debts :+ debt), (eqWAmountsA :+ eqWAmountA), (eqWAmountsB :+ eqWAmountB), (index + 1)) | |
1286 | 1241 | } | |
1287 | 1242 | else throw("Strict value is not equal to itself.") | |
1288 | 1243 | } | |
1289 | 1244 | else $Tuple6((wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), debts, (wAmountsA :+ wAmountA), (wAmountsB :+ wAmountB), (index + 1)) | |
1290 | 1245 | } | |
1291 | 1246 | } | |
1292 | 1247 | ||
1293 | - | let $ | |
1248 | + | let $t03701237123 = { | |
1294 | 1249 | let $l = pools | |
1295 | 1250 | let $s = size($l) | |
1296 | 1251 | let $acc0 = $Tuple6(nil, nil, nil, nil, nil, 0) | |
1297 | 1252 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1298 | 1253 | then $a | |
1299 | 1254 | else userPos($a, $l[$i]) | |
1300 | 1255 | ||
1301 | 1256 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1302 | 1257 | then $a | |
1303 | 1258 | else throw("List size exceeds 20") | |
1304 | 1259 | ||
1305 | 1260 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1306 | 1261 | } | |
1307 | - | let wAmountsA = $ | |
1308 | - | let wAmountsB = $ | |
1309 | - | let debts = $ | |
1310 | - | let eqWAmountsA = $ | |
1311 | - | let eqWAmountsB = $ | |
1262 | + | let wAmountsA = $t03701237123._1 | |
1263 | + | let wAmountsB = $t03701237123._2 | |
1264 | + | let debts = $t03701237123._3 | |
1265 | + | let eqWAmountsA = $t03701237123._4 | |
1266 | + | let eqWAmountsB = $t03701237123._5 | |
1312 | 1267 | $Tuple2(nil, $Tuple5(wAmountsA, wAmountsB, debts, eqWAmountsA, eqWAmountsB)) | |
1313 | 1268 | } | |
1314 | 1269 | ||
1315 | 1270 | ||
1316 | 1271 | ||
1317 | 1272 | @Callable(i) | |
1318 | 1273 | func replenish (pool,leverage,borrowId) = valueOrElse(isActiveForUsers(), { | |
1319 | 1274 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1320 | 1275 | if (!(isPoolActive(pool, pType))) | |
1321 | 1276 | then throw("Pool not active at this moment") | |
1322 | 1277 | else if (if ((100 > leverage)) | |
1323 | 1278 | then true | |
1324 | 1279 | else (leverage > 300)) | |
1325 | 1280 | then throw("Leverage can't be <100 and >300") | |
1326 | 1281 | else if (if (!(getBooleanValue(this, (pool + kPoolCanBorrow)))) | |
1327 | 1282 | then (leverage > 100) | |
1328 | 1283 | else false) | |
1329 | 1284 | then throw("You can't borrow in this pool") | |
1330 | 1285 | else { | |
1331 | - | let $ | |
1332 | - | let AId = $ | |
1333 | - | let BId = $ | |
1334 | - | let balA = $ | |
1335 | - | let balB = $ | |
1336 | - | let shareId = $ | |
1286 | + | let $t03772137811 = getPoolData(Address(fromBase58String(pool)), pType) | |
1287 | + | let AId = $t03772137811._1 | |
1288 | + | let BId = $t03772137811._2 | |
1289 | + | let balA = $t03772137811._3 | |
1290 | + | let balB = $t03772137811._4 | |
1291 | + | let shareId = $t03772137811._5 | |
1337 | 1292 | if (if ((borrowId != AId)) | |
1338 | 1293 | then (borrowId != BId) | |
1339 | 1294 | else false) | |
1340 | 1295 | then throw("Wrong borrow asset") | |
1341 | 1296 | else { | |
1342 | - | let $ | |
1343 | - | let pmtA = $ | |
1344 | - | let pmtB = $ | |
1297 | + | let $t03789237951 = parseReplenishPmts(i.payments, AId, BId) | |
1298 | + | let pmtA = $t03789237951._1 | |
1299 | + | let pmtB = $t03789237951._2 | |
1345 | 1300 | let user = toString(i.caller) | |
1346 | 1301 | let newPosNum = getNewUserPositionNumber(user) | |
1347 | 1302 | if ((leverage > 100)) | |
1348 | 1303 | then { | |
1349 | 1304 | let borrowAmount = calcBorrowAmount(pmtA, pmtB, AId, BId, leverage, borrowId) | |
1350 | 1305 | let request = makeString([user, pool, toString(pmtA), AId, toString(pmtB), BId, toString(balA), toString(balB), shareId, borrowId, toString(borrowAmount)], ",") | |
1351 | 1306 | let newRequestId = { | |
1352 | 1307 | let @ = invoke(this, "createNewRequest", [request], nil) | |
1353 | 1308 | if ($isInstanceOf(@, "Int")) | |
1354 | 1309 | then @ | |
1355 | 1310 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1356 | 1311 | } | |
1357 | 1312 | if ((newRequestId == newRequestId)) | |
1358 | 1313 | then { | |
1359 | 1314 | let args = [((user + "_") + toString(newPosNum)), shareId, borrowId, borrowAmount, toString(this), "replenishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
1360 | 1315 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
1361 | 1316 | if ((inv == inv)) | |
1362 | 1317 | then { | |
1363 | 1318 | let userStaked = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(newPosNum)) + kUserPosition)) | |
1364 | - | let $ | |
1365 | - | if (($ | |
1319 | + | let $t03894039034 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1320 | + | if (($t03894039034 == $t03894039034)) | |
1366 | 1321 | then { | |
1367 | - | let newBalB = $ | |
1368 | - | let newBalA = $ | |
1322 | + | let newBalB = $t03894039034._2 | |
1323 | + | let newBalA = $t03894039034._1 | |
1369 | 1324 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1370 | - | let $ | |
1371 | - | let wAmountA = $ | |
1372 | - | let wAmountB = $ | |
1325 | + | let $t03910439219 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1326 | + | let wAmountA = $t03910439219._1 | |
1327 | + | let wAmountB = $t03910439219._2 | |
1373 | 1328 | $Tuple2(nil, [prImpact, wAmountA, wAmountB]) | |
1374 | 1329 | } | |
1375 | 1330 | else throw("Strict value is not equal to itself.") | |
1376 | 1331 | } | |
1377 | 1332 | else throw("Strict value is not equal to itself.") | |
1378 | 1333 | } | |
1379 | 1334 | else throw("Strict value is not equal to itself.") | |
1380 | 1335 | } | |
1381 | 1336 | else { | |
1382 | - | let $ | |
1383 | - | if (($ | |
1337 | + | let $t03927239387 = replenishByType(pType, pool, NO_LOAN_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
1338 | + | if (($t03927239387 == $t03927239387)) | |
1384 | 1339 | then { | |
1385 | - | let axlyFee = $ | |
1386 | - | let userStaked = $ | |
1387 | - | let $ | |
1388 | - | if (($ | |
1340 | + | let axlyFee = $t03927239387._2 | |
1341 | + | let userStaked = $t03927239387._1 | |
1342 | + | let $t03939339487 = getPoolBalances(Address(fromBase58String(pool)), pType, AId, BId) | |
1343 | + | if (($t03939339487 == $t03939339487)) | |
1389 | 1344 | then { | |
1390 | - | let newBalB = $ | |
1391 | - | let newBalA = $ | |
1345 | + | let newBalB = $t03939339487._2 | |
1346 | + | let newBalA = $t03939339487._1 | |
1392 | 1347 | let prImpact = calcPriceImpact(balA, balB, newBalA, newBalB) | |
1393 | - | let $ | |
1394 | - | let wAmountA = $ | |
1395 | - | let wAmountB = $ | |
1348 | + | let $t03955739672 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1349 | + | let wAmountA = $t03955739672._1 | |
1350 | + | let wAmountB = $t03955739672._2 | |
1396 | 1351 | $Tuple2((replenishEntries(pool, user, userStaked, axlyFee, newPosNum, shareId, pType, false) ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])), [prImpact, wAmountA, wAmountB]) | |
1397 | 1352 | } | |
1398 | 1353 | else throw("Strict value is not equal to itself.") | |
1399 | 1354 | } | |
1400 | 1355 | else throw("Strict value is not equal to itself.") | |
1401 | 1356 | } | |
1402 | 1357 | } | |
1403 | 1358 | } | |
1404 | 1359 | }) | |
1405 | 1360 | ||
1406 | 1361 | ||
1407 | 1362 | ||
1408 | 1363 | @Callable(i) | |
1409 | 1364 | func withdraw (pool,posId) = valueOrElse(isActiveForUsers(), { | |
1410 | 1365 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1411 | 1366 | if (!(isPoolActive(pool, pType))) | |
1412 | 1367 | then throw("Pool not active at this moment") | |
1413 | 1368 | else withdrawToUser(toString(i.caller), pool, toString(posId), false) | |
1414 | 1369 | }) | |
1415 | 1370 | ||
1416 | 1371 | ||
1417 | 1372 | ||
1418 | 1373 | @Callable(i) | |
1419 | 1374 | func createUpdateStopLoss (posId,poolId,assetId,price) = valueOrElse(isActiveForUsers(), { | |
1420 | 1375 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1421 | 1376 | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1422 | 1377 | if (!(isPoolActive(poolId, pType))) | |
1423 | 1378 | then throw("Pool not active at this moment") | |
1424 | 1379 | else if (!(isDefined(getInteger(this, (((((poolId + "_") + toString(i.caller)) + "_") + toString(posId)) + kUserPosition))))) | |
1425 | 1380 | then throw("There are no user position") | |
1426 | 1381 | else if ((0 >= price)) | |
1427 | 1382 | then throw("Price must be greater than 0") | |
1428 | 1383 | else if ((price > tokenOraclePrice)) | |
1429 | 1384 | then throw("Price must be less than current token price") | |
1430 | 1385 | else [IntegerEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss), price)] | |
1431 | 1386 | }) | |
1432 | 1387 | ||
1433 | 1388 | ||
1434 | 1389 | ||
1435 | 1390 | @Callable(i) | |
1436 | 1391 | func deleteStopLoss (posId,poolId,assetId) = valueOrElse(isActiveForUsers(), { | |
1437 | 1392 | let pType = valueOrErrorMessage(getString(this, (kPool + poolId)), "Pool is not inited") | |
1438 | 1393 | if (!(isPoolActive(poolId, pType))) | |
1439 | 1394 | then throw("Pool not active at this moment") | |
1440 | 1395 | else if (!(isDefined(getInteger(this, (((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))))) | |
1441 | 1396 | then throw("No entry") | |
1442 | 1397 | else [DeleteEntry((((((((toString(i.caller) + "_") + toString(posId)) + "_") + poolId) + "_") + assetId) + kUserStopLoss))] | |
1443 | 1398 | }) | |
1444 | 1399 | ||
1445 | 1400 | ||
1446 | 1401 | ||
1447 | 1402 | @Callable(i) | |
1448 | 1403 | func init (moneyBoxAddr,sfFarmingAddr,lendAddr,priceOracleAddr,keeperExContract,wxSwapContract,swopAssetId,wxAssetId,operatorPubKey,group1Admin1PubKey,group1Admin2PubKey,group2Admin1PubKey,group2Admin2PubKey) = valueOrElse(isSelfCall(i), if (isDefined(getString(kOperatorCallPK))) | |
1449 | 1404 | then throw("Already inited") | |
1450 | 1405 | else if (!(isDefined(addressFromString(moneyBoxAddr)))) | |
1451 | 1406 | then throw("moneyBoxAddr is not correct address") | |
1452 | 1407 | else if (!(isDefined(addressFromString(sfFarmingAddr)))) | |
1453 | 1408 | then throw("sfFarmingAddr is not correct address") | |
1454 | 1409 | else if (!(isDefined(addressFromString(lendAddr)))) | |
1455 | 1410 | then throw("lendAddr is not correct address") | |
1456 | 1411 | else if (!(isDefined(addressFromString(priceOracleAddr)))) | |
1457 | 1412 | then throw("priceOracleAddr is not correct address") | |
1458 | 1413 | else if (!(isDefined(addressFromString(keeperExContract)))) | |
1459 | 1414 | then throw("keeperExContract is not correct address") | |
1460 | 1415 | else if (!(isDefined(assetInfo(fromBase58String(swopAssetId))))) | |
1461 | 1416 | then throw("swopAssetId is not correct asset id") | |
1462 | 1417 | else if (!(isDefined(assetInfo(fromBase58String(wxAssetId))))) | |
1463 | 1418 | then throw("swopAssetId is not correct asset id") | |
1464 | 1419 | else if ((size(fromBase58String(operatorPubKey)) != 32)) | |
1465 | 1420 | then throw("operatorPubKey is not correct") | |
1466 | 1421 | else if ((size(fromBase58String(group1Admin1PubKey)) != 32)) | |
1467 | 1422 | then throw("group1Admin1PubKey is not correct") | |
1468 | 1423 | else if ((size(fromBase58String(group1Admin2PubKey)) != 32)) | |
1469 | 1424 | then throw("group1Admin2PubKey is not correct") | |
1470 | 1425 | else if ((size(fromBase58String(group2Admin1PubKey)) != 32)) | |
1471 | 1426 | then throw("group2Admin1PubKey is not correct") | |
1472 | 1427 | else if ((size(fromBase58String(group2Admin2PubKey)) != 32)) | |
1473 | 1428 | then throw("group2Admin2PubKey is not correct") | |
1474 | 1429 | else [StringEntry(kMoneyBox, moneyBoxAddr), StringEntry(kSFFarmingAddr, sfFarmingAddr), StringEntry(kLendService, lendAddr), StringEntry(kPriceOracle, priceOracleAddr), StringEntry(kExContract, keeperExContract), StringEntry(kWxSwapContract, wxSwapContract), StringEntry(kSwopId, swopAssetId), StringEntry(kWxId, wxAssetId), StringEntry(kOperatorCallPK, operatorPubKey), StringEntry(kGroup1Admin1PK, group1Admin1PubKey), StringEntry(kGroup1Admin2PK, group1Admin2PubKey), StringEntry(kGroup2Admin1PK, group2Admin1PubKey), StringEntry(kGroup2Admin2PK, group2Admin2PubKey)]) | |
1475 | 1430 | ||
1476 | 1431 | ||
1477 | 1432 | ||
1478 | 1433 | @Callable(i) | |
1479 | 1434 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
1480 | 1435 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
1481 | 1436 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
1482 | 1437 | }) | |
1483 | 1438 | ||
1484 | 1439 | ||
1485 | 1440 | ||
1486 | 1441 | @Callable(i) | |
1487 | 1442 | func replenishFromLand (requestId) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1488 | - | let $ | |
1489 | - | let user = $ | |
1490 | - | let pool = $ | |
1491 | - | let pmtA = $ | |
1492 | - | let AId = $ | |
1493 | - | let pmtB = $ | |
1494 | - | let BId = $ | |
1495 | - | let balA = $ | |
1496 | - | let balB = $ | |
1497 | - | let shareId = $ | |
1498 | - | let bwAsset = $ | |
1499 | - | let bwAmount = $ | |
1443 | + | let $t04451144615 = parseRequest(requestId) | |
1444 | + | let user = $t04451144615._1 | |
1445 | + | let pool = $t04451144615._2 | |
1446 | + | let pmtA = $t04451144615._3 | |
1447 | + | let AId = $t04451144615._4 | |
1448 | + | let pmtB = $t04451144615._5 | |
1449 | + | let BId = $t04451144615._6 | |
1450 | + | let balA = $t04451144615._7 | |
1451 | + | let balB = $t04451144615._8 | |
1452 | + | let shareId = $t04451144615._9 | |
1453 | + | let bwAsset = $t04451144615._10 | |
1454 | + | let bwAmount = $t04451144615._11 | |
1500 | 1455 | if ((size(i.payments) != 1)) | |
1501 | 1456 | then throw("Wrong payment size") | |
1502 | 1457 | else if (if ((assetIdToStr(i.payments[0].assetId) != bwAsset)) | |
1503 | 1458 | then true | |
1504 | 1459 | else (i.payments[0].amount != bwAmount)) | |
1505 | 1460 | then throw("Wrong payment") | |
1506 | 1461 | else { | |
1507 | - | let $ | |
1462 | + | let $t04480544905 = if ((AId == bwAsset)) | |
1508 | 1463 | then $Tuple2((pmtA + bwAmount), pmtB) | |
1509 | 1464 | else $Tuple2(pmtA, (pmtB + bwAmount)) | |
1510 | - | let pmtAllA = $ | |
1511 | - | let pmtAllB = $ | |
1465 | + | let pmtAllA = $t04480544905._1 | |
1466 | + | let pmtAllB = $t04480544905._2 | |
1512 | 1467 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Unknown pool") | |
1513 | - | let $ | |
1514 | - | let userStaked = $ | |
1515 | - | let axlyFee = $ | |
1468 | + | let $t04498745102 = replenishByType(pType, pool, LOAN_FEE, pmtAllA, AId, pmtAllB, BId, balA, balB, shareId) | |
1469 | + | let userStaked = $t04498745102._1 | |
1470 | + | let axlyFee = $t04498745102._2 | |
1516 | 1471 | let posNum = getNewUserPositionNumber(user) | |
1517 | 1472 | let borrowEntries = [IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAmount), bwAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserBorrowAssetId), bwAsset)] | |
1518 | 1473 | let entries = replenishEntries(pool, user, userStaked, axlyFee, posNum, shareId, pType, true) | |
1519 | - | let $ | |
1520 | - | let wAmountA = $ | |
1521 | - | let wAmountB = $ | |
1474 | + | let $t04546245577 = calcWithdrawLPFromPoolVirt(Address(fromBase58String(pool)), pType, shareId, userStaked) | |
1475 | + | let wAmountA = $t04546245577._1 | |
1476 | + | let wAmountB = $t04546245577._2 | |
1522 | 1477 | $Tuple2((((entries ++ getCursEntries(AId, BId, shareId, [toString(wAmountA), toString(wAmountB)])) ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
1523 | 1478 | } | |
1524 | 1479 | })) | |
1525 | 1480 | ||
1526 | 1481 | ||
1527 | 1482 | ||
1528 | 1483 | @Callable(i) | |
1529 | 1484 | func liquidate (user,posId,liquidateAmount) = valueOrElse(isActive(), valueOrElse(isLandCall(i), { | |
1530 | 1485 | let pool = valueOrErrorMessage(getString(this, (((user + "_") + posId) + kUserPositionPool)), "no position") | |
1531 | 1486 | let pType = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
1532 | - | let $ | |
1533 | - | let AId = $ | |
1534 | - | let BId = $ | |
1535 | - | let balA = $ | |
1536 | - | let balB = $ | |
1537 | - | let shareId = $ | |
1487 | + | let $t04609846188 = getPoolData(Address(fromBase58String(pool)), pType) | |
1488 | + | let AId = $t04609846188._1 | |
1489 | + | let BId = $t04609846188._2 | |
1490 | + | let balA = $t04609846188._3 | |
1491 | + | let balB = $t04609846188._4 | |
1492 | + | let shareId = $t04609846188._5 | |
1538 | 1493 | let amount = unstakeLP(pool, pType, shareId, liquidateAmount) | |
1539 | 1494 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAmount)) | |
1540 | 1495 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + posId) + kUserBorrowAssetId)) | |
1541 | 1496 | let userCanWithdraw = userCanWithdrawShareCalc(user, pool, posId, (borrowAmount > 0)) | |
1542 | 1497 | if ((liquidateAmount > userCanWithdraw)) | |
1543 | 1498 | then throw("You can't liquidate more than user have") | |
1544 | 1499 | else if ((borrowAmount == 0)) | |
1545 | 1500 | then throw("You can't liquidate position without borrow") | |
1546 | 1501 | else [IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPositionInterest), getIntegerValue(this, (pool + kPoolInterestLoan))), IntegerEntry((pool + kPoolTotalLoan), (getPoolTotalShareWithLoan(pool) - liquidateAmount)), IntegerEntry((pool + kPoolTotal), (getPoolTotalShare(pool) - liquidateAmount)), IntegerEntry((((((pool + "_") + user) + "_") + posId) + kUserPosition), (userCanWithdraw - liquidateAmount)), ScriptTransfer(i.caller, amount, fromBase58String(shareId))] | |
1547 | 1502 | })) | |
1548 | 1503 | ||
1549 | 1504 | ||
1550 | 1505 | ||
1551 | 1506 | @Callable(i) | |
1552 | 1507 | func stopLoss (user,posId,pool,assetId) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1553 | 1508 | let tokenOraclePrice = getIntegerValue(priceOracleAddr, (assetId + kPriceInOracle)) | |
1554 | 1509 | let stopLossPrice = valueOrErrorMessage(getInteger(this, (((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss)), "No entry") | |
1555 | 1510 | if ((tokenOraclePrice > stopLossPrice)) | |
1556 | 1511 | then throw("Token price greater stop loss price") | |
1557 | 1512 | else { | |
1558 | 1513 | let res = withdrawToUser(user, pool, toString(posId), true) | |
1559 | 1514 | $Tuple2((res._1 :+ DeleteEntry((((((((user + "_") + toString(posId)) + "_") + pool) + "_") + assetId) + kUserStopLoss))), res._2) | |
1560 | 1515 | } | |
1561 | 1516 | })) | |
1562 | 1517 | ||
1563 | 1518 | ||
1564 | 1519 | ||
1565 | 1520 | @Callable(i) | |
1566 | 1521 | func capitalizeEx (pool,route,tokenToId,amountToExchange,claim) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1567 | 1522 | let pType = getStringValue(this, (kPool + pool)) | |
1568 | 1523 | let change = valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0) | |
1569 | - | let $ | |
1570 | - | if (($ | |
1524 | + | let $t04815848260 = claimAndCheckAmnt(pool, pType, claim, amountToExchange, change) | |
1525 | + | if (($t04815848260 == $t04815848260)) | |
1571 | 1526 | then { | |
1572 | - | let claimedAsset = $ | |
1573 | - | let claimedAmount = $ | |
1527 | + | let claimedAsset = $t04815848260._2 | |
1528 | + | let claimedAmount = $t04815848260._1 | |
1574 | 1529 | let rArgs = split(route, "__") | |
1575 | 1530 | let exchangedAmount = if ((rArgs[0] == "directSwopfiCPMM")) | |
1576 | 1531 | then directSwopfiCPMM(rArgs, tokenToId) | |
1577 | 1532 | else if ((rArgs[0] == "routingSwopfi")) | |
1578 | 1533 | then directRoutingSwopfi(rArgs, tokenToId) | |
1579 | 1534 | else throw("Wrong route") | |
1580 | 1535 | if ((exchangedAmount == exchangedAmount)) | |
1581 | 1536 | then { | |
1582 | 1537 | let newChange = ((claimedAmount + change) - amountToExchange) | |
1583 | 1538 | let changeEntry = if ((newChange >= 0)) | |
1584 | 1539 | then [IntegerEntry((pool + kPoolCapChange), newChange)] | |
1585 | 1540 | else nil | |
1586 | 1541 | (capitalize(pool, pType, tokenToId, exchangedAmount) ++ changeEntry) | |
1587 | 1542 | } | |
1588 | 1543 | else throw("Strict value is not equal to itself.") | |
1589 | 1544 | } | |
1590 | 1545 | else throw("Strict value is not equal to itself.") | |
1591 | 1546 | })) | |
1592 | 1547 | ||
1593 | 1548 | ||
1594 | 1549 | ||
1595 | 1550 | @Callable(i) | |
1596 | 1551 | func capitalizeNoEx (pool,claim,amountFromBalance) = valueOrElse(isActive(), valueOrElse(isOperatorCall(i), { | |
1597 | 1552 | let pType = getStringValue(this, (kPool + pool)) | |
1598 | - | let $ | |
1599 | - | if (($ | |
1553 | + | let $t04894449042 = claimAndCheckAmnt(pool, pType, claim, amountFromBalance, 0) | |
1554 | + | if (($t04894449042 == $t04894449042)) | |
1600 | 1555 | then { | |
1601 | - | let claimedAsset = $ | |
1602 | - | let claimedAmount = $ | |
1556 | + | let claimedAsset = $t04894449042._2 | |
1557 | + | let claimedAmount = $t04894449042._1 | |
1603 | 1558 | capitalize(pool, pType, assetIdToStr(claimedAsset), (claimedAmount + amountFromBalance)) | |
1604 | 1559 | } | |
1605 | 1560 | else throw("Strict value is not equal to itself.") | |
1606 | 1561 | })) | |
1607 | 1562 | ||
1608 | 1563 | ||
1609 | 1564 | ||
1610 | 1565 | @Callable(i) | |
1611 | 1566 | func initNewPool (type,poolType,poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan,canBorrow) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if (if ((type != SF_POOL)) | |
1612 | 1567 | then (type != WX_POOL) | |
1613 | 1568 | else false) | |
1614 | 1569 | then throw("Wrong type") | |
1615 | 1570 | else if (if ((poolType != CPMM)) | |
1616 | 1571 | then (poolType != FLAT) | |
1617 | 1572 | else false) | |
1618 | 1573 | then throw("Wrong pool type") | |
1619 | 1574 | else { | |
1620 | - | let $ | |
1621 | - | let aId = $ | |
1622 | - | let bId = $ | |
1623 | - | let aBal = $ | |
1624 | - | let bBal = $ | |
1625 | - | let shareId = $ | |
1575 | + | let $t04956349657 = getPoolData(Address(fromBase58String(poolAddr)), type) | |
1576 | + | let aId = $t04956349657._1 | |
1577 | + | let bId = $t04956349657._2 | |
1578 | + | let aBal = $t04956349657._3 | |
1579 | + | let bBal = $t04956349657._4 | |
1580 | + | let shareId = $t04956349657._5 | |
1626 | 1581 | if ((0 > inFeeNoLoan)) | |
1627 | 1582 | then throw("inFeeNoLoan must be greater than 0") | |
1628 | 1583 | else if ((0 > inFeeLoan)) | |
1629 | 1584 | then throw("inFeeLoan must be greater than 0") | |
1630 | 1585 | else if ((0 > capFeeNoLoan)) | |
1631 | 1586 | then throw("capFeeNoLoan must be greater than 0") | |
1632 | 1587 | else if ((0 > capFeeWithLoan)) | |
1633 | 1588 | then throw("capFeeWithLoan must be greater than 0") | |
1634 | 1589 | else if ((0 > stoplossFeeNoLoan)) | |
1635 | 1590 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1636 | 1591 | else if ((0 > stoplossFeeWithLoan)) | |
1637 | 1592 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1638 | 1593 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan), IntegerEntry((poolAddr + kPoolInterestLoan), 0), IntegerEntry((poolAddr + kPoolInterestNoLoan), 0), StringEntry((kPool + poolAddr), type), StringEntry((poolAddr + kPoolType), poolType), StringEntry((shareId + kSharePool), poolAddr), BooleanEntry((poolAddr + kPoolCanBorrow), canBorrow)] | |
1639 | 1594 | })) | |
1640 | 1595 | ||
1641 | 1596 | ||
1642 | 1597 | ||
1643 | 1598 | @Callable(i) | |
1644 | 1599 | func updatePoolFees (poolAddr,inFeeNoLoan,inFeeLoan,capFeeNoLoan,capFeeWithLoan,stoplossFeeNoLoan,stoplossFeeWithLoan) = valueOrElse(isActive(), valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + poolAddr))))) | |
1645 | 1600 | then throw(("Can't find pool with addr " + poolAddr)) | |
1646 | 1601 | else if ((0 > inFeeNoLoan)) | |
1647 | 1602 | then throw("inFeeNoLoan must be greater than 0") | |
1648 | 1603 | else if ((0 > inFeeLoan)) | |
1649 | 1604 | then throw("inFeeLoan must be greater than 0") | |
1650 | 1605 | else if ((0 > capFeeNoLoan)) | |
1651 | 1606 | then throw("capFeeNoLoan must be greater than 0") | |
1652 | 1607 | else if ((0 > capFeeWithLoan)) | |
1653 | 1608 | then throw("capFeeWithLoan must be greater than 0") | |
1654 | 1609 | else if ((0 > stoplossFeeNoLoan)) | |
1655 | 1610 | then throw("stoplossFeeNoLoan must be greater than 0") | |
1656 | 1611 | else if ((0 > stoplossFeeWithLoan)) | |
1657 | 1612 | then throw("stoplossFeeWithLoan must be greater than 0") | |
1658 | 1613 | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyNoLoanCapFee), capFeeNoLoan), IntegerEntry((poolAddr + kAxlyWithLoanCapFee), capFeeWithLoan), IntegerEntry((poolAddr + kAxlyStopLossNoLoanFee), stoplossFeeNoLoan), IntegerEntry((poolAddr + kAxlyStopLossLoanFee), stoplossFeeWithLoan)])) | |
1659 | 1614 | ||
1660 | 1615 | ||
1661 | 1616 | ||
1662 | 1617 | @Callable(i) | |
1663 | 1618 | func activate () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActive), true)) | |
1664 | 1619 | then throw("dApp already active") | |
1665 | 1620 | else [BooleanEntry(kActive, true)]) | |
1666 | 1621 | ||
1667 | 1622 | ||
1668 | 1623 | ||
1669 | 1624 | @Callable(i) | |
1670 | 1625 | func shutdown () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActive), true))) | |
1671 | 1626 | then throw("dApp already shutdown") | |
1672 | 1627 | else [BooleanEntry(kActive, false)]) | |
1673 | 1628 | ||
1674 | 1629 | ||
1675 | 1630 | ||
1676 | 1631 | @Callable(i) | |
1677 | 1632 | func activateForUsers () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, kActiveUsers), true)) | |
1678 | 1633 | then throw("dApp already active for users") | |
1679 | 1634 | else [BooleanEntry(kActiveUsers, true)]) | |
1680 | 1635 | ||
1681 | 1636 | ||
1682 | 1637 | ||
1683 | 1638 | @Callable(i) | |
1684 | 1639 | func shutdownForUsers () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, kActiveUsers), true))) | |
1685 | 1640 | then throw("dApp already shutdown for users") | |
1686 | 1641 | else [BooleanEntry(kActiveUsers, false)]) | |
1687 | 1642 | ||
1688 | 1643 | ||
1689 | 1644 | ||
1690 | 1645 | @Callable(i) | |
1691 | 1646 | func activateSF () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true)) | |
1692 | 1647 | then throw("SWOPFI already active") | |
1693 | 1648 | else [BooleanEntry((SF_POOL + kActiveSFWX), true)]) | |
1694 | 1649 | ||
1695 | 1650 | ||
1696 | 1651 | ||
1697 | 1652 | @Callable(i) | |
1698 | 1653 | func shutdownSF () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (SF_POOL + kActiveSFWX)), true))) | |
1699 | 1654 | then throw("SWOPFI already shutdown") | |
1700 | 1655 | else [BooleanEntry((SF_POOL + kActiveSFWX), false)]) | |
1701 | 1656 | ||
1702 | 1657 | ||
1703 | 1658 | ||
1704 | 1659 | @Callable(i) | |
1705 | 1660 | func activateWX () = valueOrElse(isAdminCall(i), if (valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true)) | |
1706 | 1661 | then throw("WX already active") | |
1707 | 1662 | else [BooleanEntry((WX_POOL + kActiveSFWX), true)]) | |
1708 | 1663 | ||
1709 | 1664 | ||
1710 | 1665 | ||
1711 | 1666 | @Callable(i) | |
1712 | 1667 | func shutdownWX () = valueOrElse(isAdminCall(i), if (!(valueOrElse(getBoolean(this, (WX_POOL + kActiveSFWX)), true))) | |
1713 | 1668 | then throw("WX already shutdown") | |
1714 | 1669 | else [BooleanEntry((WX_POOL + kActiveSFWX), false)]) | |
1715 | 1670 | ||
1716 | 1671 | ||
1717 | 1672 | ||
1718 | 1673 | @Callable(i) | |
1719 | 1674 | func activatePool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1720 | 1675 | then throw("Unknown pool") | |
1721 | 1676 | else if (valueOrElse(getBoolean(this, (pool + kPoolActive)), true)) | |
1722 | 1677 | then throw("Pool already active") | |
1723 | 1678 | else [BooleanEntry((pool + kPoolActive), true)]) | |
1724 | 1679 | ||
1725 | 1680 | ||
1726 | 1681 | ||
1727 | 1682 | @Callable(i) | |
1728 | 1683 | func shutdownPool (pool) = valueOrElse(isAdminCall(i), if (!(isDefined(getString(this, (kPool + pool))))) | |
1729 | 1684 | then throw("Unknown pool") | |
1730 | 1685 | else if (!(valueOrElse(getBoolean(this, (pool + kPoolActive)), true))) | |
1731 | 1686 | then throw("Pool already shutdown") | |
1732 | 1687 | else [BooleanEntry((pool + kPoolActive), false)]) | |
1733 | 1688 | ||
1734 | 1689 | ||
1735 | 1690 | @Verifier(tx) | |
1736 | 1691 | func verify () = match tx { | |
1737 | 1692 | case inv: InvokeScriptTransaction => | |
1738 | 1693 | let isSelf = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1739 | 1694 | let isRightFee = if ((inv.fee == 900000)) | |
1740 | 1695 | then (inv.feeAssetId == unit) | |
1741 | 1696 | else false | |
1742 | 1697 | let isInitCall = (inv.function == "init") | |
1743 | 1698 | let isnoPayments = (size(inv.payments) == 0) | |
1744 | 1699 | if (if (if (isRightFee) | |
1745 | 1700 | then isInitCall | |
1746 | 1701 | else false) | |
1747 | 1702 | then isSelf | |
1748 | 1703 | else false) | |
1749 | 1704 | then isnoPayments | |
1750 | 1705 | else false | |
1751 | 1706 | case _ => | |
1752 | 1707 | let group1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], group1Admin1PK)) | |
1753 | 1708 | then 1 | |
1754 | 1709 | else (0 + (if (sigVerify(tx.bodyBytes, tx.proofs[0], group1Admin2PK)) | |
1755 | 1710 | then 1 | |
1756 | 1711 | else 0)) | |
1757 | 1712 | let group2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], group2Admin1PK)) | |
1758 | 1713 | then 1 | |
1759 | 1714 | else (0 + (if (sigVerify(tx.bodyBytes, tx.proofs[1], group2Admin2PK)) | |
1760 | 1715 | then 1 | |
1761 | 1716 | else 0)) | |
1762 | 1717 | ((group1Signed + group2Signed) == 2) | |
1763 | 1718 | } | |
1764 | 1719 |
github/deemru/w8io/026f985 274.96 ms ◑