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