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