tx · ExGc3NgbitCdkWmd3LQDw56uxJcgkdic1PkSm1TXZ8mH 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.04100000 Waves 2023.05.02 09:52 [2559808] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "ExGc3NgbitCdkWmd3LQDw56uxJcgkdic1PkSm1TXZ8mH", "fee": 4100000, "feeAssetId": null, "timestamp": 1683010358922, "version": 2, "chainId": 84, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "5H3sighgHLmHtB6yyGDVeBPbqjNTnikupqgeWU35HDff4Niwu4LyU8neqfDVPCoYowFyzRnATRe8c5u2ANF7cEuD" ], "script": "base64:BgK+LAgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgMKAQgSABIECgIBBBIECgIBBBIDCgEBEgASBAoCCAESABIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAIgR0ZXN0IgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIEYmlnMyIEYmlnNCIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJp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rPNy9SPnyTtYTkFb66Jk4 Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let test = true | |
5 | + | ||
4 | 6 | let scale8 = 100000000 | |
5 | 7 | ||
6 | 8 | let scale8BigInt = toBigInt(100000000) | |
131 | 133 | func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks)) | |
132 | 134 | ||
133 | 135 | ||
134 | - | func ada () = "%s__addonAddr" | |
135 | - | ||
136 | - | ||
137 | 136 | func keyChangeAmpLastCall () = "%s__changeAmpLastCall" | |
138 | 137 | ||
139 | 138 | ||
240 | 239 | ||
241 | 240 | let poolConfigParsed = parsePoolConfig(gpc()) | |
242 | 241 | ||
243 | - | let $ | |
242 | + | let $t081818410 = poolConfigParsed | |
244 | 243 | ||
245 | - | let cfgPoolAddress = $ | |
244 | + | let cfgPoolAddress = $t081818410._1 | |
246 | 245 | ||
247 | - | let cfgPoolStatus = $ | |
246 | + | let cfgPoolStatus = $t081818410._2 | |
248 | 247 | ||
249 | - | let cfgLpAssetId = $ | |
248 | + | let cfgLpAssetId = $t081818410._3 | |
250 | 249 | ||
251 | - | let cfgAmountAssetId = $ | |
250 | + | let cfgAmountAssetId = $t081818410._4 | |
252 | 251 | ||
253 | - | let cfgPriceAssetId = $ | |
252 | + | let cfgPriceAssetId = $t081818410._5 | |
254 | 253 | ||
255 | - | let cfgAmountAssetDecimals = $ | |
254 | + | let cfgAmountAssetDecimals = $t081818410._6 | |
256 | 255 | ||
257 | - | let cfgPriceAssetDecimals = $ | |
256 | + | let cfgPriceAssetDecimals = $t081818410._7 | |
258 | 257 | ||
259 | - | let cfgInAmountAssedId = $ | |
258 | + | let cfgInAmountAssedId = $t081818410._8 | |
260 | 259 | ||
261 | - | let cfgInPriceAssetId = $ | |
260 | + | let cfgInPriceAssetId = $t081818410._9 | |
262 | 261 | ||
263 | 262 | func gfc () = split(strf(fca, fcfg()), SEP) | |
264 | 263 | ||
379 | 378 | } | |
380 | 379 | ||
381 | 380 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] | |
382 | - | let $ | |
381 | + | let $t01291512963 = { | |
383 | 382 | let $l = arr | |
384 | 383 | let $s = size($l) | |
385 | 384 | let $acc0 = $Tuple2(s, false) | |
393 | 392 | ||
394 | 393 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17) | |
395 | 394 | } | |
396 | - | let d = $ | |
397 | - | let found = $ | |
395 | + | let d = $t01291512963._1 | |
396 | + | let found = $t01291512963._2 | |
398 | 397 | if (found) | |
399 | 398 | then d | |
400 | 399 | else throw(("D calculation error, D = " + toString(d))) | |
530 | 529 | else calcLpAmt | |
531 | 530 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
532 | 531 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
533 | - | let $ | |
532 | + | let $t02080221147 = if (if (isOneAsset) | |
534 | 533 | then (pmtId == amIdStr) | |
535 | 534 | else false) | |
536 | 535 | then $Tuple2(pmtAmt, 0) | |
539 | 538 | else false) | |
540 | 539 | then $Tuple2(0, pmtAmt) | |
541 | 540 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
542 | - | let writeAmAmt = $ | |
543 | - | let writePrAmt = $ | |
541 | + | let writeAmAmt = $t02080221147._1 | |
542 | + | let writePrAmt = $t02080221147._2 | |
544 | 543 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
545 | 544 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
546 | 545 | } | |
559 | 558 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
560 | 559 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
561 | 560 | func calc (acc,cur) = { | |
562 | - | let $ | |
563 | - | let y = $ | |
564 | - | let found = $ | |
561 | + | let $t02234222362 = acc | |
562 | + | let y = $t02234222362._1 | |
563 | + | let found = $t02234222362._2 | |
565 | 564 | if ((found != unit)) | |
566 | 565 | then acc | |
567 | 566 | else { | |
574 | 573 | } | |
575 | 574 | ||
576 | 575 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
577 | - | let $ | |
576 | + | let $t02266922716 = { | |
578 | 577 | let $l = arr | |
579 | 578 | let $s = size($l) | |
580 | 579 | let $acc0 = $Tuple2(D, unit) | |
588 | 587 | ||
589 | 588 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
590 | 589 | } | |
591 | - | let y = $ | |
592 | - | let found = $ | |
590 | + | let y = $t02266922716._1 | |
591 | + | let found = $t02266922716._2 | |
593 | 592 | if ((found != unit)) | |
594 | 593 | then y | |
595 | 594 | else throw(("Y calculation error, Y = " + toString(y))) | |
633 | 632 | let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
634 | 633 | let amountAssetAmount = order.amount | |
635 | 634 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
636 | - | let $ | |
635 | + | let $t02491425126 = if ((order.orderType == Buy)) | |
637 | 636 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
638 | 637 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
639 | - | let amountAssetBalanceDelta = $ | |
640 | - | let priceAssetBalanceDelta = $ | |
638 | + | let amountAssetBalanceDelta = $t02491425126._1 | |
639 | + | let priceAssetBalanceDelta = $t02491425126._2 | |
641 | 640 | if (if (if (igs()) | |
642 | 641 | then true | |
643 | 642 | else (cfgPoolStatus == PoolMatcherDis)) | |
650 | 649 | then throw("Wr assets") | |
651 | 650 | else { | |
652 | 651 | let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0")) | |
653 | - | let $ | |
654 | - | let unusedActions = $ | |
655 | - | let dLpNew = $ | |
652 | + | let $t02546825568 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
653 | + | let unusedActions = $t02546825568._1 | |
654 | + | let dLpNew = $t02546825568._2 | |
656 | 655 | let isOrderValid = (dLpNew >= dLp) | |
657 | 656 | let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "") | |
658 | 657 | $Tuple2(isOrderValid, info) | |
706 | 705 | then { | |
707 | 706 | let amBalance = getAccBalance(amId) | |
708 | 707 | let prBalance = getAccBalance(prId) | |
709 | - | let $ | |
708 | + | let $t02822428686 = if ((txId == "")) | |
710 | 709 | then $Tuple2(amBalance, prBalance) | |
711 | 710 | else if ((pmtAssetId == amId)) | |
712 | 711 | then if ((pmtAmtRaw > amBalance)) | |
717 | 716 | then throw("invalid payment amount") | |
718 | 717 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
719 | 718 | else throw("wrong pmtAssetId") | |
720 | - | let amBalanceOld = $ | |
721 | - | let prBalanceOld = $ | |
722 | - | let $ | |
719 | + | let amBalanceOld = $t02822428686._1 | |
720 | + | let prBalanceOld = $t02822428686._2 | |
721 | + | let $t02869228868 = if ((pmtAssetId == amId)) | |
723 | 722 | then $Tuple2(pmtAmtRaw, 0) | |
724 | 723 | else if ((pmtAssetId == prId)) | |
725 | 724 | then $Tuple2(0, pmtAmtRaw) | |
726 | 725 | else throw("invalid payment") | |
727 | - | let amAmountRaw = $ | |
728 | - | let prAmountRaw = $ | |
729 | - | let $ | |
726 | + | let amAmountRaw = $t02869228868._1 | |
727 | + | let prAmountRaw = $t02869228868._2 | |
728 | + | let $t02887229126 = if (withTakeFee) | |
730 | 729 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
731 | 730 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
732 | - | let amAmount = $ | |
733 | - | let prAmount = $ | |
734 | - | let feeAmount = $ | |
731 | + | let amAmount = $t02887229126._1 | |
732 | + | let prAmount = $t02887229126._2 | |
733 | + | let feeAmount = $t02887229126._3 | |
735 | 734 | let amBalanceNew = (amBalanceOld + amAmount) | |
736 | 735 | let prBalanceNew = (prBalanceOld + prAmount) | |
737 | 736 | let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)]) | |
779 | 778 | else { | |
780 | 779 | let amBalance = getAccBalance(amId) | |
781 | 780 | let prBalance = getAccBalance(prId) | |
782 | - | let $ | |
781 | + | let $t03123831349 = { | |
783 | 782 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
784 | 783 | if ($isInstanceOf(@, "(Int, Int)")) | |
785 | 784 | then @ | |
786 | 785 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
787 | 786 | } | |
788 | - | if (($ | |
787 | + | if (($t03123831349 == $t03123831349)) | |
789 | 788 | then { | |
790 | - | let feeAmount = $ | |
791 | - | let totalGet = $ | |
789 | + | let feeAmount = $t03123831349._2 | |
790 | + | let totalGet = $t03123831349._1 | |
792 | 791 | let totalAmount = if (if ((minOutAmount > 0)) | |
793 | 792 | then (minOutAmount > totalGet) | |
794 | 793 | else false) | |
795 | 794 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
796 | 795 | else totalGet | |
797 | - | let $ | |
796 | + | let $t03153931846 = if ((outAssetId == amId)) | |
798 | 797 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
799 | 798 | else if ((outAssetId == prId)) | |
800 | 799 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
801 | 800 | else throw("invalid out asset id") | |
802 | - | let outAm = $ | |
803 | - | let outPr = $ | |
804 | - | let amBalanceNew = $ | |
805 | - | let prBalanceNew = $ | |
801 | + | let outAm = $t03153931846._1 | |
802 | + | let outPr = $t03153931846._2 | |
803 | + | let amBalanceNew = $t03153931846._3 | |
804 | + | let prBalanceNew = $t03153931846._4 | |
806 | 805 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
807 | 806 | let curPr = f1(curPrX18, scale8) | |
808 | 807 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
817 | 816 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
818 | 817 | if ((burn == burn)) | |
819 | 818 | then { | |
820 | - | let $ | |
819 | + | let $t03263132981 = { | |
821 | 820 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
822 | 821 | then 0 | |
823 | 822 | else feeAmount | |
828 | 827 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
829 | 828 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
830 | 829 | } | |
831 | - | let amountAssetBalanceDelta = $ | |
832 | - | let priceAssetBalanceDelta = $ | |
833 | - | let $ | |
834 | - | let refreshDLpActions = $ | |
835 | - | let updatedDLp = $ | |
830 | + | let amountAssetBalanceDelta = $t03263132981._1 | |
831 | + | let priceAssetBalanceDelta = $t03263132981._2 | |
832 | + | let $t03298433092 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
833 | + | let refreshDLpActions = $t03298433092._1 | |
834 | + | let updatedDLp = $t03298433092._2 | |
836 | 835 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
837 | 836 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
838 | 837 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
911 | 910 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
912 | 911 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
913 | 912 | func calc (acc,cur) = { | |
914 | - | let $ | |
915 | - | let y = $ | |
916 | - | let found = $ | |
913 | + | let $t03453934559 = acc | |
914 | + | let y = $t03453934559._1 | |
915 | + | let found = $t03453934559._2 | |
917 | 916 | if ((found != unit)) | |
918 | 917 | then acc | |
919 | 918 | else { | |
926 | 925 | } | |
927 | 926 | ||
928 | 927 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
929 | - | let $ | |
928 | + | let $t03489034937 = { | |
930 | 929 | let $l = arr | |
931 | 930 | let $s = size($l) | |
932 | 931 | let $acc0 = $Tuple2(D, unit) | |
940 | 939 | ||
941 | 940 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
942 | 941 | } | |
943 | - | let y = $ | |
944 | - | let found = $ | |
942 | + | let y = $t03489034937._1 | |
943 | + | let found = $t03489034937._2 | |
945 | 944 | if ((found != unit)) | |
946 | 945 | then y | |
947 | 946 | else throw(("Y calculation error, Y = " + toString(y))) | |
953 | 952 | ||
954 | 953 | @Callable(i) | |
955 | 954 | func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = { | |
956 | - | let $ | |
955 | + | let $t03528935713 = if ((isReverse == false)) | |
957 | 956 | then { | |
958 | 957 | let assetOut = strf(this, pa()) | |
959 | 958 | let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn)) | |
964 | 963 | let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn)) | |
965 | 964 | $Tuple2(assetOut, poolAmountInBalance) | |
966 | 965 | } | |
967 | - | let assetOut = $ | |
968 | - | let poolAmountInBalance = $ | |
966 | + | let assetOut = $t03528935713._1 | |
967 | + | let poolAmountInBalance = $t03528935713._2 | |
969 | 968 | let poolConfig = gpc() | |
970 | 969 | let amId = poolConfig[idxAmAsId] | |
971 | 970 | let prId = poolConfig[idxPrAsId] | |
1005 | 1004 | then { | |
1006 | 1005 | let pmt = value(i.payments[0]) | |
1007 | 1006 | let assetIn = assetIdToString(pmt.assetId) | |
1008 | - | let $ | |
1007 | + | let $t03714937543 = if ((isReverse == false)) | |
1009 | 1008 | then { | |
1010 | 1009 | let assetOut = strf(this, pa()) | |
1011 | 1010 | let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount) | |
1016 | 1015 | let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount) | |
1017 | 1016 | $Tuple2(assetOut, poolAmountInBalance) | |
1018 | 1017 | } | |
1019 | - | let assetOut = $ | |
1020 | - | let poolAmountInBalance = $ | |
1018 | + | let assetOut = $t03714937543._1 | |
1019 | + | let poolAmountInBalance = $t03714937543._2 | |
1021 | 1020 | let poolConfig = gpc() | |
1022 | 1021 | let amId = poolConfig[idxAmAsId] | |
1023 | 1022 | let prId = poolConfig[idxPrAsId] | |
1157 | 1156 | else throw("Strict value is not equal to itself.") | |
1158 | 1157 | } | |
1159 | 1158 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1160 | - | let $ | |
1161 | - | let refreshDLpActions = $ | |
1162 | - | let updatedDLp = $ | |
1159 | + | let $t04216242304 = refreshDLpInternal(0, 0, 0) | |
1160 | + | let refreshDLpActions = $t04216242304._1 | |
1161 | + | let updatedDLp = $t04216242304._2 | |
1163 | 1162 | let check = if ((updatedDLp >= currentDLp)) | |
1164 | 1163 | then true | |
1165 | 1164 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " ")) | |
1232 | 1231 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1233 | 1232 | if ((currentDLp == currentDLp)) | |
1234 | 1233 | then { | |
1235 | - | let $ | |
1236 | - | if (($ | |
1234 | + | let $t04394544103 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1235 | + | if (($t04394544103 == $t04394544103)) | |
1237 | 1236 | then { | |
1238 | - | let feeAmount = $ | |
1239 | - | let state = $ | |
1240 | - | let estimLP = $ | |
1237 | + | let feeAmount = $t04394544103._3 | |
1238 | + | let state = $t04394544103._2 | |
1239 | + | let estimLP = $t04394544103._1 | |
1241 | 1240 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1242 | 1241 | then (minOutAmount > estimLP) | |
1243 | 1242 | else false) | |
1265 | 1264 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1266 | 1265 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1267 | 1266 | else nil | |
1268 | - | let $ | |
1267 | + | let $t04498845337 = if ((this == feeCollectorAddress)) | |
1269 | 1268 | then $Tuple2(0, 0) | |
1270 | 1269 | else { | |
1271 | 1270 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1275 | 1274 | then $Tuple2(-(feeAmount), 0) | |
1276 | 1275 | else $Tuple2(0, -(feeAmount)) | |
1277 | 1276 | } | |
1278 | - | let amountAssetBalanceDelta = $ | |
1279 | - | let priceAssetBalanceDelta = $ | |
1280 | - | let $ | |
1281 | - | let refreshDLpActions = $ | |
1282 | - | let updatedDLp = $ | |
1277 | + | let amountAssetBalanceDelta = $t04498845337._1 | |
1278 | + | let priceAssetBalanceDelta = $t04498845337._2 | |
1279 | + | let $t04534045448 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1280 | + | let refreshDLpActions = $t04534045448._1 | |
1281 | + | let updatedDLp = $t04534045448._2 | |
1283 | 1282 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1284 | 1283 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1285 | 1284 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1311 | 1310 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1312 | 1311 | if ((currentDLp == currentDLp)) | |
1313 | 1312 | then { | |
1314 | - | let $ | |
1315 | - | let refreshDLpActions = $ | |
1316 | - | let updatedDLp = $ | |
1313 | + | let $t04647846543 = refreshDLpInternal(0, 0, 0) | |
1314 | + | let refreshDLpActions = $t04647846543._1 | |
1315 | + | let updatedDLp = $t04647846543._2 | |
1317 | 1316 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1318 | 1317 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1319 | 1318 | then (state ++ refreshDLpActions) | |
1338 | 1337 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1339 | 1338 | if ((b == b)) | |
1340 | 1339 | then { | |
1341 | - | let $ | |
1342 | - | let refreshDLpActions = $ | |
1343 | - | let updatedDLp = $ | |
1340 | + | let $t04771647798 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1341 | + | let refreshDLpActions = $t04771647798._1 | |
1342 | + | let updatedDLp = $t04771647798._2 | |
1344 | 1343 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1345 | 1344 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1346 | 1345 | then (state ++ refreshDLpActions) | |
1375 | 1374 | else throwErr("exactly 1 payment are expected")] | |
1376 | 1375 | if ((checks == checks)) | |
1377 | 1376 | then { | |
1378 | - | let $ | |
1379 | - | let state = $ | |
1380 | - | let totalAmount = $ | |
1377 | + | let $t04841648571 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1378 | + | let state = $t04841648571._1 | |
1379 | + | let totalAmount = $t04841648571._2 | |
1381 | 1380 | $Tuple2(state, totalAmount) | |
1382 | 1381 | } | |
1383 | 1382 | else throw("Strict value is not equal to itself.") | |
1394 | 1393 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1395 | 1394 | then { | |
1396 | 1395 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1397 | - | let $ | |
1398 | - | let dLpUpdateActions = $ | |
1399 | - | let updatedDLp = $ | |
1396 | + | let $t04909549159 = refreshDLpInternal(0, 0, 0) | |
1397 | + | let dLpUpdateActions = $t04909549159._1 | |
1398 | + | let updatedDLp = $t04909549159._2 | |
1400 | 1399 | let actions = if ((dLp != updatedDLp)) | |
1401 | 1400 | then dLpUpdateActions | |
1402 | 1401 | else throwErr("nothing to refresh") | |
1424 | 1423 | let newY = getYD(xp, index, D1) | |
1425 | 1424 | let dy = (xp[index] - newY) | |
1426 | 1425 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1427 | - | let $ | |
1428 | - | let totalGet = $ | |
1429 | - | let feeAmount = $ | |
1426 | + | let $t05016950224 = takeFee(totalGetRaw, outFee) | |
1427 | + | let totalGet = $t05016950224._1 | |
1428 | + | let feeAmount = $t05016950224._2 | |
1430 | 1429 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1431 | 1430 | } | |
1432 | 1431 | ||
1439 | 1438 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1440 | 1439 | let amBalance = getAccBalance(amId) | |
1441 | 1440 | let prBalance = getAccBalance(prId) | |
1442 | - | let $ | |
1441 | + | let $t05059950714 = { | |
1443 | 1442 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1444 | 1443 | if ($isInstanceOf(@, "(Int, Int)")) | |
1445 | 1444 | then @ | |
1446 | 1445 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1447 | 1446 | } | |
1448 | - | let totalGet = $ | |
1449 | - | let feeAmount = $ | |
1447 | + | let totalGet = $t05059950714._1 | |
1448 | + | let feeAmount = $t05059950714._2 | |
1450 | 1449 | let r = ego("", lpId, lpAssetAmount, this) | |
1451 | 1450 | let outAmAmt = r._1 | |
1452 | 1451 | let outPrAmt = r._2 | |
1480 | 1479 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1481 | 1480 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1482 | 1481 | then { | |
1483 | - | let $ | |
1484 | - | let refreshDLpActions = $ | |
1485 | - | let updatedDLp = $ | |
1482 | + | let $t05188051961 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1483 | + | let refreshDLpActions = $t05188051961._1 | |
1484 | + | let updatedDLp = $t05188051961._2 | |
1486 | 1485 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1487 | 1486 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1488 | 1487 | then (state ++ refreshDLpActions) | |
1527 | 1526 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1528 | 1527 | if ((burnA == burnA)) | |
1529 | 1528 | then { | |
1530 | - | let $ | |
1531 | - | let refreshDLpActions = $ | |
1532 | - | let updatedDLp = $ | |
1529 | + | let $t05298853069 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1530 | + | let refreshDLpActions = $t05298853069._1 | |
1531 | + | let updatedDLp = $t05298853069._2 | |
1533 | 1532 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1534 | 1533 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1535 | 1534 | then (state ++ refreshDLpActions) | |
1580 | 1579 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1581 | 1580 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1582 | 1581 | then { | |
1583 | - | let $ | |
1584 | - | let refreshDLpActions = $ | |
1585 | - | let updatedDLp = $ | |
1582 | + | let $t05432054401 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1583 | + | let refreshDLpActions = $t05432054401._1 | |
1584 | + | let updatedDLp = $t05432054401._2 | |
1586 | 1585 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1587 | 1586 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1588 | 1587 | then (state ++ refreshDLpActions) | |
1631 | 1630 | let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil) | |
1632 | 1631 | if ((unstakeInv == unstakeInv)) | |
1633 | 1632 | then { | |
1634 | - | let $ | |
1635 | - | let state = $ | |
1636 | - | let totalAmount = $ | |
1633 | + | let $t05542355611 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1634 | + | let state = $t05542355611._1 | |
1635 | + | let totalAmount = $t05542355611._2 | |
1637 | 1636 | $Tuple2(state, totalAmount) | |
1638 | 1637 | } | |
1639 | 1638 | else throw("Strict value is not equal to itself.") | |
1645 | 1644 | ||
1646 | 1645 | @Callable(i) | |
1647 | 1646 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1648 | - | let $ | |
1649 | - | let lpAmount = $ | |
1650 | - | let state = $ | |
1651 | - | let feeAmount = $ | |
1652 | - | let bonus = $ | |
1647 | + | let $t05573955842 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1648 | + | let lpAmount = $t05573955842._1 | |
1649 | + | let state = $t05573955842._2 | |
1650 | + | let feeAmount = $t05573955842._3 | |
1651 | + | let bonus = $t05573955842._4 | |
1653 | 1652 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1654 | 1653 | } | |
1655 | 1654 | ||
1657 | 1656 | ||
1658 | 1657 | @Callable(i) | |
1659 | 1658 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1660 | - | let $ | |
1661 | - | let lpAmount = $ | |
1662 | - | let state = $ | |
1663 | - | let feeAmount = $ | |
1664 | - | let bonus = $ | |
1659 | + | let $t05599056094 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1660 | + | let lpAmount = $t05599056094._1 | |
1661 | + | let state = $t05599056094._2 | |
1662 | + | let feeAmount = $t05599056094._3 | |
1663 | + | let bonus = $t05599056094._4 | |
1665 | 1664 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1666 | 1665 | } | |
1667 | 1666 | ||
1671 | 1670 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1672 | 1671 | then throw("denied") | |
1673 | 1672 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1674 | - | ||
1675 | - | ||
1676 | - | ||
1677 | - | @Callable(i) | |
1678 | - | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1679 | - | then pd | |
1680 | - | else [StringEntry(k, v)] | |
1681 | - | ||
1682 | - | ||
1683 | - | ||
1684 | - | @Callable(i) | |
1685 | - | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1686 | - | then pd | |
1687 | - | else [IntegerEntry(k, v)] | |
1688 | 1673 | ||
1689 | 1674 | ||
1690 | 1675 | ||
1737 | 1722 | @Callable(i) | |
1738 | 1723 | func changeAmp () = { | |
1739 | 1724 | let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil) | |
1740 | - | let $ | |
1725 | + | let $t05844858647 = match cfg { | |
1741 | 1726 | case list: List[Any] => | |
1742 | 1727 | $Tuple3({ | |
1743 | 1728 | let @ = list[0] | |
1758 | 1743 | case _ => | |
1759 | 1744 | throwErr("invalid entry type") | |
1760 | 1745 | } | |
1761 | - | let delay = $ | |
1762 | - | let delta = $ | |
1763 | - | let target = $ | |
1746 | + | let delay = $t05844858647._1 | |
1747 | + | let delta = $t05844858647._2 | |
1748 | + | let target = $t05844858647._3 | |
1764 | 1749 | let curAmp = parseIntValue(getStringValue(amp())) | |
1765 | 1750 | let newAmpRaw = (curAmp + delta) | |
1766 | 1751 | let newAmp = if ((0 > delta)) | |
1796 | 1781 | match tx { | |
1797 | 1782 | case order: Order => | |
1798 | 1783 | let matcherPub = mp() | |
1799 | - | let $ | |
1784 | + | let $t05955959676 = if (skipOrderValidation()) | |
1800 | 1785 | then $Tuple2(true, "") | |
1801 | 1786 | else validateMatcherOrderAllowed(order) | |
1802 | - | let orderValid = $ | |
1803 | - | let orderValidInfo = $ | |
1787 | + | let orderValid = $t05955959676._1 | |
1788 | + | let orderValidInfo = $t05955959676._2 | |
1804 | 1789 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1805 | 1790 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1806 | 1791 | if (if (if (orderValid) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let test = true | |
5 | + | ||
4 | 6 | let scale8 = 100000000 | |
5 | 7 | ||
6 | 8 | let scale8BigInt = toBigInt(100000000) | |
7 | 9 | ||
8 | 10 | let scale18 = toBigInt(1000000000000000000) | |
9 | 11 | ||
10 | 12 | let zeroBigInt = toBigInt(0) | |
11 | 13 | ||
12 | 14 | let big0 = toBigInt(0) | |
13 | 15 | ||
14 | 16 | let big1 = toBigInt(1) | |
15 | 17 | ||
16 | 18 | let big2 = toBigInt(2) | |
17 | 19 | ||
18 | 20 | let big3 = toBigInt(3) | |
19 | 21 | ||
20 | 22 | let big4 = toBigInt(4) | |
21 | 23 | ||
22 | 24 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | 25 | ||
24 | 26 | let wavesString = "WAVES" | |
25 | 27 | ||
26 | 28 | let Amult = "100" | |
27 | 29 | ||
28 | 30 | let Dconv = "1" | |
29 | 31 | ||
30 | 32 | let SEP = "__" | |
31 | 33 | ||
32 | 34 | let EMPTY = "" | |
33 | 35 | ||
34 | 36 | let PoolActive = 1 | |
35 | 37 | ||
36 | 38 | let PoolPutDis = 2 | |
37 | 39 | ||
38 | 40 | let PoolMatcherDis = 3 | |
39 | 41 | ||
40 | 42 | let PoolShutdown = 4 | |
41 | 43 | ||
42 | 44 | let idxPoolAddress = 1 | |
43 | 45 | ||
44 | 46 | let idxPoolSt = 2 | |
45 | 47 | ||
46 | 48 | let idxLPAsId = 3 | |
47 | 49 | ||
48 | 50 | let idxAmAsId = 4 | |
49 | 51 | ||
50 | 52 | let idxPrAsId = 5 | |
51 | 53 | ||
52 | 54 | let idxAmtAsDcm = 6 | |
53 | 55 | ||
54 | 56 | let idxPriceAsDcm = 7 | |
55 | 57 | ||
56 | 58 | let idxIAmtAsId = 8 | |
57 | 59 | ||
58 | 60 | let idxIPriceAsId = 9 | |
59 | 61 | ||
60 | 62 | let idxFactStakCntr = 1 | |
61 | 63 | ||
62 | 64 | let idxFactoryRestCntr = 6 | |
63 | 65 | ||
64 | 66 | let idxFactSlippCntr = 7 | |
65 | 67 | ||
66 | 68 | let idxFactGwxRewCntr = 10 | |
67 | 69 | ||
68 | 70 | let feeDefault = fraction(10, scale8, 10000) | |
69 | 71 | ||
70 | 72 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
71 | 73 | ||
72 | 74 | ||
73 | 75 | func t1BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult) | |
74 | 76 | ||
75 | 77 | ||
76 | 78 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
77 | 79 | ||
78 | 80 | ||
79 | 81 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
80 | 82 | ||
81 | 83 | ||
82 | 84 | func t2 (origVal,origScaleMult) = fraction(origVal, scale18, toBigInt(origScaleMult)) | |
83 | 85 | ||
84 | 86 | ||
85 | 87 | func f2 (val,resultScaleMult) = fraction(val, toBigInt(resultScaleMult), scale18) | |
86 | 88 | ||
87 | 89 | ||
88 | 90 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func abs (val) = if ((zeroBigInt > val)) | |
92 | 94 | then -(val) | |
93 | 95 | else val | |
94 | 96 | ||
95 | 97 | ||
96 | 98 | func absBigInt (val) = if ((zeroBigInt > val)) | |
97 | 99 | then -(val) | |
98 | 100 | else val | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | func fc () = "%s__factoryContract" | |
102 | 104 | ||
103 | 105 | ||
104 | 106 | func mpk () = "%s__managerPublicKey" | |
105 | 107 | ||
106 | 108 | ||
107 | 109 | func pmpk () = "%s__pendingManagerPublicKey" | |
108 | 110 | ||
109 | 111 | ||
110 | 112 | func pl () = "%s%s__price__last" | |
111 | 113 | ||
112 | 114 | ||
113 | 115 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
114 | 116 | ||
115 | 117 | ||
116 | 118 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
117 | 119 | ||
118 | 120 | ||
119 | 121 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | func aa () = "%s__amountAsset" | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func pa () = "%s__priceAsset" | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | func amp () = "%s__amp" | |
129 | 131 | ||
130 | 132 | ||
131 | 133 | func keyAmpHistory (heightBlocks) = ("%s%d__amp__" + toString(heightBlocks)) | |
132 | 134 | ||
133 | 135 | ||
134 | - | func ada () = "%s__addonAddr" | |
135 | - | ||
136 | - | ||
137 | 136 | func keyChangeAmpLastCall () = "%s__changeAmpLastCall" | |
138 | 137 | ||
139 | 138 | ||
140 | 139 | let keyFee = "%s__fee" | |
141 | 140 | ||
142 | 141 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
143 | 142 | ||
144 | 143 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
145 | 144 | ||
146 | 145 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
147 | 146 | ||
148 | 147 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
149 | 148 | ||
150 | 149 | let dLpRefreshDelayDefault = 30 | |
151 | 150 | ||
152 | 151 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
153 | 152 | ||
154 | 153 | func fcfg () = "%s__factoryConfig" | |
155 | 154 | ||
156 | 155 | ||
157 | 156 | func mtpk () = "%s%s__matcher__publicKey" | |
158 | 157 | ||
159 | 158 | ||
160 | 159 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
161 | 160 | ||
162 | 161 | ||
163 | 162 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
164 | 163 | ||
165 | 164 | ||
166 | 165 | func aps () = "%s__shutdown" | |
167 | 166 | ||
168 | 167 | ||
169 | 168 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
170 | 169 | ||
171 | 170 | ||
172 | 171 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
173 | 172 | ||
174 | 173 | ||
175 | 174 | func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress) | |
176 | 175 | ||
177 | 176 | ||
178 | 177 | func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
179 | 178 | ||
180 | 179 | ||
181 | 180 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
182 | 181 | ||
183 | 182 | ||
184 | 183 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
185 | 184 | ||
186 | 185 | ||
187 | 186 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
188 | 187 | ||
189 | 188 | ||
190 | 189 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
191 | 190 | ||
192 | 191 | ||
193 | 192 | let fca = addressFromStringValue(strf(this, fc())) | |
194 | 193 | ||
195 | 194 | let inFee = { | |
196 | 195 | let @ = invoke(fca, "getInFeeREADONLY", [toString(this)], nil) | |
197 | 196 | if ($isInstanceOf(@, "Int")) | |
198 | 197 | then @ | |
199 | 198 | else throw(($getType(@) + " couldn't be cast to Int")) | |
200 | 199 | } | |
201 | 200 | ||
202 | 201 | let outFee = { | |
203 | 202 | let @ = invoke(fca, "getOutFeeREADONLY", [toString(this)], nil) | |
204 | 203 | if ($isInstanceOf(@, "Int")) | |
205 | 204 | then @ | |
206 | 205 | else throw(($getType(@) + " couldn't be cast to Int")) | |
207 | 206 | } | |
208 | 207 | ||
209 | 208 | let A = strf(this, amp()) | |
210 | 209 | ||
211 | 210 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
212 | 211 | ||
213 | 212 | ||
214 | 213 | func mp () = fromBase58String(strf(fca, mtpk())) | |
215 | 214 | ||
216 | 215 | ||
217 | 216 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
218 | 217 | ||
219 | 218 | func gpc () = { | |
220 | 219 | let amtAs = strf(this, aa()) | |
221 | 220 | let priceAs = strf(this, pa()) | |
222 | 221 | let iPriceAs = intf(fca, mba(priceAs)) | |
223 | 222 | let iAmtAs = intf(fca, mba(amtAs)) | |
224 | 223 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
225 | 224 | } | |
226 | 225 | ||
227 | 226 | ||
228 | 227 | func parseAssetId (input) = if ((input == wavesString)) | |
229 | 228 | then unit | |
230 | 229 | else fromBase58String(input) | |
231 | 230 | ||
232 | 231 | ||
233 | 232 | func assetIdToString (input) = if ((input == unit)) | |
234 | 233 | then wavesString | |
235 | 234 | else toBase58String(value(input)) | |
236 | 235 | ||
237 | 236 | ||
238 | 237 | func parsePoolConfig (poolConfig) = $Tuple9(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm]), fromBase58String(poolConfig[idxIAmtAsId]), fromBase58String(poolConfig[idxIPriceAsId])) | |
239 | 238 | ||
240 | 239 | ||
241 | 240 | let poolConfigParsed = parsePoolConfig(gpc()) | |
242 | 241 | ||
243 | - | let $ | |
242 | + | let $t081818410 = poolConfigParsed | |
244 | 243 | ||
245 | - | let cfgPoolAddress = $ | |
244 | + | let cfgPoolAddress = $t081818410._1 | |
246 | 245 | ||
247 | - | let cfgPoolStatus = $ | |
246 | + | let cfgPoolStatus = $t081818410._2 | |
248 | 247 | ||
249 | - | let cfgLpAssetId = $ | |
248 | + | let cfgLpAssetId = $t081818410._3 | |
250 | 249 | ||
251 | - | let cfgAmountAssetId = $ | |
250 | + | let cfgAmountAssetId = $t081818410._4 | |
252 | 251 | ||
253 | - | let cfgPriceAssetId = $ | |
252 | + | let cfgPriceAssetId = $t081818410._5 | |
254 | 253 | ||
255 | - | let cfgAmountAssetDecimals = $ | |
254 | + | let cfgAmountAssetDecimals = $t081818410._6 | |
256 | 255 | ||
257 | - | let cfgPriceAssetDecimals = $ | |
256 | + | let cfgPriceAssetDecimals = $t081818410._7 | |
258 | 257 | ||
259 | - | let cfgInAmountAssedId = $ | |
258 | + | let cfgInAmountAssedId = $t081818410._8 | |
260 | 259 | ||
261 | - | let cfgInPriceAssetId = $ | |
260 | + | let cfgInPriceAssetId = $t081818410._9 | |
262 | 261 | ||
263 | 262 | func gfc () = split(strf(fca, fcfg()), SEP) | |
264 | 263 | ||
265 | 264 | ||
266 | 265 | let factoryConfig = gfc() | |
267 | 266 | ||
268 | 267 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
269 | 268 | ||
270 | 269 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
271 | 270 | ||
272 | 271 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
273 | 272 | ||
274 | 273 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
275 | 274 | ||
276 | 275 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
277 | 276 | ||
278 | 277 | ||
279 | 278 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
280 | 279 | ||
281 | 280 | ||
282 | 281 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
283 | 282 | then wavesBalance(this).available | |
284 | 283 | else assetBalance(this, fromBase58String(assetId)) | |
285 | 284 | ||
286 | 285 | ||
287 | 286 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
288 | 287 | ||
289 | 288 | ||
290 | 289 | func cpbir (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
291 | 290 | ||
292 | 291 | ||
293 | 292 | func vad (A1,A2,slippage) = { | |
294 | 293 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
295 | 294 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
296 | 295 | if (!(pass)) | |
297 | 296 | then throw(("Big slpg: " + toString(diff))) | |
298 | 297 | else $Tuple2(pass, min([A1, A2])) | |
299 | 298 | } | |
300 | 299 | ||
301 | 300 | ||
302 | 301 | func vd (D1,D0,slpg) = { | |
303 | 302 | let diff = fraction(D0, scale8BigInt, D1) | |
304 | 303 | let fail = (slpg > diff) | |
305 | 304 | if (if (fail) | |
306 | 305 | then true | |
307 | 306 | else (D0 > D1)) | |
308 | 307 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
309 | 308 | else fail | |
310 | 309 | } | |
311 | 310 | ||
312 | 311 | ||
313 | 312 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
314 | 313 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
315 | 314 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
316 | 315 | cpbi(prAsAmtX18, amtAsAmtX18) | |
317 | 316 | } | |
318 | 317 | ||
319 | 318 | ||
320 | 319 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
321 | 320 | let amtAsDcm = cfgAmountAssetDecimals | |
322 | 321 | let prAsDcm = cfgPriceAssetDecimals | |
323 | 322 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
324 | 323 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
325 | 324 | let prAmtX18 = t1(prAmt, prAsDcm) | |
326 | 325 | let lpAmtX18 = t1(lpAmt, scale8) | |
327 | 326 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
328 | 327 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
329 | 328 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
330 | 329 | } | |
331 | 330 | ||
332 | 331 | ||
333 | 332 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
334 | 333 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
335 | 334 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
336 | 335 | } | |
337 | 336 | ||
338 | 337 | ||
339 | 338 | func takeFee (amount,fee) = { | |
340 | 339 | let feeAmount = if ((fee == 0)) | |
341 | 340 | then 0 | |
342 | 341 | else fraction(amount, fee, scale8) | |
343 | 342 | $Tuple2((amount - feeAmount), feeAmount) | |
344 | 343 | } | |
345 | 344 | ||
346 | 345 | ||
347 | 346 | func getD (xp) = { | |
348 | 347 | let xp0 = xp[0] | |
349 | 348 | let xp1 = xp[1] | |
350 | 349 | let s = (xp0 + xp1) | |
351 | 350 | if ((s == big0)) | |
352 | 351 | then big0 | |
353 | 352 | else { | |
354 | 353 | let a = parseIntValue(A) | |
355 | 354 | let ann = (a * 2) | |
356 | 355 | let p = fraction(xp0, xp1, big1) | |
357 | 356 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
358 | 357 | let ann_s = fraction(toBigInt(ann), s, big1) | |
359 | 358 | let ann_1 = toBigInt((ann - 1)) | |
360 | 359 | func calcDNext (d) = { | |
361 | 360 | let dd = fraction(d, d, big1) | |
362 | 361 | let ddd = fraction(dd, d, big1) | |
363 | 362 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
364 | 363 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1))) | |
365 | 364 | } | |
366 | 365 | ||
367 | 366 | func calc (acc,i) = if (acc._2) | |
368 | 367 | then acc | |
369 | 368 | else { | |
370 | 369 | let d = acc._1 | |
371 | 370 | let dNext = calcDNext(d) | |
372 | 371 | let dDiffRaw = (dNext - value(d)) | |
373 | 372 | let dDiff = if ((big0 > dDiffRaw)) | |
374 | 373 | then -(dDiffRaw) | |
375 | 374 | else dDiffRaw | |
376 | 375 | if ((big1 >= dDiff)) | |
377 | 376 | then $Tuple2(dNext, true) | |
378 | 377 | else $Tuple2(dNext, false) | |
379 | 378 | } | |
380 | 379 | ||
381 | 380 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] | |
382 | - | let $ | |
381 | + | let $t01291512963 = { | |
383 | 382 | let $l = arr | |
384 | 383 | let $s = size($l) | |
385 | 384 | let $acc0 = $Tuple2(s, false) | |
386 | 385 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
387 | 386 | then $a | |
388 | 387 | else calc($a, $l[$i]) | |
389 | 388 | ||
390 | 389 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
391 | 390 | then $a | |
392 | 391 | else throw("List size exceeds 17") | |
393 | 392 | ||
394 | 393 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17) | |
395 | 394 | } | |
396 | - | let d = $ | |
397 | - | let found = $ | |
395 | + | let d = $t01291512963._1 | |
396 | + | let found = $t01291512963._2 | |
398 | 397 | if (found) | |
399 | 398 | then d | |
400 | 399 | else throw(("D calculation error, D = " + toString(d))) | |
401 | 400 | } | |
402 | 401 | } | |
403 | 402 | ||
404 | 403 | ||
405 | 404 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
406 | 405 | let lpId = cfgLpAssetId | |
407 | 406 | let amId = toBase58String(value(cfgAmountAssetId)) | |
408 | 407 | let prId = toBase58String(value(cfgPriceAssetId)) | |
409 | 408 | let amDcm = cfgAmountAssetDecimals | |
410 | 409 | let prDcm = cfgPriceAssetDecimals | |
411 | 410 | let sts = toString(cfgPoolStatus) | |
412 | 411 | let lpEmiss = valueOrErrorMessage(assetInfo(lpId), "Wrong LP id").quantity | |
413 | 412 | if ((toBase58String(lpId) != pmtAssetId)) | |
414 | 413 | then throw("Wrong pmt asset") | |
415 | 414 | else { | |
416 | 415 | let amBalance = getAccBalance(amId) | |
417 | 416 | let amBalanceX18 = t1(amBalance, amDcm) | |
418 | 417 | let prBalance = getAccBalance(prId) | |
419 | 418 | let prBalanceX18 = t1(prBalance, prDcm) | |
420 | 419 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
421 | 420 | let curPrice = f1(curPriceX18, scale8) | |
422 | 421 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
423 | 422 | let lpEmissX18 = t1(lpEmiss, scale8) | |
424 | 423 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
425 | 424 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
426 | 425 | let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR) | |
427 | 426 | let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR) | |
428 | 427 | let state = if ((txId58 == "")) | |
429 | 428 | then nil | |
430 | 429 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
431 | 430 | then unit | |
432 | 431 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
433 | 432 | then unit | |
434 | 433 | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
435 | 434 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
436 | 435 | } | |
437 | 436 | } | |
438 | 437 | ||
439 | 438 | ||
440 | 439 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
441 | 440 | let lpId = cfgLpAssetId | |
442 | 441 | let amIdStr = toBase58String(value(cfgAmountAssetId)) | |
443 | 442 | let prIdStr = toBase58String(value(cfgPriceAssetId)) | |
444 | 443 | let inAmIdStr = cfgInAmountAssedId | |
445 | 444 | let inPrIdStr = cfgInPriceAssetId | |
446 | 445 | let amtDcm = cfgAmountAssetDecimals | |
447 | 446 | let priceDcm = cfgPriceAssetDecimals | |
448 | 447 | let sts = toString(cfgPoolStatus) | |
449 | 448 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
450 | 449 | let amBalance = if (isEval) | |
451 | 450 | then getAccBalance(amIdStr) | |
452 | 451 | else if (if (isOneAsset) | |
453 | 452 | then (pmtId == amIdStr) | |
454 | 453 | else false) | |
455 | 454 | then (getAccBalance(amIdStr) - pmtAmt) | |
456 | 455 | else if (isOneAsset) | |
457 | 456 | then getAccBalance(amIdStr) | |
458 | 457 | else (getAccBalance(amIdStr) - inAmAmt) | |
459 | 458 | let prBalance = if (isEval) | |
460 | 459 | then getAccBalance(prIdStr) | |
461 | 460 | else if (if (isOneAsset) | |
462 | 461 | then (pmtId == prIdStr) | |
463 | 462 | else false) | |
464 | 463 | then (getAccBalance(prIdStr) - pmtAmt) | |
465 | 464 | else if (isOneAsset) | |
466 | 465 | then getAccBalance(prIdStr) | |
467 | 466 | else (getAccBalance(prIdStr) - inPrAmt) | |
468 | 467 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
469 | 468 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
470 | 469 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
471 | 470 | let amBalanceX18 = t1(amBalance, amtDcm) | |
472 | 471 | let prBalanceX18 = t1(prBalance, priceDcm) | |
473 | 472 | let D0 = getD([amBalanceX18, prBalanceX18]) | |
474 | 473 | let r = if ((lpEm == 0)) | |
475 | 474 | then { | |
476 | 475 | let D1 = getD([(amBalanceX18 + inAmAssetAmtX18), (prBalanceX18 + inPrAssetAmtX18)]) | |
477 | 476 | let checkD = if ((D1 > D0)) | |
478 | 477 | then true | |
479 | 478 | else throw("D1 should be greater than D0") | |
480 | 479 | if ((checkD == checkD)) | |
481 | 480 | then { | |
482 | 481 | let curPriceX18 = zeroBigInt | |
483 | 482 | let slippageX18 = zeroBigInt | |
484 | 483 | let lpAmtX18 = D1 | |
485 | 484 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
486 | 485 | } | |
487 | 486 | else throw("Strict value is not equal to itself.") | |
488 | 487 | } | |
489 | 488 | else { | |
490 | 489 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
491 | 490 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
492 | 491 | let slippageX18 = t1(slippage, scale8) | |
493 | 492 | if (if (if (validateSlippage) | |
494 | 493 | then (curPriceX18 != zeroBigInt) | |
495 | 494 | else false) | |
496 | 495 | then (slippageRealX18 > slippageX18) | |
497 | 496 | else false) | |
498 | 497 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
499 | 498 | else { | |
500 | 499 | let lpEmissionX18 = t1(lpEm, scale8) | |
501 | 500 | let prViaAmX18 = fraction(inAmAssetAmtX18, cpbir(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
502 | 501 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, cpbir(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
503 | 502 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
504 | 503 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
505 | 504 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
506 | 505 | let expAmtAssetAmtX18 = expectedAmts._1 | |
507 | 506 | let expPriceAssetAmtX18 = expectedAmts._2 | |
508 | 507 | let D1 = getD([(amBalanceX18 + expAmtAssetAmtX18), (prBalanceX18 + expPriceAssetAmtX18)]) | |
509 | 508 | let checkD = if ((D1 > D0)) | |
510 | 509 | then true | |
511 | 510 | else throw("D1 should be greater than D0") | |
512 | 511 | if ((checkD == checkD)) | |
513 | 512 | then { | |
514 | 513 | let lpAmtX18 = fraction(lpEmissionX18, (D1 - D0), D0) | |
515 | 514 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
516 | 515 | } | |
517 | 516 | else throw("Strict value is not equal to itself.") | |
518 | 517 | } | |
519 | 518 | } | |
520 | 519 | let calcLpAmt = r._1 | |
521 | 520 | let calcAmAssetPmt = r._2 | |
522 | 521 | let calcPrAssetPmt = r._3 | |
523 | 522 | let curPrice = f1(r._4, scale8) | |
524 | 523 | let slippageCalc = f1(r._5, scale8) | |
525 | 524 | if ((0 >= calcLpAmt)) | |
526 | 525 | then throw("LP <= 0") | |
527 | 526 | else { | |
528 | 527 | let emitLpAmt = if (!(emitLp)) | |
529 | 528 | then 0 | |
530 | 529 | else calcLpAmt | |
531 | 530 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
532 | 531 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
533 | - | let $ | |
532 | + | let $t02080221147 = if (if (isOneAsset) | |
534 | 533 | then (pmtId == amIdStr) | |
535 | 534 | else false) | |
536 | 535 | then $Tuple2(pmtAmt, 0) | |
537 | 536 | else if (if (isOneAsset) | |
538 | 537 | then (pmtId == prIdStr) | |
539 | 538 | else false) | |
540 | 539 | then $Tuple2(0, pmtAmt) | |
541 | 540 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
542 | - | let writeAmAmt = $ | |
543 | - | let writePrAmt = $ | |
541 | + | let writeAmAmt = $t02080221147._1 | |
542 | + | let writePrAmt = $t02080221147._2 | |
544 | 543 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
545 | 544 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
546 | 545 | } | |
547 | 546 | } | |
548 | 547 | ||
549 | 548 | ||
550 | 549 | func getYD (xp,i,D) = { | |
551 | 550 | let n = big2 | |
552 | 551 | let x = xp[if ((i == 0)) | |
553 | 552 | then 1 | |
554 | 553 | else 0] | |
555 | 554 | let aPrecision = parseBigIntValue(Amult) | |
556 | 555 | let a = (parseBigIntValue(A) * aPrecision) | |
557 | 556 | let s = x | |
558 | 557 | let ann = (a * n) | |
559 | 558 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
560 | 559 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
561 | 560 | func calc (acc,cur) = { | |
562 | - | let $ | |
563 | - | let y = $ | |
564 | - | let found = $ | |
561 | + | let $t02234222362 = acc | |
562 | + | let y = $t02234222362._1 | |
563 | + | let found = $t02234222362._2 | |
565 | 564 | if ((found != unit)) | |
566 | 565 | then acc | |
567 | 566 | else { | |
568 | 567 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
569 | 568 | let yDiff = absBigInt((yNext - value(y))) | |
570 | 569 | if ((big1 >= yDiff)) | |
571 | 570 | then $Tuple2(yNext, cur) | |
572 | 571 | else $Tuple2(yNext, unit) | |
573 | 572 | } | |
574 | 573 | } | |
575 | 574 | ||
576 | 575 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
577 | - | let $ | |
576 | + | let $t02266922716 = { | |
578 | 577 | let $l = arr | |
579 | 578 | let $s = size($l) | |
580 | 579 | let $acc0 = $Tuple2(D, unit) | |
581 | 580 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
582 | 581 | then $a | |
583 | 582 | else calc($a, $l[$i]) | |
584 | 583 | ||
585 | 584 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
586 | 585 | then $a | |
587 | 586 | else throw("List size exceeds 15") | |
588 | 587 | ||
589 | 588 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
590 | 589 | } | |
591 | - | let y = $ | |
592 | - | let found = $ | |
590 | + | let y = $t02266922716._1 | |
591 | + | let found = $t02266922716._2 | |
593 | 592 | if ((found != unit)) | |
594 | 593 | then y | |
595 | 594 | else throw(("Y calculation error, Y = " + toString(y))) | |
596 | 595 | } | |
597 | 596 | ||
598 | 597 | ||
599 | 598 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
600 | 599 | let updatedDLp = fraction(getD([t1BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)), t1BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))]), scale18, lpEmission) | |
601 | 600 | if ((lpEmission == big0)) | |
602 | 601 | then big0 | |
603 | 602 | else updatedDLp | |
604 | 603 | } | |
605 | 604 | ||
606 | 605 | ||
607 | 606 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
608 | 607 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
609 | 608 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
610 | 609 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
611 | 610 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
612 | 611 | currentDLp | |
613 | 612 | } | |
614 | 613 | ||
615 | 614 | ||
616 | 615 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
617 | 616 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
618 | 617 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
619 | 618 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
620 | 619 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
621 | 620 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
622 | 621 | $Tuple2(actions, updatedDLp) | |
623 | 622 | } | |
624 | 623 | ||
625 | 624 | ||
626 | 625 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
627 | 626 | then true | |
628 | 627 | else throwErr("updated DLp lower than current DLp") | |
629 | 628 | ||
630 | 629 | ||
631 | 630 | func validateMatcherOrderAllowed (order) = { | |
632 | 631 | let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
633 | 632 | let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
634 | 633 | let amountAssetAmount = order.amount | |
635 | 634 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
636 | - | let $ | |
635 | + | let $t02491425126 = if ((order.orderType == Buy)) | |
637 | 636 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
638 | 637 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
639 | - | let amountAssetBalanceDelta = $ | |
640 | - | let priceAssetBalanceDelta = $ | |
638 | + | let amountAssetBalanceDelta = $t02491425126._1 | |
639 | + | let priceAssetBalanceDelta = $t02491425126._2 | |
641 | 640 | if (if (if (igs()) | |
642 | 641 | then true | |
643 | 642 | else (cfgPoolStatus == PoolMatcherDis)) | |
644 | 643 | then true | |
645 | 644 | else (cfgPoolStatus == PoolShutdown)) | |
646 | 645 | then throw("Admin blocked") | |
647 | 646 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
648 | 647 | then true | |
649 | 648 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
650 | 649 | then throw("Wr assets") | |
651 | 650 | else { | |
652 | 651 | let dLp = parseBigIntValue(valueOrElse(getString(this, keyDLp), "0")) | |
653 | - | let $ | |
654 | - | let unusedActions = $ | |
655 | - | let dLpNew = $ | |
652 | + | let $t02546825568 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
653 | + | let unusedActions = $t02546825568._1 | |
654 | + | let dLpNew = $t02546825568._2 | |
656 | 655 | let isOrderValid = (dLpNew >= dLp) | |
657 | 656 | let info = makeString(["dLp=", toString(dLp), " dLpNew=", toString(dLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "") | |
658 | 657 | $Tuple2(isOrderValid, info) | |
659 | 658 | } | |
660 | 659 | } | |
661 | 660 | ||
662 | 661 | ||
663 | 662 | func cg (i) = if ((size(i.payments) != 1)) | |
664 | 663 | then throw("1 pmnt exp") | |
665 | 664 | else { | |
666 | 665 | let pmt = value(i.payments[0]) | |
667 | 666 | let pmtAssetId = value(pmt.assetId) | |
668 | 667 | let pmtAmt = pmt.amount | |
669 | 668 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
670 | 669 | let outAmAmt = r._1 | |
671 | 670 | let outPrAmt = r._2 | |
672 | 671 | let sts = parseIntValue(r._9) | |
673 | 672 | let state = r._10 | |
674 | 673 | if (if (igs()) | |
675 | 674 | then true | |
676 | 675 | else (sts == PoolShutdown)) | |
677 | 676 | then throw(("Admin blocked: " + toString(sts))) | |
678 | 677 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
679 | 678 | } | |
680 | 679 | ||
681 | 680 | ||
682 | 681 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
683 | 682 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
684 | 683 | let sts = parseIntValue(r._8) | |
685 | 684 | if (if (if (igs()) | |
686 | 685 | then true | |
687 | 686 | else (sts == PoolPutDis)) | |
688 | 687 | then true | |
689 | 688 | else (sts == PoolShutdown)) | |
690 | 689 | then throw(("Blocked:" + toString(sts))) | |
691 | 690 | else r | |
692 | 691 | } | |
693 | 692 | ||
694 | 693 | ||
695 | 694 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
696 | 695 | let amId = toBase58String(value(cfgAmountAssetId)) | |
697 | 696 | let prId = toBase58String(value(cfgPriceAssetId)) | |
698 | 697 | let lpId = cfgLpAssetId | |
699 | 698 | let amtDcm = cfgAmountAssetDecimals | |
700 | 699 | let priceDcm = cfgPriceAssetDecimals | |
701 | 700 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(lpId), "invalid lp asset").quantity) | |
702 | 701 | let chechEmission = if ((lpAssetEmission > big0)) | |
703 | 702 | then true | |
704 | 703 | else throw("initial deposit requires all coins") | |
705 | 704 | if ((chechEmission == chechEmission)) | |
706 | 705 | then { | |
707 | 706 | let amBalance = getAccBalance(amId) | |
708 | 707 | let prBalance = getAccBalance(prId) | |
709 | - | let $ | |
708 | + | let $t02822428686 = if ((txId == "")) | |
710 | 709 | then $Tuple2(amBalance, prBalance) | |
711 | 710 | else if ((pmtAssetId == amId)) | |
712 | 711 | then if ((pmtAmtRaw > amBalance)) | |
713 | 712 | then throw("invalid payment amount") | |
714 | 713 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
715 | 714 | else if ((pmtAssetId == prId)) | |
716 | 715 | then if ((pmtAmtRaw > prBalance)) | |
717 | 716 | then throw("invalid payment amount") | |
718 | 717 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
719 | 718 | else throw("wrong pmtAssetId") | |
720 | - | let amBalanceOld = $ | |
721 | - | let prBalanceOld = $ | |
722 | - | let $ | |
719 | + | let amBalanceOld = $t02822428686._1 | |
720 | + | let prBalanceOld = $t02822428686._2 | |
721 | + | let $t02869228868 = if ((pmtAssetId == amId)) | |
723 | 722 | then $Tuple2(pmtAmtRaw, 0) | |
724 | 723 | else if ((pmtAssetId == prId)) | |
725 | 724 | then $Tuple2(0, pmtAmtRaw) | |
726 | 725 | else throw("invalid payment") | |
727 | - | let amAmountRaw = $ | |
728 | - | let prAmountRaw = $ | |
729 | - | let $ | |
726 | + | let amAmountRaw = $t02869228868._1 | |
727 | + | let prAmountRaw = $t02869228868._2 | |
728 | + | let $t02887229126 = if (withTakeFee) | |
730 | 729 | then $Tuple3(takeFee(amAmountRaw, inFee)._1, takeFee(prAmountRaw, inFee)._1, takeFee(pmtAmtRaw, inFee)._2) | |
731 | 730 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
732 | - | let amAmount = $ | |
733 | - | let prAmount = $ | |
734 | - | let feeAmount = $ | |
731 | + | let amAmount = $t02887229126._1 | |
732 | + | let prAmount = $t02887229126._2 | |
733 | + | let feeAmount = $t02887229126._3 | |
735 | 734 | let amBalanceNew = (amBalanceOld + amAmount) | |
736 | 735 | let prBalanceNew = (prBalanceOld + prAmount) | |
737 | 736 | let D0 = getD([t1(amBalanceOld, cfgAmountAssetDecimals), t1(prBalanceOld, cfgPriceAssetDecimals)]) | |
738 | 737 | let D1 = getD([t1(amBalanceNew, cfgAmountAssetDecimals), t1(prBalanceNew, cfgPriceAssetDecimals)]) | |
739 | 738 | let checkD = if ((D1 > D0)) | |
740 | 739 | then true | |
741 | 740 | else throw() | |
742 | 741 | if ((checkD == checkD)) | |
743 | 742 | then { | |
744 | 743 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR) | |
745 | 744 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
746 | 745 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
747 | 746 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
748 | 747 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
749 | 748 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
750 | 749 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
751 | 750 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
752 | 751 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
753 | 752 | } | |
754 | 753 | else throw("Strict value is not equal to itself.") | |
755 | 754 | } | |
756 | 755 | else throw("Strict value is not equal to itself.") | |
757 | 756 | } | |
758 | 757 | ||
759 | 758 | ||
760 | 759 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
761 | 760 | let lpId = toBase58String(value(cfgLpAssetId)) | |
762 | 761 | let amId = toBase58String(value(cfgAmountAssetId)) | |
763 | 762 | let prId = toBase58String(value(cfgPriceAssetId)) | |
764 | 763 | let amDecimals = cfgAmountAssetDecimals | |
765 | 764 | let prDecimals = cfgPriceAssetDecimals | |
766 | 765 | let poolStatus = cfgPoolStatus | |
767 | 766 | let userAddress = if ((caller == restContract)) | |
768 | 767 | then originCaller | |
769 | 768 | else caller | |
770 | 769 | let pmt = value(payments[0]) | |
771 | 770 | let pmtAssetId = value(pmt.assetId) | |
772 | 771 | let pmtAmt = pmt.amount | |
773 | 772 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
774 | 773 | if ((currentDLp == currentDLp)) | |
775 | 774 | then { | |
776 | 775 | let txId58 = toBase58String(transactionId) | |
777 | 776 | if ((lpId != toBase58String(pmtAssetId))) | |
778 | 777 | then throw("Wrong LP") | |
779 | 778 | else { | |
780 | 779 | let amBalance = getAccBalance(amId) | |
781 | 780 | let prBalance = getAccBalance(prId) | |
782 | - | let $ | |
781 | + | let $t03123831349 = { | |
783 | 782 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
784 | 783 | if ($isInstanceOf(@, "(Int, Int)")) | |
785 | 784 | then @ | |
786 | 785 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
787 | 786 | } | |
788 | - | if (($ | |
787 | + | if (($t03123831349 == $t03123831349)) | |
789 | 788 | then { | |
790 | - | let feeAmount = $ | |
791 | - | let totalGet = $ | |
789 | + | let feeAmount = $t03123831349._2 | |
790 | + | let totalGet = $t03123831349._1 | |
792 | 791 | let totalAmount = if (if ((minOutAmount > 0)) | |
793 | 792 | then (minOutAmount > totalGet) | |
794 | 793 | else false) | |
795 | 794 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
796 | 795 | else totalGet | |
797 | - | let $ | |
796 | + | let $t03153931846 = if ((outAssetId == amId)) | |
798 | 797 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
799 | 798 | else if ((outAssetId == prId)) | |
800 | 799 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
801 | 800 | else throw("invalid out asset id") | |
802 | - | let outAm = $ | |
803 | - | let outPr = $ | |
804 | - | let amBalanceNew = $ | |
805 | - | let prBalanceNew = $ | |
801 | + | let outAm = $t03153931846._1 | |
802 | + | let outPr = $t03153931846._2 | |
803 | + | let amBalanceNew = $t03153931846._3 | |
804 | + | let prBalanceNew = $t03153931846._4 | |
806 | 805 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
807 | 806 | let curPr = f1(curPrX18, scale8) | |
808 | 807 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
809 | 808 | then unit | |
810 | 809 | else fromBase58String(outAssetId) | |
811 | 810 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
812 | 811 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
813 | 812 | else nil | |
814 | 813 | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
815 | 814 | if ((state == state)) | |
816 | 815 | then { | |
817 | 816 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
818 | 817 | if ((burn == burn)) | |
819 | 818 | then { | |
820 | - | let $ | |
819 | + | let $t03263132981 = { | |
821 | 820 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
822 | 821 | then 0 | |
823 | 822 | else feeAmount | |
824 | 823 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
825 | 824 | then true | |
826 | 825 | else false | |
827 | 826 | if (outInAmountAsset) | |
828 | 827 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
829 | 828 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
830 | 829 | } | |
831 | - | let amountAssetBalanceDelta = $ | |
832 | - | let priceAssetBalanceDelta = $ | |
833 | - | let $ | |
834 | - | let refreshDLpActions = $ | |
835 | - | let updatedDLp = $ | |
830 | + | let amountAssetBalanceDelta = $t03263132981._1 | |
831 | + | let priceAssetBalanceDelta = $t03263132981._2 | |
832 | + | let $t03298433092 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
833 | + | let refreshDLpActions = $t03298433092._1 | |
834 | + | let updatedDLp = $t03298433092._2 | |
836 | 835 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
837 | 836 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
838 | 837 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
839 | 838 | else throw("Strict value is not equal to itself.") | |
840 | 839 | } | |
841 | 840 | else throw("Strict value is not equal to itself.") | |
842 | 841 | } | |
843 | 842 | else throw("Strict value is not equal to itself.") | |
844 | 843 | } | |
845 | 844 | else throw("Strict value is not equal to itself.") | |
846 | 845 | } | |
847 | 846 | } | |
848 | 847 | else throw("Strict value is not equal to itself.") | |
849 | 848 | } | |
850 | 849 | ||
851 | 850 | ||
852 | 851 | func m () = match getString(mpk()) { | |
853 | 852 | case s: String => | |
854 | 853 | fromBase58String(s) | |
855 | 854 | case _: Unit => | |
856 | 855 | unit | |
857 | 856 | case _ => | |
858 | 857 | throw("Match error") | |
859 | 858 | } | |
860 | 859 | ||
861 | 860 | ||
862 | 861 | func pm () = match getString(pmpk()) { | |
863 | 862 | case s: String => | |
864 | 863 | fromBase58String(s) | |
865 | 864 | case _: Unit => | |
866 | 865 | unit | |
867 | 866 | case _ => | |
868 | 867 | throw("Match error") | |
869 | 868 | } | |
870 | 869 | ||
871 | 870 | ||
872 | 871 | let pd = throw("Permission denied") | |
873 | 872 | ||
874 | 873 | func isManager (i) = match m() { | |
875 | 874 | case pk: ByteVector => | |
876 | 875 | (i.callerPublicKey == pk) | |
877 | 876 | case _: Unit => | |
878 | 877 | (i.caller == this) | |
879 | 878 | case _ => | |
880 | 879 | throw("Match error") | |
881 | 880 | } | |
882 | 881 | ||
883 | 882 | ||
884 | 883 | func mm (i) = match m() { | |
885 | 884 | case pk: ByteVector => | |
886 | 885 | if ((i.callerPublicKey == pk)) | |
887 | 886 | then true | |
888 | 887 | else pd | |
889 | 888 | case _: Unit => | |
890 | 889 | if ((i.caller == this)) | |
891 | 890 | then true | |
892 | 891 | else pd | |
893 | 892 | case _ => | |
894 | 893 | throw("Match error") | |
895 | 894 | } | |
896 | 895 | ||
897 | 896 | ||
898 | 897 | func getY (isReverse,D,poolAmountInBalance) = { | |
899 | 898 | let poolConfig = gpc() | |
900 | 899 | let amId = poolConfig[idxAmAsId] | |
901 | 900 | let prId = poolConfig[idxPrAsId] | |
902 | 901 | let n = big2 | |
903 | 902 | let aPrecision = parseBigIntValue(Amult) | |
904 | 903 | let a = (parseBigIntValue(A) * aPrecision) | |
905 | 904 | let xp = if ((isReverse == false)) | |
906 | 905 | then [(toBigInt(getAccBalance(amId)) + poolAmountInBalance), toBigInt(getAccBalance(prId))] | |
907 | 906 | else [(toBigInt(getAccBalance(prId)) + poolAmountInBalance), toBigInt(getAccBalance(amId))] | |
908 | 907 | let x = xp[0] | |
909 | 908 | let s = x | |
910 | 909 | let ann = (a * n) | |
911 | 910 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
912 | 911 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
913 | 912 | func calc (acc,cur) = { | |
914 | - | let $ | |
915 | - | let y = $ | |
916 | - | let found = $ | |
913 | + | let $t03453934559 = acc | |
914 | + | let y = $t03453934559._1 | |
915 | + | let found = $t03453934559._2 | |
917 | 916 | if ((found != unit)) | |
918 | 917 | then acc | |
919 | 918 | else { | |
920 | 919 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
921 | 920 | let yDiff = absBigInt((yNext - value(y))) | |
922 | 921 | if ((big1 >= yDiff)) | |
923 | 922 | then $Tuple2(yNext, cur) | |
924 | 923 | else $Tuple2(yNext, unit) | |
925 | 924 | } | |
926 | 925 | } | |
927 | 926 | ||
928 | 927 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
929 | - | let $ | |
928 | + | let $t03489034937 = { | |
930 | 929 | let $l = arr | |
931 | 930 | let $s = size($l) | |
932 | 931 | let $acc0 = $Tuple2(D, unit) | |
933 | 932 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
934 | 933 | then $a | |
935 | 934 | else calc($a, $l[$i]) | |
936 | 935 | ||
937 | 936 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
938 | 937 | then $a | |
939 | 938 | else throw("List size exceeds 15") | |
940 | 939 | ||
941 | 940 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
942 | 941 | } | |
943 | - | let y = $ | |
944 | - | let found = $ | |
942 | + | let y = $t03489034937._1 | |
943 | + | let found = $t03489034937._2 | |
945 | 944 | if ((found != unit)) | |
946 | 945 | then y | |
947 | 946 | else throw(("Y calculation error, Y = " + toString(y))) | |
948 | 947 | } | |
949 | 948 | ||
950 | 949 | ||
951 | 950 | func skipOrderValidation () = valueOrElse(getBoolean(fca, keySkipOrderValidation(toString(this))), false) | |
952 | 951 | ||
953 | 952 | ||
954 | 953 | @Callable(i) | |
955 | 954 | func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = { | |
956 | - | let $ | |
955 | + | let $t03528935713 = if ((isReverse == false)) | |
957 | 956 | then { | |
958 | 957 | let assetOut = strf(this, pa()) | |
959 | 958 | let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, aa()))) + toBigInt(cleanAmountIn)) | |
960 | 959 | $Tuple2(assetOut, poolAmountInBalance) | |
961 | 960 | } | |
962 | 961 | else { | |
963 | 962 | let assetOut = strf(this, aa()) | |
964 | 963 | let poolAmountInBalance = (toBigInt(getAccBalance(strf(this, pa()))) + toBigInt(cleanAmountIn)) | |
965 | 964 | $Tuple2(assetOut, poolAmountInBalance) | |
966 | 965 | } | |
967 | - | let assetOut = $ | |
968 | - | let poolAmountInBalance = $ | |
966 | + | let assetOut = $t03528935713._1 | |
967 | + | let poolAmountInBalance = $t03528935713._2 | |
969 | 968 | let poolConfig = gpc() | |
970 | 969 | let amId = poolConfig[idxAmAsId] | |
971 | 970 | let prId = poolConfig[idxPrAsId] | |
972 | 971 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
973 | 972 | let D = getD(xp) | |
974 | 973 | let y = getY(isReverse, D, toBigInt(cleanAmountIn)) | |
975 | 974 | let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1)) | |
976 | 975 | let totalGetRaw = max([0, toInt(dy)]) | |
977 | 976 | let newXp = if ((isReverse == false)) | |
978 | 977 | then [((toBigInt(getAccBalance(amId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)] | |
979 | 978 | else [(toBigInt(getAccBalance(amId)) - dy), ((toBigInt(getAccBalance(prId)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount))] | |
980 | 979 | let newD = getD(newXp) | |
981 | 980 | let checkD = if ((newD >= D)) | |
982 | 981 | then true | |
983 | 982 | else throw(makeString(["new D is fewer error", toString(D), toString(newD)], "__")) | |
984 | 983 | if ((checkD == checkD)) | |
985 | 984 | then $Tuple2(nil, totalGetRaw) | |
986 | 985 | else throw("Strict value is not equal to itself.") | |
987 | 986 | } | |
988 | 987 | ||
989 | 988 | ||
990 | 989 | ||
991 | 990 | @Callable(i) | |
992 | 991 | func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = { | |
993 | 992 | let swapContact = { | |
994 | 993 | let @ = invoke(fca, "getSwapContractREADONLY", nil, nil) | |
995 | 994 | if ($isInstanceOf(@, "String")) | |
996 | 995 | then @ | |
997 | 996 | else throw(($getType(@) + " couldn't be cast to String")) | |
998 | 997 | } | |
999 | 998 | let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn)) | |
1000 | 999 | then true | |
1001 | 1000 | else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact))) | |
1002 | 1001 | then true | |
1003 | 1002 | else throwErr("Permission denied")] | |
1004 | 1003 | if ((checks == checks)) | |
1005 | 1004 | then { | |
1006 | 1005 | let pmt = value(i.payments[0]) | |
1007 | 1006 | let assetIn = assetIdToString(pmt.assetId) | |
1008 | - | let $ | |
1007 | + | let $t03714937543 = if ((isReverse == false)) | |
1009 | 1008 | then { | |
1010 | 1009 | let assetOut = strf(this, pa()) | |
1011 | 1010 | let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount) | |
1012 | 1011 | $Tuple2(assetOut, poolAmountInBalance) | |
1013 | 1012 | } | |
1014 | 1013 | else { | |
1015 | 1014 | let assetOut = strf(this, aa()) | |
1016 | 1015 | let poolAmountInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount) | |
1017 | 1016 | $Tuple2(assetOut, poolAmountInBalance) | |
1018 | 1017 | } | |
1019 | - | let assetOut = $ | |
1020 | - | let poolAmountInBalance = $ | |
1018 | + | let assetOut = $t03714937543._1 | |
1019 | + | let poolAmountInBalance = $t03714937543._2 | |
1021 | 1020 | let poolConfig = gpc() | |
1022 | 1021 | let amId = poolConfig[idxAmAsId] | |
1023 | 1022 | let prId = poolConfig[idxPrAsId] | |
1024 | 1023 | let xp = if ((isReverse == false)) | |
1025 | 1024 | then [(toBigInt(getAccBalance(amId)) - toBigInt(value(i.payments[0]).amount)), toBigInt(getAccBalance(prId))] | |
1026 | 1025 | else [toBigInt(getAccBalance(amId)), (toBigInt(getAccBalance(prId)) - toBigInt(value(i.payments[0]).amount))] | |
1027 | 1026 | let D = getD(xp) | |
1028 | 1027 | let y = getY(isReverse, D, toBigInt(0)) | |
1029 | 1028 | let dy = ((toBigInt(getAccBalance(assetOut)) - y) - toBigInt(1)) | |
1030 | 1029 | let totalGetRaw = max([0, toInt(dy)]) | |
1031 | 1030 | let checkMin = if ((totalGetRaw >= amountOutMin)) | |
1032 | 1031 | then true | |
1033 | 1032 | else throw("Exchange result is fewer coins than expected") | |
1034 | 1033 | if ((checkMin == checkMin)) | |
1035 | 1034 | then { | |
1036 | 1035 | let newXp = if ((isReverse == false)) | |
1037 | 1036 | then [(toBigInt(getAccBalance(amId)) + toBigInt(feePoolAmount)), (toBigInt(getAccBalance(prId)) - dy)] | |
1038 | 1037 | else [(toBigInt(getAccBalance(amId)) - dy), (toBigInt(getAccBalance(prId)) + toBigInt(feePoolAmount))] | |
1039 | 1038 | let newD = getD(newXp) | |
1040 | 1039 | let checkD = if ((newD >= D)) | |
1041 | 1040 | then true | |
1042 | 1041 | else throw("new D is fewer error") | |
1043 | 1042 | if ((checkD == checkD)) | |
1044 | 1043 | then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), totalGetRaw, parseAssetId(assetOut))], totalGetRaw) | |
1045 | 1044 | else throw("Strict value is not equal to itself.") | |
1046 | 1045 | } | |
1047 | 1046 | else throw("Strict value is not equal to itself.") | |
1048 | 1047 | } | |
1049 | 1048 | else throw("Strict value is not equal to itself.") | |
1050 | 1049 | } | |
1051 | 1050 | ||
1052 | 1051 | ||
1053 | 1052 | ||
1054 | 1053 | @Callable(i) | |
1055 | 1054 | func constructor (fc) = { | |
1056 | 1055 | let c = mm(i) | |
1057 | 1056 | if ((c == c)) | |
1058 | 1057 | then [StringEntry(fc(), fc)] | |
1059 | 1058 | else throw("Strict value is not equal to itself.") | |
1060 | 1059 | } | |
1061 | 1060 | ||
1062 | 1061 | ||
1063 | 1062 | ||
1064 | 1063 | @Callable(i) | |
1065 | 1064 | func setManager (pendingManagerPublicKey) = { | |
1066 | 1065 | let c = mm(i) | |
1067 | 1066 | if ((c == c)) | |
1068 | 1067 | then { | |
1069 | 1068 | let cm = fromBase58String(pendingManagerPublicKey) | |
1070 | 1069 | if ((cm == cm)) | |
1071 | 1070 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
1072 | 1071 | else throw("Strict value is not equal to itself.") | |
1073 | 1072 | } | |
1074 | 1073 | else throw("Strict value is not equal to itself.") | |
1075 | 1074 | } | |
1076 | 1075 | ||
1077 | 1076 | ||
1078 | 1077 | ||
1079 | 1078 | @Callable(i) | |
1080 | 1079 | func confirmManager () = { | |
1081 | 1080 | let p = pm() | |
1082 | 1081 | let hpm = if (isDefined(p)) | |
1083 | 1082 | then true | |
1084 | 1083 | else throw("No pending manager") | |
1085 | 1084 | if ((hpm == hpm)) | |
1086 | 1085 | then { | |
1087 | 1086 | let cpm = if ((i.callerPublicKey == value(p))) | |
1088 | 1087 | then true | |
1089 | 1088 | else throw("You are not pending manager") | |
1090 | 1089 | if ((cpm == cpm)) | |
1091 | 1090 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
1092 | 1091 | else throw("Strict value is not equal to itself.") | |
1093 | 1092 | } | |
1094 | 1093 | else throw("Strict value is not equal to itself.") | |
1095 | 1094 | } | |
1096 | 1095 | ||
1097 | 1096 | ||
1098 | 1097 | ||
1099 | 1098 | @Callable(i) | |
1100 | 1099 | func put (slip,autoStake) = { | |
1101 | 1100 | let factCfg = gfc() | |
1102 | 1101 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
1103 | 1102 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
1104 | 1103 | if ((0 > slip)) | |
1105 | 1104 | then throw("Wrong slippage") | |
1106 | 1105 | else if ((size(i.payments) != 2)) | |
1107 | 1106 | then throw("2 pmnts expd") | |
1108 | 1107 | else { | |
1109 | 1108 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1110 | 1109 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1111 | 1110 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
1112 | 1111 | if ((amountAssetBalance == amountAssetBalance)) | |
1113 | 1112 | then { | |
1114 | 1113 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
1115 | 1114 | if ((priceAssetBalance == priceAssetBalance)) | |
1116 | 1115 | then { | |
1117 | 1116 | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
1118 | 1117 | if ((lpAssetEmission == lpAssetEmission)) | |
1119 | 1118 | then { | |
1120 | 1119 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1121 | 1120 | if ((currentDLp == currentDLp)) | |
1122 | 1121 | then { | |
1123 | 1122 | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "") | |
1124 | 1123 | let emitLpAmt = e._2 | |
1125 | 1124 | let lpAssetId = e._7 | |
1126 | 1125 | let state = e._9 | |
1127 | 1126 | let amDiff = e._10 | |
1128 | 1127 | let prDiff = e._11 | |
1129 | 1128 | let amId = e._12 | |
1130 | 1129 | let prId = e._13 | |
1131 | 1130 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
1132 | 1131 | if ((r == r)) | |
1133 | 1132 | then { | |
1134 | 1133 | let el = match r { | |
1135 | 1134 | case legacy: Address => | |
1136 | 1135 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1137 | 1136 | case _ => | |
1138 | 1137 | unit | |
1139 | 1138 | } | |
1140 | 1139 | if ((el == el)) | |
1141 | 1140 | then { | |
1142 | 1141 | let sa = if ((amDiff > 0)) | |
1143 | 1142 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
1144 | 1143 | else nil | |
1145 | 1144 | if ((sa == sa)) | |
1146 | 1145 | then { | |
1147 | 1146 | let sp = if ((prDiff > 0)) | |
1148 | 1147 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
1149 | 1148 | else nil | |
1150 | 1149 | if ((sp == sp)) | |
1151 | 1150 | then { | |
1152 | 1151 | let lpTrnsfr = if (autoStake) | |
1153 | 1152 | then { | |
1154 | 1153 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
1155 | 1154 | if ((ss == ss)) | |
1156 | 1155 | then nil | |
1157 | 1156 | else throw("Strict value is not equal to itself.") | |
1158 | 1157 | } | |
1159 | 1158 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1160 | - | let $ | |
1161 | - | let refreshDLpActions = $ | |
1162 | - | let updatedDLp = $ | |
1159 | + | let $t04216242304 = refreshDLpInternal(0, 0, 0) | |
1160 | + | let refreshDLpActions = $t04216242304._1 | |
1161 | + | let updatedDLp = $t04216242304._2 | |
1163 | 1162 | let check = if ((updatedDLp >= currentDLp)) | |
1164 | 1163 | then true | |
1165 | 1164 | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(amDiff), toString(prDiff)], " ")) | |
1166 | 1165 | if ((check == check)) | |
1167 | 1166 | then { | |
1168 | 1167 | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
1169 | 1168 | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
1170 | 1169 | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1171 | 1170 | else throw("Strict value is not equal to itself.") | |
1172 | 1171 | } | |
1173 | 1172 | else throw("Strict value is not equal to itself.") | |
1174 | 1173 | } | |
1175 | 1174 | else throw("Strict value is not equal to itself.") | |
1176 | 1175 | } | |
1177 | 1176 | else throw("Strict value is not equal to itself.") | |
1178 | 1177 | } | |
1179 | 1178 | else throw("Strict value is not equal to itself.") | |
1180 | 1179 | } | |
1181 | 1180 | else throw("Strict value is not equal to itself.") | |
1182 | 1181 | } | |
1183 | 1182 | else throw("Strict value is not equal to itself.") | |
1184 | 1183 | } | |
1185 | 1184 | else throw("Strict value is not equal to itself.") | |
1186 | 1185 | } | |
1187 | 1186 | else throw("Strict value is not equal to itself.") | |
1188 | 1187 | } | |
1189 | 1188 | else throw("Strict value is not equal to itself.") | |
1190 | 1189 | } | |
1191 | 1190 | } | |
1192 | 1191 | ||
1193 | 1192 | ||
1194 | 1193 | ||
1195 | 1194 | @Callable(i) | |
1196 | 1195 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1197 | 1196 | let isPoolOneTokenOperationsDisabled = { | |
1198 | 1197 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1199 | 1198 | if ($isInstanceOf(@, "Boolean")) | |
1200 | 1199 | then @ | |
1201 | 1200 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1202 | 1201 | } | |
1203 | 1202 | let isPutDisabled = if (if (if (igs()) | |
1204 | 1203 | then true | |
1205 | 1204 | else (cfgPoolStatus == PoolPutDis)) | |
1206 | 1205 | then true | |
1207 | 1206 | else (cfgPoolStatus == PoolShutdown)) | |
1208 | 1207 | then true | |
1209 | 1208 | else isPoolOneTokenOperationsDisabled | |
1210 | 1209 | let checks = [if (if (!(isPutDisabled)) | |
1211 | 1210 | then true | |
1212 | 1211 | else isManager(i)) | |
1213 | 1212 | then true | |
1214 | 1213 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1215 | 1214 | then true | |
1216 | 1215 | else throwErr("exactly 1 payment are expected")] | |
1217 | 1216 | if ((checks == checks)) | |
1218 | 1217 | then { | |
1219 | 1218 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1220 | 1219 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1221 | 1220 | let lpId = cfgLpAssetId | |
1222 | 1221 | let amDecimals = cfgAmountAssetDecimals | |
1223 | 1222 | let prDecimals = cfgPriceAssetDecimals | |
1224 | 1223 | let userAddress = if ((i.caller == this)) | |
1225 | 1224 | then i.originCaller | |
1226 | 1225 | else i.caller | |
1227 | 1226 | let pmt = value(i.payments[0]) | |
1228 | 1227 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1229 | 1228 | let pmtAmt = pmt.amount | |
1230 | 1229 | let currentDLp = if ((pmt.assetId == cfgAmountAssetId)) | |
1231 | 1230 | then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0)) | |
1232 | 1231 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1233 | 1232 | if ((currentDLp == currentDLp)) | |
1234 | 1233 | then { | |
1235 | - | let $ | |
1236 | - | if (($ | |
1234 | + | let $t04394544103 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1235 | + | if (($t04394544103 == $t04394544103)) | |
1237 | 1236 | then { | |
1238 | - | let feeAmount = $ | |
1239 | - | let state = $ | |
1240 | - | let estimLP = $ | |
1237 | + | let feeAmount = $t04394544103._3 | |
1238 | + | let state = $t04394544103._2 | |
1239 | + | let estimLP = $t04394544103._1 | |
1241 | 1240 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1242 | 1241 | then (minOutAmount > estimLP) | |
1243 | 1242 | else false) | |
1244 | 1243 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1245 | 1244 | else estimLP | |
1246 | 1245 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1247 | 1246 | if ((e == e)) | |
1248 | 1247 | then { | |
1249 | 1248 | let el = match e { | |
1250 | 1249 | case legacy: Address => | |
1251 | 1250 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1252 | 1251 | case _ => | |
1253 | 1252 | unit | |
1254 | 1253 | } | |
1255 | 1254 | if ((el == el)) | |
1256 | 1255 | then { | |
1257 | 1256 | let lpTrnsfr = if (autoStake) | |
1258 | 1257 | then { | |
1259 | 1258 | let ss = invoke(stakingContract, "stakeFor", [toString(i.caller)], [AttachedPayment(lpId, emitLpAmt)]) | |
1260 | 1259 | if ((ss == ss)) | |
1261 | 1260 | then nil | |
1262 | 1261 | else throw("Strict value is not equal to itself.") | |
1263 | 1262 | } | |
1264 | 1263 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1265 | 1264 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1266 | 1265 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1267 | 1266 | else nil | |
1268 | - | let $ | |
1267 | + | let $t04498845337 = if ((this == feeCollectorAddress)) | |
1269 | 1268 | then $Tuple2(0, 0) | |
1270 | 1269 | else { | |
1271 | 1270 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1272 | 1271 | then true | |
1273 | 1272 | else false | |
1274 | 1273 | if (paymentInAmountAsset) | |
1275 | 1274 | then $Tuple2(-(feeAmount), 0) | |
1276 | 1275 | else $Tuple2(0, -(feeAmount)) | |
1277 | 1276 | } | |
1278 | - | let amountAssetBalanceDelta = $ | |
1279 | - | let priceAssetBalanceDelta = $ | |
1280 | - | let $ | |
1281 | - | let refreshDLpActions = $ | |
1282 | - | let updatedDLp = $ | |
1277 | + | let amountAssetBalanceDelta = $t04498845337._1 | |
1278 | + | let priceAssetBalanceDelta = $t04498845337._2 | |
1279 | + | let $t04534045448 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1280 | + | let refreshDLpActions = $t04534045448._1 | |
1281 | + | let updatedDLp = $t04534045448._2 | |
1283 | 1282 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1284 | 1283 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1285 | 1284 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1286 | 1285 | else throw("Strict value is not equal to itself.") | |
1287 | 1286 | } | |
1288 | 1287 | else throw("Strict value is not equal to itself.") | |
1289 | 1288 | } | |
1290 | 1289 | else throw("Strict value is not equal to itself.") | |
1291 | 1290 | } | |
1292 | 1291 | else throw("Strict value is not equal to itself.") | |
1293 | 1292 | } | |
1294 | 1293 | else throw("Strict value is not equal to itself.") | |
1295 | 1294 | } | |
1296 | 1295 | else throw("Strict value is not equal to itself.") | |
1297 | 1296 | } | |
1298 | 1297 | ||
1299 | 1298 | ||
1300 | 1299 | ||
1301 | 1300 | @Callable(i) | |
1302 | 1301 | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1303 | 1302 | then throw("Wrong slpg") | |
1304 | 1303 | else if ((size(i.payments) != 2)) | |
1305 | 1304 | then throw("2 pmnts expd") | |
1306 | 1305 | else { | |
1307 | 1306 | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
1308 | 1307 | let state = estPut._9 | |
1309 | 1308 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1310 | 1309 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1311 | 1310 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1312 | 1311 | if ((currentDLp == currentDLp)) | |
1313 | 1312 | then { | |
1314 | - | let $ | |
1315 | - | let refreshDLpActions = $ | |
1316 | - | let updatedDLp = $ | |
1313 | + | let $t04647846543 = refreshDLpInternal(0, 0, 0) | |
1314 | + | let refreshDLpActions = $t04647846543._1 | |
1315 | + | let updatedDLp = $t04647846543._2 | |
1317 | 1316 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1318 | 1317 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1319 | 1318 | then (state ++ refreshDLpActions) | |
1320 | 1319 | else throw("Strict value is not equal to itself.") | |
1321 | 1320 | } | |
1322 | 1321 | else throw("Strict value is not equal to itself.") | |
1323 | 1322 | } | |
1324 | 1323 | ||
1325 | 1324 | ||
1326 | 1325 | ||
1327 | 1326 | @Callable(i) | |
1328 | 1327 | func get () = { | |
1329 | 1328 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1330 | 1329 | if ((currentDLp == currentDLp)) | |
1331 | 1330 | then { | |
1332 | 1331 | let r = cg(i) | |
1333 | 1332 | let outAmtAmt = r._1 | |
1334 | 1333 | let outPrAmt = r._2 | |
1335 | 1334 | let pmtAmt = r._3 | |
1336 | 1335 | let pmtAssetId = r._4 | |
1337 | 1336 | let state = r._5 | |
1338 | 1337 | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1339 | 1338 | if ((b == b)) | |
1340 | 1339 | then { | |
1341 | - | let $ | |
1342 | - | let refreshDLpActions = $ | |
1343 | - | let updatedDLp = $ | |
1340 | + | let $t04771647798 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1341 | + | let refreshDLpActions = $t04771647798._1 | |
1342 | + | let updatedDLp = $t04771647798._2 | |
1344 | 1343 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1345 | 1344 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1346 | 1345 | then (state ++ refreshDLpActions) | |
1347 | 1346 | else throw("Strict value is not equal to itself.") | |
1348 | 1347 | } | |
1349 | 1348 | else throw("Strict value is not equal to itself.") | |
1350 | 1349 | } | |
1351 | 1350 | else throw("Strict value is not equal to itself.") | |
1352 | 1351 | } | |
1353 | 1352 | ||
1354 | 1353 | ||
1355 | 1354 | ||
1356 | 1355 | @Callable(i) | |
1357 | 1356 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1358 | 1357 | let isPoolOneTokenOperationsDisabled = { | |
1359 | 1358 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1360 | 1359 | if ($isInstanceOf(@, "Boolean")) | |
1361 | 1360 | then @ | |
1362 | 1361 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1363 | 1362 | } | |
1364 | 1363 | let isGetDisabled = if (if (igs()) | |
1365 | 1364 | then true | |
1366 | 1365 | else (cfgPoolStatus == PoolShutdown)) | |
1367 | 1366 | then true | |
1368 | 1367 | else isPoolOneTokenOperationsDisabled | |
1369 | 1368 | let checks = [if (if (!(isGetDisabled)) | |
1370 | 1369 | then true | |
1371 | 1370 | else isManager(i)) | |
1372 | 1371 | then true | |
1373 | 1372 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1374 | 1373 | then true | |
1375 | 1374 | else throwErr("exactly 1 payment are expected")] | |
1376 | 1375 | if ((checks == checks)) | |
1377 | 1376 | then { | |
1378 | - | let $ | |
1379 | - | let state = $ | |
1380 | - | let totalAmount = $ | |
1377 | + | let $t04841648571 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1378 | + | let state = $t04841648571._1 | |
1379 | + | let totalAmount = $t04841648571._2 | |
1381 | 1380 | $Tuple2(state, totalAmount) | |
1382 | 1381 | } | |
1383 | 1382 | else throw("Strict value is not equal to itself.") | |
1384 | 1383 | } | |
1385 | 1384 | ||
1386 | 1385 | ||
1387 | 1386 | ||
1388 | 1387 | @Callable(i) | |
1389 | 1388 | func refreshDLp () = { | |
1390 | 1389 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1391 | 1390 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1392 | 1391 | then unit | |
1393 | 1392 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1394 | 1393 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1395 | 1394 | then { | |
1396 | 1395 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1397 | - | let $ | |
1398 | - | let dLpUpdateActions = $ | |
1399 | - | let updatedDLp = $ | |
1396 | + | let $t04909549159 = refreshDLpInternal(0, 0, 0) | |
1397 | + | let dLpUpdateActions = $t04909549159._1 | |
1398 | + | let updatedDLp = $t04909549159._2 | |
1400 | 1399 | let actions = if ((dLp != updatedDLp)) | |
1401 | 1400 | then dLpUpdateActions | |
1402 | 1401 | else throwErr("nothing to refresh") | |
1403 | 1402 | $Tuple2(actions, toString(updatedDLp)) | |
1404 | 1403 | } | |
1405 | 1404 | else throw("Strict value is not equal to itself.") | |
1406 | 1405 | } | |
1407 | 1406 | ||
1408 | 1407 | ||
1409 | 1408 | ||
1410 | 1409 | @Callable(i) | |
1411 | 1410 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1412 | 1411 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1413 | 1412 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1414 | 1413 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1415 | 1414 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1416 | 1415 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1417 | 1416 | let D0 = getD(xp) | |
1418 | 1417 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1419 | 1418 | let index = if ((outAssetId == amId)) | |
1420 | 1419 | then 0 | |
1421 | 1420 | else if ((outAssetId == prId)) | |
1422 | 1421 | then 1 | |
1423 | 1422 | else throw("invalid out asset id") | |
1424 | 1423 | let newY = getYD(xp, index, D1) | |
1425 | 1424 | let dy = (xp[index] - newY) | |
1426 | 1425 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1427 | - | let $ | |
1428 | - | let totalGet = $ | |
1429 | - | let feeAmount = $ | |
1426 | + | let $t05016950224 = takeFee(totalGetRaw, outFee) | |
1427 | + | let totalGet = $t05016950224._1 | |
1428 | + | let feeAmount = $t05016950224._2 | |
1430 | 1429 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1431 | 1430 | } | |
1432 | 1431 | ||
1433 | 1432 | ||
1434 | 1433 | ||
1435 | 1434 | @Callable(i) | |
1436 | 1435 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1437 | 1436 | let amId = toBase58String(value(cfgAmountAssetId)) | |
1438 | 1437 | let prId = toBase58String(value(cfgPriceAssetId)) | |
1439 | 1438 | let lpId = toBase58String(value(cfgLpAssetId)) | |
1440 | 1439 | let amBalance = getAccBalance(amId) | |
1441 | 1440 | let prBalance = getAccBalance(prId) | |
1442 | - | let $ | |
1441 | + | let $t05059950714 = { | |
1443 | 1442 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1444 | 1443 | if ($isInstanceOf(@, "(Int, Int)")) | |
1445 | 1444 | then @ | |
1446 | 1445 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1447 | 1446 | } | |
1448 | - | let totalGet = $ | |
1449 | - | let feeAmount = $ | |
1447 | + | let totalGet = $t05059950714._1 | |
1448 | + | let feeAmount = $t05059950714._2 | |
1450 | 1449 | let r = ego("", lpId, lpAssetAmount, this) | |
1451 | 1450 | let outAmAmt = r._1 | |
1452 | 1451 | let outPrAmt = r._2 | |
1453 | 1452 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1454 | 1453 | let bonus = if ((sumOfGetAssets == 0)) | |
1455 | 1454 | then if ((totalGet == 0)) | |
1456 | 1455 | then 0 | |
1457 | 1456 | else throw("bonus calculation error") | |
1458 | 1457 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1459 | 1458 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1460 | 1459 | } | |
1461 | 1460 | ||
1462 | 1461 | ||
1463 | 1462 | ||
1464 | 1463 | @Callable(i) | |
1465 | 1464 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1466 | 1465 | let r = cg(i) | |
1467 | 1466 | let outAmAmt = r._1 | |
1468 | 1467 | let outPrAmt = r._2 | |
1469 | 1468 | let pmtAmt = r._3 | |
1470 | 1469 | let pmtAssetId = r._4 | |
1471 | 1470 | let state = r._5 | |
1472 | 1471 | if ((noLessThenAmtAsset > outAmAmt)) | |
1473 | 1472 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1474 | 1473 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1475 | 1474 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1476 | 1475 | else { | |
1477 | 1476 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1478 | 1477 | if ((currentDLp == currentDLp)) | |
1479 | 1478 | then { | |
1480 | 1479 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1481 | 1480 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1482 | 1481 | then { | |
1483 | - | let $ | |
1484 | - | let refreshDLpActions = $ | |
1485 | - | let updatedDLp = $ | |
1482 | + | let $t05188051961 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1483 | + | let refreshDLpActions = $t05188051961._1 | |
1484 | + | let updatedDLp = $t05188051961._2 | |
1486 | 1485 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1487 | 1486 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1488 | 1487 | then (state ++ refreshDLpActions) | |
1489 | 1488 | else throw("Strict value is not equal to itself.") | |
1490 | 1489 | } | |
1491 | 1490 | else throw("Strict value is not equal to itself.") | |
1492 | 1491 | } | |
1493 | 1492 | else throw("Strict value is not equal to itself.") | |
1494 | 1493 | } | |
1495 | 1494 | } | |
1496 | 1495 | ||
1497 | 1496 | ||
1498 | 1497 | ||
1499 | 1498 | @Callable(i) | |
1500 | 1499 | func unstakeAndGet (amount) = { | |
1501 | 1500 | let checkPayments = if ((size(i.payments) != 0)) | |
1502 | 1501 | then throw("No pmnts expd") | |
1503 | 1502 | else true | |
1504 | 1503 | if ((checkPayments == checkPayments)) | |
1505 | 1504 | then { | |
1506 | 1505 | let factoryCfg = gfc() | |
1507 | 1506 | let lpAssetId = cfgLpAssetId | |
1508 | 1507 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1509 | 1508 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1510 | 1509 | if ((currentDLp == currentDLp)) | |
1511 | 1510 | then { | |
1512 | 1511 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1513 | 1512 | if ((unstakeInv == unstakeInv)) | |
1514 | 1513 | then { | |
1515 | 1514 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1516 | 1515 | let outAmAmt = r._1 | |
1517 | 1516 | let outPrAmt = r._2 | |
1518 | 1517 | let sts = parseIntValue(r._9) | |
1519 | 1518 | let state = r._10 | |
1520 | 1519 | let v = if (if (igs()) | |
1521 | 1520 | then true | |
1522 | 1521 | else (sts == PoolShutdown)) | |
1523 | 1522 | then throw(("Blocked: " + toString(sts))) | |
1524 | 1523 | else true | |
1525 | 1524 | if ((v == v)) | |
1526 | 1525 | then { | |
1527 | 1526 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1528 | 1527 | if ((burnA == burnA)) | |
1529 | 1528 | then { | |
1530 | - | let $ | |
1531 | - | let refreshDLpActions = $ | |
1532 | - | let updatedDLp = $ | |
1529 | + | let $t05298853069 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1530 | + | let refreshDLpActions = $t05298853069._1 | |
1531 | + | let updatedDLp = $t05298853069._2 | |
1533 | 1532 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1534 | 1533 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1535 | 1534 | then (state ++ refreshDLpActions) | |
1536 | 1535 | else throw("Strict value is not equal to itself.") | |
1537 | 1536 | } | |
1538 | 1537 | else throw("Strict value is not equal to itself.") | |
1539 | 1538 | } | |
1540 | 1539 | else throw("Strict value is not equal to itself.") | |
1541 | 1540 | } | |
1542 | 1541 | else throw("Strict value is not equal to itself.") | |
1543 | 1542 | } | |
1544 | 1543 | else throw("Strict value is not equal to itself.") | |
1545 | 1544 | } | |
1546 | 1545 | else throw("Strict value is not equal to itself.") | |
1547 | 1546 | } | |
1548 | 1547 | ||
1549 | 1548 | ||
1550 | 1549 | ||
1551 | 1550 | @Callable(i) | |
1552 | 1551 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1553 | 1552 | let isGetDisabled = if (igs()) | |
1554 | 1553 | then true | |
1555 | 1554 | else (cfgPoolStatus == PoolShutdown) | |
1556 | 1555 | let checks = [if (!(isGetDisabled)) | |
1557 | 1556 | then true | |
1558 | 1557 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1559 | 1558 | then true | |
1560 | 1559 | else throw("no payments are expected")] | |
1561 | 1560 | if ((checks == checks)) | |
1562 | 1561 | then { | |
1563 | 1562 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1564 | 1563 | if ((currentDLp == currentDLp)) | |
1565 | 1564 | then { | |
1566 | 1565 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1567 | 1566 | if ((unstakeInv == unstakeInv)) | |
1568 | 1567 | then { | |
1569 | 1568 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1570 | 1569 | let outAmAmt = res._1 | |
1571 | 1570 | let outPrAmt = res._2 | |
1572 | 1571 | let state = res._10 | |
1573 | 1572 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1574 | 1573 | then true | |
1575 | 1574 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1576 | 1575 | then true | |
1577 | 1576 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1578 | 1577 | if ((checkAmounts == checkAmounts)) | |
1579 | 1578 | then { | |
1580 | 1579 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1581 | 1580 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1582 | 1581 | then { | |
1583 | - | let $ | |
1584 | - | let refreshDLpActions = $ | |
1585 | - | let updatedDLp = $ | |
1582 | + | let $t05432054401 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1583 | + | let refreshDLpActions = $t05432054401._1 | |
1584 | + | let updatedDLp = $t05432054401._2 | |
1586 | 1585 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1587 | 1586 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1588 | 1587 | then (state ++ refreshDLpActions) | |
1589 | 1588 | else throw("Strict value is not equal to itself.") | |
1590 | 1589 | } | |
1591 | 1590 | else throw("Strict value is not equal to itself.") | |
1592 | 1591 | } | |
1593 | 1592 | else throw("Strict value is not equal to itself.") | |
1594 | 1593 | } | |
1595 | 1594 | else throw("Strict value is not equal to itself.") | |
1596 | 1595 | } | |
1597 | 1596 | else throw("Strict value is not equal to itself.") | |
1598 | 1597 | } | |
1599 | 1598 | else throw("Strict value is not equal to itself.") | |
1600 | 1599 | } | |
1601 | 1600 | ||
1602 | 1601 | ||
1603 | 1602 | ||
1604 | 1603 | @Callable(i) | |
1605 | 1604 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1606 | 1605 | let isPoolOneTokenOperationsDisabled = { | |
1607 | 1606 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1608 | 1607 | if ($isInstanceOf(@, "Boolean")) | |
1609 | 1608 | then @ | |
1610 | 1609 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1611 | 1610 | } | |
1612 | 1611 | let isGetDisabled = if (if (igs()) | |
1613 | 1612 | then true | |
1614 | 1613 | else (cfgPoolStatus == PoolShutdown)) | |
1615 | 1614 | then true | |
1616 | 1615 | else isPoolOneTokenOperationsDisabled | |
1617 | 1616 | let checks = [if (if (!(isGetDisabled)) | |
1618 | 1617 | then true | |
1619 | 1618 | else isManager(i)) | |
1620 | 1619 | then true | |
1621 | 1620 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1622 | 1621 | then true | |
1623 | 1622 | else throwErr("no payments are expected")] | |
1624 | 1623 | if ((checks == checks)) | |
1625 | 1624 | then { | |
1626 | 1625 | let factoryCfg = gfc() | |
1627 | 1626 | let lpAssetId = cfgLpAssetId | |
1628 | 1627 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1629 | 1628 | let userAddress = i.caller | |
1630 | 1629 | let lpAssetRecipientAddress = this | |
1631 | 1630 | let unstakeInv = invoke(staking, "unstakeINTERNAL", [lpAssetId, unstakeAmount, userAddress.bytes, lpAssetRecipientAddress.bytes], nil) | |
1632 | 1631 | if ((unstakeInv == unstakeInv)) | |
1633 | 1632 | then { | |
1634 | - | let $ | |
1635 | - | let state = $ | |
1636 | - | let totalAmount = $ | |
1633 | + | let $t05542355611 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1634 | + | let state = $t05542355611._1 | |
1635 | + | let totalAmount = $t05542355611._2 | |
1637 | 1636 | $Tuple2(state, totalAmount) | |
1638 | 1637 | } | |
1639 | 1638 | else throw("Strict value is not equal to itself.") | |
1640 | 1639 | } | |
1641 | 1640 | else throw("Strict value is not equal to itself.") | |
1642 | 1641 | } | |
1643 | 1642 | ||
1644 | 1643 | ||
1645 | 1644 | ||
1646 | 1645 | @Callable(i) | |
1647 | 1646 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1648 | - | let $ | |
1649 | - | let lpAmount = $ | |
1650 | - | let state = $ | |
1651 | - | let feeAmount = $ | |
1652 | - | let bonus = $ | |
1647 | + | let $t05573955842 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1648 | + | let lpAmount = $t05573955842._1 | |
1649 | + | let state = $t05573955842._2 | |
1650 | + | let feeAmount = $t05573955842._3 | |
1651 | + | let bonus = $t05573955842._4 | |
1653 | 1652 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1654 | 1653 | } | |
1655 | 1654 | ||
1656 | 1655 | ||
1657 | 1656 | ||
1658 | 1657 | @Callable(i) | |
1659 | 1658 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1660 | - | let $ | |
1661 | - | let lpAmount = $ | |
1662 | - | let state = $ | |
1663 | - | let feeAmount = $ | |
1664 | - | let bonus = $ | |
1659 | + | let $t05599056094 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1660 | + | let lpAmount = $t05599056094._1 | |
1661 | + | let state = $t05599056094._2 | |
1662 | + | let feeAmount = $t05599056094._3 | |
1663 | + | let bonus = $t05599056094._4 | |
1665 | 1664 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1666 | 1665 | } | |
1667 | 1666 | ||
1668 | 1667 | ||
1669 | 1668 | ||
1670 | 1669 | @Callable(i) | |
1671 | 1670 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1672 | 1671 | then throw("denied") | |
1673 | 1672 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1674 | - | ||
1675 | - | ||
1676 | - | ||
1677 | - | @Callable(i) | |
1678 | - | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1679 | - | then pd | |
1680 | - | else [StringEntry(k, v)] | |
1681 | - | ||
1682 | - | ||
1683 | - | ||
1684 | - | @Callable(i) | |
1685 | - | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1686 | - | then pd | |
1687 | - | else [IntegerEntry(k, v)] | |
1688 | 1673 | ||
1689 | 1674 | ||
1690 | 1675 | ||
1691 | 1676 | @Callable(i) | |
1692 | 1677 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1693 | 1678 | ||
1694 | 1679 | ||
1695 | 1680 | ||
1696 | 1681 | @Callable(i) | |
1697 | 1682 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1698 | 1683 | ||
1699 | 1684 | ||
1700 | 1685 | ||
1701 | 1686 | @Callable(i) | |
1702 | 1687 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1703 | 1688 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1704 | 1689 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1705 | 1690 | } | |
1706 | 1691 | ||
1707 | 1692 | ||
1708 | 1693 | ||
1709 | 1694 | @Callable(i) | |
1710 | 1695 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1711 | 1696 | ||
1712 | 1697 | ||
1713 | 1698 | ||
1714 | 1699 | @Callable(i) | |
1715 | 1700 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1716 | 1701 | ||
1717 | 1702 | ||
1718 | 1703 | ||
1719 | 1704 | @Callable(i) | |
1720 | 1705 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1721 | 1706 | ||
1722 | 1707 | ||
1723 | 1708 | ||
1724 | 1709 | @Callable(i) | |
1725 | 1710 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1726 | 1711 | ||
1727 | 1712 | ||
1728 | 1713 | ||
1729 | 1714 | @Callable(i) | |
1730 | 1715 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1731 | 1716 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1732 | 1717 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1733 | 1718 | } | |
1734 | 1719 | ||
1735 | 1720 | ||
1736 | 1721 | ||
1737 | 1722 | @Callable(i) | |
1738 | 1723 | func changeAmp () = { | |
1739 | 1724 | let cfg = invoke(fca, "getChangeAmpConfigREADONLY", [toString(this)], nil) | |
1740 | - | let $ | |
1725 | + | let $t05844858647 = match cfg { | |
1741 | 1726 | case list: List[Any] => | |
1742 | 1727 | $Tuple3({ | |
1743 | 1728 | let @ = list[0] | |
1744 | 1729 | if ($isInstanceOf(@, "Int")) | |
1745 | 1730 | then @ | |
1746 | 1731 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1747 | 1732 | }, { | |
1748 | 1733 | let @ = list[1] | |
1749 | 1734 | if ($isInstanceOf(@, "Int")) | |
1750 | 1735 | then @ | |
1751 | 1736 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1752 | 1737 | }, { | |
1753 | 1738 | let @ = list[2] | |
1754 | 1739 | if ($isInstanceOf(@, "Int")) | |
1755 | 1740 | then @ | |
1756 | 1741 | else throw(($getType(@) + " couldn't be cast to Int")) | |
1757 | 1742 | }) | |
1758 | 1743 | case _ => | |
1759 | 1744 | throwErr("invalid entry type") | |
1760 | 1745 | } | |
1761 | - | let delay = $ | |
1762 | - | let delta = $ | |
1763 | - | let target = $ | |
1746 | + | let delay = $t05844858647._1 | |
1747 | + | let delta = $t05844858647._2 | |
1748 | + | let target = $t05844858647._3 | |
1764 | 1749 | let curAmp = parseIntValue(getStringValue(amp())) | |
1765 | 1750 | let newAmpRaw = (curAmp + delta) | |
1766 | 1751 | let newAmp = if ((0 > delta)) | |
1767 | 1752 | then if ((target > newAmpRaw)) | |
1768 | 1753 | then target | |
1769 | 1754 | else newAmpRaw | |
1770 | 1755 | else if ((newAmpRaw > target)) | |
1771 | 1756 | then target | |
1772 | 1757 | else newAmpRaw | |
1773 | 1758 | let lastCall = valueOrElse(getInteger(keyChangeAmpLastCall()), 0) | |
1774 | 1759 | let wait = (lastCall + delay) | |
1775 | 1760 | let checks = [if ((height > wait)) | |
1776 | 1761 | then true | |
1777 | 1762 | else throwErr("try again in few blocks"), if ((curAmp != newAmp)) | |
1778 | 1763 | then true | |
1779 | 1764 | else throwErr("already reached target")] | |
1780 | 1765 | if ((checks == checks)) | |
1781 | 1766 | then [IntegerEntry(keyChangeAmpLastCall(), height), StringEntry(amp(), toString(newAmp)), StringEntry(keyAmpHistory(height), toString(newAmp))] | |
1782 | 1767 | else throw("Strict value is not equal to itself.") | |
1783 | 1768 | } | |
1784 | 1769 | ||
1785 | 1770 | ||
1786 | 1771 | @Verifier(tx) | |
1787 | 1772 | func verify () = { | |
1788 | 1773 | let targetPublicKey = match m() { | |
1789 | 1774 | case pk: ByteVector => | |
1790 | 1775 | pk | |
1791 | 1776 | case _: Unit => | |
1792 | 1777 | tx.senderPublicKey | |
1793 | 1778 | case _ => | |
1794 | 1779 | throw("Match error") | |
1795 | 1780 | } | |
1796 | 1781 | match tx { | |
1797 | 1782 | case order: Order => | |
1798 | 1783 | let matcherPub = mp() | |
1799 | - | let $ | |
1784 | + | let $t05955959676 = if (skipOrderValidation()) | |
1800 | 1785 | then $Tuple2(true, "") | |
1801 | 1786 | else validateMatcherOrderAllowed(order) | |
1802 | - | let orderValid = $ | |
1803 | - | let orderValidInfo = $ | |
1787 | + | let orderValid = $t05955959676._1 | |
1788 | + | let orderValidInfo = $t05955959676._2 | |
1804 | 1789 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1805 | 1790 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1806 | 1791 | if (if (if (orderValid) | |
1807 | 1792 | then senderValid | |
1808 | 1793 | else false) | |
1809 | 1794 | then matcherValid | |
1810 | 1795 | else false) | |
1811 | 1796 | then true | |
1812 | 1797 | else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid) | |
1813 | 1798 | case s: SetScriptTransaction => | |
1814 | 1799 | if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)) | |
1815 | 1800 | then true | |
1816 | 1801 | else { | |
1817 | 1802 | let newHash = blake2b256(value(s.script)) | |
1818 | 1803 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1819 | 1804 | let currentHash = scriptHash(this) | |
1820 | 1805 | if ((allowedHash == newHash)) | |
1821 | 1806 | then (currentHash != newHash) | |
1822 | 1807 | else false | |
1823 | 1808 | } | |
1824 | 1809 | case _ => | |
1825 | 1810 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1826 | 1811 | } | |
1827 | 1812 | } | |
1828 | 1813 |
github/deemru/w8io/026f985 267.23 ms ◑