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