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