tx · 3HzS5zWaowaTuXXM1UgzeTbZ81r8E2LGQWsoqGBe6F7k 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT: -0.03600000 Waves 2023.01.23 13:43 [2417485] smart account 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT > SELF 0.00000000 Waves
{ "type": 13, "id": "3HzS5zWaowaTuXXM1UgzeTbZ81r8E2LGQWsoqGBe6F7k", "fee": 3600000, "feeAssetId": null, "timestamp": 1674470654003, "version": 1, "sender": "3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT", "senderPublicKey": "AYbpHveq7zviKTDV7SGTB1pZGFbkumgfq3jSwVv6BznT", "proofs": [ "ta77YHJPzWZP1QBy2SXGKnjM75XeJLfsdZfZEAxdDpokEuLiQ6rxZQsCEnKdicXpcdp22EAbUs8Ka8mBu8ov1Lx" ], "script": "base64:BgKBLggCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZ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mHF7gVGG8uaTCAQa1ERj3jvRhoVbTPf7MiHuzH Next: C4YHY5zxGuCYdb5ojqVMw9yk96MTYym6HyytEv2oxAVw Diff:
Old | New | Differences | |
---|---|---|---|
449 | 449 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
450 | 450 | then throw("Wrong order assets.") | |
451 | 451 | else { | |
452 | - | let kLp = valueOrErrorMessage(parseBigInt( | |
453 | - | let $ | |
454 | - | let unusedActions = $ | |
455 | - | let kLpNew = $ | |
452 | + | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
453 | + | let $t02197822078 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
454 | + | let unusedActions = $t02197822078._1 | |
455 | + | let kLpNew = $t02197822078._2 | |
456 | 456 | let isOrderValid = (kLpNew >= kLp) | |
457 | 457 | let info = makeString([toString(kLp), toString(kLpNew)], " ") | |
458 | 458 | $Tuple2(isOrderValid, info) | |
531 | 531 | else if ((paymentAssetId == cfgPriceAssetId)) | |
532 | 532 | then false | |
533 | 533 | else throwErr("invalid asset") | |
534 | - | let $ | |
534 | + | let $t02488525178 = if (isEval) | |
535 | 535 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
536 | 536 | else if (paymentInAmountAsset) | |
537 | 537 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
538 | 538 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
539 | - | let amountBalanceOld = $ | |
540 | - | let priceBalanceOld = $ | |
541 | - | let $ | |
539 | + | let amountBalanceOld = $t02488525178._1 | |
540 | + | let priceBalanceOld = $t02488525178._2 | |
541 | + | let $t02518225331 = if (paymentInAmountAsset) | |
542 | 542 | then $Tuple2(paymentAmountRaw, 0) | |
543 | 543 | else $Tuple2(0, paymentAmountRaw) | |
544 | - | let amountAssetAmountRaw = $ | |
545 | - | let priceAssetAmountRaw = $ | |
544 | + | let amountAssetAmountRaw = $t02518225331._1 | |
545 | + | let priceAssetAmountRaw = $t02518225331._2 | |
546 | 546 | let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1 | |
547 | 547 | let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1 | |
548 | - | let $ | |
549 | - | let paymentAmount = $ | |
550 | - | let feeAmount = $ | |
548 | + | let $t02546325527 = takeFee(paymentAmountRaw, inFee) | |
549 | + | let paymentAmount = $t02546325527._1 | |
550 | + | let feeAmount = $t02546325527._2 | |
551 | 551 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
552 | 552 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
553 | 553 | let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals)) | |
570 | 570 | let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals)) | |
571 | 571 | let priceOld = fromX18(priceOldX18, scale8) | |
572 | 572 | let loss = { | |
573 | - | let $ | |
573 | + | let $t02720827375 = if (paymentInAmountAsset) | |
574 | 574 | then $Tuple2(amountAssetAmountRaw, amountBalanceOld) | |
575 | 575 | else $Tuple2(priceAssetAmountRaw, priceBalanceOld) | |
576 | - | let amount = $ | |
577 | - | let balance = $ | |
576 | + | let amount = $t02720827375._1 | |
577 | + | let balance = $t02720827375._2 | |
578 | 578 | let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance))) | |
579 | 579 | fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth) | |
580 | 580 | } | |
614 | 614 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
615 | 615 | let redeemedBigInt = toBigInt(paymentAmount) | |
616 | 616 | let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))]) | |
617 | - | let $ | |
618 | - | let totalAmount = $ | |
619 | - | let feeAmount = $ | |
620 | - | let $ | |
617 | + | let $t02945329509 = takeFee(amountRaw, outFee) | |
618 | + | let totalAmount = $t02945329509._1 | |
619 | + | let feeAmount = $t02945329509._2 | |
620 | + | let $t02951329739 = if (outInAmountAsset) | |
621 | 621 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
622 | 622 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
623 | - | let outAmAmount = $ | |
624 | - | let outPrAmount = $ | |
625 | - | let amBalanceNew = $ | |
626 | - | let prBalanceNew = $ | |
623 | + | let outAmAmount = $t02951329739._1 | |
624 | + | let outPrAmount = $t02951329739._2 | |
625 | + | let amBalanceNew = $t02951329739._3 | |
626 | + | let prBalanceNew = $t02951329739._4 | |
627 | 627 | let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals)) | |
628 | 628 | let priceNew = fromX18(priceNewX18, scale8) | |
629 | 629 | let commonState = if (isEval) | |
769 | 769 | else throw("Strict value is not equal to itself.") | |
770 | 770 | } | |
771 | 771 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
772 | - | let $ | |
773 | - | if (($ | |
772 | + | let $t03426734729 = refreshKLpInternal(0, 0, 0) | |
773 | + | if (($t03426734729 == $t03426734729)) | |
774 | 774 | then { | |
775 | - | let updatedKLp = $ | |
776 | - | let refreshKLpActions = $ | |
775 | + | let updatedKLp = $t03426734729._2 | |
776 | + | let refreshKLpActions = $t03426734729._1 | |
777 | 777 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
778 | 778 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
779 | 779 | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
805 | 805 | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
806 | 806 | if ((currentKLp == currentKLp)) | |
807 | 807 | then { | |
808 | - | let $ | |
809 | - | let refreshKLpActions = $ | |
810 | - | let updatedKLp = $ | |
808 | + | let $t03529135356 = refreshKLpInternal(0, 0, 0) | |
809 | + | let refreshKLpActions = $t03529135356._1 | |
810 | + | let updatedKLp = $t03529135356._2 | |
811 | 811 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
812 | 812 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
813 | 813 | then (state ++ refreshKLpActions) | |
854 | 854 | then { | |
855 | 855 | let userAddress = i.caller | |
856 | 856 | let txId = i.transactionId | |
857 | - | let $ | |
858 | - | if (($ | |
857 | + | let $t03654436696 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
858 | + | if (($t03654436696 == $t03654436696)) | |
859 | 859 | then { | |
860 | - | let paymentInAmountAsset = $ | |
861 | - | let bonus = $ | |
862 | - | let feeAmount = $ | |
863 | - | let commonState = $ | |
864 | - | let emitAmountEstimated = $ | |
860 | + | let paymentInAmountAsset = $t03654436696._5 | |
861 | + | let bonus = $t03654436696._4 | |
862 | + | let feeAmount = $t03654436696._3 | |
863 | + | let commonState = $t03654436696._2 | |
864 | + | let emitAmountEstimated = $t03654436696._1 | |
865 | 865 | let emitAmount = if (if ((minOutAmount > 0)) | |
866 | 866 | then (minOutAmount > emitAmountEstimated) | |
867 | 867 | else false) | |
881 | 881 | let sendFee = if ((feeAmount > 0)) | |
882 | 882 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
883 | 883 | else nil | |
884 | - | let $ | |
884 | + | let $t03728237479 = if ((this == feeCollectorAddress)) | |
885 | 885 | then $Tuple2(0, 0) | |
886 | 886 | else if (paymentInAmountAsset) | |
887 | 887 | then $Tuple2(-(feeAmount), 0) | |
888 | 888 | else $Tuple2(0, -(feeAmount)) | |
889 | - | let amountAssetBalanceDelta = $ | |
890 | - | let priceAssetBalanceDelta = $ | |
891 | - | let $ | |
892 | - | let refreshKLpActions = $ | |
893 | - | let updatedKLp = $ | |
889 | + | let amountAssetBalanceDelta = $t03728237479._1 | |
890 | + | let priceAssetBalanceDelta = $t03728237479._2 | |
891 | + | let $t03748237590 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
892 | + | let refreshKLpActions = $t03748237590._1 | |
893 | + | let updatedKLp = $t03748237590._2 | |
894 | 894 | let kLp = value(getString(keyKLp)) | |
895 | 895 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
896 | 896 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
910 | 910 | ||
911 | 911 | @Callable(i) | |
912 | 912 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
913 | - | let $ | |
914 | - | let emitAmountEstimated = $ | |
915 | - | let commonState = $ | |
916 | - | let feeAmount = $ | |
917 | - | let bonus = $ | |
918 | - | let paymentInAmountAsset = $ | |
913 | + | let $t03789638053 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
914 | + | let emitAmountEstimated = $t03789638053._1 | |
915 | + | let commonState = $t03789638053._2 | |
916 | + | let feeAmount = $t03789638053._3 | |
917 | + | let bonus = $t03789638053._4 | |
918 | + | let paymentInAmountAsset = $t03789638053._5 | |
919 | 919 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
920 | 920 | } | |
921 | 921 | ||
952 | 952 | then { | |
953 | 953 | let userAddress = i.caller | |
954 | 954 | let txId = i.transactionId | |
955 | - | let $ | |
956 | - | if (($ | |
955 | + | let $t03893839091 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
956 | + | if (($t03893839091 == $t03893839091)) | |
957 | 957 | then { | |
958 | - | let outInAmountAsset = $ | |
959 | - | let bonus = $ | |
960 | - | let feeAmount = $ | |
961 | - | let commonState = $ | |
962 | - | let amountEstimated = $ | |
958 | + | let outInAmountAsset = $t03893839091._5 | |
959 | + | let bonus = $t03893839091._4 | |
960 | + | let feeAmount = $t03893839091._3 | |
961 | + | let commonState = $t03893839091._2 | |
962 | + | let amountEstimated = $t03893839091._1 | |
963 | 963 | let amount = if (if ((minOutAmount > 0)) | |
964 | 964 | then (minOutAmount > amountEstimated) | |
965 | 965 | else false) | |
972 | 972 | let sendFee = if ((feeAmount > 0)) | |
973 | 973 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
974 | 974 | else nil | |
975 | - | let $ | |
975 | + | let $t03959139838 = { | |
976 | 976 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
977 | 977 | then 0 | |
978 | 978 | else feeAmount | |
980 | 980 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
981 | 981 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
982 | 982 | } | |
983 | - | let amountAssetBalanceDelta = $ | |
984 | - | let priceAssetBalanceDelta = $ | |
985 | - | let $ | |
986 | - | let refreshKLpActions = $ | |
987 | - | let updatedKLp = $ | |
983 | + | let amountAssetBalanceDelta = $t03959139838._1 | |
984 | + | let priceAssetBalanceDelta = $t03959139838._2 | |
985 | + | let $t03984139949 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
986 | + | let refreshKLpActions = $t03984139949._1 | |
987 | + | let updatedKLp = $t03984139949._2 | |
988 | 988 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
989 | 989 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
990 | 990 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
1003 | 1003 | ||
1004 | 1004 | @Callable(i) | |
1005 | 1005 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
1006 | - | let $ | |
1007 | - | let amountEstimated = $ | |
1008 | - | let commonState = $ | |
1009 | - | let feeAmount = $ | |
1010 | - | let bonus = $ | |
1011 | - | let outInAmountAsset = $ | |
1006 | + | let $t04020640362 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
1007 | + | let amountEstimated = $t04020640362._1 | |
1008 | + | let commonState = $t04020640362._2 | |
1009 | + | let feeAmount = $t04020640362._3 | |
1010 | + | let bonus = $t04020640362._4 | |
1011 | + | let outInAmountAsset = $t04020640362._5 | |
1012 | 1012 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
1013 | 1013 | } | |
1014 | 1014 | ||
1045 | 1045 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1046 | 1046 | if ((unstakeInv == unstakeInv)) | |
1047 | 1047 | then { | |
1048 | - | let $ | |
1049 | - | if (($ | |
1048 | + | let $t04126741418 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
1049 | + | if (($t04126741418 == $t04126741418)) | |
1050 | 1050 | then { | |
1051 | - | let outInAmountAsset = $ | |
1052 | - | let bonus = $ | |
1053 | - | let feeAmount = $ | |
1054 | - | let commonState = $ | |
1055 | - | let amountEstimated = $ | |
1051 | + | let outInAmountAsset = $t04126741418._5 | |
1052 | + | let bonus = $t04126741418._4 | |
1053 | + | let feeAmount = $t04126741418._3 | |
1054 | + | let commonState = $t04126741418._2 | |
1055 | + | let amountEstimated = $t04126741418._1 | |
1056 | 1056 | let amount = if (if ((minOutAmount > 0)) | |
1057 | 1057 | then (minOutAmount > amountEstimated) | |
1058 | 1058 | else false) | |
1065 | 1065 | let sendFee = if ((feeAmount > 0)) | |
1066 | 1066 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
1067 | 1067 | else nil | |
1068 | - | let $ | |
1068 | + | let $t04191342160 = { | |
1069 | 1069 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
1070 | 1070 | then 0 | |
1071 | 1071 | else feeAmount | |
1073 | 1073 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
1074 | 1074 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
1075 | 1075 | } | |
1076 | - | let amountAssetBalanceDelta = $ | |
1077 | - | let priceAssetBalanceDelta = $ | |
1078 | - | let $ | |
1079 | - | let refreshKLpActions = $ | |
1080 | - | let updatedKLp = $ | |
1076 | + | let amountAssetBalanceDelta = $t04191342160._1 | |
1077 | + | let priceAssetBalanceDelta = $t04191342160._2 | |
1078 | + | let $t04216342271 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1079 | + | let refreshKLpActions = $t04216342271._1 | |
1080 | + | let updatedKLp = $t04216342271._2 | |
1081 | 1081 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1082 | 1082 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1083 | 1083 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
1110 | 1110 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1111 | 1111 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1112 | 1112 | then { | |
1113 | - | let $ | |
1114 | - | let refreshKLpActions = $ | |
1115 | - | let updatedKLp = $ | |
1113 | + | let $t04321743299 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1114 | + | let refreshKLpActions = $t04321743299._1 | |
1115 | + | let updatedKLp = $t04321743299._2 | |
1116 | 1116 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1117 | 1117 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1118 | 1118 | then (state ++ refreshKLpActions) | |
1144 | 1144 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1145 | 1145 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1146 | 1146 | then { | |
1147 | - | let $ | |
1148 | - | let refreshKLpActions = $ | |
1149 | - | let updatedKLp = $ | |
1147 | + | let $t04424844329 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1148 | + | let refreshKLpActions = $t04424844329._1 | |
1149 | + | let updatedKLp = $t04424844329._2 | |
1150 | 1150 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1151 | 1151 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1152 | 1152 | then (state ++ refreshKLpActions) | |
1190 | 1190 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1191 | 1191 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1192 | 1192 | then { | |
1193 | - | let $ | |
1194 | - | let refreshKLpActions = $ | |
1195 | - | let updatedKLp = $ | |
1193 | + | let $t04545545536 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1194 | + | let refreshKLpActions = $t04545545536._1 | |
1195 | + | let updatedKLp = $t04545545536._2 | |
1196 | 1196 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1197 | 1197 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1198 | 1198 | then (state ++ refreshKLpActions) | |
1243 | 1243 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1244 | 1244 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1245 | 1245 | then { | |
1246 | - | let $ | |
1247 | - | let refreshKLpActions = $ | |
1248 | - | let updatedKLp = $ | |
1246 | + | let $t04683146912 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1247 | + | let refreshKLpActions = $t04683146912._1 | |
1248 | + | let updatedKLp = $t04683146912._2 | |
1249 | 1249 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1250 | 1250 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1251 | 1251 | then (state ++ refreshKLpActions) | |
1280 | 1280 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1281 | 1281 | then { | |
1282 | 1282 | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
1283 | - | let $ | |
1284 | - | let kLpUpdateActions = $ | |
1285 | - | let updatedKLp = $ | |
1283 | + | let $t04809948163 = refreshKLpInternal(0, 0, 0) | |
1284 | + | let kLpUpdateActions = $t04809948163._1 | |
1285 | + | let updatedKLp = $t04809948163._2 | |
1286 | 1286 | let actions = if ((kLp != updatedKLp)) | |
1287 | 1287 | then kLpUpdateActions | |
1288 | 1288 | else throwErr("nothing to refresh") | |
1457 | 1457 | match tx { | |
1458 | 1458 | case order: Order => | |
1459 | 1459 | let matcherPub = getMatcherPubOrFail() | |
1460 | - | let $ | |
1461 | - | let orderValid = $ | |
1462 | - | let orderValidInfo = $ | |
1460 | + | let $t05682556894 = validateMatcherOrderAllowed(order) | |
1461 | + | let orderValid = $t05682556894._1 | |
1462 | + | let orderValidInfo = $t05682556894._2 | |
1463 | 1463 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1464 | 1464 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1465 | 1465 | 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 lPdecimals = 8 | |
5 | 5 | ||
6 | 6 | let scale8 = 100000000 | |
7 | 7 | ||
8 | 8 | let scale8BigInt = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let scale18 = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let zeroBigInt = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big0 = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let big1 = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let big2 = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let wavesString = "WAVES" | |
21 | 21 | ||
22 | 22 | let SEP = "__" | |
23 | 23 | ||
24 | 24 | let PoolActive = 1 | |
25 | 25 | ||
26 | 26 | let PoolPutDisabled = 2 | |
27 | 27 | ||
28 | 28 | let PoolMatcherDisabled = 3 | |
29 | 29 | ||
30 | 30 | let PoolShutdown = 4 | |
31 | 31 | ||
32 | 32 | let idxPoolAddress = 1 | |
33 | 33 | ||
34 | 34 | let idxPoolStatus = 2 | |
35 | 35 | ||
36 | 36 | let idxPoolLPAssetId = 3 | |
37 | 37 | ||
38 | 38 | let idxAmtAssetId = 4 | |
39 | 39 | ||
40 | 40 | let idxPriceAssetId = 5 | |
41 | 41 | ||
42 | 42 | let idxAmtAssetDcm = 6 | |
43 | 43 | ||
44 | 44 | let idxPriceAssetDcm = 7 | |
45 | 45 | ||
46 | 46 | let idxIAmtAssetId = 8 | |
47 | 47 | ||
48 | 48 | let idxIPriceAssetId = 9 | |
49 | 49 | ||
50 | 50 | let idxLPAssetDcm = 10 | |
51 | 51 | ||
52 | 52 | let idxPoolAmtAssetAmt = 1 | |
53 | 53 | ||
54 | 54 | let idxPoolPriceAssetAmt = 2 | |
55 | 55 | ||
56 | 56 | let idxPoolLPAssetAmt = 3 | |
57 | 57 | ||
58 | 58 | let idxFactoryStakingContract = 1 | |
59 | 59 | ||
60 | 60 | let idxFactorySlippageContract = 7 | |
61 | 61 | ||
62 | 62 | func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func abs (val) = if ((0 > val)) | |
78 | 78 | then -(val) | |
79 | 79 | else val | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func absBigInt (val) = if ((zeroBigInt > val)) | |
83 | 83 | then -(val) | |
84 | 84 | else val | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func fc () = "%s__factoryContract" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func mpk () = "%s__managerPublicKey" | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func pmpk () = "%s__pendingManagerPublicKey" | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func pl () = "%s%s__price__last" | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func aa () = "%s__amountAsset" | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func pa () = "%s__priceAsset" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | let keyFee = "%s__fee" | |
115 | 115 | ||
116 | 116 | let feeDefault = fraction(10, scale8, 10000) | |
117 | 117 | ||
118 | 118 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
119 | 119 | ||
120 | 120 | let keyKLp = makeString(["%s", "kLp"], SEP) | |
121 | 121 | ||
122 | 122 | let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP) | |
123 | 123 | ||
124 | 124 | let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP) | |
125 | 125 | ||
126 | 126 | let kLpRefreshDelayDefault = 30 | |
127 | 127 | ||
128 | 128 | let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault) | |
129 | 129 | ||
130 | 130 | func keyFactoryConfig () = "%s__factoryConfig" | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config") | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func keyAllPoolsShutdown () = "%s__shutdown" | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | let keyFeeCollectorAddress = "%s__feeCollectorAddress" | |
155 | 155 | ||
156 | 156 | func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid))) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func throwErr (msg) = throw(makeString(["lp.ride:", msg], " ")) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func fmtErr (msg) = makeString(["lp.ride:", msg], " ") | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | let factoryContract = addressFromStringValue(getStringOrFail(this, fc())) | |
172 | 172 | ||
173 | 173 | let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress)) | |
174 | 174 | ||
175 | 175 | let inFee = { | |
176 | 176 | let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil) | |
177 | 177 | if ($isInstanceOf(@, "Int")) | |
178 | 178 | then @ | |
179 | 179 | else throw(($getType(@) + " couldn't be cast to Int")) | |
180 | 180 | } | |
181 | 181 | ||
182 | 182 | let outFee = { | |
183 | 183 | let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil) | |
184 | 184 | if ($isInstanceOf(@, "Int")) | |
185 | 185 | then @ | |
186 | 186 | else throw(($getType(@) + " couldn't be cast to Int")) | |
187 | 187 | } | |
188 | 188 | ||
189 | 189 | func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub())) | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func getPoolConfig () = { | |
196 | 196 | let amtAsset = getStringOrFail(this, aa()) | |
197 | 197 | let priceAsset = getStringOrFail(this, pa()) | |
198 | 198 | let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset)) | |
199 | 199 | let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset)) | |
200 | 200 | split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func parseAssetId (input) = if ((input == wavesString)) | |
205 | 205 | then unit | |
206 | 206 | else fromBase58String(input) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func assetIdToString (input) = if ((input == unit)) | |
210 | 210 | then wavesString | |
211 | 211 | else toBase58String(value(input)) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm])) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | let poolConfigParsed = parsePoolConfig(getPoolConfig()) | |
218 | 218 | ||
219 | 219 | let $t084088574 = poolConfigParsed | |
220 | 220 | ||
221 | 221 | let cfgPoolAddress = $t084088574._1 | |
222 | 222 | ||
223 | 223 | let cfgPoolStatus = $t084088574._2 | |
224 | 224 | ||
225 | 225 | let cfgLpAssetId = $t084088574._3 | |
226 | 226 | ||
227 | 227 | let cfgAmountAssetId = $t084088574._4 | |
228 | 228 | ||
229 | 229 | let cfgPriceAssetId = $t084088574._5 | |
230 | 230 | ||
231 | 231 | let cfgAmountAssetDecimals = $t084088574._6 | |
232 | 232 | ||
233 | 233 | let cfgPriceAssetDecimals = $t084088574._7 | |
234 | 234 | ||
235 | 235 | func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address") | |
239 | 239 | ||
240 | 240 | let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address") | |
241 | 241 | ||
242 | 242 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | 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) | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
249 | 249 | then wavesBalance(this).available | |
250 | 250 | else assetBalance(this, fromBase58String(assetId)) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
260 | 260 | let amtAssetAmtX18 = toX18(amAmt, amAssetDcm) | |
261 | 261 | let priceAssetAmtX18 = toX18(prAmt, prAssetDcm) | |
262 | 262 | calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
263 | 263 | } | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
267 | 267 | let cfg = getPoolConfig() | |
268 | 268 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
269 | 269 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
270 | 270 | let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt) | |
271 | 271 | let amAmtX18 = toX18(amAmt, amtAssetDcm) | |
272 | 272 | let prAmtX18 = toX18(prAmt, priceAssetDcm) | |
273 | 273 | let lpAmtX18 = toX18(lpAmt, scale8) | |
274 | 274 | let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18) | |
275 | 275 | let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18) | |
276 | 276 | [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18] | |
277 | 277 | } | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
281 | 281 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
282 | 282 | [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)] | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
287 | 287 | let cfg = getPoolConfig() | |
288 | 288 | let lpAssetId = cfg[idxPoolLPAssetId] | |
289 | 289 | let amAssetId = cfg[idxAmtAssetId] | |
290 | 290 | let prAssetId = cfg[idxPriceAssetId] | |
291 | 291 | let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
292 | 292 | let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
293 | 293 | let poolStatus = cfg[idxPoolStatus] | |
294 | 294 | let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity | |
295 | 295 | if ((lpAssetId != pmtAssetId)) | |
296 | 296 | then throw("Invalid asset passed.") | |
297 | 297 | else { | |
298 | 298 | let amBalance = getAccBalance(amAssetId) | |
299 | 299 | let amBalanceX18 = toX18(amBalance, amAssetDcm) | |
300 | 300 | let prBalance = getAccBalance(prAssetId) | |
301 | 301 | let prBalanceX18 = toX18(prBalance, prAssetDcm) | |
302 | 302 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
303 | 303 | let curPrice = fromX18(curPriceX18, scale8) | |
304 | 304 | let pmtLpAmtX18 = toX18(pmtLpAmt, scale8) | |
305 | 305 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
306 | 306 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
307 | 307 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18) | |
308 | 308 | let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR) | |
309 | 309 | let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR) | |
310 | 310 | let state = if ((txId58 == "")) | |
311 | 311 | then nil | |
312 | 312 | else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES")) | |
313 | 313 | then unit | |
314 | 314 | else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES")) | |
315 | 315 | then unit | |
316 | 316 | else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
317 | 317 | $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state) | |
318 | 318 | } | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = { | |
323 | 323 | let cfg = getPoolConfig() | |
324 | 324 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
325 | 325 | let amAssetIdStr = cfg[idxAmtAssetId] | |
326 | 326 | let prAssetIdStr = cfg[idxPriceAssetId] | |
327 | 327 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
328 | 328 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
329 | 329 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
330 | 330 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
331 | 331 | let poolStatus = cfg[idxPoolStatus] | |
332 | 332 | let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
333 | 333 | let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES"))) | |
334 | 334 | let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES"))) | |
335 | 335 | if (if ((amAssetIdStr != inAmAssetIdStr)) | |
336 | 336 | then true | |
337 | 337 | else (prAssetIdStr != inPrAssetIdStr)) | |
338 | 338 | then throw("Invalid amt or price asset passed.") | |
339 | 339 | else { | |
340 | 340 | let amBalance = if (isEvaluate) | |
341 | 341 | then getAccBalance(amAssetIdStr) | |
342 | 342 | else (getAccBalance(amAssetIdStr) - inAmAssetAmt) | |
343 | 343 | let prBalance = if (isEvaluate) | |
344 | 344 | then getAccBalance(prAssetIdStr) | |
345 | 345 | else (getAccBalance(prAssetIdStr) - inPrAssetAmt) | |
346 | 346 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
347 | 347 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
348 | 348 | let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18) | |
349 | 349 | let amBalanceX18 = toX18(amBalance, amtAssetDcm) | |
350 | 350 | let prBalanceX18 = toX18(prBalance, priceAssetDcm) | |
351 | 351 | let res = if ((lpEmission == 0)) | |
352 | 352 | then { | |
353 | 353 | let curPriceX18 = zeroBigInt | |
354 | 354 | let slippageX18 = zeroBigInt | |
355 | 355 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
356 | 356 | $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
357 | 357 | } | |
358 | 358 | else { | |
359 | 359 | let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18) | |
360 | 360 | let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
361 | 361 | let slippageToleranceX18 = toX18(slippageTolerance, scale8) | |
362 | 362 | if (if ((curPriceX18 != zeroBigInt)) | |
363 | 363 | then (slippageX18 > slippageToleranceX18) | |
364 | 364 | else false) | |
365 | 365 | then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18))) | |
366 | 366 | else { | |
367 | 367 | let lpEmissionX18 = toX18(lpEmission, scale8) | |
368 | 368 | let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING) | |
369 | 369 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING) | |
370 | 370 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
371 | 371 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
372 | 372 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
373 | 373 | let expAmtAssetAmtX18 = expectedAmts._1 | |
374 | 374 | let expPriceAssetAmtX18 = expectedAmts._2 | |
375 | 375 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR) | |
376 | 376 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18) | |
377 | 377 | } | |
378 | 378 | } | |
379 | 379 | let calcLpAmt = res._1 | |
380 | 380 | let calcAmAssetPmt = res._2 | |
381 | 381 | let calcPrAssetPmt = res._3 | |
382 | 382 | let curPrice = fromX18(res._4, scale8) | |
383 | 383 | let slippageCalc = fromX18(res._5, scale8) | |
384 | 384 | if ((0 >= calcLpAmt)) | |
385 | 385 | then throw("Invalid calculations. LP calculated is less than zero.") | |
386 | 386 | else { | |
387 | 387 | let emitLpAmt = if (!(emitLp)) | |
388 | 388 | then 0 | |
389 | 389 | else calcLpAmt | |
390 | 390 | let amDiff = (inAmAssetAmt - calcAmAssetPmt) | |
391 | 391 | let prDiff = (inPrAssetAmt - calcPrAssetPmt) | |
392 | 392 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
393 | 393 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId) | |
394 | 394 | } | |
395 | 395 | } | |
396 | 396 | } | |
397 | 397 | ||
398 | 398 | ||
399 | 399 | func calcKLp (amountBalance,priceBalance,lpEmission) = { | |
400 | 400 | let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals)) | |
401 | 401 | let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals)) | |
402 | 402 | let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission) | |
403 | 403 | if ((lpEmission == big0)) | |
404 | 404 | then big0 | |
405 | 405 | else updatedKLp | |
406 | 406 | } | |
407 | 407 | ||
408 | 408 | ||
409 | 409 | func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
410 | 410 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
411 | 411 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
412 | 412 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
413 | 413 | let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
414 | 414 | currentKLp | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
419 | 419 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
420 | 420 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
421 | 421 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
422 | 422 | let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
423 | 423 | let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))] | |
424 | 424 | $Tuple2(actions, updatedKLp) | |
425 | 425 | } | |
426 | 426 | ||
427 | 427 | ||
428 | 428 | func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp)) | |
429 | 429 | then true | |
430 | 430 | else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " ")) | |
431 | 431 | ||
432 | 432 | ||
433 | 433 | func validateMatcherOrderAllowed (order) = { | |
434 | 434 | let amountAssetAmount = order.amount | |
435 | 435 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
436 | 436 | let $t02132621538 = if ((order.orderType == Buy)) | |
437 | 437 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
438 | 438 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
439 | 439 | let amountAssetBalanceDelta = $t02132621538._1 | |
440 | 440 | let priceAssetBalanceDelta = $t02132621538._2 | |
441 | 441 | if (if (if (isGlobalShutdown()) | |
442 | 442 | then true | |
443 | 443 | else (cfgPoolStatus == PoolMatcherDisabled)) | |
444 | 444 | then true | |
445 | 445 | else (cfgPoolStatus == PoolShutdown)) | |
446 | 446 | then throw("Exchange operations disabled") | |
447 | 447 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
448 | 448 | then true | |
449 | 449 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
450 | 450 | then throw("Wrong order assets.") | |
451 | 451 | else { | |
452 | - | let kLp = valueOrErrorMessage(parseBigInt( | |
453 | - | let $ | |
454 | - | let unusedActions = $ | |
455 | - | let kLpNew = $ | |
452 | + | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
453 | + | let $t02197822078 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
454 | + | let unusedActions = $t02197822078._1 | |
455 | + | let kLpNew = $t02197822078._2 | |
456 | 456 | let isOrderValid = (kLpNew >= kLp) | |
457 | 457 | let info = makeString([toString(kLp), toString(kLpNew)], " ") | |
458 | 458 | $Tuple2(isOrderValid, info) | |
459 | 459 | } | |
460 | 460 | } | |
461 | 461 | ||
462 | 462 | ||
463 | 463 | func commonGet (i) = if ((size(i.payments) != 1)) | |
464 | 464 | then throw("exactly 1 payment is expected") | |
465 | 465 | else { | |
466 | 466 | let pmt = value(i.payments[0]) | |
467 | 467 | let pmtAssetId = value(pmt.assetId) | |
468 | 468 | let pmtAmt = pmt.amount | |
469 | 469 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
470 | 470 | let outAmAmt = res._1 | |
471 | 471 | let outPrAmt = res._2 | |
472 | 472 | let poolStatus = parseIntValue(res._9) | |
473 | 473 | let state = res._10 | |
474 | 474 | if (if (isGlobalShutdown()) | |
475 | 475 | then true | |
476 | 476 | else (poolStatus == PoolShutdown)) | |
477 | 477 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
478 | 478 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
479 | 479 | } | |
480 | 480 | ||
481 | 481 | ||
482 | 482 | func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2)) | |
483 | 483 | then throw("exactly 2 payments are expected") | |
484 | 484 | else { | |
485 | 485 | let amAssetPmt = value(i.payments[0]) | |
486 | 486 | let prAssetPmt = value(i.payments[1]) | |
487 | 487 | let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp) | |
488 | 488 | let poolStatus = parseIntValue(estPut._8) | |
489 | 489 | if (if (if (isGlobalShutdown()) | |
490 | 490 | then true | |
491 | 491 | else (poolStatus == PoolPutDisabled)) | |
492 | 492 | then true | |
493 | 493 | else (poolStatus == PoolShutdown)) | |
494 | 494 | then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus))) | |
495 | 495 | else estPut | |
496 | 496 | } | |
497 | 497 | ||
498 | 498 | ||
499 | 499 | func emit (amount) = { | |
500 | 500 | let emitInv = invoke(factoryContract, "emit", [amount], nil) | |
501 | 501 | if ((emitInv == emitInv)) | |
502 | 502 | then { | |
503 | 503 | let emitInvLegacy = match emitInv { | |
504 | 504 | case legacyFactoryContract: Address => | |
505 | 505 | invoke(legacyFactoryContract, "emit", [amount], nil) | |
506 | 506 | case _ => | |
507 | 507 | unit | |
508 | 508 | } | |
509 | 509 | if ((emitInvLegacy == emitInvLegacy)) | |
510 | 510 | then amount | |
511 | 511 | else throw("Strict value is not equal to itself.") | |
512 | 512 | } | |
513 | 513 | else throw("Strict value is not equal to itself.") | |
514 | 514 | } | |
515 | 515 | ||
516 | 516 | ||
517 | 517 | func takeFee (amount,fee) = { | |
518 | 518 | let feeAmount = if ((fee == 0)) | |
519 | 519 | then 0 | |
520 | 520 | else fraction(amount, fee, scale8) | |
521 | 521 | $Tuple2((amount - feeAmount), feeAmount) | |
522 | 522 | } | |
523 | 523 | ||
524 | 524 | ||
525 | 525 | func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = { | |
526 | 526 | let isEval = (txId == unit) | |
527 | 527 | let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
528 | 528 | let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
529 | 529 | let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId)) | |
530 | 530 | then true | |
531 | 531 | else if ((paymentAssetId == cfgPriceAssetId)) | |
532 | 532 | then false | |
533 | 533 | else throwErr("invalid asset") | |
534 | - | let $ | |
534 | + | let $t02488525178 = if (isEval) | |
535 | 535 | then $Tuple2(amountBalanceRaw, priceBalanceRaw) | |
536 | 536 | else if (paymentInAmountAsset) | |
537 | 537 | then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw) | |
538 | 538 | else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw)) | |
539 | - | let amountBalanceOld = $ | |
540 | - | let priceBalanceOld = $ | |
541 | - | let $ | |
539 | + | let amountBalanceOld = $t02488525178._1 | |
540 | + | let priceBalanceOld = $t02488525178._2 | |
541 | + | let $t02518225331 = if (paymentInAmountAsset) | |
542 | 542 | then $Tuple2(paymentAmountRaw, 0) | |
543 | 543 | else $Tuple2(0, paymentAmountRaw) | |
544 | - | let amountAssetAmountRaw = $ | |
545 | - | let priceAssetAmountRaw = $ | |
544 | + | let amountAssetAmountRaw = $t02518225331._1 | |
545 | + | let priceAssetAmountRaw = $t02518225331._2 | |
546 | 546 | let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1 | |
547 | 547 | let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1 | |
548 | - | let $ | |
549 | - | let paymentAmount = $ | |
550 | - | let feeAmount = $ | |
548 | + | let $t02546325527 = takeFee(paymentAmountRaw, inFee) | |
549 | + | let paymentAmount = $t02546325527._1 | |
550 | + | let feeAmount = $t02546325527._2 | |
551 | 551 | let amountBalanceNew = (amountBalanceOld + amountAssetAmount) | |
552 | 552 | let priceBalanceNew = (priceBalanceOld + priceAssetAmount) | |
553 | 553 | let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals)) | |
554 | 554 | let priceNew = fromX18(priceNewX18, scale8) | |
555 | 555 | let paymentBalance = if (paymentInAmountAsset) | |
556 | 556 | then amountBalanceOld | |
557 | 557 | else priceBalanceOld | |
558 | 558 | let paymentBalanceBigInt = toBigInt(paymentBalance) | |
559 | 559 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
560 | 560 | let chechSupply = if ((supplyBigInt > big0)) | |
561 | 561 | then true | |
562 | 562 | else throwErr("initial deposit requires all coins") | |
563 | 563 | if ((chechSupply == chechSupply)) | |
564 | 564 | then { | |
565 | 565 | let depositBigInt = toBigInt(paymentAmount) | |
566 | 566 | let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))]) | |
567 | 567 | let commonState = if (isEval) | |
568 | 568 | then nil | |
569 | 569 | else [IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew), StringEntry(pau(toString(value(userAddress)), toBase58String(value(txId))), dataPutActionInfo(amountAssetAmountRaw, priceAssetAmountRaw, issueAmount, priceNew, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
570 | 570 | let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals)) | |
571 | 571 | let priceOld = fromX18(priceOldX18, scale8) | |
572 | 572 | let loss = { | |
573 | - | let $ | |
573 | + | let $t02720827375 = if (paymentInAmountAsset) | |
574 | 574 | then $Tuple2(amountAssetAmountRaw, amountBalanceOld) | |
575 | 575 | else $Tuple2(priceAssetAmountRaw, priceBalanceOld) | |
576 | - | let amount = $ | |
577 | - | let balance = $ | |
576 | + | let amount = $t02720827375._1 | |
577 | + | let balance = $t02720827375._2 | |
578 | 578 | let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance))) | |
579 | 579 | fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth) | |
580 | 580 | } | |
581 | 581 | $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset) | |
582 | 582 | } | |
583 | 583 | else throw("Strict value is not equal to itself.") | |
584 | 584 | } | |
585 | 585 | ||
586 | 586 | ||
587 | 587 | func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = { | |
588 | 588 | let isEval = (txId == unit) | |
589 | 589 | let cfg = getPoolConfig() | |
590 | 590 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
591 | 591 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
592 | 592 | let checks = [if ((paymentAssetId == cfgLpAssetId)) | |
593 | 593 | then true | |
594 | 594 | else throwErr("invalid lp asset")] | |
595 | 595 | if ((checks == checks)) | |
596 | 596 | then { | |
597 | 597 | let outInAmountAsset = if ((outAssetId == cfgAmountAssetId)) | |
598 | 598 | then true | |
599 | 599 | else if ((outAssetId == cfgPriceAssetId)) | |
600 | 600 | then false | |
601 | 601 | else throwErr("invalid asset") | |
602 | 602 | let balanceBigInt = if (outInAmountAsset) | |
603 | 603 | then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
604 | 604 | else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
605 | 605 | let outInAmountAssetDecimals = if (outInAmountAsset) | |
606 | 606 | then amtAssetDcm | |
607 | 607 | else priceAssetDcm | |
608 | 608 | let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId)) | |
609 | 609 | let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId)) | |
610 | 610 | let outBalance = if (outInAmountAsset) | |
611 | 611 | then amBalanceOld | |
612 | 612 | else prBalanceOld | |
613 | 613 | let outBalanceBigInt = toBigInt(outBalance) | |
614 | 614 | let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity) | |
615 | 615 | let redeemedBigInt = toBigInt(paymentAmount) | |
616 | 616 | let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))]) | |
617 | - | let $ | |
618 | - | let totalAmount = $ | |
619 | - | let feeAmount = $ | |
620 | - | let $ | |
617 | + | let $t02945329509 = takeFee(amountRaw, outFee) | |
618 | + | let totalAmount = $t02945329509._1 | |
619 | + | let feeAmount = $t02945329509._2 | |
620 | + | let $t02951329739 = if (outInAmountAsset) | |
621 | 621 | then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld) | |
622 | 622 | else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw)) | |
623 | - | let outAmAmount = $ | |
624 | - | let outPrAmount = $ | |
625 | - | let amBalanceNew = $ | |
626 | - | let prBalanceNew = $ | |
623 | + | let outAmAmount = $t02951329739._1 | |
624 | + | let outPrAmount = $t02951329739._2 | |
625 | + | let amBalanceNew = $t02951329739._3 | |
626 | + | let prBalanceNew = $t02951329739._4 | |
627 | 627 | let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals)) | |
628 | 628 | let priceNew = fromX18(priceNewX18, scale8) | |
629 | 629 | let commonState = if (isEval) | |
630 | 630 | then nil | |
631 | 631 | else [StringEntry(gau(toString(value(userAddress)), toBase58String(value(txId))), dataGetActionInfo(outAmAmount, outPrAmount, paymentAmount, priceNew, height, lastBlock.timestamp)), IntegerEntry(pl(), priceNew), IntegerEntry(ph(height, lastBlock.timestamp), priceNew)] | |
632 | 632 | let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals)) | |
633 | 633 | let priceOld = fromX18(priceOldX18, scale8) | |
634 | 634 | let loss = { | |
635 | 635 | let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2) | |
636 | 636 | fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset) | |
637 | 637 | } | |
638 | 638 | $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset) | |
639 | 639 | } | |
640 | 640 | else throw("Strict value is not equal to itself.") | |
641 | 641 | } | |
642 | 642 | ||
643 | 643 | ||
644 | 644 | func managerPublicKeyOrUnit () = match getString(mpk()) { | |
645 | 645 | case s: String => | |
646 | 646 | fromBase58String(s) | |
647 | 647 | case _: Unit => | |
648 | 648 | unit | |
649 | 649 | case _ => | |
650 | 650 | throw("Match error") | |
651 | 651 | } | |
652 | 652 | ||
653 | 653 | ||
654 | 654 | func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) { | |
655 | 655 | case s: String => | |
656 | 656 | fromBase58String(s) | |
657 | 657 | case _: Unit => | |
658 | 658 | unit | |
659 | 659 | case _ => | |
660 | 660 | throw("Match error") | |
661 | 661 | } | |
662 | 662 | ||
663 | 663 | ||
664 | 664 | func isManager (i) = match managerPublicKeyOrUnit() { | |
665 | 665 | case pk: ByteVector => | |
666 | 666 | (i.callerPublicKey == pk) | |
667 | 667 | case _: Unit => | |
668 | 668 | (i.caller == this) | |
669 | 669 | case _ => | |
670 | 670 | throw("Match error") | |
671 | 671 | } | |
672 | 672 | ||
673 | 673 | ||
674 | 674 | func mustManager (i) = { | |
675 | 675 | let pd = throw("Permission denied") | |
676 | 676 | match managerPublicKeyOrUnit() { | |
677 | 677 | case pk: ByteVector => | |
678 | 678 | if ((i.callerPublicKey == pk)) | |
679 | 679 | then true | |
680 | 680 | else pd | |
681 | 681 | case _: Unit => | |
682 | 682 | if ((i.caller == this)) | |
683 | 683 | then true | |
684 | 684 | else pd | |
685 | 685 | case _ => | |
686 | 686 | throw("Match error") | |
687 | 687 | } | |
688 | 688 | } | |
689 | 689 | ||
690 | 690 | ||
691 | 691 | @Callable(i) | |
692 | 692 | func setManager (pendingManagerPublicKey) = { | |
693 | 693 | let checkCaller = mustManager(i) | |
694 | 694 | if ((checkCaller == checkCaller)) | |
695 | 695 | then { | |
696 | 696 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
697 | 697 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
698 | 698 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
699 | 699 | else throw("Strict value is not equal to itself.") | |
700 | 700 | } | |
701 | 701 | else throw("Strict value is not equal to itself.") | |
702 | 702 | } | |
703 | 703 | ||
704 | 704 | ||
705 | 705 | ||
706 | 706 | @Callable(i) | |
707 | 707 | func confirmManager () = { | |
708 | 708 | let pm = pendingManagerPublicKeyOrUnit() | |
709 | 709 | let hasPM = if (isDefined(pm)) | |
710 | 710 | then true | |
711 | 711 | else throw("No pending manager") | |
712 | 712 | if ((hasPM == hasPM)) | |
713 | 713 | then { | |
714 | 714 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
715 | 715 | then true | |
716 | 716 | else throw("You are not pending manager") | |
717 | 717 | if ((checkPM == checkPM)) | |
718 | 718 | then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())] | |
719 | 719 | else throw("Strict value is not equal to itself.") | |
720 | 720 | } | |
721 | 721 | else throw("Strict value is not equal to itself.") | |
722 | 722 | } | |
723 | 723 | ||
724 | 724 | ||
725 | 725 | ||
726 | 726 | @Callable(i) | |
727 | 727 | func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance)) | |
728 | 728 | then throw("Invalid slippageTolerance passed") | |
729 | 729 | else { | |
730 | 730 | let estPut = commonPut(i, slippageTolerance, true) | |
731 | 731 | let emitLpAmt = estPut._2 | |
732 | 732 | let lpAssetId = estPut._7 | |
733 | 733 | let state = estPut._9 | |
734 | 734 | let amDiff = estPut._10 | |
735 | 735 | let prDiff = estPut._11 | |
736 | 736 | let amId = estPut._12 | |
737 | 737 | let prId = estPut._13 | |
738 | 738 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
739 | 739 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
740 | 740 | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
741 | 741 | if ((currentKLp == currentKLp)) | |
742 | 742 | then { | |
743 | 743 | let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil) | |
744 | 744 | if ((emitInv == emitInv)) | |
745 | 745 | then { | |
746 | 746 | let emitInvLegacy = match emitInv { | |
747 | 747 | case legacyFactoryContract: Address => | |
748 | 748 | invoke(legacyFactoryContract, "emit", [emitLpAmt], nil) | |
749 | 749 | case _ => | |
750 | 750 | unit | |
751 | 751 | } | |
752 | 752 | if ((emitInvLegacy == emitInvLegacy)) | |
753 | 753 | then { | |
754 | 754 | let slippageAInv = if ((amDiff > 0)) | |
755 | 755 | then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)]) | |
756 | 756 | else nil | |
757 | 757 | if ((slippageAInv == slippageAInv)) | |
758 | 758 | then { | |
759 | 759 | let slippagePInv = if ((prDiff > 0)) | |
760 | 760 | then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)]) | |
761 | 761 | else nil | |
762 | 762 | if ((slippagePInv == slippagePInv)) | |
763 | 763 | then { | |
764 | 764 | let lpTransfer = if (shouldAutoStake) | |
765 | 765 | then { | |
766 | 766 | let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
767 | 767 | if ((slpStakeInv == slpStakeInv)) | |
768 | 768 | then nil | |
769 | 769 | else throw("Strict value is not equal to itself.") | |
770 | 770 | } | |
771 | 771 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
772 | - | let $ | |
773 | - | if (($ | |
772 | + | let $t03426734729 = refreshKLpInternal(0, 0, 0) | |
773 | + | if (($t03426734729 == $t03426734729)) | |
774 | 774 | then { | |
775 | - | let updatedKLp = $ | |
776 | - | let refreshKLpActions = $ | |
775 | + | let updatedKLp = $t03426734729._2 | |
776 | + | let refreshKLpActions = $t03426734729._1 | |
777 | 777 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
778 | 778 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
779 | 779 | then ((state ++ lpTransfer) ++ refreshKLpActions) | |
780 | 780 | else throw("Strict value is not equal to itself.") | |
781 | 781 | } | |
782 | 782 | else throw("Strict value is not equal to itself.") | |
783 | 783 | } | |
784 | 784 | else throw("Strict value is not equal to itself.") | |
785 | 785 | } | |
786 | 786 | else throw("Strict value is not equal to itself.") | |
787 | 787 | } | |
788 | 788 | else throw("Strict value is not equal to itself.") | |
789 | 789 | } | |
790 | 790 | else throw("Strict value is not equal to itself.") | |
791 | 791 | } | |
792 | 792 | else throw("Strict value is not equal to itself.") | |
793 | 793 | } | |
794 | 794 | ||
795 | 795 | ||
796 | 796 | ||
797 | 797 | @Callable(i) | |
798 | 798 | func putForFree (maxSlippage) = if ((0 > maxSlippage)) | |
799 | 799 | then throw("Invalid value passed") | |
800 | 800 | else { | |
801 | 801 | let estPut = commonPut(i, maxSlippage, false) | |
802 | 802 | let state = estPut._9 | |
803 | 803 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
804 | 804 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
805 | 805 | let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
806 | 806 | if ((currentKLp == currentKLp)) | |
807 | 807 | then { | |
808 | - | let $ | |
809 | - | let refreshKLpActions = $ | |
810 | - | let updatedKLp = $ | |
808 | + | let $t03529135356 = refreshKLpInternal(0, 0, 0) | |
809 | + | let refreshKLpActions = $t03529135356._1 | |
810 | + | let updatedKLp = $t03529135356._2 | |
811 | 811 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
812 | 812 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
813 | 813 | then (state ++ refreshKLpActions) | |
814 | 814 | else throw("Strict value is not equal to itself.") | |
815 | 815 | } | |
816 | 816 | else throw("Strict value is not equal to itself.") | |
817 | 817 | } | |
818 | 818 | ||
819 | 819 | ||
820 | 820 | ||
821 | 821 | @Callable(i) | |
822 | 822 | func putOneTkn (minOutAmount,autoStake) = { | |
823 | 823 | let isPoolOneTokenOperationsDisabled = { | |
824 | 824 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
825 | 825 | if ($isInstanceOf(@, "Boolean")) | |
826 | 826 | then @ | |
827 | 827 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
828 | 828 | } | |
829 | 829 | let isPutDisabled = if (if (if (isGlobalShutdown()) | |
830 | 830 | then true | |
831 | 831 | else (cfgPoolStatus == PoolPutDisabled)) | |
832 | 832 | then true | |
833 | 833 | else (cfgPoolStatus == PoolShutdown)) | |
834 | 834 | then true | |
835 | 835 | else isPoolOneTokenOperationsDisabled | |
836 | 836 | let checks = [if (if (!(isPutDisabled)) | |
837 | 837 | then true | |
838 | 838 | else isManager(i)) | |
839 | 839 | then true | |
840 | 840 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
841 | 841 | then true | |
842 | 842 | else throwErr("exactly 1 payment are expected")] | |
843 | 843 | if ((checks == checks)) | |
844 | 844 | then { | |
845 | 845 | let payment = i.payments[0] | |
846 | 846 | let paymentAssetId = payment.assetId | |
847 | 847 | let paymentAmountRaw = payment.amount | |
848 | 848 | let currentKLp = if ((paymentAssetId == cfgAmountAssetId)) | |
849 | 849 | then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0)) | |
850 | 850 | else if ((paymentAssetId == cfgPriceAssetId)) | |
851 | 851 | then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0)) | |
852 | 852 | else throwErr("payment asset is not supported") | |
853 | 853 | if ((currentKLp == currentKLp)) | |
854 | 854 | then { | |
855 | 855 | let userAddress = i.caller | |
856 | 856 | let txId = i.transactionId | |
857 | - | let $ | |
858 | - | if (($ | |
857 | + | let $t03654436696 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId) | |
858 | + | if (($t03654436696 == $t03654436696)) | |
859 | 859 | then { | |
860 | - | let paymentInAmountAsset = $ | |
861 | - | let bonus = $ | |
862 | - | let feeAmount = $ | |
863 | - | let commonState = $ | |
864 | - | let emitAmountEstimated = $ | |
860 | + | let paymentInAmountAsset = $t03654436696._5 | |
861 | + | let bonus = $t03654436696._4 | |
862 | + | let feeAmount = $t03654436696._3 | |
863 | + | let commonState = $t03654436696._2 | |
864 | + | let emitAmountEstimated = $t03654436696._1 | |
865 | 865 | let emitAmount = if (if ((minOutAmount > 0)) | |
866 | 866 | then (minOutAmount > emitAmountEstimated) | |
867 | 867 | else false) | |
868 | 868 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
869 | 869 | else emitAmountEstimated | |
870 | 870 | let emitInv = emit(emitAmount) | |
871 | 871 | if ((emitInv == emitInv)) | |
872 | 872 | then { | |
873 | 873 | let lpTransfer = if (autoStake) | |
874 | 874 | then { | |
875 | 875 | let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)]) | |
876 | 876 | if ((stakeInv == stakeInv)) | |
877 | 877 | then nil | |
878 | 878 | else throw("Strict value is not equal to itself.") | |
879 | 879 | } | |
880 | 880 | else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)] | |
881 | 881 | let sendFee = if ((feeAmount > 0)) | |
882 | 882 | then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)] | |
883 | 883 | else nil | |
884 | - | let $ | |
884 | + | let $t03728237479 = if ((this == feeCollectorAddress)) | |
885 | 885 | then $Tuple2(0, 0) | |
886 | 886 | else if (paymentInAmountAsset) | |
887 | 887 | then $Tuple2(-(feeAmount), 0) | |
888 | 888 | else $Tuple2(0, -(feeAmount)) | |
889 | - | let amountAssetBalanceDelta = $ | |
890 | - | let priceAssetBalanceDelta = $ | |
891 | - | let $ | |
892 | - | let refreshKLpActions = $ | |
893 | - | let updatedKLp = $ | |
889 | + | let amountAssetBalanceDelta = $t03728237479._1 | |
890 | + | let priceAssetBalanceDelta = $t03728237479._2 | |
891 | + | let $t03748237590 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
892 | + | let refreshKLpActions = $t03748237590._1 | |
893 | + | let updatedKLp = $t03748237590._2 | |
894 | 894 | let kLp = value(getString(keyKLp)) | |
895 | 895 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
896 | 896 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
897 | 897 | then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount) | |
898 | 898 | else throw("Strict value is not equal to itself.") | |
899 | 899 | } | |
900 | 900 | else throw("Strict value is not equal to itself.") | |
901 | 901 | } | |
902 | 902 | else throw("Strict value is not equal to itself.") | |
903 | 903 | } | |
904 | 904 | else throw("Strict value is not equal to itself.") | |
905 | 905 | } | |
906 | 906 | else throw("Strict value is not equal to itself.") | |
907 | 907 | } | |
908 | 908 | ||
909 | 909 | ||
910 | 910 | ||
911 | 911 | @Callable(i) | |
912 | 912 | func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = { | |
913 | - | let $ | |
914 | - | let emitAmountEstimated = $ | |
915 | - | let commonState = $ | |
916 | - | let feeAmount = $ | |
917 | - | let bonus = $ | |
918 | - | let paymentInAmountAsset = $ | |
913 | + | let $t03789638053 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit) | |
914 | + | let emitAmountEstimated = $t03789638053._1 | |
915 | + | let commonState = $t03789638053._2 | |
916 | + | let feeAmount = $t03789638053._3 | |
917 | + | let bonus = $t03789638053._4 | |
918 | + | let paymentInAmountAsset = $t03789638053._5 | |
919 | 919 | $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus)) | |
920 | 920 | } | |
921 | 921 | ||
922 | 922 | ||
923 | 923 | ||
924 | 924 | @Callable(i) | |
925 | 925 | func getOneTkn (outAssetIdStr,minOutAmount) = { | |
926 | 926 | let isPoolOneTokenOperationsDisabled = { | |
927 | 927 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
928 | 928 | if ($isInstanceOf(@, "Boolean")) | |
929 | 929 | then @ | |
930 | 930 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
931 | 931 | } | |
932 | 932 | let isGetDisabled = if (if (isGlobalShutdown()) | |
933 | 933 | then true | |
934 | 934 | else (cfgPoolStatus == PoolShutdown)) | |
935 | 935 | then true | |
936 | 936 | else isPoolOneTokenOperationsDisabled | |
937 | 937 | let checks = [if (if (!(isGetDisabled)) | |
938 | 938 | then true | |
939 | 939 | else isManager(i)) | |
940 | 940 | then true | |
941 | 941 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
942 | 942 | then true | |
943 | 943 | else throwErr("exactly 1 payment are expected")] | |
944 | 944 | if ((checks == checks)) | |
945 | 945 | then { | |
946 | 946 | let outAssetId = parseAssetId(outAssetIdStr) | |
947 | 947 | let payment = i.payments[0] | |
948 | 948 | let paymentAssetId = payment.assetId | |
949 | 949 | let paymentAmount = payment.amount | |
950 | 950 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
951 | 951 | if ((currentKLp == currentKLp)) | |
952 | 952 | then { | |
953 | 953 | let userAddress = i.caller | |
954 | 954 | let txId = i.transactionId | |
955 | - | let $ | |
956 | - | if (($ | |
955 | + | let $t03893839091 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId) | |
956 | + | if (($t03893839091 == $t03893839091)) | |
957 | 957 | then { | |
958 | - | let outInAmountAsset = $ | |
959 | - | let bonus = $ | |
960 | - | let feeAmount = $ | |
961 | - | let commonState = $ | |
962 | - | let amountEstimated = $ | |
958 | + | let outInAmountAsset = $t03893839091._5 | |
959 | + | let bonus = $t03893839091._4 | |
960 | + | let feeAmount = $t03893839091._3 | |
961 | + | let commonState = $t03893839091._2 | |
962 | + | let amountEstimated = $t03893839091._1 | |
963 | 963 | let amount = if (if ((minOutAmount > 0)) | |
964 | 964 | then (minOutAmount > amountEstimated) | |
965 | 965 | else false) | |
966 | 966 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
967 | 967 | else amountEstimated | |
968 | 968 | let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)]) | |
969 | 969 | if ((burnInv == burnInv)) | |
970 | 970 | then { | |
971 | 971 | let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)] | |
972 | 972 | let sendFee = if ((feeAmount > 0)) | |
973 | 973 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
974 | 974 | else nil | |
975 | - | let $ | |
975 | + | let $t03959139838 = { | |
976 | 976 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
977 | 977 | then 0 | |
978 | 978 | else feeAmount | |
979 | 979 | if (outInAmountAsset) | |
980 | 980 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
981 | 981 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
982 | 982 | } | |
983 | - | let amountAssetBalanceDelta = $ | |
984 | - | let priceAssetBalanceDelta = $ | |
985 | - | let $ | |
986 | - | let refreshKLpActions = $ | |
987 | - | let updatedKLp = $ | |
983 | + | let amountAssetBalanceDelta = $t03959139838._1 | |
984 | + | let priceAssetBalanceDelta = $t03959139838._2 | |
985 | + | let $t03984139949 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
986 | + | let refreshKLpActions = $t03984139949._1 | |
987 | + | let updatedKLp = $t03984139949._2 | |
988 | 988 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
989 | 989 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
990 | 990 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
991 | 991 | else throw("Strict value is not equal to itself.") | |
992 | 992 | } | |
993 | 993 | else throw("Strict value is not equal to itself.") | |
994 | 994 | } | |
995 | 995 | else throw("Strict value is not equal to itself.") | |
996 | 996 | } | |
997 | 997 | else throw("Strict value is not equal to itself.") | |
998 | 998 | } | |
999 | 999 | else throw("Strict value is not equal to itself.") | |
1000 | 1000 | } | |
1001 | 1001 | ||
1002 | 1002 | ||
1003 | 1003 | ||
1004 | 1004 | @Callable(i) | |
1005 | 1005 | func getOneTknREADONLY (outAssetId,paymentAmount) = { | |
1006 | - | let $ | |
1007 | - | let amountEstimated = $ | |
1008 | - | let commonState = $ | |
1009 | - | let feeAmount = $ | |
1010 | - | let bonus = $ | |
1011 | - | let outInAmountAsset = $ | |
1006 | + | let $t04020640362 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit) | |
1007 | + | let amountEstimated = $t04020640362._1 | |
1008 | + | let commonState = $t04020640362._2 | |
1009 | + | let feeAmount = $t04020640362._3 | |
1010 | + | let bonus = $t04020640362._4 | |
1011 | + | let outInAmountAsset = $t04020640362._5 | |
1012 | 1012 | $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus)) | |
1013 | 1013 | } | |
1014 | 1014 | ||
1015 | 1015 | ||
1016 | 1016 | ||
1017 | 1017 | @Callable(i) | |
1018 | 1018 | func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = { | |
1019 | 1019 | let isPoolOneTokenOperationsDisabled = { | |
1020 | 1020 | let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1021 | 1021 | if ($isInstanceOf(@, "Boolean")) | |
1022 | 1022 | then @ | |
1023 | 1023 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1024 | 1024 | } | |
1025 | 1025 | let isGetDisabled = if (if (isGlobalShutdown()) | |
1026 | 1026 | then true | |
1027 | 1027 | else (cfgPoolStatus == PoolShutdown)) | |
1028 | 1028 | then true | |
1029 | 1029 | else isPoolOneTokenOperationsDisabled | |
1030 | 1030 | let checks = [if (if (!(isGetDisabled)) | |
1031 | 1031 | then true | |
1032 | 1032 | else isManager(i)) | |
1033 | 1033 | then true | |
1034 | 1034 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1035 | 1035 | then true | |
1036 | 1036 | else throwErr("no payments are expected")] | |
1037 | 1037 | if ((checks == checks)) | |
1038 | 1038 | then { | |
1039 | 1039 | let outAssetId = parseAssetId(outAssetIdStr) | |
1040 | 1040 | let userAddress = i.caller | |
1041 | 1041 | let txId = i.transactionId | |
1042 | 1042 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1043 | 1043 | if ((currentKLp == currentKLp)) | |
1044 | 1044 | then { | |
1045 | 1045 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1046 | 1046 | if ((unstakeInv == unstakeInv)) | |
1047 | 1047 | then { | |
1048 | - | let $ | |
1049 | - | if (($ | |
1048 | + | let $t04126741418 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId) | |
1049 | + | if (($t04126741418 == $t04126741418)) | |
1050 | 1050 | then { | |
1051 | - | let outInAmountAsset = $ | |
1052 | - | let bonus = $ | |
1053 | - | let feeAmount = $ | |
1054 | - | let commonState = $ | |
1055 | - | let amountEstimated = $ | |
1051 | + | let outInAmountAsset = $t04126741418._5 | |
1052 | + | let bonus = $t04126741418._4 | |
1053 | + | let feeAmount = $t04126741418._3 | |
1054 | + | let commonState = $t04126741418._2 | |
1055 | + | let amountEstimated = $t04126741418._1 | |
1056 | 1056 | let amount = if (if ((minOutAmount > 0)) | |
1057 | 1057 | then (minOutAmount > amountEstimated) | |
1058 | 1058 | else false) | |
1059 | 1059 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1060 | 1060 | else amountEstimated | |
1061 | 1061 | let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1062 | 1062 | if ((burnInv == burnInv)) | |
1063 | 1063 | then { | |
1064 | 1064 | let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)] | |
1065 | 1065 | let sendFee = if ((feeAmount > 0)) | |
1066 | 1066 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)] | |
1067 | 1067 | else nil | |
1068 | - | let $ | |
1068 | + | let $t04191342160 = { | |
1069 | 1069 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
1070 | 1070 | then 0 | |
1071 | 1071 | else feeAmount | |
1072 | 1072 | if (outInAmountAsset) | |
1073 | 1073 | then $Tuple2(-((amount + feeAmountForCalc)), 0) | |
1074 | 1074 | else $Tuple2(0, -((amount + feeAmountForCalc))) | |
1075 | 1075 | } | |
1076 | - | let amountAssetBalanceDelta = $ | |
1077 | - | let priceAssetBalanceDelta = $ | |
1078 | - | let $ | |
1079 | - | let refreshKLpActions = $ | |
1080 | - | let updatedKLp = $ | |
1076 | + | let amountAssetBalanceDelta = $t04191342160._1 | |
1077 | + | let priceAssetBalanceDelta = $t04191342160._2 | |
1078 | + | let $t04216342271 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1079 | + | let refreshKLpActions = $t04216342271._1 | |
1080 | + | let updatedKLp = $t04216342271._2 | |
1081 | 1081 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1082 | 1082 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1083 | 1083 | then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount) | |
1084 | 1084 | else throw("Strict value is not equal to itself.") | |
1085 | 1085 | } | |
1086 | 1086 | else throw("Strict value is not equal to itself.") | |
1087 | 1087 | } | |
1088 | 1088 | else throw("Strict value is not equal to itself.") | |
1089 | 1089 | } | |
1090 | 1090 | else throw("Strict value is not equal to itself.") | |
1091 | 1091 | } | |
1092 | 1092 | else throw("Strict value is not equal to itself.") | |
1093 | 1093 | } | |
1094 | 1094 | else throw("Strict value is not equal to itself.") | |
1095 | 1095 | } | |
1096 | 1096 | ||
1097 | 1097 | ||
1098 | 1098 | ||
1099 | 1099 | @Callable(i) | |
1100 | 1100 | func get () = { | |
1101 | 1101 | let res = commonGet(i) | |
1102 | 1102 | let outAmtAmt = res._1 | |
1103 | 1103 | let outPrAmt = res._2 | |
1104 | 1104 | let pmtAmt = res._3 | |
1105 | 1105 | let pmtAssetId = res._4 | |
1106 | 1106 | let state = res._5 | |
1107 | 1107 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1108 | 1108 | if ((currentKLp == currentKLp)) | |
1109 | 1109 | then { | |
1110 | 1110 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1111 | 1111 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1112 | 1112 | then { | |
1113 | - | let $ | |
1114 | - | let refreshKLpActions = $ | |
1115 | - | let updatedKLp = $ | |
1113 | + | let $t04321743299 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1114 | + | let refreshKLpActions = $t04321743299._1 | |
1115 | + | let updatedKLp = $t04321743299._2 | |
1116 | 1116 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1117 | 1117 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1118 | 1118 | then (state ++ refreshKLpActions) | |
1119 | 1119 | else throw("Strict value is not equal to itself.") | |
1120 | 1120 | } | |
1121 | 1121 | else throw("Strict value is not equal to itself.") | |
1122 | 1122 | } | |
1123 | 1123 | else throw("Strict value is not equal to itself.") | |
1124 | 1124 | } | |
1125 | 1125 | ||
1126 | 1126 | ||
1127 | 1127 | ||
1128 | 1128 | @Callable(i) | |
1129 | 1129 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1130 | 1130 | let res = commonGet(i) | |
1131 | 1131 | let outAmAmt = res._1 | |
1132 | 1132 | let outPrAmt = res._2 | |
1133 | 1133 | let pmtAmt = res._3 | |
1134 | 1134 | let pmtAssetId = res._4 | |
1135 | 1135 | let state = res._5 | |
1136 | 1136 | if ((noLessThenAmtAsset > outAmAmt)) | |
1137 | 1137 | then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1138 | 1138 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1139 | 1139 | then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1140 | 1140 | else { | |
1141 | 1141 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1142 | 1142 | if ((currentKLp == currentKLp)) | |
1143 | 1143 | then { | |
1144 | 1144 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1145 | 1145 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1146 | 1146 | then { | |
1147 | - | let $ | |
1148 | - | let refreshKLpActions = $ | |
1149 | - | let updatedKLp = $ | |
1147 | + | let $t04424844329 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1148 | + | let refreshKLpActions = $t04424844329._1 | |
1149 | + | let updatedKLp = $t04424844329._2 | |
1150 | 1150 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1151 | 1151 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1152 | 1152 | then (state ++ refreshKLpActions) | |
1153 | 1153 | else throw("Strict value is not equal to itself.") | |
1154 | 1154 | } | |
1155 | 1155 | else throw("Strict value is not equal to itself.") | |
1156 | 1156 | } | |
1157 | 1157 | else throw("Strict value is not equal to itself.") | |
1158 | 1158 | } | |
1159 | 1159 | } | |
1160 | 1160 | ||
1161 | 1161 | ||
1162 | 1162 | ||
1163 | 1163 | @Callable(i) | |
1164 | 1164 | func unstakeAndGet (amount) = { | |
1165 | 1165 | let checkPayments = if ((size(i.payments) != 0)) | |
1166 | 1166 | then throw("No payments are expected") | |
1167 | 1167 | else true | |
1168 | 1168 | if ((checkPayments == checkPayments)) | |
1169 | 1169 | then { | |
1170 | 1170 | let cfg = getPoolConfig() | |
1171 | 1171 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1172 | 1172 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1173 | 1173 | if ((currentKLp == currentKLp)) | |
1174 | 1174 | then { | |
1175 | 1175 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1176 | 1176 | if ((unstakeInv == unstakeInv)) | |
1177 | 1177 | then { | |
1178 | 1178 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1179 | 1179 | let outAmAmt = res._1 | |
1180 | 1180 | let outPrAmt = res._2 | |
1181 | 1181 | let poolStatus = parseIntValue(res._9) | |
1182 | 1182 | let state = res._10 | |
1183 | 1183 | let checkPoolStatus = if (if (isGlobalShutdown()) | |
1184 | 1184 | then true | |
1185 | 1185 | else (poolStatus == PoolShutdown)) | |
1186 | 1186 | then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus))) | |
1187 | 1187 | else true | |
1188 | 1188 | if ((checkPoolStatus == checkPoolStatus)) | |
1189 | 1189 | then { | |
1190 | 1190 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1191 | 1191 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1192 | 1192 | then { | |
1193 | - | let $ | |
1194 | - | let refreshKLpActions = $ | |
1195 | - | let updatedKLp = $ | |
1193 | + | let $t04545545536 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1194 | + | let refreshKLpActions = $t04545545536._1 | |
1195 | + | let updatedKLp = $t04545545536._2 | |
1196 | 1196 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1197 | 1197 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1198 | 1198 | then (state ++ refreshKLpActions) | |
1199 | 1199 | else throw("Strict value is not equal to itself.") | |
1200 | 1200 | } | |
1201 | 1201 | else throw("Strict value is not equal to itself.") | |
1202 | 1202 | } | |
1203 | 1203 | else throw("Strict value is not equal to itself.") | |
1204 | 1204 | } | |
1205 | 1205 | else throw("Strict value is not equal to itself.") | |
1206 | 1206 | } | |
1207 | 1207 | else throw("Strict value is not equal to itself.") | |
1208 | 1208 | } | |
1209 | 1209 | else throw("Strict value is not equal to itself.") | |
1210 | 1210 | } | |
1211 | 1211 | ||
1212 | 1212 | ||
1213 | 1213 | ||
1214 | 1214 | @Callable(i) | |
1215 | 1215 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1216 | 1216 | let isGetDisabled = if (isGlobalShutdown()) | |
1217 | 1217 | then true | |
1218 | 1218 | else (cfgPoolStatus == PoolShutdown) | |
1219 | 1219 | let checks = [if (!(isGetDisabled)) | |
1220 | 1220 | then true | |
1221 | 1221 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1222 | 1222 | then true | |
1223 | 1223 | else throw("no payments are expected")] | |
1224 | 1224 | if ((checks == checks)) | |
1225 | 1225 | then { | |
1226 | 1226 | let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1227 | 1227 | if ((currentKLp == currentKLp)) | |
1228 | 1228 | then { | |
1229 | 1229 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1230 | 1230 | if ((unstakeInv == unstakeInv)) | |
1231 | 1231 | then { | |
1232 | 1232 | let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1233 | 1233 | let outAmAmt = res._1 | |
1234 | 1234 | let outPrAmt = res._2 | |
1235 | 1235 | let state = res._10 | |
1236 | 1236 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1237 | 1237 | then true | |
1238 | 1238 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1239 | 1239 | then true | |
1240 | 1240 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1241 | 1241 | if ((checkAmounts == checkAmounts)) | |
1242 | 1242 | then { | |
1243 | 1243 | let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1244 | 1244 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1245 | 1245 | then { | |
1246 | - | let $ | |
1247 | - | let refreshKLpActions = $ | |
1248 | - | let updatedKLp = $ | |
1246 | + | let $t04683146912 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1247 | + | let refreshKLpActions = $t04683146912._1 | |
1248 | + | let updatedKLp = $t04683146912._2 | |
1249 | 1249 | let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp) | |
1250 | 1250 | if ((isUpdatedKLpValid == isUpdatedKLpValid)) | |
1251 | 1251 | then (state ++ refreshKLpActions) | |
1252 | 1252 | else throw("Strict value is not equal to itself.") | |
1253 | 1253 | } | |
1254 | 1254 | else throw("Strict value is not equal to itself.") | |
1255 | 1255 | } | |
1256 | 1256 | else throw("Strict value is not equal to itself.") | |
1257 | 1257 | } | |
1258 | 1258 | else throw("Strict value is not equal to itself.") | |
1259 | 1259 | } | |
1260 | 1260 | else throw("Strict value is not equal to itself.") | |
1261 | 1261 | } | |
1262 | 1262 | else throw("Strict value is not equal to itself.") | |
1263 | 1263 | } | |
1264 | 1264 | ||
1265 | 1265 | ||
1266 | 1266 | ||
1267 | 1267 | @Callable(i) | |
1268 | 1268 | func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract))) | |
1269 | 1269 | then throw("permissions denied") | |
1270 | 1270 | else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success") | |
1271 | 1271 | ||
1272 | 1272 | ||
1273 | 1273 | ||
1274 | 1274 | @Callable(i) | |
1275 | 1275 | func refreshKLp () = { | |
1276 | 1276 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0) | |
1277 | 1277 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay)) | |
1278 | 1278 | then unit | |
1279 | 1279 | else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1280 | 1280 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1281 | 1281 | then { | |
1282 | 1282 | let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp")) | |
1283 | - | let $ | |
1284 | - | let kLpUpdateActions = $ | |
1285 | - | let updatedKLp = $ | |
1283 | + | let $t04809948163 = refreshKLpInternal(0, 0, 0) | |
1284 | + | let kLpUpdateActions = $t04809948163._1 | |
1285 | + | let updatedKLp = $t04809948163._2 | |
1286 | 1286 | let actions = if ((kLp != updatedKLp)) | |
1287 | 1287 | then kLpUpdateActions | |
1288 | 1288 | else throwErr("nothing to refresh") | |
1289 | 1289 | $Tuple2(actions, toString(updatedKLp)) | |
1290 | 1290 | } | |
1291 | 1291 | else throw("Strict value is not equal to itself.") | |
1292 | 1292 | } | |
1293 | 1293 | ||
1294 | 1294 | ||
1295 | 1295 | ||
1296 | 1296 | @Callable(i) | |
1297 | 1297 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig()) | |
1298 | 1298 | ||
1299 | 1299 | ||
1300 | 1300 | ||
1301 | 1301 | @Callable(i) | |
1302 | 1302 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1303 | 1303 | ||
1304 | 1304 | ||
1305 | 1305 | ||
1306 | 1306 | @Callable(i) | |
1307 | 1307 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1308 | 1308 | let prices = calcPrices(amAmt, prAmt, lpAmt) | |
1309 | 1309 | $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])]) | |
1310 | 1310 | } | |
1311 | 1311 | ||
1312 | 1312 | ||
1313 | 1313 | ||
1314 | 1314 | @Callable(i) | |
1315 | 1315 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult))) | |
1316 | 1316 | ||
1317 | 1317 | ||
1318 | 1318 | ||
1319 | 1319 | @Callable(i) | |
1320 | 1320 | func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult)) | |
1321 | 1321 | ||
1322 | 1322 | ||
1323 | 1323 | ||
1324 | 1324 | @Callable(i) | |
1325 | 1325 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1326 | 1326 | ||
1327 | 1327 | ||
1328 | 1328 | ||
1329 | 1329 | @Callable(i) | |
1330 | 1330 | func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp)) | |
1331 | 1331 | ||
1332 | 1332 | ||
1333 | 1333 | ||
1334 | 1334 | @Callable(i) | |
1335 | 1335 | func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
1336 | 1336 | let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress)) | |
1337 | 1337 | $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10)) | |
1338 | 1338 | } | |
1339 | 1339 | ||
1340 | 1340 | ||
1341 | 1341 | ||
1342 | 1342 | @Callable(i) | |
1343 | 1343 | func statsREADONLY () = { | |
1344 | 1344 | let cfg = getPoolConfig() | |
1345 | 1345 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1346 | 1346 | let amtAssetId = cfg[idxAmtAssetId] | |
1347 | 1347 | let priceAssetId = cfg[idxPriceAssetId] | |
1348 | 1348 | let iAmtAssetId = cfg[idxIAmtAssetId] | |
1349 | 1349 | let iPriceAssetId = cfg[idxIPriceAssetId] | |
1350 | 1350 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1351 | 1351 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1352 | 1352 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1353 | 1353 | let accAmtAssetBalance = getAccBalance(amtAssetId) | |
1354 | 1354 | let accPriceAssetBalance = getAccBalance(priceAssetId) | |
1355 | 1355 | let pricesList = if ((poolLPBalance == 0)) | |
1356 | 1356 | then [zeroBigInt, zeroBigInt, zeroBigInt] | |
1357 | 1357 | else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance) | |
1358 | 1358 | let curPrice = 0 | |
1359 | 1359 | let lpAmtAssetShare = fromX18(pricesList[1], scale8) | |
1360 | 1360 | let lpPriceAssetShare = fromX18(pricesList[2], scale8) | |
1361 | 1361 | let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this)))) | |
1362 | 1362 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(accAmtAssetBalance), toString(accPriceAssetBalance), toString(poolLPBalance), toString(curPrice), toString(lpAmtAssetShare), toString(lpPriceAssetShare), toString(poolWeight)], SEP)) | |
1363 | 1363 | } | |
1364 | 1364 | ||
1365 | 1365 | ||
1366 | 1366 | ||
1367 | 1367 | @Callable(i) | |
1368 | 1368 | func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = { | |
1369 | 1369 | let cfg = getPoolConfig() | |
1370 | 1370 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1371 | 1371 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1372 | 1372 | let amAssetId = fromBase58String(amAssetIdStr) | |
1373 | 1373 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1374 | 1374 | let prAssetId = fromBase58String(prAssetIdStr) | |
1375 | 1375 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1376 | 1376 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1377 | 1377 | let poolStatus = cfg[idxPoolStatus] | |
1378 | 1378 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1379 | 1379 | let accAmtAssetBalance = getAccBalance(amAssetIdStr) | |
1380 | 1380 | let accPriceAssetBalance = getAccBalance(prAssetIdStr) | |
1381 | 1381 | let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm) | |
1382 | 1382 | let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm) | |
1383 | 1383 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1384 | 1384 | then zeroBigInt | |
1385 | 1385 | else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18) | |
1386 | 1386 | let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm) | |
1387 | 1387 | let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
1388 | 1388 | let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm) | |
1389 | 1389 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1390 | 1390 | let calcLpAmt = estPut._1 | |
1391 | 1391 | let curPriceCalc = estPut._3 | |
1392 | 1392 | let amBalance = estPut._4 | |
1393 | 1393 | let prBalance = estPut._5 | |
1394 | 1394 | let lpEmission = estPut._6 | |
1395 | 1395 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
1396 | 1396 | } | |
1397 | 1397 | ||
1398 | 1398 | ||
1399 | 1399 | ||
1400 | 1400 | @Callable(i) | |
1401 | 1401 | func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = { | |
1402 | 1402 | let cfg = getPoolConfig() | |
1403 | 1403 | let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId]) | |
1404 | 1404 | let amAssetIdStr = cfg[idxAmtAssetId] | |
1405 | 1405 | let amAssetId = fromBase58String(amAssetIdStr) | |
1406 | 1406 | let prAssetIdStr = cfg[idxPriceAssetId] | |
1407 | 1407 | let prAssetId = fromBase58String(prAssetIdStr) | |
1408 | 1408 | let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm]) | |
1409 | 1409 | let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm]) | |
1410 | 1410 | let poolStatus = cfg[idxPoolStatus] | |
1411 | 1411 | let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity | |
1412 | 1412 | let amBalanceRaw = getAccBalance(amAssetIdStr) | |
1413 | 1413 | let prBalanceRaw = getAccBalance(prAssetIdStr) | |
1414 | 1414 | let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm) | |
1415 | 1415 | let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm) | |
1416 | 1416 | let curPriceX18 = if ((poolLPBalance == 0)) | |
1417 | 1417 | then zeroBigInt | |
1418 | 1418 | else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18) | |
1419 | 1419 | let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm) | |
1420 | 1420 | let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
1421 | 1421 | let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm) | |
1422 | 1422 | let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false) | |
1423 | 1423 | let calcLpAmt = estPut._1 | |
1424 | 1424 | let curPriceCalc = estPut._3 | |
1425 | 1425 | let amBalance = estPut._4 | |
1426 | 1426 | let prBalance = estPut._5 | |
1427 | 1427 | let lpEmission = estPut._6 | |
1428 | 1428 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(calcLpAmt), toString(fromX18(curPriceX18, scale8)), toString(amBalance), toString(prBalance), toString(lpEmission), poolStatus, toString(inAmAssetAmt), toString(inPrAssetAmt)], SEP)) | |
1429 | 1429 | } | |
1430 | 1430 | ||
1431 | 1431 | ||
1432 | 1432 | ||
1433 | 1433 | @Callable(i) | |
1434 | 1434 | func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = { | |
1435 | 1435 | let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this) | |
1436 | 1436 | let outAmAmt = res._1 | |
1437 | 1437 | let outPrAmt = res._2 | |
1438 | 1438 | let amBalance = res._5 | |
1439 | 1439 | let prBalance = res._6 | |
1440 | 1440 | let lpEmission = res._7 | |
1441 | 1441 | let curPrice = res._8 | |
1442 | 1442 | let poolStatus = parseIntValue(res._9) | |
1443 | 1443 | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(outAmAmt), toString(outPrAmt), toString(amBalance), toString(prBalance), toString(lpEmission), toString(curPrice), toString(poolStatus)], SEP)) | |
1444 | 1444 | } | |
1445 | 1445 | ||
1446 | 1446 | ||
1447 | 1447 | @Verifier(tx) | |
1448 | 1448 | func verify () = { | |
1449 | 1449 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1450 | 1450 | case pk: ByteVector => | |
1451 | 1451 | pk | |
1452 | 1452 | case _: Unit => | |
1453 | 1453 | tx.senderPublicKey | |
1454 | 1454 | case _ => | |
1455 | 1455 | throw("Match error") | |
1456 | 1456 | } | |
1457 | 1457 | match tx { | |
1458 | 1458 | case order: Order => | |
1459 | 1459 | let matcherPub = getMatcherPubOrFail() | |
1460 | - | let $ | |
1461 | - | let orderValid = $ | |
1462 | - | let orderValidInfo = $ | |
1460 | + | let $t05682556894 = validateMatcherOrderAllowed(order) | |
1461 | + | let orderValid = $t05682556894._1 | |
1462 | + | let orderValidInfo = $t05682556894._2 | |
1463 | 1463 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1464 | 1464 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1465 | 1465 | if (if (if (orderValid) | |
1466 | 1466 | then senderValid | |
1467 | 1467 | else false) | |
1468 | 1468 | then matcherValid | |
1469 | 1469 | else false) | |
1470 | 1470 | then true | |
1471 | 1471 | else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid) | |
1472 | 1472 | case s: SetScriptTransaction => | |
1473 | 1473 | let newHash = blake2b256(value(s.script)) | |
1474 | 1474 | let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash()))) | |
1475 | 1475 | let currentHash = scriptHash(this) | |
1476 | 1476 | if (if ((allowedHash == newHash)) | |
1477 | 1477 | then (currentHash != newHash) | |
1478 | 1478 | else false) | |
1479 | 1479 | then true | |
1480 | 1480 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1481 | 1481 | case _ => | |
1482 | 1482 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1483 | 1483 | } | |
1484 | 1484 | } | |
1485 | 1485 |
github/deemru/w8io/026f985 180.03 ms ◑