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