tx · 24ur5xTDtKegEVmv88shnbugBou3imHU3jfa4rE5u9Vt

3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT:  -0.03800000 Waves

2023.02.21 09:28 [2459038] smart account 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT > SELF 0.00000000 Waves

{ "type": 13, "id": "24ur5xTDtKegEVmv88shnbugBou3imHU3jfa4rE5u9Vt", "fee": 3800000, "feeAssetId": null, "timestamp": 1676960956044, "version": 2, "chainId": 84, "sender": "3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT", "senderPublicKey": "AYbpHveq7zviKTDV7SGTB1pZGFbkumgfq3jSwVv6BznT", "proofs": [ "5XRFgToayetDZHAGRnGg5mdvAjNTMN6vp2VHdeYDucirxr9ej3L626yWdh3vrNmvY8e9PdSVbo4LUc5vkr2nRzqv" ], "script": "base64:BgLiLwgCEgUKAwEEARIHCgUBBAEIARIDCgEIEgASBAoCAQQSAwoBARIECgIBBBIECgIIARIECgIIARIECgIIARIFCgMBCAESABIECgIBARIDCgEBEgUKAwEBARIECgIICBIAEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2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mRlclB1YmxpY0tleQQCYUcJAPQDAwgFAmRBCWJvZHlCeXRlcwkAkQMCCAUCZEEGcHJvb2ZzAAEFAmhjAwMDBQJhRAUCYUYHBQJhRwcGCQECYUMEBQJhRAUCYUUFAmFGBQJhRwMJAAECBQJkVwIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmZhBQJkVwMJAPQDAwgFAmdaCWJvZHlCeXRlcwkAkQMCCAUCZ1oGcHJvb2ZzAAAFAmhiBgQCaGUJAPYDAQkBBXZhbHVlAQgFAmZhBnNjcmlwdAQCaGYJANsEAQkBBXZhbHVlAQkAnQgCBQJhTwkBAmFBAAQCaGcJAPEHAQUEdGhpcwMJAAACBQJoZgUCaGUJAQIhPQIFAmhnBQJoZQcJAPQDAwgFAmdaCWJvZHlCeXRlcwkAkQMCCAUCZ1oGcHJvb2ZzAAAFAmhiqF/ylA==", "height": 2459038, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5UbD44Zk8GLsGhCHGmyFPkoD8NVtxQW8x3HsEpkQ7EGa Next: 5DzdZyLEvuFS93qMgiWtNh14JFsBK3ukAkRrERxHQ3dG Diff:
OldNewDifferences
694694
695695
696696 @Callable(i)
697-func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse) = {
698- let $t03195732262 = if ((isReverse == false))
697+func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
698+ let $t03197732282 = if ((isReverse == false))
699699 then {
700700 let assetOut = getStringOrFail(this, pa())
701701 let assetIn = getStringOrFail(this, aa())
706706 let assetIn = getStringOrFail(this, pa())
707707 $Tuple2(assetOut, assetIn)
708708 }
709- let assetOut = $t03195732262._1
710- let assetIn = $t03195732262._2
709+ let assetOut = $t03197732282._1
710+ let assetIn = $t03197732282._2
711711 let poolAssetInBalance = getAccBalance(assetIn)
712712 let poolAssetOutBalance = getAccBalance(assetOut)
713713 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
714714 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
715- let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
715+ let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
716716 let checkK = if ((newK >= oldK))
717717 then true
718718 else throw("new K is fewer error")
724724
725725
726726 @Callable(i)
727-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
727+func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
728728 let swapContact = {
729729 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
730730 if ($isInstanceOf(@, "String"))
747747 let poolAssetOutBalance = getAccBalance(assetOut)
748748 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
749749 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
750- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
750+ let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
751751 let checkK = if ((newK >= oldK))
752752 then true
753753 else throw("new K is fewer error")
848848 else throw("Strict value is not equal to itself.")
849849 }
850850 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
851- let $t03707137533 = refreshKLpInternal(0, 0, 0)
852- if (($t03707137533 == $t03707137533))
851+ let $t03716637628 = refreshKLpInternal(0, 0, 0)
852+ if (($t03716637628 == $t03716637628))
853853 then {
854- let updatedKLp = $t03707137533._2
855- let refreshKLpActions = $t03707137533._1
854+ let updatedKLp = $t03716637628._2
855+ let refreshKLpActions = $t03716637628._1
856856 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
857857 if ((isUpdatedKLpValid == isUpdatedKLpValid))
858858 then ((state ++ lpTransfer) ++ refreshKLpActions)
884884 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
885885 if ((currentKLp == currentKLp))
886886 then {
887- let $t03809538160 = refreshKLpInternal(0, 0, 0)
888- let refreshKLpActions = $t03809538160._1
889- let updatedKLp = $t03809538160._2
887+ let $t03819038255 = refreshKLpInternal(0, 0, 0)
888+ let refreshKLpActions = $t03819038255._1
889+ let updatedKLp = $t03819038255._2
890890 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
891891 if ((isUpdatedKLpValid == isUpdatedKLpValid))
892892 then (state ++ refreshKLpActions)
933933 then {
934934 let userAddress = i.caller
935935 let txId = i.transactionId
936- let $t03934839500 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
937- if (($t03934839500 == $t03934839500))
936+ let $t03944339595 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
937+ if (($t03944339595 == $t03944339595))
938938 then {
939- let paymentInAmountAsset = $t03934839500._5
940- let bonus = $t03934839500._4
941- let feeAmount = $t03934839500._3
942- let commonState = $t03934839500._2
943- let emitAmountEstimated = $t03934839500._1
939+ let paymentInAmountAsset = $t03944339595._5
940+ let bonus = $t03944339595._4
941+ let feeAmount = $t03944339595._3
942+ let commonState = $t03944339595._2
943+ let emitAmountEstimated = $t03944339595._1
944944 let emitAmount = if (if ((minOutAmount > 0))
945945 then (minOutAmount > emitAmountEstimated)
946946 else false)
960960 let sendFee = if ((feeAmount > 0))
961961 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
962962 else nil
963- let $t04008640283 = if ((this == feeCollectorAddress))
963+ let $t04018140378 = if ((this == feeCollectorAddress))
964964 then $Tuple2(0, 0)
965965 else if (paymentInAmountAsset)
966966 then $Tuple2(-(feeAmount), 0)
967967 else $Tuple2(0, -(feeAmount))
968- let amountAssetBalanceDelta = $t04008640283._1
969- let priceAssetBalanceDelta = $t04008640283._2
970- let $t04028640394 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971- let refreshKLpActions = $t04028640394._1
972- let updatedKLp = $t04028640394._2
968+ let amountAssetBalanceDelta = $t04018140378._1
969+ let priceAssetBalanceDelta = $t04018140378._2
970+ let $t04038140489 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971+ let refreshKLpActions = $t04038140489._1
972+ let updatedKLp = $t04038140489._2
973973 let kLp = value(getString(keyKLp))
974974 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
975975 if ((isUpdatedKLpValid == isUpdatedKLpValid))
989989
990990 @Callable(i)
991991 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
992- let $t04070040857 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
993- let emitAmountEstimated = $t04070040857._1
994- let commonState = $t04070040857._2
995- let feeAmount = $t04070040857._3
996- let bonus = $t04070040857._4
997- let paymentInAmountAsset = $t04070040857._5
992+ let $t04079540952 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
993+ let emitAmountEstimated = $t04079540952._1
994+ let commonState = $t04079540952._2
995+ let feeAmount = $t04079540952._3
996+ let bonus = $t04079540952._4
997+ let paymentInAmountAsset = $t04079540952._5
998998 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
999999 }
10001000
10311031 then {
10321032 let userAddress = i.caller
10331033 let txId = i.transactionId
1034- let $t04174241895 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1035- if (($t04174241895 == $t04174241895))
1034+ let $t04183741990 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1035+ if (($t04183741990 == $t04183741990))
10361036 then {
1037- let outInAmountAsset = $t04174241895._5
1038- let bonus = $t04174241895._4
1039- let feeAmount = $t04174241895._3
1040- let commonState = $t04174241895._2
1041- let amountEstimated = $t04174241895._1
1037+ let outInAmountAsset = $t04183741990._5
1038+ let bonus = $t04183741990._4
1039+ let feeAmount = $t04183741990._3
1040+ let commonState = $t04183741990._2
1041+ let amountEstimated = $t04183741990._1
10421042 let amount = if (if ((minOutAmount > 0))
10431043 then (minOutAmount > amountEstimated)
10441044 else false)
10511051 let sendFee = if ((feeAmount > 0))
10521052 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10531053 else nil
1054- let $t04239542642 = {
1054+ let $t04249042737 = {
10551055 let feeAmountForCalc = if ((this == feeCollectorAddress))
10561056 then 0
10571057 else feeAmount
10591059 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10601060 else $Tuple2(0, -((amount + feeAmountForCalc)))
10611061 }
1062- let amountAssetBalanceDelta = $t04239542642._1
1063- let priceAssetBalanceDelta = $t04239542642._2
1064- let $t04264542753 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1065- let refreshKLpActions = $t04264542753._1
1066- let updatedKLp = $t04264542753._2
1062+ let amountAssetBalanceDelta = $t04249042737._1
1063+ let priceAssetBalanceDelta = $t04249042737._2
1064+ let $t04274042848 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1065+ let refreshKLpActions = $t04274042848._1
1066+ let updatedKLp = $t04274042848._2
10671067 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10681068 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10691069 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10821082
10831083 @Callable(i)
10841084 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1085- let $t04301043166 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1086- let amountEstimated = $t04301043166._1
1087- let commonState = $t04301043166._2
1088- let feeAmount = $t04301043166._3
1089- let bonus = $t04301043166._4
1090- let outInAmountAsset = $t04301043166._5
1085+ let $t04310543261 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1086+ let amountEstimated = $t04310543261._1
1087+ let commonState = $t04310543261._2
1088+ let feeAmount = $t04310543261._3
1089+ let bonus = $t04310543261._4
1090+ let outInAmountAsset = $t04310543261._5
10911091 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10921092 }
10931093
11241124 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11251125 if ((unstakeInv == unstakeInv))
11261126 then {
1127- let $t04407144222 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1128- if (($t04407144222 == $t04407144222))
1127+ let $t04416644317 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1128+ if (($t04416644317 == $t04416644317))
11291129 then {
1130- let outInAmountAsset = $t04407144222._5
1131- let bonus = $t04407144222._4
1132- let feeAmount = $t04407144222._3
1133- let commonState = $t04407144222._2
1134- let amountEstimated = $t04407144222._1
1130+ let outInAmountAsset = $t04416644317._5
1131+ let bonus = $t04416644317._4
1132+ let feeAmount = $t04416644317._3
1133+ let commonState = $t04416644317._2
1134+ let amountEstimated = $t04416644317._1
11351135 let amount = if (if ((minOutAmount > 0))
11361136 then (minOutAmount > amountEstimated)
11371137 else false)
11441144 let sendFee = if ((feeAmount > 0))
11451145 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
11461146 else nil
1147- let $t04471744964 = {
1147+ let $t04481245059 = {
11481148 let feeAmountForCalc = if ((this == feeCollectorAddress))
11491149 then 0
11501150 else feeAmount
11521152 then $Tuple2(-((amount + feeAmountForCalc)), 0)
11531153 else $Tuple2(0, -((amount + feeAmountForCalc)))
11541154 }
1155- let amountAssetBalanceDelta = $t04471744964._1
1156- let priceAssetBalanceDelta = $t04471744964._2
1157- let $t04496745075 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1158- let refreshKLpActions = $t04496745075._1
1159- let updatedKLp = $t04496745075._2
1155+ let amountAssetBalanceDelta = $t04481245059._1
1156+ let priceAssetBalanceDelta = $t04481245059._2
1157+ let $t04506245170 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1158+ let refreshKLpActions = $t04506245170._1
1159+ let updatedKLp = $t04506245170._2
11601160 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11611161 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11621162 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11891189 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11901190 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11911191 then {
1192- let $t04602146103 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1193- let refreshKLpActions = $t04602146103._1
1194- let updatedKLp = $t04602146103._2
1192+ let $t04611646198 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1193+ let refreshKLpActions = $t04611646198._1
1194+ let updatedKLp = $t04611646198._2
11951195 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11961196 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11971197 then (state ++ refreshKLpActions)
12231223 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12241224 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12251225 then {
1226- let $t04705247133 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1227- let refreshKLpActions = $t04705247133._1
1228- let updatedKLp = $t04705247133._2
1226+ let $t04714747228 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1227+ let refreshKLpActions = $t04714747228._1
1228+ let updatedKLp = $t04714747228._2
12291229 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12301230 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12311231 then (state ++ refreshKLpActions)
12691269 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12701270 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12711271 then {
1272- let $t04825948340 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1273- let refreshKLpActions = $t04825948340._1
1274- let updatedKLp = $t04825948340._2
1272+ let $t04835448435 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1273+ let refreshKLpActions = $t04835448435._1
1274+ let updatedKLp = $t04835448435._2
12751275 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12761276 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12771277 then (state ++ refreshKLpActions)
13221322 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13231323 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13241324 then {
1325- let $t04963549716 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1326- let refreshKLpActions = $t04963549716._1
1327- let updatedKLp = $t04963549716._2
1325+ let $t04973049811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1326+ let refreshKLpActions = $t04973049811._1
1327+ let updatedKLp = $t04973049811._2
13281328 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13291329 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13301330 then (state ++ refreshKLpActions)
13591359 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13601360 then {
13611361 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1362- let $t05090350967 = refreshKLpInternal(0, 0, 0)
1363- let kLpUpdateActions = $t05090350967._1
1364- let updatedKLp = $t05090350967._2
1362+ let $t05099851062 = refreshKLpInternal(0, 0, 0)
1363+ let kLpUpdateActions = $t05099851062._1
1364+ let updatedKLp = $t05099851062._2
13651365 let actions = if ((kLp != updatedKLp))
13661366 then kLpUpdateActions
13671367 else throwErr("nothing to refresh")
15361536 match tx {
15371537 case order: Order =>
15381538 let matcherPub = getMatcherPubOrFail()
1539- let $t05962959698 = validateMatcherOrderAllowed(order)
1540- let orderValid = $t05962959698._1
1541- let orderValidInfo = $t05962959698._2
1539+ let $t05972459793 = validateMatcherOrderAllowed(order)
1540+ let orderValid = $t05972459793._1
1541+ let orderValidInfo = $t05972459793._2
15421542 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15431543 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15441544 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
8585
8686
8787 func swapContract () = "%s__swapContract"
8888
8989
9090 func fc () = "%s__factoryContract"
9191
9292
9393 func mpk () = "%s__managerPublicKey"
9494
9595
9696 func pmpk () = "%s__pendingManagerPublicKey"
9797
9898
9999 func pl () = "%s%s__price__last"
100100
101101
102102 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
103103
104104
105105 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
106106
107107
108108 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
109109
110110
111111 func aa () = "%s__amountAsset"
112112
113113
114114 func pa () = "%s__priceAsset"
115115
116116
117117 let keyFee = "%s__fee"
118118
119119 let feeDefault = fraction(10, scale8, 10000)
120120
121121 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
122122
123123 let keyKLp = makeString(["%s", "kLp"], SEP)
124124
125125 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
126126
127127 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
128128
129129 let kLpRefreshDelayDefault = 30
130130
131131 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
132132
133133 func keyFactoryConfig () = "%s__factoryConfig"
134134
135135
136136 func keyMatcherPub () = "%s%s__matcher__publicKey"
137137
138138
139139 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
140140
141141
142142 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
143143
144144
145145 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
146146
147147
148148 func keyAllPoolsShutdown () = "%s__shutdown"
149149
150150
151151 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
152152
153153
154154 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
155155
156156
157157 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
158158
159159 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
160160
161161
162162 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
163163
164164
165165 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
166166
167167
168168 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
169169
170170
171171 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
172172
173173
174174 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
175175
176176 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
177177
178178 let inFee = {
179179 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
180180 if ($isInstanceOf(@, "Int"))
181181 then @
182182 else throw(($getType(@) + " couldn't be cast to Int"))
183183 }
184184
185185 let outFee = {
186186 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
187187 if ($isInstanceOf(@, "Int"))
188188 then @
189189 else throw(($getType(@) + " couldn't be cast to Int"))
190190 }
191191
192192 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
193193
194194
195195 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
196196
197197
198198 func getPoolConfig () = {
199199 let amtAsset = getStringOrFail(this, aa())
200200 let priceAsset = getStringOrFail(this, pa())
201201 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
202202 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
203203 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
204204 }
205205
206206
207207 func parseAssetId (input) = if ((input == wavesString))
208208 then unit
209209 else fromBase58String(input)
210210
211211
212212 func assetIdToString (input) = if ((input == unit))
213213 then wavesString
214214 else toBase58String(value(input))
215215
216216
217217 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]))
218218
219219
220220 let poolConfigParsed = parsePoolConfig(getPoolConfig())
221221
222222 let $t084698635 = poolConfigParsed
223223
224224 let cfgPoolAddress = $t084698635._1
225225
226226 let cfgPoolStatus = $t084698635._2
227227
228228 let cfgLpAssetId = $t084698635._3
229229
230230 let cfgAmountAssetId = $t084698635._4
231231
232232 let cfgPriceAssetId = $t084698635._5
233233
234234 let cfgAmountAssetDecimals = $t084698635._6
235235
236236 let cfgPriceAssetDecimals = $t084698635._7
237237
238238 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
239239
240240
241241 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
242242
243243 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
244244
245245 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)
246246
247247
248248 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)
249249
250250
251251 func getAccBalance (assetId) = if ((assetId == "WAVES"))
252252 then wavesBalance(this).available
253253 else assetBalance(this, fromBase58String(assetId))
254254
255255
256256 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
257257
258258
259259 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
260260
261261
262262 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
263263 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
264264 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
265265 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
266266 }
267267
268268
269269 func calcPrices (amAmt,prAmt,lpAmt) = {
270270 let cfg = getPoolConfig()
271271 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
272272 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
273273 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
274274 let amAmtX18 = toX18(amAmt, amtAssetDcm)
275275 let prAmtX18 = toX18(prAmt, priceAssetDcm)
276276 let lpAmtX18 = toX18(lpAmt, scale8)
277277 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
278278 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
279279 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
280280 }
281281
282282
283283 func calculatePrices (amAmt,prAmt,lpAmt) = {
284284 let prices = calcPrices(amAmt, prAmt, lpAmt)
285285 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
286286 }
287287
288288
289289 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
290290 let cfg = getPoolConfig()
291291 let lpAssetId = cfg[idxPoolLPAssetId]
292292 let amAssetId = cfg[idxAmtAssetId]
293293 let prAssetId = cfg[idxPriceAssetId]
294294 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
295295 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
296296 let poolStatus = cfg[idxPoolStatus]
297297 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
298298 if ((lpAssetId != pmtAssetId))
299299 then throw("Invalid asset passed.")
300300 else {
301301 let amBalance = getAccBalance(amAssetId)
302302 let amBalanceX18 = toX18(amBalance, amAssetDcm)
303303 let prBalance = getAccBalance(prAssetId)
304304 let prBalanceX18 = toX18(prBalance, prAssetDcm)
305305 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
306306 let curPrice = fromX18(curPriceX18, scale8)
307307 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
308308 let lpEmissionX18 = toX18(lpEmission, scale8)
309309 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
310310 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
311311 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
312312 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
313313 let state = if ((txId58 == ""))
314314 then nil
315315 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
316316 then unit
317317 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
318318 then unit
319319 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)]
320320 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
321321 }
322322 }
323323
324324
325325 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
326326 let cfg = getPoolConfig()
327327 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
328328 let amAssetIdStr = cfg[idxAmtAssetId]
329329 let prAssetIdStr = cfg[idxPriceAssetId]
330330 let iAmtAssetId = cfg[idxIAmtAssetId]
331331 let iPriceAssetId = cfg[idxIPriceAssetId]
332332 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
333333 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
334334 let poolStatus = cfg[idxPoolStatus]
335335 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
336336 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
337337 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
338338 if (if ((amAssetIdStr != inAmAssetIdStr))
339339 then true
340340 else (prAssetIdStr != inPrAssetIdStr))
341341 then throw("Invalid amt or price asset passed.")
342342 else {
343343 let amBalance = if (isEvaluate)
344344 then getAccBalance(amAssetIdStr)
345345 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
346346 let prBalance = if (isEvaluate)
347347 then getAccBalance(prAssetIdStr)
348348 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
349349 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
350350 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
351351 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
352352 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
353353 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
354354 let res = if ((lpEmission == 0))
355355 then {
356356 let curPriceX18 = zeroBigInt
357357 let slippageX18 = zeroBigInt
358358 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
359359 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
360360 }
361361 else {
362362 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
363363 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
364364 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
365365 if (if ((curPriceX18 != zeroBigInt))
366366 then (slippageX18 > slippageToleranceX18)
367367 else false)
368368 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
369369 else {
370370 let lpEmissionX18 = toX18(lpEmission, scale8)
371371 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
372372 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
373373 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
374374 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
375375 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
376376 let expAmtAssetAmtX18 = expectedAmts._1
377377 let expPriceAssetAmtX18 = expectedAmts._2
378378 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
379379 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
380380 }
381381 }
382382 let calcLpAmt = res._1
383383 let calcAmAssetPmt = res._2
384384 let calcPrAssetPmt = res._3
385385 let curPrice = fromX18(res._4, scale8)
386386 let slippageCalc = fromX18(res._5, scale8)
387387 if ((0 >= calcLpAmt))
388388 then throw("Invalid calculations. LP calculated is less than zero.")
389389 else {
390390 let emitLpAmt = if (!(emitLp))
391391 then 0
392392 else calcLpAmt
393393 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
394394 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
395395 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))]
396396 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
397397 }
398398 }
399399 }
400400
401401
402402 func calcKLp (amountBalance,priceBalance,lpEmission) = {
403403 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
404404 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
405405 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
406406 if ((lpEmission == big0))
407407 then big0
408408 else updatedKLp
409409 }
410410
411411
412412 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
413413 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
414414 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
415415 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
416416 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
417417 currentKLp
418418 }
419419
420420
421421 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
422422 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
423423 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
424424 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
425425 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
426426 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
427427 $Tuple2(actions, updatedKLp)
428428 }
429429
430430
431431 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
432432 then true
433433 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
434434
435435
436436 func validateMatcherOrderAllowed (order) = {
437437 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
438438 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
439439 let amountAssetAmount = order.amount
440440 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
441441 let $t02154121753 = if ((order.orderType == Buy))
442442 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
443443 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
444444 let amountAssetBalanceDelta = $t02154121753._1
445445 let priceAssetBalanceDelta = $t02154121753._2
446446 if (if (if (isGlobalShutdown())
447447 then true
448448 else (cfgPoolStatus == PoolMatcherDisabled))
449449 then true
450450 else (cfgPoolStatus == PoolShutdown))
451451 then throw("Exchange operations disabled")
452452 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
453453 then true
454454 else (order.assetPair.priceAsset != cfgPriceAssetId))
455455 then throw("Wrong order assets.")
456456 else {
457457 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
458458 let $t02219322293 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
459459 let unusedActions = $t02219322293._1
460460 let kLpNew = $t02219322293._2
461461 let isOrderValid = (kLpNew >= kLp)
462462 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
463463 $Tuple2(isOrderValid, info)
464464 }
465465 }
466466
467467
468468 func commonGet (i) = if ((size(i.payments) != 1))
469469 then throw("exactly 1 payment is expected")
470470 else {
471471 let pmt = value(i.payments[0])
472472 let pmtAssetId = value(pmt.assetId)
473473 let pmtAmt = pmt.amount
474474 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
475475 let outAmAmt = res._1
476476 let outPrAmt = res._2
477477 let poolStatus = parseIntValue(res._9)
478478 let state = res._10
479479 if (if (isGlobalShutdown())
480480 then true
481481 else (poolStatus == PoolShutdown))
482482 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
483483 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
484484 }
485485
486486
487487 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
488488 then throw("exactly 2 payments are expected")
489489 else {
490490 let amAssetPmt = value(i.payments[0])
491491 let prAssetPmt = value(i.payments[1])
492492 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
493493 let poolStatus = parseIntValue(estPut._8)
494494 if (if (if (isGlobalShutdown())
495495 then true
496496 else (poolStatus == PoolPutDisabled))
497497 then true
498498 else (poolStatus == PoolShutdown))
499499 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
500500 else estPut
501501 }
502502
503503
504504 func emit (amount) = {
505505 let emitInv = invoke(factoryContract, "emit", [amount], nil)
506506 if ((emitInv == emitInv))
507507 then {
508508 let emitInvLegacy = match emitInv {
509509 case legacyFactoryContract: Address =>
510510 invoke(legacyFactoryContract, "emit", [amount], nil)
511511 case _ =>
512512 unit
513513 }
514514 if ((emitInvLegacy == emitInvLegacy))
515515 then amount
516516 else throw("Strict value is not equal to itself.")
517517 }
518518 else throw("Strict value is not equal to itself.")
519519 }
520520
521521
522522 func takeFee (amount,fee) = {
523523 let feeAmount = if ((fee == 0))
524524 then 0
525525 else fraction(amount, fee, scale8)
526526 $Tuple2((amount - feeAmount), feeAmount)
527527 }
528528
529529
530530 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
531531 let isEval = (txId == unit)
532532 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
533533 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
534534 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
535535 then true
536536 else if ((paymentAssetId == cfgPriceAssetId))
537537 then false
538538 else throwErr("invalid asset")
539539 let $t02540625699 = if (isEval)
540540 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
541541 else if (paymentInAmountAsset)
542542 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
543543 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
544544 let amountBalanceOld = $t02540625699._1
545545 let priceBalanceOld = $t02540625699._2
546546 let $t02570325852 = if (paymentInAmountAsset)
547547 then $Tuple2(paymentAmountRaw, 0)
548548 else $Tuple2(0, paymentAmountRaw)
549549 let amountAssetAmountRaw = $t02570325852._1
550550 let priceAssetAmountRaw = $t02570325852._2
551551 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
552552 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
553553 let $t02598426048 = takeFee(paymentAmountRaw, inFee)
554554 let paymentAmount = $t02598426048._1
555555 let feeAmount = $t02598426048._2
556556 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
557557 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
558558 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
559559 let priceNew = fromX18(priceNewX18, scale8)
560560 let paymentBalance = if (paymentInAmountAsset)
561561 then amountBalanceOld
562562 else priceBalanceOld
563563 let paymentBalanceBigInt = toBigInt(paymentBalance)
564564 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565565 let chechSupply = if ((supplyBigInt > big0))
566566 then true
567567 else throwErr("initial deposit requires all coins")
568568 if ((chechSupply == chechSupply))
569569 then {
570570 let depositBigInt = toBigInt(paymentAmount)
571571 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
572572 let commonState = if (isEval)
573573 then nil
574574 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))]
575575 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
576576 let priceOld = fromX18(priceOldX18, scale8)
577577 let loss = {
578578 let $t02772927896 = if (paymentInAmountAsset)
579579 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
580580 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
581581 let amount = $t02772927896._1
582582 let balance = $t02772927896._2
583583 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
584584 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
585585 }
586586 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
587587 }
588588 else throw("Strict value is not equal to itself.")
589589 }
590590
591591
592592 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
593593 let isEval = (txId == unit)
594594 let cfg = getPoolConfig()
595595 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
596596 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
597597 let checks = [if ((paymentAssetId == cfgLpAssetId))
598598 then true
599599 else throwErr("invalid lp asset")]
600600 if ((checks == checks))
601601 then {
602602 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
603603 then true
604604 else if ((outAssetId == cfgPriceAssetId))
605605 then false
606606 else throwErr("invalid asset")
607607 let balanceBigInt = if (outInAmountAsset)
608608 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
609609 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
610610 let outInAmountAssetDecimals = if (outInAmountAsset)
611611 then amtAssetDcm
612612 else priceAssetDcm
613613 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
614614 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
615615 let outBalance = if (outInAmountAsset)
616616 then amBalanceOld
617617 else prBalanceOld
618618 let outBalanceBigInt = toBigInt(outBalance)
619619 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
620620 let redeemedBigInt = toBigInt(paymentAmount)
621621 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
622622 let $t02997430030 = takeFee(amountRaw, outFee)
623623 let totalAmount = $t02997430030._1
624624 let feeAmount = $t02997430030._2
625625 let $t03003430260 = if (outInAmountAsset)
626626 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
627627 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
628628 let outAmAmount = $t03003430260._1
629629 let outPrAmount = $t03003430260._2
630630 let amBalanceNew = $t03003430260._3
631631 let prBalanceNew = $t03003430260._4
632632 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
633633 let priceNew = fromX18(priceNewX18, scale8)
634634 let commonState = if (isEval)
635635 then nil
636636 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)]
637637 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
638638 let priceOld = fromX18(priceOldX18, scale8)
639639 let loss = {
640640 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
641641 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
642642 }
643643 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
644644 }
645645 else throw("Strict value is not equal to itself.")
646646 }
647647
648648
649649 func managerPublicKeyOrUnit () = match getString(mpk()) {
650650 case s: String =>
651651 fromBase58String(s)
652652 case _: Unit =>
653653 unit
654654 case _ =>
655655 throw("Match error")
656656 }
657657
658658
659659 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
660660 case s: String =>
661661 fromBase58String(s)
662662 case _: Unit =>
663663 unit
664664 case _ =>
665665 throw("Match error")
666666 }
667667
668668
669669 func isManager (i) = match managerPublicKeyOrUnit() {
670670 case pk: ByteVector =>
671671 (i.callerPublicKey == pk)
672672 case _: Unit =>
673673 (i.caller == this)
674674 case _ =>
675675 throw("Match error")
676676 }
677677
678678
679679 func mustManager (i) = {
680680 let pd = throw("Permission denied")
681681 match managerPublicKeyOrUnit() {
682682 case pk: ByteVector =>
683683 if ((i.callerPublicKey == pk))
684684 then true
685685 else pd
686686 case _: Unit =>
687687 if ((i.caller == this))
688688 then true
689689 else pd
690690 case _ =>
691691 throw("Match error")
692692 }
693693 }
694694
695695
696696 @Callable(i)
697-func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse) = {
698- let $t03195732262 = if ((isReverse == false))
697+func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
698+ let $t03197732282 = if ((isReverse == false))
699699 then {
700700 let assetOut = getStringOrFail(this, pa())
701701 let assetIn = getStringOrFail(this, aa())
702702 $Tuple2(assetOut, assetIn)
703703 }
704704 else {
705705 let assetOut = getStringOrFail(this, aa())
706706 let assetIn = getStringOrFail(this, pa())
707707 $Tuple2(assetOut, assetIn)
708708 }
709- let assetOut = $t03195732262._1
710- let assetIn = $t03195732262._2
709+ let assetOut = $t03197732282._1
710+ let assetIn = $t03197732282._2
711711 let poolAssetInBalance = getAccBalance(assetIn)
712712 let poolAssetOutBalance = getAccBalance(assetOut)
713713 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
714714 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
715- let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
715+ let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
716716 let checkK = if ((newK >= oldK))
717717 then true
718718 else throw("new K is fewer error")
719719 if ((checkK == checkK))
720720 then $Tuple2(nil, amountOut)
721721 else throw("Strict value is not equal to itself.")
722722 }
723723
724724
725725
726726 @Callable(i)
727-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
727+func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
728728 let swapContact = {
729729 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
730730 if ($isInstanceOf(@, "String"))
731731 then @
732732 else throw(($getType(@) + " couldn't be cast to String"))
733733 }
734734 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
735735 then true
736736 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
737737 then true
738738 else throwErr("Permission denied")]
739739 if ((checks == checks))
740740 then {
741741 let pmt = value(i.payments[0])
742742 let assetIn = assetIdToString(pmt.assetId)
743743 let assetOut = if ((isReverse == false))
744744 then getStringOrFail(this, pa())
745745 else getStringOrFail(this, aa())
746746 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
747747 let poolAssetOutBalance = getAccBalance(assetOut)
748748 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
749749 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
750- let newK = (toBigInt(getAccBalance(assetIn)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
750+ let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
751751 let checkK = if ((newK >= oldK))
752752 then true
753753 else throw("new K is fewer error")
754754 if ((checkK == checkK))
755755 then {
756756 let checkMin = if ((amountOut >= amountOutMin))
757757 then true
758758 else throw("Exchange result is fewer coins than expected")
759759 if ((checkMin == checkMin))
760760 then $Tuple2([ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))], amountOut)
761761 else throw("Strict value is not equal to itself.")
762762 }
763763 else throw("Strict value is not equal to itself.")
764764 }
765765 else throw("Strict value is not equal to itself.")
766766 }
767767
768768
769769
770770 @Callable(i)
771771 func setManager (pendingManagerPublicKey) = {
772772 let checkCaller = mustManager(i)
773773 if ((checkCaller == checkCaller))
774774 then {
775775 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
776776 if ((checkManagerPublicKey == checkManagerPublicKey))
777777 then [StringEntry(pmpk(), pendingManagerPublicKey)]
778778 else throw("Strict value is not equal to itself.")
779779 }
780780 else throw("Strict value is not equal to itself.")
781781 }
782782
783783
784784
785785 @Callable(i)
786786 func confirmManager () = {
787787 let pm = pendingManagerPublicKeyOrUnit()
788788 let hasPM = if (isDefined(pm))
789789 then true
790790 else throw("No pending manager")
791791 if ((hasPM == hasPM))
792792 then {
793793 let checkPM = if ((i.callerPublicKey == value(pm)))
794794 then true
795795 else throw("You are not pending manager")
796796 if ((checkPM == checkPM))
797797 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
798798 else throw("Strict value is not equal to itself.")
799799 }
800800 else throw("Strict value is not equal to itself.")
801801 }
802802
803803
804804
805805 @Callable(i)
806806 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
807807 then throw("Invalid slippageTolerance passed")
808808 else {
809809 let estPut = commonPut(i, slippageTolerance, true)
810810 let emitLpAmt = estPut._2
811811 let lpAssetId = estPut._7
812812 let state = estPut._9
813813 let amDiff = estPut._10
814814 let prDiff = estPut._11
815815 let amId = estPut._12
816816 let prId = estPut._13
817817 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
818818 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
819819 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
820820 if ((currentKLp == currentKLp))
821821 then {
822822 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
823823 if ((emitInv == emitInv))
824824 then {
825825 let emitInvLegacy = match emitInv {
826826 case legacyFactoryContract: Address =>
827827 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
828828 case _ =>
829829 unit
830830 }
831831 if ((emitInvLegacy == emitInvLegacy))
832832 then {
833833 let slippageAInv = if ((amDiff > 0))
834834 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
835835 else nil
836836 if ((slippageAInv == slippageAInv))
837837 then {
838838 let slippagePInv = if ((prDiff > 0))
839839 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
840840 else nil
841841 if ((slippagePInv == slippagePInv))
842842 then {
843843 let lpTransfer = if (shouldAutoStake)
844844 then {
845845 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
846846 if ((slpStakeInv == slpStakeInv))
847847 then nil
848848 else throw("Strict value is not equal to itself.")
849849 }
850850 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
851- let $t03707137533 = refreshKLpInternal(0, 0, 0)
852- if (($t03707137533 == $t03707137533))
851+ let $t03716637628 = refreshKLpInternal(0, 0, 0)
852+ if (($t03716637628 == $t03716637628))
853853 then {
854- let updatedKLp = $t03707137533._2
855- let refreshKLpActions = $t03707137533._1
854+ let updatedKLp = $t03716637628._2
855+ let refreshKLpActions = $t03716637628._1
856856 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
857857 if ((isUpdatedKLpValid == isUpdatedKLpValid))
858858 then ((state ++ lpTransfer) ++ refreshKLpActions)
859859 else throw("Strict value is not equal to itself.")
860860 }
861861 else throw("Strict value is not equal to itself.")
862862 }
863863 else throw("Strict value is not equal to itself.")
864864 }
865865 else throw("Strict value is not equal to itself.")
866866 }
867867 else throw("Strict value is not equal to itself.")
868868 }
869869 else throw("Strict value is not equal to itself.")
870870 }
871871 else throw("Strict value is not equal to itself.")
872872 }
873873
874874
875875
876876 @Callable(i)
877877 func putForFree (maxSlippage) = if ((0 > maxSlippage))
878878 then throw("Invalid value passed")
879879 else {
880880 let estPut = commonPut(i, maxSlippage, false)
881881 let state = estPut._9
882882 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
883883 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
884884 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
885885 if ((currentKLp == currentKLp))
886886 then {
887- let $t03809538160 = refreshKLpInternal(0, 0, 0)
888- let refreshKLpActions = $t03809538160._1
889- let updatedKLp = $t03809538160._2
887+ let $t03819038255 = refreshKLpInternal(0, 0, 0)
888+ let refreshKLpActions = $t03819038255._1
889+ let updatedKLp = $t03819038255._2
890890 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
891891 if ((isUpdatedKLpValid == isUpdatedKLpValid))
892892 then (state ++ refreshKLpActions)
893893 else throw("Strict value is not equal to itself.")
894894 }
895895 else throw("Strict value is not equal to itself.")
896896 }
897897
898898
899899
900900 @Callable(i)
901901 func putOneTkn (minOutAmount,autoStake) = {
902902 let isPoolOneTokenOperationsDisabled = {
903903 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
904904 if ($isInstanceOf(@, "Boolean"))
905905 then @
906906 else throw(($getType(@) + " couldn't be cast to Boolean"))
907907 }
908908 let isPutDisabled = if (if (if (isGlobalShutdown())
909909 then true
910910 else (cfgPoolStatus == PoolPutDisabled))
911911 then true
912912 else (cfgPoolStatus == PoolShutdown))
913913 then true
914914 else isPoolOneTokenOperationsDisabled
915915 let checks = [if (if (!(isPutDisabled))
916916 then true
917917 else isManager(i))
918918 then true
919919 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
920920 then true
921921 else throwErr("exactly 1 payment are expected")]
922922 if ((checks == checks))
923923 then {
924924 let payment = i.payments[0]
925925 let paymentAssetId = payment.assetId
926926 let paymentAmountRaw = payment.amount
927927 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
928928 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
929929 else if ((paymentAssetId == cfgPriceAssetId))
930930 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
931931 else throwErr("payment asset is not supported")
932932 if ((currentKLp == currentKLp))
933933 then {
934934 let userAddress = i.caller
935935 let txId = i.transactionId
936- let $t03934839500 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
937- if (($t03934839500 == $t03934839500))
936+ let $t03944339595 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
937+ if (($t03944339595 == $t03944339595))
938938 then {
939- let paymentInAmountAsset = $t03934839500._5
940- let bonus = $t03934839500._4
941- let feeAmount = $t03934839500._3
942- let commonState = $t03934839500._2
943- let emitAmountEstimated = $t03934839500._1
939+ let paymentInAmountAsset = $t03944339595._5
940+ let bonus = $t03944339595._4
941+ let feeAmount = $t03944339595._3
942+ let commonState = $t03944339595._2
943+ let emitAmountEstimated = $t03944339595._1
944944 let emitAmount = if (if ((minOutAmount > 0))
945945 then (minOutAmount > emitAmountEstimated)
946946 else false)
947947 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
948948 else emitAmountEstimated
949949 let emitInv = emit(emitAmount)
950950 if ((emitInv == emitInv))
951951 then {
952952 let lpTransfer = if (autoStake)
953953 then {
954954 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
955955 if ((stakeInv == stakeInv))
956956 then nil
957957 else throw("Strict value is not equal to itself.")
958958 }
959959 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
960960 let sendFee = if ((feeAmount > 0))
961961 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
962962 else nil
963- let $t04008640283 = if ((this == feeCollectorAddress))
963+ let $t04018140378 = if ((this == feeCollectorAddress))
964964 then $Tuple2(0, 0)
965965 else if (paymentInAmountAsset)
966966 then $Tuple2(-(feeAmount), 0)
967967 else $Tuple2(0, -(feeAmount))
968- let amountAssetBalanceDelta = $t04008640283._1
969- let priceAssetBalanceDelta = $t04008640283._2
970- let $t04028640394 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971- let refreshKLpActions = $t04028640394._1
972- let updatedKLp = $t04028640394._2
968+ let amountAssetBalanceDelta = $t04018140378._1
969+ let priceAssetBalanceDelta = $t04018140378._2
970+ let $t04038140489 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
971+ let refreshKLpActions = $t04038140489._1
972+ let updatedKLp = $t04038140489._2
973973 let kLp = value(getString(keyKLp))
974974 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
975975 if ((isUpdatedKLpValid == isUpdatedKLpValid))
976976 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
977977 else throw("Strict value is not equal to itself.")
978978 }
979979 else throw("Strict value is not equal to itself.")
980980 }
981981 else throw("Strict value is not equal to itself.")
982982 }
983983 else throw("Strict value is not equal to itself.")
984984 }
985985 else throw("Strict value is not equal to itself.")
986986 }
987987
988988
989989
990990 @Callable(i)
991991 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
992- let $t04070040857 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
993- let emitAmountEstimated = $t04070040857._1
994- let commonState = $t04070040857._2
995- let feeAmount = $t04070040857._3
996- let bonus = $t04070040857._4
997- let paymentInAmountAsset = $t04070040857._5
992+ let $t04079540952 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
993+ let emitAmountEstimated = $t04079540952._1
994+ let commonState = $t04079540952._2
995+ let feeAmount = $t04079540952._3
996+ let bonus = $t04079540952._4
997+ let paymentInAmountAsset = $t04079540952._5
998998 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
999999 }
10001000
10011001
10021002
10031003 @Callable(i)
10041004 func getOneTkn (outAssetIdStr,minOutAmount) = {
10051005 let isPoolOneTokenOperationsDisabled = {
10061006 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
10071007 if ($isInstanceOf(@, "Boolean"))
10081008 then @
10091009 else throw(($getType(@) + " couldn't be cast to Boolean"))
10101010 }
10111011 let isGetDisabled = if (if (isGlobalShutdown())
10121012 then true
10131013 else (cfgPoolStatus == PoolShutdown))
10141014 then true
10151015 else isPoolOneTokenOperationsDisabled
10161016 let checks = [if (if (!(isGetDisabled))
10171017 then true
10181018 else isManager(i))
10191019 then true
10201020 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
10211021 then true
10221022 else throwErr("exactly 1 payment are expected")]
10231023 if ((checks == checks))
10241024 then {
10251025 let outAssetId = parseAssetId(outAssetIdStr)
10261026 let payment = i.payments[0]
10271027 let paymentAssetId = payment.assetId
10281028 let paymentAmount = payment.amount
10291029 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10301030 if ((currentKLp == currentKLp))
10311031 then {
10321032 let userAddress = i.caller
10331033 let txId = i.transactionId
1034- let $t04174241895 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1035- if (($t04174241895 == $t04174241895))
1034+ let $t04183741990 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1035+ if (($t04183741990 == $t04183741990))
10361036 then {
1037- let outInAmountAsset = $t04174241895._5
1038- let bonus = $t04174241895._4
1039- let feeAmount = $t04174241895._3
1040- let commonState = $t04174241895._2
1041- let amountEstimated = $t04174241895._1
1037+ let outInAmountAsset = $t04183741990._5
1038+ let bonus = $t04183741990._4
1039+ let feeAmount = $t04183741990._3
1040+ let commonState = $t04183741990._2
1041+ let amountEstimated = $t04183741990._1
10421042 let amount = if (if ((minOutAmount > 0))
10431043 then (minOutAmount > amountEstimated)
10441044 else false)
10451045 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10461046 else amountEstimated
10471047 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
10481048 if ((burnInv == burnInv))
10491049 then {
10501050 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
10511051 let sendFee = if ((feeAmount > 0))
10521052 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10531053 else nil
1054- let $t04239542642 = {
1054+ let $t04249042737 = {
10551055 let feeAmountForCalc = if ((this == feeCollectorAddress))
10561056 then 0
10571057 else feeAmount
10581058 if (outInAmountAsset)
10591059 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10601060 else $Tuple2(0, -((amount + feeAmountForCalc)))
10611061 }
1062- let amountAssetBalanceDelta = $t04239542642._1
1063- let priceAssetBalanceDelta = $t04239542642._2
1064- let $t04264542753 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1065- let refreshKLpActions = $t04264542753._1
1066- let updatedKLp = $t04264542753._2
1062+ let amountAssetBalanceDelta = $t04249042737._1
1063+ let priceAssetBalanceDelta = $t04249042737._2
1064+ let $t04274042848 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1065+ let refreshKLpActions = $t04274042848._1
1066+ let updatedKLp = $t04274042848._2
10671067 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10681068 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10691069 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10701070 else throw("Strict value is not equal to itself.")
10711071 }
10721072 else throw("Strict value is not equal to itself.")
10731073 }
10741074 else throw("Strict value is not equal to itself.")
10751075 }
10761076 else throw("Strict value is not equal to itself.")
10771077 }
10781078 else throw("Strict value is not equal to itself.")
10791079 }
10801080
10811081
10821082
10831083 @Callable(i)
10841084 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1085- let $t04301043166 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1086- let amountEstimated = $t04301043166._1
1087- let commonState = $t04301043166._2
1088- let feeAmount = $t04301043166._3
1089- let bonus = $t04301043166._4
1090- let outInAmountAsset = $t04301043166._5
1085+ let $t04310543261 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1086+ let amountEstimated = $t04310543261._1
1087+ let commonState = $t04310543261._2
1088+ let feeAmount = $t04310543261._3
1089+ let bonus = $t04310543261._4
1090+ let outInAmountAsset = $t04310543261._5
10911091 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
10921092 }
10931093
10941094
10951095
10961096 @Callable(i)
10971097 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
10981098 let isPoolOneTokenOperationsDisabled = {
10991099 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11001100 if ($isInstanceOf(@, "Boolean"))
11011101 then @
11021102 else throw(($getType(@) + " couldn't be cast to Boolean"))
11031103 }
11041104 let isGetDisabled = if (if (isGlobalShutdown())
11051105 then true
11061106 else (cfgPoolStatus == PoolShutdown))
11071107 then true
11081108 else isPoolOneTokenOperationsDisabled
11091109 let checks = [if (if (!(isGetDisabled))
11101110 then true
11111111 else isManager(i))
11121112 then true
11131113 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
11141114 then true
11151115 else throwErr("no payments are expected")]
11161116 if ((checks == checks))
11171117 then {
11181118 let outAssetId = parseAssetId(outAssetIdStr)
11191119 let userAddress = i.caller
11201120 let txId = i.transactionId
11211121 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11221122 if ((currentKLp == currentKLp))
11231123 then {
11241124 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11251125 if ((unstakeInv == unstakeInv))
11261126 then {
1127- let $t04407144222 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1128- if (($t04407144222 == $t04407144222))
1127+ let $t04416644317 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1128+ if (($t04416644317 == $t04416644317))
11291129 then {
1130- let outInAmountAsset = $t04407144222._5
1131- let bonus = $t04407144222._4
1132- let feeAmount = $t04407144222._3
1133- let commonState = $t04407144222._2
1134- let amountEstimated = $t04407144222._1
1130+ let outInAmountAsset = $t04416644317._5
1131+ let bonus = $t04416644317._4
1132+ let feeAmount = $t04416644317._3
1133+ let commonState = $t04416644317._2
1134+ let amountEstimated = $t04416644317._1
11351135 let amount = if (if ((minOutAmount > 0))
11361136 then (minOutAmount > amountEstimated)
11371137 else false)
11381138 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11391139 else amountEstimated
11401140 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11411141 if ((burnInv == burnInv))
11421142 then {
11431143 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
11441144 let sendFee = if ((feeAmount > 0))
11451145 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
11461146 else nil
1147- let $t04471744964 = {
1147+ let $t04481245059 = {
11481148 let feeAmountForCalc = if ((this == feeCollectorAddress))
11491149 then 0
11501150 else feeAmount
11511151 if (outInAmountAsset)
11521152 then $Tuple2(-((amount + feeAmountForCalc)), 0)
11531153 else $Tuple2(0, -((amount + feeAmountForCalc)))
11541154 }
1155- let amountAssetBalanceDelta = $t04471744964._1
1156- let priceAssetBalanceDelta = $t04471744964._2
1157- let $t04496745075 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1158- let refreshKLpActions = $t04496745075._1
1159- let updatedKLp = $t04496745075._2
1155+ let amountAssetBalanceDelta = $t04481245059._1
1156+ let priceAssetBalanceDelta = $t04481245059._2
1157+ let $t04506245170 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1158+ let refreshKLpActions = $t04506245170._1
1159+ let updatedKLp = $t04506245170._2
11601160 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11611161 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11621162 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11631163 else throw("Strict value is not equal to itself.")
11641164 }
11651165 else throw("Strict value is not equal to itself.")
11661166 }
11671167 else throw("Strict value is not equal to itself.")
11681168 }
11691169 else throw("Strict value is not equal to itself.")
11701170 }
11711171 else throw("Strict value is not equal to itself.")
11721172 }
11731173 else throw("Strict value is not equal to itself.")
11741174 }
11751175
11761176
11771177
11781178 @Callable(i)
11791179 func get () = {
11801180 let res = commonGet(i)
11811181 let outAmtAmt = res._1
11821182 let outPrAmt = res._2
11831183 let pmtAmt = res._3
11841184 let pmtAssetId = res._4
11851185 let state = res._5
11861186 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11871187 if ((currentKLp == currentKLp))
11881188 then {
11891189 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11901190 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11911191 then {
1192- let $t04602146103 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1193- let refreshKLpActions = $t04602146103._1
1194- let updatedKLp = $t04602146103._2
1192+ let $t04611646198 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1193+ let refreshKLpActions = $t04611646198._1
1194+ let updatedKLp = $t04611646198._2
11951195 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11961196 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11971197 then (state ++ refreshKLpActions)
11981198 else throw("Strict value is not equal to itself.")
11991199 }
12001200 else throw("Strict value is not equal to itself.")
12011201 }
12021202 else throw("Strict value is not equal to itself.")
12031203 }
12041204
12051205
12061206
12071207 @Callable(i)
12081208 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
12091209 let res = commonGet(i)
12101210 let outAmAmt = res._1
12111211 let outPrAmt = res._2
12121212 let pmtAmt = res._3
12131213 let pmtAssetId = res._4
12141214 let state = res._5
12151215 if ((noLessThenAmtAsset > outAmAmt))
12161216 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
12171217 else if ((noLessThenPriceAsset > outPrAmt))
12181218 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
12191219 else {
12201220 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12211221 if ((currentKLp == currentKLp))
12221222 then {
12231223 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
12241224 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12251225 then {
1226- let $t04705247133 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1227- let refreshKLpActions = $t04705247133._1
1228- let updatedKLp = $t04705247133._2
1226+ let $t04714747228 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1227+ let refreshKLpActions = $t04714747228._1
1228+ let updatedKLp = $t04714747228._2
12291229 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12301230 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12311231 then (state ++ refreshKLpActions)
12321232 else throw("Strict value is not equal to itself.")
12331233 }
12341234 else throw("Strict value is not equal to itself.")
12351235 }
12361236 else throw("Strict value is not equal to itself.")
12371237 }
12381238 }
12391239
12401240
12411241
12421242 @Callable(i)
12431243 func unstakeAndGet (amount) = {
12441244 let checkPayments = if ((size(i.payments) != 0))
12451245 then throw("No payments are expected")
12461246 else true
12471247 if ((checkPayments == checkPayments))
12481248 then {
12491249 let cfg = getPoolConfig()
12501250 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12511251 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12521252 if ((currentKLp == currentKLp))
12531253 then {
12541254 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
12551255 if ((unstakeInv == unstakeInv))
12561256 then {
12571257 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
12581258 let outAmAmt = res._1
12591259 let outPrAmt = res._2
12601260 let poolStatus = parseIntValue(res._9)
12611261 let state = res._10
12621262 let checkPoolStatus = if (if (isGlobalShutdown())
12631263 then true
12641264 else (poolStatus == PoolShutdown))
12651265 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
12661266 else true
12671267 if ((checkPoolStatus == checkPoolStatus))
12681268 then {
12691269 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
12701270 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12711271 then {
1272- let $t04825948340 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1273- let refreshKLpActions = $t04825948340._1
1274- let updatedKLp = $t04825948340._2
1272+ let $t04835448435 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1273+ let refreshKLpActions = $t04835448435._1
1274+ let updatedKLp = $t04835448435._2
12751275 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12761276 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12771277 then (state ++ refreshKLpActions)
12781278 else throw("Strict value is not equal to itself.")
12791279 }
12801280 else throw("Strict value is not equal to itself.")
12811281 }
12821282 else throw("Strict value is not equal to itself.")
12831283 }
12841284 else throw("Strict value is not equal to itself.")
12851285 }
12861286 else throw("Strict value is not equal to itself.")
12871287 }
12881288 else throw("Strict value is not equal to itself.")
12891289 }
12901290
12911291
12921292
12931293 @Callable(i)
12941294 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
12951295 let isGetDisabled = if (isGlobalShutdown())
12961296 then true
12971297 else (cfgPoolStatus == PoolShutdown)
12981298 let checks = [if (!(isGetDisabled))
12991299 then true
13001300 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
13011301 then true
13021302 else throw("no payments are expected")]
13031303 if ((checks == checks))
13041304 then {
13051305 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13061306 if ((currentKLp == currentKLp))
13071307 then {
13081308 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13091309 if ((unstakeInv == unstakeInv))
13101310 then {
13111311 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
13121312 let outAmAmt = res._1
13131313 let outPrAmt = res._2
13141314 let state = res._10
13151315 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
13161316 then true
13171317 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
13181318 then true
13191319 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
13201320 if ((checkAmounts == checkAmounts))
13211321 then {
13221322 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
13231323 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
13241324 then {
1325- let $t04963549716 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1326- let refreshKLpActions = $t04963549716._1
1327- let updatedKLp = $t04963549716._2
1325+ let $t04973049811 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1326+ let refreshKLpActions = $t04973049811._1
1327+ let updatedKLp = $t04973049811._2
13281328 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13291329 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13301330 then (state ++ refreshKLpActions)
13311331 else throw("Strict value is not equal to itself.")
13321332 }
13331333 else throw("Strict value is not equal to itself.")
13341334 }
13351335 else throw("Strict value is not equal to itself.")
13361336 }
13371337 else throw("Strict value is not equal to itself.")
13381338 }
13391339 else throw("Strict value is not equal to itself.")
13401340 }
13411341 else throw("Strict value is not equal to itself.")
13421342 }
13431343
13441344
13451345
13461346 @Callable(i)
13471347 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
13481348 then throw("permissions denied")
13491349 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
13501350
13511351
13521352
13531353 @Callable(i)
13541354 func refreshKLp () = {
13551355 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
13561356 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
13571357 then unit
13581358 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
13591359 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
13601360 then {
13611361 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1362- let $t05090350967 = refreshKLpInternal(0, 0, 0)
1363- let kLpUpdateActions = $t05090350967._1
1364- let updatedKLp = $t05090350967._2
1362+ let $t05099851062 = refreshKLpInternal(0, 0, 0)
1363+ let kLpUpdateActions = $t05099851062._1
1364+ let updatedKLp = $t05099851062._2
13651365 let actions = if ((kLp != updatedKLp))
13661366 then kLpUpdateActions
13671367 else throwErr("nothing to refresh")
13681368 $Tuple2(actions, toString(updatedKLp))
13691369 }
13701370 else throw("Strict value is not equal to itself.")
13711371 }
13721372
13731373
13741374
13751375 @Callable(i)
13761376 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
13771377
13781378
13791379
13801380 @Callable(i)
13811381 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
13821382
13831383
13841384
13851385 @Callable(i)
13861386 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13871387 let prices = calcPrices(amAmt, prAmt, lpAmt)
13881388 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
13891389 }
13901390
13911391
13921392
13931393 @Callable(i)
13941394 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
13951395
13961396
13971397
13981398 @Callable(i)
13991399 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
14001400
14011401
14021402
14031403 @Callable(i)
14041404 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
14051405
14061406
14071407
14081408 @Callable(i)
14091409 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
14101410
14111411
14121412
14131413 @Callable(i)
14141414 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
14151415 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
14161416 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
14171417 }
14181418
14191419
14201420
14211421 @Callable(i)
14221422 func statsREADONLY () = {
14231423 let cfg = getPoolConfig()
14241424 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14251425 let amtAssetId = cfg[idxAmtAssetId]
14261426 let priceAssetId = cfg[idxPriceAssetId]
14271427 let iAmtAssetId = cfg[idxIAmtAssetId]
14281428 let iPriceAssetId = cfg[idxIPriceAssetId]
14291429 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14301430 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14311431 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14321432 let accAmtAssetBalance = getAccBalance(amtAssetId)
14331433 let accPriceAssetBalance = getAccBalance(priceAssetId)
14341434 let pricesList = if ((poolLPBalance == 0))
14351435 then [zeroBigInt, zeroBigInt, zeroBigInt]
14361436 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
14371437 let curPrice = 0
14381438 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
14391439 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
14401440 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
14411441 $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))
14421442 }
14431443
14441444
14451445
14461446 @Callable(i)
14471447 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
14481448 let cfg = getPoolConfig()
14491449 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14501450 let amAssetIdStr = cfg[idxAmtAssetId]
14511451 let amAssetId = fromBase58String(amAssetIdStr)
14521452 let prAssetIdStr = cfg[idxPriceAssetId]
14531453 let prAssetId = fromBase58String(prAssetIdStr)
14541454 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14551455 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14561456 let poolStatus = cfg[idxPoolStatus]
14571457 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14581458 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
14591459 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
14601460 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
14611461 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
14621462 let curPriceX18 = if ((poolLPBalance == 0))
14631463 then zeroBigInt
14641464 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
14651465 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
14661466 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
14671467 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
14681468 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
14691469 let calcLpAmt = estPut._1
14701470 let curPriceCalc = estPut._3
14711471 let amBalance = estPut._4
14721472 let prBalance = estPut._5
14731473 let lpEmission = estPut._6
14741474 $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))
14751475 }
14761476
14771477
14781478
14791479 @Callable(i)
14801480 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
14811481 let cfg = getPoolConfig()
14821482 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14831483 let amAssetIdStr = cfg[idxAmtAssetId]
14841484 let amAssetId = fromBase58String(amAssetIdStr)
14851485 let prAssetIdStr = cfg[idxPriceAssetId]
14861486 let prAssetId = fromBase58String(prAssetIdStr)
14871487 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14881488 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14891489 let poolStatus = cfg[idxPoolStatus]
14901490 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14911491 let amBalanceRaw = getAccBalance(amAssetIdStr)
14921492 let prBalanceRaw = getAccBalance(prAssetIdStr)
14931493 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
14941494 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
14951495 let curPriceX18 = if ((poolLPBalance == 0))
14961496 then zeroBigInt
14971497 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
14981498 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
14991499 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
15001500 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
15011501 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
15021502 let calcLpAmt = estPut._1
15031503 let curPriceCalc = estPut._3
15041504 let amBalance = estPut._4
15051505 let prBalance = estPut._5
15061506 let lpEmission = estPut._6
15071507 $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))
15081508 }
15091509
15101510
15111511
15121512 @Callable(i)
15131513 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
15141514 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
15151515 let outAmAmt = res._1
15161516 let outPrAmt = res._2
15171517 let amBalance = res._5
15181518 let prBalance = res._6
15191519 let lpEmission = res._7
15201520 let curPrice = res._8
15211521 let poolStatus = parseIntValue(res._9)
15221522 $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))
15231523 }
15241524
15251525
15261526 @Verifier(tx)
15271527 func verify () = {
15281528 let targetPublicKey = match managerPublicKeyOrUnit() {
15291529 case pk: ByteVector =>
15301530 pk
15311531 case _: Unit =>
15321532 tx.senderPublicKey
15331533 case _ =>
15341534 throw("Match error")
15351535 }
15361536 match tx {
15371537 case order: Order =>
15381538 let matcherPub = getMatcherPubOrFail()
1539- let $t05962959698 = validateMatcherOrderAllowed(order)
1540- let orderValid = $t05962959698._1
1541- let orderValidInfo = $t05962959698._2
1539+ let $t05972459793 = validateMatcherOrderAllowed(order)
1540+ let orderValid = $t05972459793._1
1541+ let orderValidInfo = $t05972459793._2
15421542 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
15431543 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
15441544 if (if (if (orderValid)
15451545 then senderValid
15461546 else false)
15471547 then matcherValid
15481548 else false)
15491549 then true
15501550 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
15511551 case s: SetScriptTransaction =>
15521552 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
15531553 then true
15541554 else {
15551555 let newHash = blake2b256(value(s.script))
15561556 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
15571557 let currentHash = scriptHash(this)
15581558 if ((allowedHash == newHash))
15591559 then (currentHash != newHash)
15601560 else false
15611561 }
15621562 case _ =>
15631563 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
15641564 }
15651565 }
15661566

github/deemru/w8io/169f3d6 
277.05 ms