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