tx · 5B2GFR6f4TRhfJ5VQKTCccn2LRgsrjYU1kzLHNEy1rJw

3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh:  -0.03600000 Waves

2023.02.09 15:49 [2442107] smart account 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh > SELF 0.00000000 Waves

{ "type": 13, "id": "5B2GFR6f4TRhfJ5VQKTCccn2LRgsrjYU1kzLHNEy1rJw", "fee": 3600000, "feeAssetId": null, "timestamp": 1675946944247, "version": 1, "sender": "3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh", "senderPublicKey": "Cr8D7eozSzJh7XHsYTjBinPpo3SS83BrCGiBAJsjGxBo", "proofs": [ "3ihRQmR1fsEYoAVxPqxVVi8earikq88BXMVweTz7MYm9aGETM4jFDauTyhuUDpj5zmzW2z83dt6YVq6EvmHXUFR7" ], "script": "base64:BgKBLggCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQi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zYWN0aW9uBAJlWgUCZFYDCQD0AwMIBQJnSQlib2R5Qnl0ZXMJAJEDAggFAmdJBnByb29mcwAABQJnSwYEAmdOCQD2AwEJAQV2YWx1ZQEIBQJlWgZzY3JpcHQEAmdPCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYU4JAQJhegAEAmdQCQDxBwEFBHRoaXMDCQAAAgUCZ08FAmdOCQECIT0CBQJnUAUCZ04HCQD0AwMIBQJnSQlib2R5Qnl0ZXMJAJEDAggFAmdJBnByb29mcwAABQJnS0Hdfx8=", "chainId": 84, "height": 2442107, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2WgjaRzisTBEtqaBbJ5GRHrKKZ4zQjmWHNyXD59sVb7G Next: 5vpTG19KCiioQXqW6f81AtY2psgrono2yJCgz6Ni11ZE Diff:
OldNewDifferences
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
85-
86-
87-func swapContract () = "%s__swapContract"
8885
8986
9087 func fc () = "%s__factoryContract"
219216
220217 let poolConfigParsed = parsePoolConfig(getPoolConfig())
221218
222-let $t084698635 = poolConfigParsed
219+let $t084088574 = poolConfigParsed
223220
224-let cfgPoolAddress = $t084698635._1
221+let cfgPoolAddress = $t084088574._1
225222
226-let cfgPoolStatus = $t084698635._2
223+let cfgPoolStatus = $t084088574._2
227224
228-let cfgLpAssetId = $t084698635._3
225+let cfgLpAssetId = $t084088574._3
229226
230-let cfgAmountAssetId = $t084698635._4
227+let cfgAmountAssetId = $t084088574._4
231228
232-let cfgPriceAssetId = $t084698635._5
229+let cfgPriceAssetId = $t084088574._5
233230
234-let cfgAmountAssetDecimals = $t084698635._6
231+let cfgAmountAssetDecimals = $t084088574._6
235232
236-let cfgPriceAssetDecimals = $t084698635._7
233+let cfgPriceAssetDecimals = $t084088574._7
237234
238235 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
239236
438435 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
439436 let amountAssetAmount = order.amount
440437 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
441- let $t02154121753 = if ((order.orderType == Buy))
438+ let $t02148021692 = if ((order.orderType == Buy))
442439 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
443440 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
444- let amountAssetBalanceDelta = $t02154121753._1
445- let priceAssetBalanceDelta = $t02154121753._2
441+ let amountAssetBalanceDelta = $t02148021692._1
442+ let priceAssetBalanceDelta = $t02148021692._2
446443 if (if (if (isGlobalShutdown())
447444 then true
448445 else (cfgPoolStatus == PoolMatcherDisabled))
455452 then throw("Wrong order assets.")
456453 else {
457454 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
458- let $t02219322293 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
459- let unusedActions = $t02219322293._1
460- let kLpNew = $t02219322293._2
455+ let $t02213222232 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
456+ let unusedActions = $t02213222232._1
457+ let kLpNew = $t02213222232._2
461458 let isOrderValid = (kLpNew >= kLp)
462459 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
463460 $Tuple2(isOrderValid, info)
536533 else if ((paymentAssetId == cfgPriceAssetId))
537534 then false
538535 else throwErr("invalid asset")
539- let $t02540625699 = if (isEval)
536+ let $t02534525638 = if (isEval)
540537 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
541538 else if (paymentInAmountAsset)
542539 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
543540 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
544- let amountBalanceOld = $t02540625699._1
545- let priceBalanceOld = $t02540625699._2
546- let $t02570325852 = if (paymentInAmountAsset)
541+ let amountBalanceOld = $t02534525638._1
542+ let priceBalanceOld = $t02534525638._2
543+ let $t02564225791 = if (paymentInAmountAsset)
547544 then $Tuple2(paymentAmountRaw, 0)
548545 else $Tuple2(0, paymentAmountRaw)
549- let amountAssetAmountRaw = $t02570325852._1
550- let priceAssetAmountRaw = $t02570325852._2
546+ let amountAssetAmountRaw = $t02564225791._1
547+ let priceAssetAmountRaw = $t02564225791._2
551548 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
552549 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
553- let $t02598426048 = takeFee(paymentAmountRaw, inFee)
554- let paymentAmount = $t02598426048._1
555- let feeAmount = $t02598426048._2
550+ let $t02592325987 = takeFee(paymentAmountRaw, inFee)
551+ let paymentAmount = $t02592325987._1
552+ let feeAmount = $t02592325987._2
556553 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
557554 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
558555 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
575572 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
576573 let priceOld = fromX18(priceOldX18, scale8)
577574 let loss = {
578- let $t02772927896 = if (paymentInAmountAsset)
575+ let $t02766827835 = if (paymentInAmountAsset)
579576 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
580577 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
581- let amount = $t02772927896._1
582- let balance = $t02772927896._2
578+ let amount = $t02766827835._1
579+ let balance = $t02766827835._2
583580 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
584581 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
585582 }
619616 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
620617 let redeemedBigInt = toBigInt(paymentAmount)
621618 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
622- let $t02997430030 = takeFee(amountRaw, outFee)
623- let totalAmount = $t02997430030._1
624- let feeAmount = $t02997430030._2
625- let $t03003430260 = if (outInAmountAsset)
619+ let $t02991329969 = takeFee(amountRaw, outFee)
620+ let totalAmount = $t02991329969._1
621+ let feeAmount = $t02991329969._2
622+ let $t02997330199 = if (outInAmountAsset)
626623 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
627624 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
628- let outAmAmount = $t03003430260._1
629- let outPrAmount = $t03003430260._2
630- let amBalanceNew = $t03003430260._3
631- let prBalanceNew = $t03003430260._4
625+ let outAmAmount = $t02997330199._1
626+ let outPrAmount = $t02997330199._2
627+ let amBalanceNew = $t02997330199._3
628+ let prBalanceNew = $t02997330199._4
632629 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
633630 let priceNew = fromX18(priceNewX18, scale8)
634631 let commonState = if (isEval)
691688 throw("Match error")
692689 }
693690 }
694-
695-
696-@Callable(i)
697-func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse) = {
698- let $t03195532260 = if ((isReverse == false))
699- then {
700- let assetOut = getStringOrFail(this, pa())
701- let assetIn = getStringOrFail(this, aa())
702- $Tuple2(assetOut, assetIn)
703- }
704- else {
705- let assetOut = getStringOrFail(this, aa())
706- let assetIn = getStringOrFail(this, pa())
707- $Tuple2(assetOut, assetIn)
708- }
709- let assetOut = $t03195532260._1
710- let assetIn = $t03195532260._2
711- let poolAssetInBalance = getAccBalance(assetIn)
712- let poolAssetOutBalance = getAccBalance(assetOut)
713- let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
714- let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
715- let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
716- let checkK = if ((newK >= oldK))
717- then true
718- else throw("new K is fewer error")
719- if ((checkK == checkK))
720- then $Tuple2(nil, amountOut)
721- else throw("Strict value is not equal to itself.")
722- }
723-
724-
725-
726-@Callable(i)
727-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
728- let swapContact = {
729- let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
730- if ($isInstanceOf(@, "String"))
731- then @
732- else throw(($getType(@) + " couldn't be cast to String"))
733- }
734- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
735- then true
736- else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
737- then true
738- else throwErr("Permission denied")]
739- if ((checks == checks))
740- then {
741- let pmt = value(i.payments[0])
742- let assetIn = if ((pmt.assetId == unit))
743- then toBase58String(toBytes("WAVES"))
744- else toBase58String(value(pmt.assetId))
745- let assetOut = if ((isReverse == false))
746- then getStringOrFail(this, pa())
747- else getStringOrFail(this, aa())
748- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
749- let poolAssetOutBalance = getAccBalance(assetOut)
750- let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
751- let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
752- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
753- let checkK = if ((newK >= oldK))
754- then true
755- else throw("new K is fewer error")
756- if ((checkK == checkK))
757- then {
758- let checkMin = if ((amountOut >= amountOutMin))
759- then true
760- else throw("Exchange result is fewer coins than expected")
761- if ((checkMin == checkMin))
762- then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))], amountOut)
763- else throw("Strict value is not equal to itself.")
764- }
765- else throw("Strict value is not equal to itself.")
766- }
767- else throw("Strict value is not equal to itself.")
768- }
769-
770691
771692
772693 @Callable(i)
850771 else throw("Strict value is not equal to itself.")
851772 }
852773 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
853- let $t03714537607 = refreshKLpInternal(0, 0, 0)
854- if (($t03714537607 == $t03714537607))
774+ let $t03472735189 = refreshKLpInternal(0, 0, 0)
775+ if (($t03472735189 == $t03472735189))
855776 then {
856- let updatedKLp = $t03714537607._2
857- let refreshKLpActions = $t03714537607._1
777+ let updatedKLp = $t03472735189._2
778+ let refreshKLpActions = $t03472735189._1
858779 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
859780 if ((isUpdatedKLpValid == isUpdatedKLpValid))
860781 then ((state ++ lpTransfer) ++ refreshKLpActions)
886807 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
887808 if ((currentKLp == currentKLp))
888809 then {
889- let $t03816938234 = refreshKLpInternal(0, 0, 0)
890- let refreshKLpActions = $t03816938234._1
891- let updatedKLp = $t03816938234._2
810+ let $t03575135816 = refreshKLpInternal(0, 0, 0)
811+ let refreshKLpActions = $t03575135816._1
812+ let updatedKLp = $t03575135816._2
892813 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
893814 if ((isUpdatedKLpValid == isUpdatedKLpValid))
894815 then (state ++ refreshKLpActions)
935856 then {
936857 let userAddress = i.caller
937858 let txId = i.transactionId
938- let $t03942239574 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
939- if (($t03942239574 == $t03942239574))
859+ let $t03700437156 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
860+ if (($t03700437156 == $t03700437156))
940861 then {
941- let paymentInAmountAsset = $t03942239574._5
942- let bonus = $t03942239574._4
943- let feeAmount = $t03942239574._3
944- let commonState = $t03942239574._2
945- let emitAmountEstimated = $t03942239574._1
862+ let paymentInAmountAsset = $t03700437156._5
863+ let bonus = $t03700437156._4
864+ let feeAmount = $t03700437156._3
865+ let commonState = $t03700437156._2
866+ let emitAmountEstimated = $t03700437156._1
946867 let emitAmount = if (if ((minOutAmount > 0))
947868 then (minOutAmount > emitAmountEstimated)
948869 else false)
962883 let sendFee = if ((feeAmount > 0))
963884 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
964885 else nil
965- let $t04016040357 = if ((this == feeCollectorAddress))
886+ let $t03774237939 = if ((this == feeCollectorAddress))
966887 then $Tuple2(0, 0)
967888 else if (paymentInAmountAsset)
968889 then $Tuple2(-(feeAmount), 0)
969890 else $Tuple2(0, -(feeAmount))
970- let amountAssetBalanceDelta = $t04016040357._1
971- let priceAssetBalanceDelta = $t04016040357._2
972- let $t04036040468 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
973- let refreshKLpActions = $t04036040468._1
974- let updatedKLp = $t04036040468._2
891+ let amountAssetBalanceDelta = $t03774237939._1
892+ let priceAssetBalanceDelta = $t03774237939._2
893+ let $t03794238050 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
894+ let refreshKLpActions = $t03794238050._1
895+ let updatedKLp = $t03794238050._2
975896 let kLp = value(getString(keyKLp))
976897 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
977898 if ((isUpdatedKLpValid == isUpdatedKLpValid))
991912
992913 @Callable(i)
993914 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
994- let $t04077440931 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
995- let emitAmountEstimated = $t04077440931._1
996- let commonState = $t04077440931._2
997- let feeAmount = $t04077440931._3
998- let bonus = $t04077440931._4
999- let paymentInAmountAsset = $t04077440931._5
915+ let $t03835638513 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
916+ let emitAmountEstimated = $t03835638513._1
917+ let commonState = $t03835638513._2
918+ let feeAmount = $t03835638513._3
919+ let bonus = $t03835638513._4
920+ let paymentInAmountAsset = $t03835638513._5
1000921 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
1001922 }
1002923
1033954 then {
1034955 let userAddress = i.caller
1035956 let txId = i.transactionId
1036- let $t04181641969 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1037- if (($t04181641969 == $t04181641969))
957+ let $t03939839551 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
958+ if (($t03939839551 == $t03939839551))
1038959 then {
1039- let outInAmountAsset = $t04181641969._5
1040- let bonus = $t04181641969._4
1041- let feeAmount = $t04181641969._3
1042- let commonState = $t04181641969._2
1043- let amountEstimated = $t04181641969._1
960+ let outInAmountAsset = $t03939839551._5
961+ let bonus = $t03939839551._4
962+ let feeAmount = $t03939839551._3
963+ let commonState = $t03939839551._2
964+ let amountEstimated = $t03939839551._1
1044965 let amount = if (if ((minOutAmount > 0))
1045966 then (minOutAmount > amountEstimated)
1046967 else false)
1053974 let sendFee = if ((feeAmount > 0))
1054975 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1055976 else nil
1056- let $t04246942716 = {
977+ let $t04005140298 = {
1057978 let feeAmountForCalc = if ((this == feeCollectorAddress))
1058979 then 0
1059980 else feeAmount
1061982 then $Tuple2(-((amount + feeAmountForCalc)), 0)
1062983 else $Tuple2(0, -((amount + feeAmountForCalc)))
1063984 }
1064- let amountAssetBalanceDelta = $t04246942716._1
1065- let priceAssetBalanceDelta = $t04246942716._2
1066- let $t04271942827 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1067- let refreshKLpActions = $t04271942827._1
1068- let updatedKLp = $t04271942827._2
985+ let amountAssetBalanceDelta = $t04005140298._1
986+ let priceAssetBalanceDelta = $t04005140298._2
987+ let $t04030140409 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
988+ let refreshKLpActions = $t04030140409._1
989+ let updatedKLp = $t04030140409._2
1069990 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1070991 if ((isUpdatedKLpValid == isUpdatedKLpValid))
1071992 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10841005
10851006 @Callable(i)
10861007 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1087- let $t04308443240 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1088- let amountEstimated = $t04308443240._1
1089- let commonState = $t04308443240._2
1090- let feeAmount = $t04308443240._3
1091- let bonus = $t04308443240._4
1092- let outInAmountAsset = $t04308443240._5
1008+ let $t04066640822 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1009+ let amountEstimated = $t04066640822._1
1010+ let commonState = $t04066640822._2
1011+ let feeAmount = $t04066640822._3
1012+ let bonus = $t04066640822._4
1013+ let outInAmountAsset = $t04066640822._5
10931014 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10941015 }
10951016
11261047 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11271048 if ((unstakeInv == unstakeInv))
11281049 then {
1129- let $t04414544296 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1130- if (($t04414544296 == $t04414544296))
1050+ let $t04172741878 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1051+ if (($t04172741878 == $t04172741878))
11311052 then {
1132- let outInAmountAsset = $t04414544296._5
1133- let bonus = $t04414544296._4
1134- let feeAmount = $t04414544296._3
1135- let commonState = $t04414544296._2
1136- let amountEstimated = $t04414544296._1
1053+ let outInAmountAsset = $t04172741878._5
1054+ let bonus = $t04172741878._4
1055+ let feeAmount = $t04172741878._3
1056+ let commonState = $t04172741878._2
1057+ let amountEstimated = $t04172741878._1
11371058 let amount = if (if ((minOutAmount > 0))
11381059 then (minOutAmount > amountEstimated)
11391060 else false)
11461067 let sendFee = if ((feeAmount > 0))
11471068 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
11481069 else nil
1149- let $t04479145038 = {
1070+ let $t04237342620 = {
11501071 let feeAmountForCalc = if ((this == feeCollectorAddress))
11511072 then 0
11521073 else feeAmount
11541075 then $Tuple2(-((amount + feeAmountForCalc)), 0)
11551076 else $Tuple2(0, -((amount + feeAmountForCalc)))
11561077 }
1157- let amountAssetBalanceDelta = $t04479145038._1
1158- let priceAssetBalanceDelta = $t04479145038._2
1159- let $t04504145149 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1160- let refreshKLpActions = $t04504145149._1
1161- let updatedKLp = $t04504145149._2
1078+ let amountAssetBalanceDelta = $t04237342620._1
1079+ let priceAssetBalanceDelta = $t04237342620._2
1080+ let $t04262342731 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1081+ let refreshKLpActions = $t04262342731._1
1082+ let updatedKLp = $t04262342731._2
11621083 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11631084 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11641085 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11911112 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11921113 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11931114 then {
1194- let $t04609546177 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1195- let refreshKLpActions = $t04609546177._1
1196- let updatedKLp = $t04609546177._2
1115+ let $t04367743759 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1116+ let refreshKLpActions = $t04367743759._1
1117+ let updatedKLp = $t04367743759._2
11971118 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11981119 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11991120 then (state ++ refreshKLpActions)
12251146 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12261147 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12271148 then {
1228- let $t04712647207 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1229- let refreshKLpActions = $t04712647207._1
1230- let updatedKLp = $t04712647207._2
1149+ let $t04470844789 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1150+ let refreshKLpActions = $t04470844789._1
1151+ let updatedKLp = $t04470844789._2
12311152 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12321153 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12331154 then (state ++ refreshKLpActions)
12711192 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12721193 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12731194 then {
1274- let $t04833348414 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1275- let refreshKLpActions = $t04833348414._1
1276- let updatedKLp = $t04833348414._2
1195+ let $t04591545996 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1196+ let refreshKLpActions = $t04591545996._1
1197+ let updatedKLp = $t04591545996._2
12771198 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12781199 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12791200 then (state ++ refreshKLpActions)
13241245 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13251246 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13261247 then {
1327- let $t04970949790 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1328- let refreshKLpActions = $t04970949790._1
1329- let updatedKLp = $t04970949790._2
1248+ let $t04729147372 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1249+ let refreshKLpActions = $t04729147372._1
1250+ let updatedKLp = $t04729147372._2
13301251 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13311252 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13321253 then (state ++ refreshKLpActions)
13611282 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13621283 then {
13631284 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1364- let $t05097751041 = refreshKLpInternal(0, 0, 0)
1365- let kLpUpdateActions = $t05097751041._1
1366- let updatedKLp = $t05097751041._2
1285+ let $t04855948623 = refreshKLpInternal(0, 0, 0)
1286+ let kLpUpdateActions = $t04855948623._1
1287+ let updatedKLp = $t04855948623._2
13671288 let actions = if ((kLp != updatedKLp))
13681289 then kLpUpdateActions
13691290 else throwErr("nothing to refresh")
15381459 match tx {
15391460 case order: Order =>
15401461 let matcherPub = getMatcherPubOrFail()
1541- let $t05970359772 = validateMatcherOrderAllowed(order)
1542- let orderValid = $t05970359772._1
1543- let orderValidInfo = $t05970359772._2
1462+ let $t05728557354 = validateMatcherOrderAllowed(order)
1463+ let orderValid = $t05728557354._1
1464+ let orderValidInfo = $t05728557354._2
15441465 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15451466 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15461467 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6666
6767
6868 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6969
7070
7171 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
7272
7373
7474 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7575
7676
7777 func abs (val) = if ((0 > val))
7878 then -(val)
7979 else val
8080
8181
8282 func absBigInt (val) = if ((zeroBigInt > val))
8383 then -(val)
8484 else val
85-
86-
87-func swapContract () = "%s__swapContract"
8885
8986
9087 func fc () = "%s__factoryContract"
9188
9289
9390 func mpk () = "%s__managerPublicKey"
9491
9592
9693 func pmpk () = "%s__pendingManagerPublicKey"
9794
9895
9996 func pl () = "%s%s__price__last"
10097
10198
10299 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103100
104101
105102 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106103
107104
108105 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109106
110107
111108 func aa () = "%s__amountAsset"
112109
113110
114111 func pa () = "%s__priceAsset"
115112
116113
117114 let keyFee = "%s__fee"
118115
119116 let feeDefault = fraction(10, scale8, 10000)
120117
121118 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122119
123120 let keyKLp = makeString(["%s", "kLp"], SEP)
124121
125122 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126123
127124 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128125
129126 let kLpRefreshDelayDefault = 30
130127
131128 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132129
133130 func keyFactoryConfig () = "%s__factoryConfig"
134131
135132
136133 func keyMatcherPub () = "%s%s__matcher__publicKey"
137134
138135
139136 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
140137
141138
142139 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
143140
144141
145142 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
146143
147144
148145 func keyAllPoolsShutdown () = "%s__shutdown"
149146
150147
151148 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
152149
153150
154151 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
155152
156153
157154 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
158155
159156 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
160157
161158
162159 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
163160
164161
165162 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
166163
167164
168165 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
169166
170167
171168 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
172169
173170
174171 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
175172
176173 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
177174
178175 let inFee = {
179176 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
180177 if ($isInstanceOf(@, "Int"))
181178 then @
182179 else throw(($getType(@) + " couldn't be cast to Int"))
183180 }
184181
185182 let outFee = {
186183 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
187184 if ($isInstanceOf(@, "Int"))
188185 then @
189186 else throw(($getType(@) + " couldn't be cast to Int"))
190187 }
191188
192189 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
193190
194191
195192 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
196193
197194
198195 func getPoolConfig () = {
199196 let amtAsset = getStringOrFail(this, aa())
200197 let priceAsset = getStringOrFail(this, pa())
201198 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
202199 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
203200 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
204201 }
205202
206203
207204 func parseAssetId (input) = if ((input == wavesString))
208205 then unit
209206 else fromBase58String(input)
210207
211208
212209 func assetIdToString (input) = if ((input == unit))
213210 then wavesString
214211 else toBase58String(value(input))
215212
216213
217214 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]))
218215
219216
220217 let poolConfigParsed = parsePoolConfig(getPoolConfig())
221218
222-let $t084698635 = poolConfigParsed
219+let $t084088574 = poolConfigParsed
223220
224-let cfgPoolAddress = $t084698635._1
221+let cfgPoolAddress = $t084088574._1
225222
226-let cfgPoolStatus = $t084698635._2
223+let cfgPoolStatus = $t084088574._2
227224
228-let cfgLpAssetId = $t084698635._3
225+let cfgLpAssetId = $t084088574._3
229226
230-let cfgAmountAssetId = $t084698635._4
227+let cfgAmountAssetId = $t084088574._4
231228
232-let cfgPriceAssetId = $t084698635._5
229+let cfgPriceAssetId = $t084088574._5
233230
234-let cfgAmountAssetDecimals = $t084698635._6
231+let cfgAmountAssetDecimals = $t084088574._6
235232
236-let cfgPriceAssetDecimals = $t084698635._7
233+let cfgPriceAssetDecimals = $t084088574._7
237234
238235 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
239236
240237
241238 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
242239
243240 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
244241
245242 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)
246243
247244
248245 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)
249246
250247
251248 func getAccBalance (assetId) = if ((assetId == "WAVES"))
252249 then wavesBalance(this).available
253250 else assetBalance(this, fromBase58String(assetId))
254251
255252
256253 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
257254
258255
259256 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
260257
261258
262259 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
263260 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
264261 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
265262 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
266263 }
267264
268265
269266 func calcPrices (amAmt,prAmt,lpAmt) = {
270267 let cfg = getPoolConfig()
271268 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
272269 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
273270 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
274271 let amAmtX18 = toX18(amAmt, amtAssetDcm)
275272 let prAmtX18 = toX18(prAmt, priceAssetDcm)
276273 let lpAmtX18 = toX18(lpAmt, scale8)
277274 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
278275 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
279276 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
280277 }
281278
282279
283280 func calculatePrices (amAmt,prAmt,lpAmt) = {
284281 let prices = calcPrices(amAmt, prAmt, lpAmt)
285282 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
286283 }
287284
288285
289286 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
290287 let cfg = getPoolConfig()
291288 let lpAssetId = cfg[idxPoolLPAssetId]
292289 let amAssetId = cfg[idxAmtAssetId]
293290 let prAssetId = cfg[idxPriceAssetId]
294291 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
295292 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
296293 let poolStatus = cfg[idxPoolStatus]
297294 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
298295 if ((lpAssetId != pmtAssetId))
299296 then throw("Invalid asset passed.")
300297 else {
301298 let amBalance = getAccBalance(amAssetId)
302299 let amBalanceX18 = toX18(amBalance, amAssetDcm)
303300 let prBalance = getAccBalance(prAssetId)
304301 let prBalanceX18 = toX18(prBalance, prAssetDcm)
305302 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
306303 let curPrice = fromX18(curPriceX18, scale8)
307304 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
308305 let lpEmissionX18 = toX18(lpEmission, scale8)
309306 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
310307 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
311308 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
312309 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
313310 let state = if ((txId58 == ""))
314311 then nil
315312 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
316313 then unit
317314 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
318315 then unit
319316 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)]
320317 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
321318 }
322319 }
323320
324321
325322 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
326323 let cfg = getPoolConfig()
327324 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
328325 let amAssetIdStr = cfg[idxAmtAssetId]
329326 let prAssetIdStr = cfg[idxPriceAssetId]
330327 let iAmtAssetId = cfg[idxIAmtAssetId]
331328 let iPriceAssetId = cfg[idxIPriceAssetId]
332329 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
333330 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
334331 let poolStatus = cfg[idxPoolStatus]
335332 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
336333 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
337334 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
338335 if (if ((amAssetIdStr != inAmAssetIdStr))
339336 then true
340337 else (prAssetIdStr != inPrAssetIdStr))
341338 then throw("Invalid amt or price asset passed.")
342339 else {
343340 let amBalance = if (isEvaluate)
344341 then getAccBalance(amAssetIdStr)
345342 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
346343 let prBalance = if (isEvaluate)
347344 then getAccBalance(prAssetIdStr)
348345 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
349346 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
350347 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
351348 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
352349 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
353350 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
354351 let res = if ((lpEmission == 0))
355352 then {
356353 let curPriceX18 = zeroBigInt
357354 let slippageX18 = zeroBigInt
358355 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
359356 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
360357 }
361358 else {
362359 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
363360 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
364361 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
365362 if (if ((curPriceX18 != zeroBigInt))
366363 then (slippageX18 > slippageToleranceX18)
367364 else false)
368365 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
369366 else {
370367 let lpEmissionX18 = toX18(lpEmission, scale8)
371368 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
372369 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
373370 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
374371 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
375372 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
376373 let expAmtAssetAmtX18 = expectedAmts._1
377374 let expPriceAssetAmtX18 = expectedAmts._2
378375 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
379376 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
380377 }
381378 }
382379 let calcLpAmt = res._1
383380 let calcAmAssetPmt = res._2
384381 let calcPrAssetPmt = res._3
385382 let curPrice = fromX18(res._4, scale8)
386383 let slippageCalc = fromX18(res._5, scale8)
387384 if ((0 >= calcLpAmt))
388385 then throw("Invalid calculations. LP calculated is less than zero.")
389386 else {
390387 let emitLpAmt = if (!(emitLp))
391388 then 0
392389 else calcLpAmt
393390 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
394391 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
395392 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))]
396393 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
397394 }
398395 }
399396 }
400397
401398
402399 func calcKLp (amountBalance,priceBalance,lpEmission) = {
403400 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
404401 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
405402 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
406403 if ((lpEmission == big0))
407404 then big0
408405 else updatedKLp
409406 }
410407
411408
412409 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
413410 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
414411 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
415412 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
416413 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
417414 currentKLp
418415 }
419416
420417
421418 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
422419 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
423420 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
424421 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
425422 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
426423 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
427424 $Tuple2(actions, updatedKLp)
428425 }
429426
430427
431428 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
432429 then true
433430 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
434431
435432
436433 func validateMatcherOrderAllowed (order) = {
437434 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
438435 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
439436 let amountAssetAmount = order.amount
440437 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
441- let $t02154121753 = if ((order.orderType == Buy))
438+ let $t02148021692 = if ((order.orderType == Buy))
442439 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
443440 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
444- let amountAssetBalanceDelta = $t02154121753._1
445- let priceAssetBalanceDelta = $t02154121753._2
441+ let amountAssetBalanceDelta = $t02148021692._1
442+ let priceAssetBalanceDelta = $t02148021692._2
446443 if (if (if (isGlobalShutdown())
447444 then true
448445 else (cfgPoolStatus == PoolMatcherDisabled))
449446 then true
450447 else (cfgPoolStatus == PoolShutdown))
451448 then throw("Exchange operations disabled")
452449 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
453450 then true
454451 else (order.assetPair.priceAsset != cfgPriceAssetId))
455452 then throw("Wrong order assets.")
456453 else {
457454 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
458- let $t02219322293 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
459- let unusedActions = $t02219322293._1
460- let kLpNew = $t02219322293._2
455+ let $t02213222232 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
456+ let unusedActions = $t02213222232._1
457+ let kLpNew = $t02213222232._2
461458 let isOrderValid = (kLpNew >= kLp)
462459 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
463460 $Tuple2(isOrderValid, info)
464461 }
465462 }
466463
467464
468465 func commonGet (i) = if ((size(i.payments) != 1))
469466 then throw("exactly 1 payment is expected")
470467 else {
471468 let pmt = value(i.payments[0])
472469 let pmtAssetId = value(pmt.assetId)
473470 let pmtAmt = pmt.amount
474471 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
475472 let outAmAmt = res._1
476473 let outPrAmt = res._2
477474 let poolStatus = parseIntValue(res._9)
478475 let state = res._10
479476 if (if (isGlobalShutdown())
480477 then true
481478 else (poolStatus == PoolShutdown))
482479 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
483480 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
484481 }
485482
486483
487484 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
488485 then throw("exactly 2 payments are expected")
489486 else {
490487 let amAssetPmt = value(i.payments[0])
491488 let prAssetPmt = value(i.payments[1])
492489 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
493490 let poolStatus = parseIntValue(estPut._8)
494491 if (if (if (isGlobalShutdown())
495492 then true
496493 else (poolStatus == PoolPutDisabled))
497494 then true
498495 else (poolStatus == PoolShutdown))
499496 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
500497 else estPut
501498 }
502499
503500
504501 func emit (amount) = {
505502 let emitInv = invoke(factoryContract, "emit", [amount], nil)
506503 if ((emitInv == emitInv))
507504 then {
508505 let emitInvLegacy = match emitInv {
509506 case legacyFactoryContract: Address =>
510507 invoke(legacyFactoryContract, "emit", [amount], nil)
511508 case _ =>
512509 unit
513510 }
514511 if ((emitInvLegacy == emitInvLegacy))
515512 then amount
516513 else throw("Strict value is not equal to itself.")
517514 }
518515 else throw("Strict value is not equal to itself.")
519516 }
520517
521518
522519 func takeFee (amount,fee) = {
523520 let feeAmount = if ((fee == 0))
524521 then 0
525522 else fraction(amount, fee, scale8)
526523 $Tuple2((amount - feeAmount), feeAmount)
527524 }
528525
529526
530527 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
531528 let isEval = (txId == unit)
532529 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
533530 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
534531 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
535532 then true
536533 else if ((paymentAssetId == cfgPriceAssetId))
537534 then false
538535 else throwErr("invalid asset")
539- let $t02540625699 = if (isEval)
536+ let $t02534525638 = if (isEval)
540537 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
541538 else if (paymentInAmountAsset)
542539 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
543540 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
544- let amountBalanceOld = $t02540625699._1
545- let priceBalanceOld = $t02540625699._2
546- let $t02570325852 = if (paymentInAmountAsset)
541+ let amountBalanceOld = $t02534525638._1
542+ let priceBalanceOld = $t02534525638._2
543+ let $t02564225791 = if (paymentInAmountAsset)
547544 then $Tuple2(paymentAmountRaw, 0)
548545 else $Tuple2(0, paymentAmountRaw)
549- let amountAssetAmountRaw = $t02570325852._1
550- let priceAssetAmountRaw = $t02570325852._2
546+ let amountAssetAmountRaw = $t02564225791._1
547+ let priceAssetAmountRaw = $t02564225791._2
551548 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
552549 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
553- let $t02598426048 = takeFee(paymentAmountRaw, inFee)
554- let paymentAmount = $t02598426048._1
555- let feeAmount = $t02598426048._2
550+ let $t02592325987 = takeFee(paymentAmountRaw, inFee)
551+ let paymentAmount = $t02592325987._1
552+ let feeAmount = $t02592325987._2
556553 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
557554 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
558555 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
559556 let priceNew = fromX18(priceNewX18, scale8)
560557 let paymentBalance = if (paymentInAmountAsset)
561558 then amountBalanceOld
562559 else priceBalanceOld
563560 let paymentBalanceBigInt = toBigInt(paymentBalance)
564561 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565562 let chechSupply = if ((supplyBigInt > big0))
566563 then true
567564 else throwErr("initial deposit requires all coins")
568565 if ((chechSupply == chechSupply))
569566 then {
570567 let depositBigInt = toBigInt(paymentAmount)
571568 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
572569 let commonState = if (isEval)
573570 then nil
574571 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))]
575572 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
576573 let priceOld = fromX18(priceOldX18, scale8)
577574 let loss = {
578- let $t02772927896 = if (paymentInAmountAsset)
575+ let $t02766827835 = if (paymentInAmountAsset)
579576 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
580577 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
581- let amount = $t02772927896._1
582- let balance = $t02772927896._2
578+ let amount = $t02766827835._1
579+ let balance = $t02766827835._2
583580 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
584581 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
585582 }
586583 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
587584 }
588585 else throw("Strict value is not equal to itself.")
589586 }
590587
591588
592589 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
593590 let isEval = (txId == unit)
594591 let cfg = getPoolConfig()
595592 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
596593 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
597594 let checks = [if ((paymentAssetId == cfgLpAssetId))
598595 then true
599596 else throwErr("invalid lp asset")]
600597 if ((checks == checks))
601598 then {
602599 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
603600 then true
604601 else if ((outAssetId == cfgPriceAssetId))
605602 then false
606603 else throwErr("invalid asset")
607604 let balanceBigInt = if (outInAmountAsset)
608605 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
609606 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
610607 let outInAmountAssetDecimals = if (outInAmountAsset)
611608 then amtAssetDcm
612609 else priceAssetDcm
613610 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
614611 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
615612 let outBalance = if (outInAmountAsset)
616613 then amBalanceOld
617614 else prBalanceOld
618615 let outBalanceBigInt = toBigInt(outBalance)
619616 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
620617 let redeemedBigInt = toBigInt(paymentAmount)
621618 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
622- let $t02997430030 = takeFee(amountRaw, outFee)
623- let totalAmount = $t02997430030._1
624- let feeAmount = $t02997430030._2
625- let $t03003430260 = if (outInAmountAsset)
619+ let $t02991329969 = takeFee(amountRaw, outFee)
620+ let totalAmount = $t02991329969._1
621+ let feeAmount = $t02991329969._2
622+ let $t02997330199 = if (outInAmountAsset)
626623 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
627624 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
628- let outAmAmount = $t03003430260._1
629- let outPrAmount = $t03003430260._2
630- let amBalanceNew = $t03003430260._3
631- let prBalanceNew = $t03003430260._4
625+ let outAmAmount = $t02997330199._1
626+ let outPrAmount = $t02997330199._2
627+ let amBalanceNew = $t02997330199._3
628+ let prBalanceNew = $t02997330199._4
632629 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
633630 let priceNew = fromX18(priceNewX18, scale8)
634631 let commonState = if (isEval)
635632 then nil
636633 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)]
637634 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
638635 let priceOld = fromX18(priceOldX18, scale8)
639636 let loss = {
640637 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
641638 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
642639 }
643640 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
644641 }
645642 else throw("Strict value is not equal to itself.")
646643 }
647644
648645
649646 func managerPublicKeyOrUnit () = match getString(mpk()) {
650647 case s: String =>
651648 fromBase58String(s)
652649 case _: Unit =>
653650 unit
654651 case _ =>
655652 throw("Match error")
656653 }
657654
658655
659656 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
660657 case s: String =>
661658 fromBase58String(s)
662659 case _: Unit =>
663660 unit
664661 case _ =>
665662 throw("Match error")
666663 }
667664
668665
669666 func isManager (i) = match managerPublicKeyOrUnit() {
670667 case pk: ByteVector =>
671668 (i.callerPublicKey == pk)
672669 case _: Unit =>
673670 (i.caller == this)
674671 case _ =>
675672 throw("Match error")
676673 }
677674
678675
679676 func mustManager (i) = {
680677 let pd = throw("Permission denied")
681678 match managerPublicKeyOrUnit() {
682679 case pk: ByteVector =>
683680 if ((i.callerPublicKey == pk))
684681 then true
685682 else pd
686683 case _: Unit =>
687684 if ((i.caller == this))
688685 then true
689686 else pd
690687 case _ =>
691688 throw("Match error")
692689 }
693690 }
694-
695-
696-@Callable(i)
697-func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse) = {
698- let $t03195532260 = if ((isReverse == false))
699- then {
700- let assetOut = getStringOrFail(this, pa())
701- let assetIn = getStringOrFail(this, aa())
702- $Tuple2(assetOut, assetIn)
703- }
704- else {
705- let assetOut = getStringOrFail(this, aa())
706- let assetIn = getStringOrFail(this, pa())
707- $Tuple2(assetOut, assetIn)
708- }
709- let assetOut = $t03195532260._1
710- let assetIn = $t03195532260._2
711- let poolAssetInBalance = getAccBalance(assetIn)
712- let poolAssetOutBalance = getAccBalance(assetOut)
713- let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
714- let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
715- let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
716- let checkK = if ((newK >= oldK))
717- then true
718- else throw("new K is fewer error")
719- if ((checkK == checkK))
720- then $Tuple2(nil, amountOut)
721- else throw("Strict value is not equal to itself.")
722- }
723-
724-
725-
726-@Callable(i)
727-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
728- let swapContact = {
729- let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
730- if ($isInstanceOf(@, "String"))
731- then @
732- else throw(($getType(@) + " couldn't be cast to String"))
733- }
734- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
735- then true
736- else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
737- then true
738- else throwErr("Permission denied")]
739- if ((checks == checks))
740- then {
741- let pmt = value(i.payments[0])
742- let assetIn = if ((pmt.assetId == unit))
743- then toBase58String(toBytes("WAVES"))
744- else toBase58String(value(pmt.assetId))
745- let assetOut = if ((isReverse == false))
746- then getStringOrFail(this, pa())
747- else getStringOrFail(this, aa())
748- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
749- let poolAssetOutBalance = getAccBalance(assetOut)
750- let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
751- let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
752- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
753- let checkK = if ((newK >= oldK))
754- then true
755- else throw("new K is fewer error")
756- if ((checkK == checkK))
757- then {
758- let checkMin = if ((amountOut >= amountOutMin))
759- then true
760- else throw("Exchange result is fewer coins than expected")
761- if ((checkMin == checkMin))
762- then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))], amountOut)
763- else throw("Strict value is not equal to itself.")
764- }
765- else throw("Strict value is not equal to itself.")
766- }
767- else throw("Strict value is not equal to itself.")
768- }
769-
770691
771692
772693 @Callable(i)
773694 func setManager (pendingManagerPublicKey) = {
774695 let checkCaller = mustManager(i)
775696 if ((checkCaller == checkCaller))
776697 then {
777698 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
778699 if ((checkManagerPublicKey == checkManagerPublicKey))
779700 then [StringEntry(pmpk(), pendingManagerPublicKey)]
780701 else throw("Strict value is not equal to itself.")
781702 }
782703 else throw("Strict value is not equal to itself.")
783704 }
784705
785706
786707
787708 @Callable(i)
788709 func confirmManager () = {
789710 let pm = pendingManagerPublicKeyOrUnit()
790711 let hasPM = if (isDefined(pm))
791712 then true
792713 else throw("No pending manager")
793714 if ((hasPM == hasPM))
794715 then {
795716 let checkPM = if ((i.callerPublicKey == value(pm)))
796717 then true
797718 else throw("You are not pending manager")
798719 if ((checkPM == checkPM))
799720 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
800721 else throw("Strict value is not equal to itself.")
801722 }
802723 else throw("Strict value is not equal to itself.")
803724 }
804725
805726
806727
807728 @Callable(i)
808729 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
809730 then throw("Invalid slippageTolerance passed")
810731 else {
811732 let estPut = commonPut(i, slippageTolerance, true)
812733 let emitLpAmt = estPut._2
813734 let lpAssetId = estPut._7
814735 let state = estPut._9
815736 let amDiff = estPut._10
816737 let prDiff = estPut._11
817738 let amId = estPut._12
818739 let prId = estPut._13
819740 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
820741 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
821742 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
822743 if ((currentKLp == currentKLp))
823744 then {
824745 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
825746 if ((emitInv == emitInv))
826747 then {
827748 let emitInvLegacy = match emitInv {
828749 case legacyFactoryContract: Address =>
829750 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
830751 case _ =>
831752 unit
832753 }
833754 if ((emitInvLegacy == emitInvLegacy))
834755 then {
835756 let slippageAInv = if ((amDiff > 0))
836757 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
837758 else nil
838759 if ((slippageAInv == slippageAInv))
839760 then {
840761 let slippagePInv = if ((prDiff > 0))
841762 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
842763 else nil
843764 if ((slippagePInv == slippagePInv))
844765 then {
845766 let lpTransfer = if (shouldAutoStake)
846767 then {
847768 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
848769 if ((slpStakeInv == slpStakeInv))
849770 then nil
850771 else throw("Strict value is not equal to itself.")
851772 }
852773 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
853- let $t03714537607 = refreshKLpInternal(0, 0, 0)
854- if (($t03714537607 == $t03714537607))
774+ let $t03472735189 = refreshKLpInternal(0, 0, 0)
775+ if (($t03472735189 == $t03472735189))
855776 then {
856- let updatedKLp = $t03714537607._2
857- let refreshKLpActions = $t03714537607._1
777+ let updatedKLp = $t03472735189._2
778+ let refreshKLpActions = $t03472735189._1
858779 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
859780 if ((isUpdatedKLpValid == isUpdatedKLpValid))
860781 then ((state ++ lpTransfer) ++ refreshKLpActions)
861782 else throw("Strict value is not equal to itself.")
862783 }
863784 else throw("Strict value is not equal to itself.")
864785 }
865786 else throw("Strict value is not equal to itself.")
866787 }
867788 else throw("Strict value is not equal to itself.")
868789 }
869790 else throw("Strict value is not equal to itself.")
870791 }
871792 else throw("Strict value is not equal to itself.")
872793 }
873794 else throw("Strict value is not equal to itself.")
874795 }
875796
876797
877798
878799 @Callable(i)
879800 func putForFree (maxSlippage) = if ((0 > maxSlippage))
880801 then throw("Invalid value passed")
881802 else {
882803 let estPut = commonPut(i, maxSlippage, false)
883804 let state = estPut._9
884805 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
885806 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
886807 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
887808 if ((currentKLp == currentKLp))
888809 then {
889- let $t03816938234 = refreshKLpInternal(0, 0, 0)
890- let refreshKLpActions = $t03816938234._1
891- let updatedKLp = $t03816938234._2
810+ let $t03575135816 = refreshKLpInternal(0, 0, 0)
811+ let refreshKLpActions = $t03575135816._1
812+ let updatedKLp = $t03575135816._2
892813 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
893814 if ((isUpdatedKLpValid == isUpdatedKLpValid))
894815 then (state ++ refreshKLpActions)
895816 else throw("Strict value is not equal to itself.")
896817 }
897818 else throw("Strict value is not equal to itself.")
898819 }
899820
900821
901822
902823 @Callable(i)
903824 func putOneTkn (minOutAmount,autoStake) = {
904825 let isPoolOneTokenOperationsDisabled = {
905826 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
906827 if ($isInstanceOf(@, "Boolean"))
907828 then @
908829 else throw(($getType(@) + " couldn't be cast to Boolean"))
909830 }
910831 let isPutDisabled = if (if (if (isGlobalShutdown())
911832 then true
912833 else (cfgPoolStatus == PoolPutDisabled))
913834 then true
914835 else (cfgPoolStatus == PoolShutdown))
915836 then true
916837 else isPoolOneTokenOperationsDisabled
917838 let checks = [if (if (!(isPutDisabled))
918839 then true
919840 else isManager(i))
920841 then true
921842 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
922843 then true
923844 else throwErr("exactly 1 payment are expected")]
924845 if ((checks == checks))
925846 then {
926847 let payment = i.payments[0]
927848 let paymentAssetId = payment.assetId
928849 let paymentAmountRaw = payment.amount
929850 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
930851 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
931852 else if ((paymentAssetId == cfgPriceAssetId))
932853 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
933854 else throwErr("payment asset is not supported")
934855 if ((currentKLp == currentKLp))
935856 then {
936857 let userAddress = i.caller
937858 let txId = i.transactionId
938- let $t03942239574 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
939- if (($t03942239574 == $t03942239574))
859+ let $t03700437156 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
860+ if (($t03700437156 == $t03700437156))
940861 then {
941- let paymentInAmountAsset = $t03942239574._5
942- let bonus = $t03942239574._4
943- let feeAmount = $t03942239574._3
944- let commonState = $t03942239574._2
945- let emitAmountEstimated = $t03942239574._1
862+ let paymentInAmountAsset = $t03700437156._5
863+ let bonus = $t03700437156._4
864+ let feeAmount = $t03700437156._3
865+ let commonState = $t03700437156._2
866+ let emitAmountEstimated = $t03700437156._1
946867 let emitAmount = if (if ((minOutAmount > 0))
947868 then (minOutAmount > emitAmountEstimated)
948869 else false)
949870 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
950871 else emitAmountEstimated
951872 let emitInv = emit(emitAmount)
952873 if ((emitInv == emitInv))
953874 then {
954875 let lpTransfer = if (autoStake)
955876 then {
956877 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
957878 if ((stakeInv == stakeInv))
958879 then nil
959880 else throw("Strict value is not equal to itself.")
960881 }
961882 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
962883 let sendFee = if ((feeAmount > 0))
963884 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
964885 else nil
965- let $t04016040357 = if ((this == feeCollectorAddress))
886+ let $t03774237939 = if ((this == feeCollectorAddress))
966887 then $Tuple2(0, 0)
967888 else if (paymentInAmountAsset)
968889 then $Tuple2(-(feeAmount), 0)
969890 else $Tuple2(0, -(feeAmount))
970- let amountAssetBalanceDelta = $t04016040357._1
971- let priceAssetBalanceDelta = $t04016040357._2
972- let $t04036040468 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
973- let refreshKLpActions = $t04036040468._1
974- let updatedKLp = $t04036040468._2
891+ let amountAssetBalanceDelta = $t03774237939._1
892+ let priceAssetBalanceDelta = $t03774237939._2
893+ let $t03794238050 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
894+ let refreshKLpActions = $t03794238050._1
895+ let updatedKLp = $t03794238050._2
975896 let kLp = value(getString(keyKLp))
976897 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
977898 if ((isUpdatedKLpValid == isUpdatedKLpValid))
978899 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
979900 else throw("Strict value is not equal to itself.")
980901 }
981902 else throw("Strict value is not equal to itself.")
982903 }
983904 else throw("Strict value is not equal to itself.")
984905 }
985906 else throw("Strict value is not equal to itself.")
986907 }
987908 else throw("Strict value is not equal to itself.")
988909 }
989910
990911
991912
992913 @Callable(i)
993914 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
994- let $t04077440931 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
995- let emitAmountEstimated = $t04077440931._1
996- let commonState = $t04077440931._2
997- let feeAmount = $t04077440931._3
998- let bonus = $t04077440931._4
999- let paymentInAmountAsset = $t04077440931._5
915+ let $t03835638513 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
916+ let emitAmountEstimated = $t03835638513._1
917+ let commonState = $t03835638513._2
918+ let feeAmount = $t03835638513._3
919+ let bonus = $t03835638513._4
920+ let paymentInAmountAsset = $t03835638513._5
1000921 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
1001922 }
1002923
1003924
1004925
1005926 @Callable(i)
1006927 func getOneTkn (outAssetIdStr,minOutAmount) = {
1007928 let isPoolOneTokenOperationsDisabled = {
1008929 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1009930 if ($isInstanceOf(@, "Boolean"))
1010931 then @
1011932 else throw(($getType(@) + " couldn't be cast to Boolean"))
1012933 }
1013934 let isGetDisabled = if (if (isGlobalShutdown())
1014935 then true
1015936 else (cfgPoolStatus == PoolShutdown))
1016937 then true
1017938 else isPoolOneTokenOperationsDisabled
1018939 let checks = [if (if (!(isGetDisabled))
1019940 then true
1020941 else isManager(i))
1021942 then true
1022943 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
1023944 then true
1024945 else throwErr("exactly 1 payment are expected")]
1025946 if ((checks == checks))
1026947 then {
1027948 let outAssetId = parseAssetId(outAssetIdStr)
1028949 let payment = i.payments[0]
1029950 let paymentAssetId = payment.assetId
1030951 let paymentAmount = payment.amount
1031952 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1032953 if ((currentKLp == currentKLp))
1033954 then {
1034955 let userAddress = i.caller
1035956 let txId = i.transactionId
1036- let $t04181641969 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1037- if (($t04181641969 == $t04181641969))
957+ let $t03939839551 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
958+ if (($t03939839551 == $t03939839551))
1038959 then {
1039- let outInAmountAsset = $t04181641969._5
1040- let bonus = $t04181641969._4
1041- let feeAmount = $t04181641969._3
1042- let commonState = $t04181641969._2
1043- let amountEstimated = $t04181641969._1
960+ let outInAmountAsset = $t03939839551._5
961+ let bonus = $t03939839551._4
962+ let feeAmount = $t03939839551._3
963+ let commonState = $t03939839551._2
964+ let amountEstimated = $t03939839551._1
1044965 let amount = if (if ((minOutAmount > 0))
1045966 then (minOutAmount > amountEstimated)
1046967 else false)
1047968 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1048969 else amountEstimated
1049970 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
1050971 if ((burnInv == burnInv))
1051972 then {
1052973 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
1053974 let sendFee = if ((feeAmount > 0))
1054975 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1055976 else nil
1056- let $t04246942716 = {
977+ let $t04005140298 = {
1057978 let feeAmountForCalc = if ((this == feeCollectorAddress))
1058979 then 0
1059980 else feeAmount
1060981 if (outInAmountAsset)
1061982 then $Tuple2(-((amount + feeAmountForCalc)), 0)
1062983 else $Tuple2(0, -((amount + feeAmountForCalc)))
1063984 }
1064- let amountAssetBalanceDelta = $t04246942716._1
1065- let priceAssetBalanceDelta = $t04246942716._2
1066- let $t04271942827 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1067- let refreshKLpActions = $t04271942827._1
1068- let updatedKLp = $t04271942827._2
985+ let amountAssetBalanceDelta = $t04005140298._1
986+ let priceAssetBalanceDelta = $t04005140298._2
987+ let $t04030140409 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
988+ let refreshKLpActions = $t04030140409._1
989+ let updatedKLp = $t04030140409._2
1069990 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1070991 if ((isUpdatedKLpValid == isUpdatedKLpValid))
1071992 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1072993 else throw("Strict value is not equal to itself.")
1073994 }
1074995 else throw("Strict value is not equal to itself.")
1075996 }
1076997 else throw("Strict value is not equal to itself.")
1077998 }
1078999 else throw("Strict value is not equal to itself.")
10791000 }
10801001 else throw("Strict value is not equal to itself.")
10811002 }
10821003
10831004
10841005
10851006 @Callable(i)
10861007 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1087- let $t04308443240 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1088- let amountEstimated = $t04308443240._1
1089- let commonState = $t04308443240._2
1090- let feeAmount = $t04308443240._3
1091- let bonus = $t04308443240._4
1092- let outInAmountAsset = $t04308443240._5
1008+ let $t04066640822 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1009+ let amountEstimated = $t04066640822._1
1010+ let commonState = $t04066640822._2
1011+ let feeAmount = $t04066640822._3
1012+ let bonus = $t04066640822._4
1013+ let outInAmountAsset = $t04066640822._5
10931014 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10941015 }
10951016
10961017
10971018
10981019 @Callable(i)
10991020 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
11001021 let isPoolOneTokenOperationsDisabled = {
11011022 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11021023 if ($isInstanceOf(@, "Boolean"))
11031024 then @
11041025 else throw(($getType(@) + " couldn't be cast to Boolean"))
11051026 }
11061027 let isGetDisabled = if (if (isGlobalShutdown())
11071028 then true
11081029 else (cfgPoolStatus == PoolShutdown))
11091030 then true
11101031 else isPoolOneTokenOperationsDisabled
11111032 let checks = [if (if (!(isGetDisabled))
11121033 then true
11131034 else isManager(i))
11141035 then true
11151036 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
11161037 then true
11171038 else throwErr("no payments are expected")]
11181039 if ((checks == checks))
11191040 then {
11201041 let outAssetId = parseAssetId(outAssetIdStr)
11211042 let userAddress = i.caller
11221043 let txId = i.transactionId
11231044 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11241045 if ((currentKLp == currentKLp))
11251046 then {
11261047 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11271048 if ((unstakeInv == unstakeInv))
11281049 then {
1129- let $t04414544296 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1130- if (($t04414544296 == $t04414544296))
1050+ let $t04172741878 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1051+ if (($t04172741878 == $t04172741878))
11311052 then {
1132- let outInAmountAsset = $t04414544296._5
1133- let bonus = $t04414544296._4
1134- let feeAmount = $t04414544296._3
1135- let commonState = $t04414544296._2
1136- let amountEstimated = $t04414544296._1
1053+ let outInAmountAsset = $t04172741878._5
1054+ let bonus = $t04172741878._4
1055+ let feeAmount = $t04172741878._3
1056+ let commonState = $t04172741878._2
1057+ let amountEstimated = $t04172741878._1
11371058 let amount = if (if ((minOutAmount > 0))
11381059 then (minOutAmount > amountEstimated)
11391060 else false)
11401061 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11411062 else amountEstimated
11421063 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11431064 if ((burnInv == burnInv))
11441065 then {
11451066 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
11461067 let sendFee = if ((feeAmount > 0))
11471068 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
11481069 else nil
1149- let $t04479145038 = {
1070+ let $t04237342620 = {
11501071 let feeAmountForCalc = if ((this == feeCollectorAddress))
11511072 then 0
11521073 else feeAmount
11531074 if (outInAmountAsset)
11541075 then $Tuple2(-((amount + feeAmountForCalc)), 0)
11551076 else $Tuple2(0, -((amount + feeAmountForCalc)))
11561077 }
1157- let amountAssetBalanceDelta = $t04479145038._1
1158- let priceAssetBalanceDelta = $t04479145038._2
1159- let $t04504145149 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1160- let refreshKLpActions = $t04504145149._1
1161- let updatedKLp = $t04504145149._2
1078+ let amountAssetBalanceDelta = $t04237342620._1
1079+ let priceAssetBalanceDelta = $t04237342620._2
1080+ let $t04262342731 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1081+ let refreshKLpActions = $t04262342731._1
1082+ let updatedKLp = $t04262342731._2
11621083 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11631084 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11641085 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11651086 else throw("Strict value is not equal to itself.")
11661087 }
11671088 else throw("Strict value is not equal to itself.")
11681089 }
11691090 else throw("Strict value is not equal to itself.")
11701091 }
11711092 else throw("Strict value is not equal to itself.")
11721093 }
11731094 else throw("Strict value is not equal to itself.")
11741095 }
11751096 else throw("Strict value is not equal to itself.")
11761097 }
11771098
11781099
11791100
11801101 @Callable(i)
11811102 func get () = {
11821103 let res = commonGet(i)
11831104 let outAmtAmt = res._1
11841105 let outPrAmt = res._2
11851106 let pmtAmt = res._3
11861107 let pmtAssetId = res._4
11871108 let state = res._5
11881109 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11891110 if ((currentKLp == currentKLp))
11901111 then {
11911112 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11921113 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11931114 then {
1194- let $t04609546177 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1195- let refreshKLpActions = $t04609546177._1
1196- let updatedKLp = $t04609546177._2
1115+ let $t04367743759 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1116+ let refreshKLpActions = $t04367743759._1
1117+ let updatedKLp = $t04367743759._2
11971118 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11981119 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11991120 then (state ++ refreshKLpActions)
12001121 else throw("Strict value is not equal to itself.")
12011122 }
12021123 else throw("Strict value is not equal to itself.")
12031124 }
12041125 else throw("Strict value is not equal to itself.")
12051126 }
12061127
12071128
12081129
12091130 @Callable(i)
12101131 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
12111132 let res = commonGet(i)
12121133 let outAmAmt = res._1
12131134 let outPrAmt = res._2
12141135 let pmtAmt = res._3
12151136 let pmtAssetId = res._4
12161137 let state = res._5
12171138 if ((noLessThenAmtAsset > outAmAmt))
12181139 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
12191140 else if ((noLessThenPriceAsset > outPrAmt))
12201141 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
12211142 else {
12221143 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12231144 if ((currentKLp == currentKLp))
12241145 then {
12251146 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12261147 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12271148 then {
1228- let $t04712647207 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1229- let refreshKLpActions = $t04712647207._1
1230- let updatedKLp = $t04712647207._2
1149+ let $t04470844789 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1150+ let refreshKLpActions = $t04470844789._1
1151+ let updatedKLp = $t04470844789._2
12311152 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12321153 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12331154 then (state ++ refreshKLpActions)
12341155 else throw("Strict value is not equal to itself.")
12351156 }
12361157 else throw("Strict value is not equal to itself.")
12371158 }
12381159 else throw("Strict value is not equal to itself.")
12391160 }
12401161 }
12411162
12421163
12431164
12441165 @Callable(i)
12451166 func unstakeAndGet (amount) = {
12461167 let checkPayments = if ((size(i.payments) != 0))
12471168 then throw("No payments are expected")
12481169 else true
12491170 if ((checkPayments == checkPayments))
12501171 then {
12511172 let cfg = getPoolConfig()
12521173 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12531174 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12541175 if ((currentKLp == currentKLp))
12551176 then {
12561177 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
12571178 if ((unstakeInv == unstakeInv))
12581179 then {
12591180 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
12601181 let outAmAmt = res._1
12611182 let outPrAmt = res._2
12621183 let poolStatus = parseIntValue(res._9)
12631184 let state = res._10
12641185 let checkPoolStatus = if (if (isGlobalShutdown())
12651186 then true
12661187 else (poolStatus == PoolShutdown))
12671188 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
12681189 else true
12691190 if ((checkPoolStatus == checkPoolStatus))
12701191 then {
12711192 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12721193 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12731194 then {
1274- let $t04833348414 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1275- let refreshKLpActions = $t04833348414._1
1276- let updatedKLp = $t04833348414._2
1195+ let $t04591545996 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1196+ let refreshKLpActions = $t04591545996._1
1197+ let updatedKLp = $t04591545996._2
12771198 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12781199 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12791200 then (state ++ refreshKLpActions)
12801201 else throw("Strict value is not equal to itself.")
12811202 }
12821203 else throw("Strict value is not equal to itself.")
12831204 }
12841205 else throw("Strict value is not equal to itself.")
12851206 }
12861207 else throw("Strict value is not equal to itself.")
12871208 }
12881209 else throw("Strict value is not equal to itself.")
12891210 }
12901211 else throw("Strict value is not equal to itself.")
12911212 }
12921213
12931214
12941215
12951216 @Callable(i)
12961217 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
12971218 let isGetDisabled = if (isGlobalShutdown())
12981219 then true
12991220 else (cfgPoolStatus == PoolShutdown)
13001221 let checks = [if (!(isGetDisabled))
13011222 then true
13021223 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
13031224 then true
13041225 else throw("no payments are expected")]
13051226 if ((checks == checks))
13061227 then {
13071228 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13081229 if ((currentKLp == currentKLp))
13091230 then {
13101231 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13111232 if ((unstakeInv == unstakeInv))
13121233 then {
13131234 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
13141235 let outAmAmt = res._1
13151236 let outPrAmt = res._2
13161237 let state = res._10
13171238 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
13181239 then true
13191240 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
13201241 then true
13211242 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
13221243 if ((checkAmounts == checkAmounts))
13231244 then {
13241245 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13251246 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13261247 then {
1327- let $t04970949790 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1328- let refreshKLpActions = $t04970949790._1
1329- let updatedKLp = $t04970949790._2
1248+ let $t04729147372 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1249+ let refreshKLpActions = $t04729147372._1
1250+ let updatedKLp = $t04729147372._2
13301251 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13311252 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13321253 then (state ++ refreshKLpActions)
13331254 else throw("Strict value is not equal to itself.")
13341255 }
13351256 else throw("Strict value is not equal to itself.")
13361257 }
13371258 else throw("Strict value is not equal to itself.")
13381259 }
13391260 else throw("Strict value is not equal to itself.")
13401261 }
13411262 else throw("Strict value is not equal to itself.")
13421263 }
13431264 else throw("Strict value is not equal to itself.")
13441265 }
13451266
13461267
13471268
13481269 @Callable(i)
13491270 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
13501271 then throw("permissions denied")
13511272 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
13521273
13531274
13541275
13551276 @Callable(i)
13561277 func refreshKLp () = {
13571278 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
13581279 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
13591280 then unit
13601281 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13611282 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13621283 then {
13631284 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1364- let $t05097751041 = refreshKLpInternal(0, 0, 0)
1365- let kLpUpdateActions = $t05097751041._1
1366- let updatedKLp = $t05097751041._2
1285+ let $t04855948623 = refreshKLpInternal(0, 0, 0)
1286+ let kLpUpdateActions = $t04855948623._1
1287+ let updatedKLp = $t04855948623._2
13671288 let actions = if ((kLp != updatedKLp))
13681289 then kLpUpdateActions
13691290 else throwErr("nothing to refresh")
13701291 $Tuple2(actions, toString(updatedKLp))
13711292 }
13721293 else throw("Strict value is not equal to itself.")
13731294 }
13741295
13751296
13761297
13771298 @Callable(i)
13781299 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
13791300
13801301
13811302
13821303 @Callable(i)
13831304 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
13841305
13851306
13861307
13871308 @Callable(i)
13881309 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13891310 let prices = calcPrices(amAmt, prAmt, lpAmt)
13901311 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
13911312 }
13921313
13931314
13941315
13951316 @Callable(i)
13961317 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
13971318
13981319
13991320
14001321 @Callable(i)
14011322 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
14021323
14031324
14041325
14051326 @Callable(i)
14061327 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
14071328
14081329
14091330
14101331 @Callable(i)
14111332 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
14121333
14131334
14141335
14151336 @Callable(i)
14161337 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
14171338 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
14181339 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
14191340 }
14201341
14211342
14221343
14231344 @Callable(i)
14241345 func statsREADONLY () = {
14251346 let cfg = getPoolConfig()
14261347 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14271348 let amtAssetId = cfg[idxAmtAssetId]
14281349 let priceAssetId = cfg[idxPriceAssetId]
14291350 let iAmtAssetId = cfg[idxIAmtAssetId]
14301351 let iPriceAssetId = cfg[idxIPriceAssetId]
14311352 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14321353 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14331354 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14341355 let accAmtAssetBalance = getAccBalance(amtAssetId)
14351356 let accPriceAssetBalance = getAccBalance(priceAssetId)
14361357 let pricesList = if ((poolLPBalance == 0))
14371358 then [zeroBigInt, zeroBigInt, zeroBigInt]
14381359 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
14391360 let curPrice = 0
14401361 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
14411362 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
14421363 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
14431364 $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))
14441365 }
14451366
14461367
14471368
14481369 @Callable(i)
14491370 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
14501371 let cfg = getPoolConfig()
14511372 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14521373 let amAssetIdStr = cfg[idxAmtAssetId]
14531374 let amAssetId = fromBase58String(amAssetIdStr)
14541375 let prAssetIdStr = cfg[idxPriceAssetId]
14551376 let prAssetId = fromBase58String(prAssetIdStr)
14561377 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14571378 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14581379 let poolStatus = cfg[idxPoolStatus]
14591380 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14601381 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
14611382 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
14621383 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
14631384 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
14641385 let curPriceX18 = if ((poolLPBalance == 0))
14651386 then zeroBigInt
14661387 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
14671388 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
14681389 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
14691390 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
14701391 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
14711392 let calcLpAmt = estPut._1
14721393 let curPriceCalc = estPut._3
14731394 let amBalance = estPut._4
14741395 let prBalance = estPut._5
14751396 let lpEmission = estPut._6
14761397 $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))
14771398 }
14781399
14791400
14801401
14811402 @Callable(i)
14821403 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
14831404 let cfg = getPoolConfig()
14841405 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14851406 let amAssetIdStr = cfg[idxAmtAssetId]
14861407 let amAssetId = fromBase58String(amAssetIdStr)
14871408 let prAssetIdStr = cfg[idxPriceAssetId]
14881409 let prAssetId = fromBase58String(prAssetIdStr)
14891410 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14901411 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14911412 let poolStatus = cfg[idxPoolStatus]
14921413 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14931414 let amBalanceRaw = getAccBalance(amAssetIdStr)
14941415 let prBalanceRaw = getAccBalance(prAssetIdStr)
14951416 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
14961417 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
14971418 let curPriceX18 = if ((poolLPBalance == 0))
14981419 then zeroBigInt
14991420 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
15001421 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
15011422 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
15021423 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
15031424 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
15041425 let calcLpAmt = estPut._1
15051426 let curPriceCalc = estPut._3
15061427 let amBalance = estPut._4
15071428 let prBalance = estPut._5
15081429 let lpEmission = estPut._6
15091430 $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))
15101431 }
15111432
15121433
15131434
15141435 @Callable(i)
15151436 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
15161437 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
15171438 let outAmAmt = res._1
15181439 let outPrAmt = res._2
15191440 let amBalance = res._5
15201441 let prBalance = res._6
15211442 let lpEmission = res._7
15221443 let curPrice = res._8
15231444 let poolStatus = parseIntValue(res._9)
15241445 $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))
15251446 }
15261447
15271448
15281449 @Verifier(tx)
15291450 func verify () = {
15301451 let targetPublicKey = match managerPublicKeyOrUnit() {
15311452 case pk: ByteVector =>
15321453 pk
15331454 case _: Unit =>
15341455 tx.senderPublicKey
15351456 case _ =>
15361457 throw("Match error")
15371458 }
15381459 match tx {
15391460 case order: Order =>
15401461 let matcherPub = getMatcherPubOrFail()
1541- let $t05970359772 = validateMatcherOrderAllowed(order)
1542- let orderValid = $t05970359772._1
1543- let orderValidInfo = $t05970359772._2
1462+ let $t05728557354 = validateMatcherOrderAllowed(order)
1463+ let orderValid = $t05728557354._1
1464+ let orderValidInfo = $t05728557354._2
15441465 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15451466 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15461467 if (if (if (orderValid)
15471468 then senderValid
15481469 else false)
15491470 then matcherValid
15501471 else false)
15511472 then true
15521473 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
15531474 case s: SetScriptTransaction =>
15541475 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
15551476 then true
15561477 else {
15571478 let newHash = blake2b256(value(s.script))
15581479 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
15591480 let currentHash = scriptHash(this)
15601481 if ((allowedHash == newHash))
15611482 then (currentHash != newHash)
15621483 else false
15631484 }
15641485 case _ =>
15651486 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
15661487 }
15671488 }
15681489

github/deemru/w8io/026f985 
307.78 ms