tx · AW4YZ4n3KvY1AESN4Bn2s1bqSuz6BoA7oyMXT9XohiUK

3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh:  -0.04300000 Waves

2023.04.03 16:15 [2518443] smart account 3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh > SELF 0.00000000 Waves

{ "type": 13, "id": "AW4YZ4n3KvY1AESN4Bn2s1bqSuz6BoA7oyMXT9XohiUK", "fee": 4300000, "feeAssetId": null, "timestamp": 1680527728321, "version": 2, "chainId": 84, "sender": "3N6wAa7PMFZJu4Zrmp3avXmMnRTrRpMM9Lh", "senderPublicKey": "Cr8D7eozSzJh7XHsYTjBinPpo3SS83BrCGiBAJsjGxBo", "proofs": [ "25twWPD1mXqtVYSn5MEj5asbBFS11oz8VyeZSMAR8vEhnjRNjBa7TLrmzdL9PBJuSFB3bV7AwWA2voSY9o4P6SE6" ], "script": "base64:BgLsNggCEgASBQoDAQQBEgcKBQEEAQgBEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtd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CQDMCAIJAKQDAQUCZGgFA25pbAUBagECaWkBAmlqAAQCaWsEAmJWCQECZlYAAwkAAQIFAmJWAgpCeXRlVmVjdG9yBAJmWgUCYlYFAmZaAwkAAQIFAmJWAgRVbml0CAUCaWkPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IEAmJWBQJpaQMJAAECBQJiVgIFT3JkZXIEAmV5BQJiVgQCaWwJAQJiZAAEAmltCQECZXgBBQJleQQCYUsIBQJpbQJfMQQCYUwIBQJpbQJfMgQCYU0JAPQDAwgFAmV5CWJvZHlCeXRlcwkAkQMCCAUCZXkGcHJvb2ZzAAAIBQJleQ9zZW5kZXJQdWJsaWNLZXkEAmFOCQD0AwMIBQJleQlib2R5Qnl0ZXMJAJEDAggFAmV5BnByb29mcwABBQJpbAMDAwUCYUsFAmFNBwUCYU4HBgkBAmFKBAUCYUsFAmFMBQJhTQUCYU4DCQABAgUCYlYCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJmVwUCYlYDCQD0AwMIBQJpaQlib2R5Qnl0ZXMJAJEDAggFAmlpBnByb29mcwAABQJpawYEAmluCQD2AwEJAQV2YWx1ZQEIBQJmVwZzY3JpcHQEAmlvCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYVYJAQJhSAAEAmlwCQDxBwEFBHRoaXMDCQAAAgUCaW8FAmluCQECIT0CBQJpcAUCaW4HCQD0AwMIBQJpaQlib2R5Qnl0ZXMJAJEDAggFAmlpBnByb29mcwAABQJpa9O2yUQ=", "height": 2518443, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HSfdGnuCToxuFZSFt8BWwPYjGpb5y5kG6uy4KZt4UeFZ Next: DmTF4tKBU57njZFnYSdkLxM7TWRLGN6DEoQPBn3R2cw4 Diff:
OldNewDifferences
872872
873873
874874 @Callable(i)
875-func rebalance () = (rebalanceAsset(aa()) ++ rebalanceAsset(pa()))
875+func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
876876
877877
878878
879879 @Callable(i)
880880 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
881- let $t03770438009 = if ((isReverse == false))
881+ let $t03775038055 = if ((isReverse == false))
882882 then {
883883 let assetOut = getStringOrFail(this, pa())
884884 let assetIn = getStringOrFail(this, aa())
889889 let assetIn = getStringOrFail(this, pa())
890890 $Tuple2(assetOut, assetIn)
891891 }
892- let assetOut = $t03770438009._1
893- let assetIn = $t03770438009._2
892+ let assetOut = $t03775038055._1
893+ let assetIn = $t03775038055._2
894894 let poolAssetInBalance = getAccBalance(assetIn)
895895 let poolAssetOutBalance = getAccBalance(assetOut)
896896 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
947947 case _ =>
948948 throw("error lease config")
949949 }
950- let $t04001540129 = lsConf
951- let isLeasable = $t04001540129._1
952- let leasedRatio = $t04001540129._2
953- let minBalance = $t04001540129._3
954- let proxyAddress = $t04001540129._4
955- let proxyAssetId = $t04001540129._5
956- let proxyRateMul = $t04001540129._6
957- let stakingProfitAddress = $t04001540129._7
950+ let $t04006140175 = lsConf
951+ let isLeasable = $t04006140175._1
952+ let leasedRatio = $t04006140175._2
953+ let minBalance = $t04006140175._3
954+ let proxyAddress = $t04006140175._4
955+ let proxyAssetId = $t04006140175._5
956+ let proxyRateMul = $t04006140175._6
957+ let stakingProfitAddress = $t04006140175._7
958958 let assetOnPool = assetBalance(this, fromBase58String(assetOut))
959959 let amountOfProfit = if (if ((assetOut == "WAVES"))
960960 then (amountOut > assetOnPool)
10681068 else throw("Strict value is not equal to itself.")
10691069 }
10701070 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1071- let $t04394044402 = refreshKLpInternal(0, 0, 0)
1072- if (($t04394044402 == $t04394044402))
1071+ let $t04398644448 = refreshKLpInternal(0, 0, 0)
1072+ if (($t04398644448 == $t04398644448))
10731073 then {
1074- let updatedKLp = $t04394044402._2
1075- let refreshKLpActions = $t04394044402._1
1074+ let updatedKLp = $t04398644448._2
1075+ let refreshKLpActions = $t04398644448._1
10761076 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10771077 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10781078 then ((state ++ lpTransfer) ++ refreshKLpActions)
11041104 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11051105 if ((currentKLp == currentKLp))
11061106 then {
1107- let $t04496445029 = refreshKLpInternal(0, 0, 0)
1108- let refreshKLpActions = $t04496445029._1
1109- let updatedKLp = $t04496445029._2
1107+ let $t04501045075 = refreshKLpInternal(0, 0, 0)
1108+ let refreshKLpActions = $t04501045075._1
1109+ let updatedKLp = $t04501045075._2
11101110 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11111111 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11121112 then (state ++ refreshKLpActions)
11531153 then {
11541154 let userAddress = i.caller
11551155 let txId = i.transactionId
1156- let $t04621746369 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1157- if (($t04621746369 == $t04621746369))
1156+ let $t04626346415 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1157+ if (($t04626346415 == $t04626346415))
11581158 then {
1159- let paymentInAmountAsset = $t04621746369._5
1160- let bonus = $t04621746369._4
1161- let feeAmount = $t04621746369._3
1162- let commonState = $t04621746369._2
1163- let emitAmountEstimated = $t04621746369._1
1159+ let paymentInAmountAsset = $t04626346415._5
1160+ let bonus = $t04626346415._4
1161+ let feeAmount = $t04626346415._3
1162+ let commonState = $t04626346415._2
1163+ let emitAmountEstimated = $t04626346415._1
11641164 let emitAmount = if (if ((minOutAmount > 0))
11651165 then (minOutAmount > emitAmountEstimated)
11661166 else false)
11801180 let sendFee = if ((feeAmount > 0))
11811181 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11821182 else nil
1183- let $t04695547152 = if ((this == feeCollectorAddress))
1183+ let $t04700147198 = if ((this == feeCollectorAddress))
11841184 then $Tuple2(0, 0)
11851185 else if (paymentInAmountAsset)
11861186 then $Tuple2(-(feeAmount), 0)
11871187 else $Tuple2(0, -(feeAmount))
1188- let amountAssetBalanceDelta = $t04695547152._1
1189- let priceAssetBalanceDelta = $t04695547152._2
1190- let $t04715547263 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1191- let refreshKLpActions = $t04715547263._1
1192- let updatedKLp = $t04715547263._2
1188+ let amountAssetBalanceDelta = $t04700147198._1
1189+ let priceAssetBalanceDelta = $t04700147198._2
1190+ let $t04720147309 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1191+ let refreshKLpActions = $t04720147309._1
1192+ let updatedKLp = $t04720147309._2
11931193 let kLp = value(getString(keyKLp))
11941194 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11951195 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12141214
12151215 @Callable(i)
12161216 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1217- let $t04761847775 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1218- let emitAmountEstimated = $t04761847775._1
1219- let commonState = $t04761847775._2
1220- let feeAmount = $t04761847775._3
1221- let bonus = $t04761847775._4
1222- let paymentInAmountAsset = $t04761847775._5
1217+ let $t04766447821 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1218+ let emitAmountEstimated = $t04766447821._1
1219+ let commonState = $t04766447821._2
1220+ let feeAmount = $t04766447821._3
1221+ let bonus = $t04766447821._4
1222+ let paymentInAmountAsset = $t04766447821._5
12231223 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12241224 }
12251225
12561256 then {
12571257 let userAddress = i.caller
12581258 let txId = i.transactionId
1259- let $t04866048813 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1260- if (($t04866048813 == $t04866048813))
1259+ let $t04870648859 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1260+ if (($t04870648859 == $t04870648859))
12611261 then {
1262- let outInAmountAsset = $t04866048813._5
1263- let bonus = $t04866048813._4
1264- let feeAmount = $t04866048813._3
1265- let commonState = $t04866048813._2
1266- let amountEstimated = $t04866048813._1
1262+ let outInAmountAsset = $t04870648859._5
1263+ let bonus = $t04870648859._4
1264+ let feeAmount = $t04870648859._3
1265+ let commonState = $t04870648859._2
1266+ let amountEstimated = $t04870648859._1
12671267 let amount = if (if ((minOutAmount > 0))
12681268 then (minOutAmount > amountEstimated)
12691269 else false)
12751275 case _ =>
12761276 throw("error lease config")
12771277 }
1278- let $t04919749311 = lsConf
1279- let isLeasable = $t04919749311._1
1280- let leasedRatio = $t04919749311._2
1281- let minBalance = $t04919749311._3
1282- let proxyAddress = $t04919749311._4
1283- let proxyAssetId = $t04919749311._5
1284- let proxyRateMul = $t04919749311._6
1285- let stakingProfitAddress = $t04919749311._7
1278+ let $t04924349357 = lsConf
1279+ let isLeasable = $t04924349357._1
1280+ let leasedRatio = $t04924349357._2
1281+ let minBalance = $t04924349357._3
1282+ let proxyAddress = $t04924349357._4
1283+ let proxyAssetId = $t04924349357._5
1284+ let proxyRateMul = $t04924349357._6
1285+ let stakingProfitAddress = $t04924349357._7
12861286 let assetOnPool = assetBalance(this, fromBase58String(outAssetIdStr))
12871287 let amountOfProfit = if (if ((outAssetIdStr == "WAVES"))
12881288 then (amount > assetOnPool)
13091309 let sendFee = if ((feeAmount > 0))
13101310 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13111311 else nil
1312- let $t05035050597 = {
1312+ let $t05039650643 = {
13131313 let feeAmountForCalc = if ((this == feeCollectorAddress))
13141314 then 0
13151315 else feeAmount
13171317 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13181318 else $Tuple2(0, -((amount + feeAmountForCalc)))
13191319 }
1320- let amountAssetBalanceDelta = $t05035050597._1
1321- let priceAssetBalanceDelta = $t05035050597._2
1322- let $t05060050708 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1323- let refreshKLpActions = $t05060050708._1
1324- let updatedKLp = $t05060050708._2
1320+ let amountAssetBalanceDelta = $t05039650643._1
1321+ let priceAssetBalanceDelta = $t05039650643._2
1322+ let $t05064650754 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1323+ let refreshKLpActions = $t05064650754._1
1324+ let updatedKLp = $t05064650754._2
13251325 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13261326 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13271327 then {
13451345
13461346 @Callable(i)
13471347 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1348- let $t05103551191 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1349- let amountEstimated = $t05103551191._1
1350- let commonState = $t05103551191._2
1351- let feeAmount = $t05103551191._3
1352- let bonus = $t05103551191._4
1353- let outInAmountAsset = $t05103551191._5
1348+ let $t05108151237 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1349+ let amountEstimated = $t05108151237._1
1350+ let commonState = $t05108151237._2
1351+ let feeAmount = $t05108151237._3
1352+ let bonus = $t05108151237._4
1353+ let outInAmountAsset = $t05108151237._5
13541354 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13551355 }
13561356
13871387 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13881388 if ((unstakeInv == unstakeInv))
13891389 then {
1390- let $t05209652247 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1391- if (($t05209652247 == $t05209652247))
1390+ let $t05214252293 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1391+ if (($t05214252293 == $t05214252293))
13921392 then {
1393- let outInAmountAsset = $t05209652247._5
1394- let bonus = $t05209652247._4
1395- let feeAmount = $t05209652247._3
1396- let commonState = $t05209652247._2
1397- let amountEstimated = $t05209652247._1
1393+ let outInAmountAsset = $t05214252293._5
1394+ let bonus = $t05214252293._4
1395+ let feeAmount = $t05214252293._3
1396+ let commonState = $t05214252293._2
1397+ let amountEstimated = $t05214252293._1
13981398 let amount = if (if ((minOutAmount > 0))
13991399 then (minOutAmount > amountEstimated)
14001400 else false)
14071407 let sendFee = if ((feeAmount > 0))
14081408 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14091409 else nil
1410- let $t05274252989 = {
1410+ let $t05278853035 = {
14111411 let feeAmountForCalc = if ((this == feeCollectorAddress))
14121412 then 0
14131413 else feeAmount
14151415 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14161416 else $Tuple2(0, -((amount + feeAmountForCalc)))
14171417 }
1418- let amountAssetBalanceDelta = $t05274252989._1
1419- let priceAssetBalanceDelta = $t05274252989._2
1420- let $t05299253100 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421- let refreshKLpActions = $t05299253100._1
1422- let updatedKLp = $t05299253100._2
1418+ let amountAssetBalanceDelta = $t05278853035._1
1419+ let priceAssetBalanceDelta = $t05278853035._2
1420+ let $t05303853146 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421+ let refreshKLpActions = $t05303853146._1
1422+ let updatedKLp = $t05303853146._2
14231423 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14241424 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14251425 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14521452 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14531453 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14541454 then {
1455- let $t05404654128 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1456- let refreshKLpActions = $t05404654128._1
1457- let updatedKLp = $t05404654128._2
1455+ let $t05409254174 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1456+ let refreshKLpActions = $t05409254174._1
1457+ let updatedKLp = $t05409254174._2
14581458 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14591459 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14601460 then (state ++ refreshKLpActions)
14861486 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14871487 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14881488 then {
1489- let $t05507755158 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490- let refreshKLpActions = $t05507755158._1
1491- let updatedKLp = $t05507755158._2
1489+ let $t05512355204 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490+ let refreshKLpActions = $t05512355204._1
1491+ let updatedKLp = $t05512355204._2
14921492 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14931493 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14941494 then (state ++ refreshKLpActions)
15321532 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15331533 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15341534 then {
1535- let $t05628456365 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1536- let refreshKLpActions = $t05628456365._1
1537- let updatedKLp = $t05628456365._2
1535+ let $t05633056411 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1536+ let refreshKLpActions = $t05633056411._1
1537+ let updatedKLp = $t05633056411._2
15381538 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15391539 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15401540 then (state ++ refreshKLpActions)
15851585 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15861586 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15871587 then {
1588- let $t05766057741 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1589- let refreshKLpActions = $t05766057741._1
1590- let updatedKLp = $t05766057741._2
1588+ let $t05770657787 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1589+ let refreshKLpActions = $t05770657787._1
1590+ let updatedKLp = $t05770657787._2
15911591 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15921592 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15931593 then (state ++ refreshKLpActions)
16221622 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16231623 then {
16241624 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1625- let $t05892858992 = refreshKLpInternal(0, 0, 0)
1626- let kLpUpdateActions = $t05892858992._1
1627- let updatedKLp = $t05892858992._2
1625+ let $t05897459038 = refreshKLpInternal(0, 0, 0)
1626+ let kLpUpdateActions = $t05897459038._1
1627+ let updatedKLp = $t05897459038._2
16281628 let actions = if ((kLp != updatedKLp))
16291629 then kLpUpdateActions
16301630 else throwErr("nothing to refresh")
17991799 match tx {
18001800 case order: Order =>
18011801 let matcherPub = getMatcherPubOrFail()
1802- let $t06765467723 = validateMatcherOrderAllowed(order)
1803- let orderValid = $t06765467723._1
1804- let orderValidInfo = $t06765467723._2
1802+ let $t06770067769 = validateMatcherOrderAllowed(order)
1803+ let orderValid = $t06770067769._1
1804+ let orderValidInfo = $t06770067769._2
18051805 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18061806 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18071807 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 keySWavesAssetId () = "%s__sWavesAssetId"
134134
135135
136136 func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
137137
138138
139139 func keyAdditionalBalance (assetId) = makeString(["%s%s", "additionalBalance", assetId], SEP)
140140
141141
142142 func keyStakingAssetBalance (assetId) = makeString(["%s%s", "stakingAssetBalance", assetId], SEP)
143143
144144
145145 func getAdditionalBalance (assetId) = valueOrElse(getInteger(this, keyAdditionalBalance(assetId)), 0)
146146
147147
148148 func getStakingAssetBalance (assetId) = valueOrElse(getInteger(this, keyStakingAssetBalance(assetId)), 0)
149149
150150
151151 func keyFactoryConfig () = "%s__factoryConfig"
152152
153153
154154 func keyMatcherPub () = "%s%s__matcher__publicKey"
155155
156156
157157 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
158158
159159
160160 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
161161
162162
163163 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
164164
165165
166166 func keyAllPoolsShutdown () = "%s__shutdown"
167167
168168
169169 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
170170
171171
172172 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
173173
174174
175175 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
176176
177177 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
178178
179179
180180 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
181181
182182
183183 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
184184
185185
186186 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
187187
188188
189189 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
190190
191191
192192 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
193193
194194 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
195195
196196 let inFee = {
197197 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
198198 if ($isInstanceOf(@, "Int"))
199199 then @
200200 else throw(($getType(@) + " couldn't be cast to Int"))
201201 }
202202
203203 let outFee = {
204204 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
205205 if ($isInstanceOf(@, "Int"))
206206 then @
207207 else throw(($getType(@) + " couldn't be cast to Int"))
208208 }
209209
210210 func sWavesId () = getStringOrFail(factoryContract, keySWavesAssetId())
211211
212212
213213 func sWavesProxy () = getStringOrFail(factoryContract, keySWavesProxyAddress())
214214
215215
216216 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
217217
218218
219219 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
220220
221221
222222 func getPoolConfig () = {
223223 let amtAsset = getStringOrFail(this, aa())
224224 let priceAsset = getStringOrFail(this, pa())
225225 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
226226 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
227227 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
228228 }
229229
230230
231231 func parseAssetId (input) = if ((input == wavesString))
232232 then unit
233233 else fromBase58String(input)
234234
235235
236236 func assetIdToString (input) = if ((input == unit))
237237 then wavesString
238238 else toBase58String(value(input))
239239
240240
241241 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]))
242242
243243
244244 let poolConfigParsed = parsePoolConfig(getPoolConfig())
245245
246246 let $t092129378 = poolConfigParsed
247247
248248 let cfgPoolAddress = $t092129378._1
249249
250250 let cfgPoolStatus = $t092129378._2
251251
252252 let cfgLpAssetId = $t092129378._3
253253
254254 let cfgAmountAssetId = $t092129378._4
255255
256256 let cfgPriceAssetId = $t092129378._5
257257
258258 let cfgAmountAssetDecimals = $t092129378._6
259259
260260 let cfgPriceAssetDecimals = $t092129378._7
261261
262262 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
263263
264264
265265 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
266266
267267 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
268268
269269 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)
270270
271271
272272 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)
273273
274274
275275 func getAccBalance (assetId) = if ((assetId == "WAVES"))
276276 then (wavesBalance(this).available + getAdditionalBalance(assetId))
277277 else if ((assetId == sWavesId()))
278278 then {
279279 let amtAsset = getStringOrFail(this, aa())
280280 let priceAsset = getStringOrFail(this, pa())
281281 if (if (if ((amtAsset == "WAVES"))
282282 then (priceAsset == sWavesId())
283283 else false)
284284 then true
285285 else if ((priceAsset == "WAVES"))
286286 then (amtAsset == sWavesId())
287287 else false)
288288 then assetBalance(this, fromBase58String(assetId))
289289 else (assetBalance(this, fromBase58String(assetId)) + getStakingAssetBalance(assetId))
290290 }
291291 else assetBalance(this, fromBase58String(assetId))
292292
293293
294294 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
295295
296296
297297 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
298298
299299
300300 func getRate (proxy) = {
301301 let inv = invoke(proxy, "getRate", nil, nil)
302302 if ((inv == inv))
303303 then match inv {
304304 case r: Int =>
305305 r
306306 case _ =>
307307 throwErr("proxy.getRate() unexpected value")
308308 }
309309 else throw("Strict value is not equal to itself.")
310310 }
311311
312312
313313 func deposit (assetId,amount,stakingAssetId,proxy) = {
314314 let currentAdditionalBalance = getAdditionalBalance(assetId)
315315 if ((currentAdditionalBalance == currentAdditionalBalance))
316316 then {
317317 let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
318318 if ((currentStakingAssetBalance == currentStakingAssetBalance))
319319 then {
320320 let asset = parseAssetId(assetId)
321321 if ((amount > 0))
322322 then {
323323 let depositInvoke = invoke(proxy, "deposit", nil, [AttachedPayment(asset, amount)])
324324 if ((depositInvoke == depositInvoke))
325325 then match depositInvoke {
326326 case receivedStakingAsset: Int =>
327327 let newAdditionalBalance = (currentAdditionalBalance + amount)
328328 let newStakingAssetBalance = (currentStakingAssetBalance + receivedStakingAsset)
329329 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
330330 case _ =>
331331 nil
332332 }
333333 else throw("Strict value is not equal to itself.")
334334 }
335335 else nil
336336 }
337337 else throw("Strict value is not equal to itself.")
338338 }
339339 else throw("Strict value is not equal to itself.")
340340 }
341341
342342
343343 func withdraw (assetId,amount,stakingAssetId,proxy,proxyRateMul) = {
344344 let currentAdditionalBalance = getAdditionalBalance(assetId)
345345 if ((currentAdditionalBalance == currentAdditionalBalance))
346346 then {
347347 let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
348348 if ((currentStakingAssetBalance == currentStakingAssetBalance))
349349 then {
350350 let currentProxyRate = getRate(proxy)
351351 if ((currentProxyRate == currentProxyRate))
352352 then {
353353 let stakingAsset = parseAssetId(stakingAssetId)
354354 let sendStakingAssetAmount = fraction(proxyRateMul, amount, currentProxyRate)
355355 if ((sendStakingAssetAmount > 0))
356356 then {
357357 let withdrawInvoke = invoke(proxy, "withdraw", nil, [AttachedPayment(stakingAsset, sendStakingAssetAmount)])
358358 if ((withdrawInvoke == withdrawInvoke))
359359 then match withdrawInvoke {
360360 case receivedAssets: Int =>
361361 let newAdditionalBalance = (currentAdditionalBalance - receivedAssets)
362362 let newStakingAssetBalance = (currentStakingAssetBalance - sendStakingAssetAmount)
363363 [IntegerEntry(keyAdditionalBalance(assetId), newAdditionalBalance), IntegerEntry(keyStakingAssetBalance(stakingAssetId), newStakingAssetBalance)]
364364 case _ =>
365365 nil
366366 }
367367 else throw("Strict value is not equal to itself.")
368368 }
369369 else nil
370370 }
371371 else throw("Strict value is not equal to itself.")
372372 }
373373 else throw("Strict value is not equal to itself.")
374374 }
375375 else throw("Strict value is not equal to itself.")
376376 }
377377
378378
379379 func getLeaseProxyConfig (assetId) = invoke(factoryContract, "getPoolLeaseConfigREADONLY", [toString(this), assetId], nil)
380380
381381
382382 func rebalanceInternal (targetRatio,assetId,stakingAssetId,minBalance,proxy,proxyRateMul) = {
383383 let currentAdditionalBalance = getAdditionalBalance(assetId)
384384 if ((currentAdditionalBalance == currentAdditionalBalance))
385385 then {
386386 let currentStakingAssetBalance = getStakingAssetBalance(stakingAssetId)
387387 if ((currentStakingAssetBalance == currentStakingAssetBalance))
388388 then {
389389 let availableBalance = match parseAssetId(assetId) {
390390 case b: ByteVector =>
391391 assetBalance(this, b)
392392 case u: Unit =>
393393 wavesBalance(this).available
394394 case _ =>
395395 throw("Match error")
396396 }
397397 if ((availableBalance == availableBalance))
398398 then {
399399 let wholeBalance = max([0, ((availableBalance + currentAdditionalBalance) - minBalance)])
400400 let targetAdditionalBalance = fraction(targetRatio, wholeBalance, 100)
401401 let diff = (currentAdditionalBalance - targetAdditionalBalance)
402402 if ((diff == 0))
403403 then nil
404404 else if ((0 > diff))
405405 then {
406406 let sendAssetAmount = -(diff)
407407 deposit(assetId, sendAssetAmount, stakingAssetId, proxy)
408408 }
409409 else {
410410 let getAssetAmount = diff
411411 withdraw(assetId, getAssetAmount, stakingAssetId, proxy, proxyRateMul)
412412 }
413413 }
414414 else throw("Strict value is not equal to itself.")
415415 }
416416 else throw("Strict value is not equal to itself.")
417417 }
418418 else throw("Strict value is not equal to itself.")
419419 }
420420
421421
422422 func rebalanceAsset (assetId) = match getLeaseProxyConfig(assetId) {
423423 case a: (Boolean, Int, Int, String, String, Int, String) =>
424424 let $t01551515624 = a
425425 let isLeasable = $t01551515624._1
426426 let leasedRatio = $t01551515624._2
427427 let minBalance = $t01551515624._3
428428 let proxyAddress = $t01551515624._4
429429 let proxyAssetId = $t01551515624._5
430430 let proxyRateMul = $t01551515624._6
431431 let stakingProfitAddress = $t01551515624._7
432432 if (isLeasable)
433433 then rebalanceInternal(leasedRatio, assetId, proxyAssetId, minBalance, addressFromStringValue(proxyAddress), proxyRateMul)
434434 else nil
435435 case _ =>
436436 throwErr((("[" + assetId) + "] Rebalance error"))
437437 }
438438
439439
440440 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
441441 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
442442 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
443443 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
444444 }
445445
446446
447447 func calcPrices (amAmt,prAmt,lpAmt) = {
448448 let cfg = getPoolConfig()
449449 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
450450 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
451451 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
452452 let amAmtX18 = toX18(amAmt, amtAssetDcm)
453453 let prAmtX18 = toX18(prAmt, priceAssetDcm)
454454 let lpAmtX18 = toX18(lpAmt, scale8)
455455 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
456456 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
457457 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
458458 }
459459
460460
461461 func calculatePrices (amAmt,prAmt,lpAmt) = {
462462 let prices = calcPrices(amAmt, prAmt, lpAmt)
463463 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
464464 }
465465
466466
467467 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
468468 let cfg = getPoolConfig()
469469 let lpAssetId = cfg[idxPoolLPAssetId]
470470 let amAssetId = cfg[idxAmtAssetId]
471471 let prAssetId = cfg[idxPriceAssetId]
472472 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
473473 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
474474 let poolStatus = cfg[idxPoolStatus]
475475 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
476476 if ((lpAssetId != pmtAssetId))
477477 then throw("Invalid asset passed.")
478478 else {
479479 let amBalance = getAccBalance(amAssetId)
480480 let amBalanceX18 = toX18(amBalance, amAssetDcm)
481481 let prBalance = getAccBalance(prAssetId)
482482 let prBalanceX18 = toX18(prBalance, prAssetDcm)
483483 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
484484 let curPrice = fromX18(curPriceX18, scale8)
485485 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
486486 let lpEmissionX18 = toX18(lpEmission, scale8)
487487 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
488488 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
489489 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
490490 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
491491 let state = if ((txId58 == ""))
492492 then nil
493493 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
494494 then unit
495495 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
496496 then unit
497497 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)]
498498 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
499499 }
500500 }
501501
502502
503503 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
504504 let cfg = getPoolConfig()
505505 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
506506 let amAssetIdStr = cfg[idxAmtAssetId]
507507 let prAssetIdStr = cfg[idxPriceAssetId]
508508 let iAmtAssetId = cfg[idxIAmtAssetId]
509509 let iPriceAssetId = cfg[idxIPriceAssetId]
510510 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
511511 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
512512 let poolStatus = cfg[idxPoolStatus]
513513 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
514514 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
515515 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
516516 if (if ((amAssetIdStr != inAmAssetIdStr))
517517 then true
518518 else (prAssetIdStr != inPrAssetIdStr))
519519 then throw("Invalid amt or price asset passed.")
520520 else {
521521 let amBalance = if (isEvaluate)
522522 then getAccBalance(amAssetIdStr)
523523 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
524524 let prBalance = if (isEvaluate)
525525 then getAccBalance(prAssetIdStr)
526526 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
527527 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
528528 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
529529 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
530530 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
531531 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
532532 let res = if ((lpEmission == 0))
533533 then {
534534 let curPriceX18 = zeroBigInt
535535 let slippageX18 = zeroBigInt
536536 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
537537 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
538538 }
539539 else {
540540 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
541541 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
542542 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
543543 if (if ((curPriceX18 != zeroBigInt))
544544 then (slippageX18 > slippageToleranceX18)
545545 else false)
546546 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
547547 else {
548548 let lpEmissionX18 = toX18(lpEmission, scale8)
549549 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
550550 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
551551 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
552552 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
553553 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
554554 let expAmtAssetAmtX18 = expectedAmts._1
555555 let expPriceAssetAmtX18 = expectedAmts._2
556556 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
557557 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
558558 }
559559 }
560560 let calcLpAmt = res._1
561561 let calcAmAssetPmt = res._2
562562 let calcPrAssetPmt = res._3
563563 let curPrice = fromX18(res._4, scale8)
564564 let slippageCalc = fromX18(res._5, scale8)
565565 if ((0 >= calcLpAmt))
566566 then throw("Invalid calculations. LP calculated is less than zero.")
567567 else {
568568 let emitLpAmt = if (!(emitLp))
569569 then 0
570570 else calcLpAmt
571571 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
572572 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
573573 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))]
574574 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
575575 }
576576 }
577577 }
578578
579579
580580 func calcKLp (amountBalance,priceBalance,lpEmission) = {
581581 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
582582 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
583583 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
584584 if ((lpEmission == big0))
585585 then big0
586586 else updatedKLp
587587 }
588588
589589
590590 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
591591 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
592592 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
593593 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
594594 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
595595 currentKLp
596596 }
597597
598598
599599 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
600600 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
601601 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
602602 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
603603 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
604604 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
605605 $Tuple2(actions, updatedKLp)
606606 }
607607
608608
609609 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
610610 then true
611611 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
612612
613613
614614 func validateMatcherOrderAllowed (order) = {
615615 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
616616 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
617617 let amountAssetAmount = order.amount
618618 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
619619 let $t02714527357 = if ((order.orderType == Buy))
620620 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
621621 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
622622 let amountAssetBalanceDelta = $t02714527357._1
623623 let priceAssetBalanceDelta = $t02714527357._2
624624 if (if (if (isGlobalShutdown())
625625 then true
626626 else (cfgPoolStatus == PoolMatcherDisabled))
627627 then true
628628 else (cfgPoolStatus == PoolShutdown))
629629 then throw("Exchange operations disabled")
630630 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
631631 then true
632632 else (order.assetPair.priceAsset != cfgPriceAssetId))
633633 then throw("Wrong order assets.")
634634 else {
635635 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
636636 let $t02779727897 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
637637 let unusedActions = $t02779727897._1
638638 let kLpNew = $t02779727897._2
639639 let isOrderValid = (kLpNew >= kLp)
640640 let info = makeString(["kLp=", toString(kLp), " kLpNew=", toString(kLpNew), " amountAssetBalance=", toString(amountAssetBalance), " priceAssetBalance=", toString(priceAssetBalance), " amountAssetBalanceDelta=", toString(amountAssetBalanceDelta), " priceAssetBalanceDelta=", toString(priceAssetBalanceDelta), " height=", toString(height)], "")
641641 $Tuple2(isOrderValid, info)
642642 }
643643 }
644644
645645
646646 func commonGet (i) = if ((size(i.payments) != 1))
647647 then throw("exactly 1 payment is expected")
648648 else {
649649 let pmt = value(i.payments[0])
650650 let pmtAssetId = value(pmt.assetId)
651651 let pmtAmt = pmt.amount
652652 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
653653 let outAmAmt = res._1
654654 let outPrAmt = res._2
655655 let poolStatus = parseIntValue(res._9)
656656 let state = res._10
657657 if (if (isGlobalShutdown())
658658 then true
659659 else (poolStatus == PoolShutdown))
660660 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
661661 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
662662 }
663663
664664
665665 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
666666 then throw("exactly 2 payments are expected")
667667 else {
668668 let amAssetPmt = value(i.payments[0])
669669 let prAssetPmt = value(i.payments[1])
670670 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
671671 let poolStatus = parseIntValue(estPut._8)
672672 if (if (if (isGlobalShutdown())
673673 then true
674674 else (poolStatus == PoolPutDisabled))
675675 then true
676676 else (poolStatus == PoolShutdown))
677677 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
678678 else estPut
679679 }
680680
681681
682682 func emit (amount) = {
683683 let emitInv = invoke(factoryContract, "emit", [amount], nil)
684684 if ((emitInv == emitInv))
685685 then {
686686 let emitInvLegacy = match emitInv {
687687 case legacyFactoryContract: Address =>
688688 invoke(legacyFactoryContract, "emit", [amount], nil)
689689 case _ =>
690690 unit
691691 }
692692 if ((emitInvLegacy == emitInvLegacy))
693693 then amount
694694 else throw("Strict value is not equal to itself.")
695695 }
696696 else throw("Strict value is not equal to itself.")
697697 }
698698
699699
700700 func takeFee (amount,fee) = {
701701 let feeAmount = if ((fee == 0))
702702 then 0
703703 else fraction(amount, fee, scale8)
704704 $Tuple2((amount - feeAmount), feeAmount)
705705 }
706706
707707
708708 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
709709 let isEval = (txId == unit)
710710 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
711711 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
712712 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
713713 then true
714714 else if ((paymentAssetId == cfgPriceAssetId))
715715 then false
716716 else throwErr("invalid asset")
717717 let $t03101031303 = if (isEval)
718718 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
719719 else if (paymentInAmountAsset)
720720 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
721721 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
722722 let amountBalanceOld = $t03101031303._1
723723 let priceBalanceOld = $t03101031303._2
724724 let $t03130731456 = if (paymentInAmountAsset)
725725 then $Tuple2(paymentAmountRaw, 0)
726726 else $Tuple2(0, paymentAmountRaw)
727727 let amountAssetAmountRaw = $t03130731456._1
728728 let priceAssetAmountRaw = $t03130731456._2
729729 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
730730 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
731731 let $t03158831652 = takeFee(paymentAmountRaw, inFee)
732732 let paymentAmount = $t03158831652._1
733733 let feeAmount = $t03158831652._2
734734 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
735735 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
736736 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
737737 let priceNew = fromX18(priceNewX18, scale8)
738738 let paymentBalance = if (paymentInAmountAsset)
739739 then amountBalanceOld
740740 else priceBalanceOld
741741 let paymentBalanceBigInt = toBigInt(paymentBalance)
742742 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
743743 let chechSupply = if ((supplyBigInt > big0))
744744 then true
745745 else throwErr("initial deposit requires all coins")
746746 if ((chechSupply == chechSupply))
747747 then {
748748 let depositBigInt = toBigInt(paymentAmount)
749749 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
750750 let commonState = if (isEval)
751751 then nil
752752 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))]
753753 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
754754 let priceOld = fromX18(priceOldX18, scale8)
755755 let loss = {
756756 let $t03333333500 = if (paymentInAmountAsset)
757757 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
758758 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
759759 let amount = $t03333333500._1
760760 let balance = $t03333333500._2
761761 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
762762 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
763763 }
764764 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
765765 }
766766 else throw("Strict value is not equal to itself.")
767767 }
768768
769769
770770 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
771771 let isEval = (txId == unit)
772772 let cfg = getPoolConfig()
773773 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
774774 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
775775 let checks = [if ((paymentAssetId == cfgLpAssetId))
776776 then true
777777 else throwErr("invalid lp asset")]
778778 if ((checks == checks))
779779 then {
780780 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
781781 then true
782782 else if ((outAssetId == cfgPriceAssetId))
783783 then false
784784 else throwErr("invalid asset")
785785 let balanceBigInt = if (outInAmountAsset)
786786 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
787787 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
788788 let outInAmountAssetDecimals = if (outInAmountAsset)
789789 then amtAssetDcm
790790 else priceAssetDcm
791791 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
792792 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
793793 let outBalance = if (outInAmountAsset)
794794 then amBalanceOld
795795 else prBalanceOld
796796 let outBalanceBigInt = toBigInt(outBalance)
797797 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
798798 let redeemedBigInt = toBigInt(paymentAmount)
799799 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
800800 let $t03557835634 = takeFee(amountRaw, outFee)
801801 let totalAmount = $t03557835634._1
802802 let feeAmount = $t03557835634._2
803803 let $t03563835864 = if (outInAmountAsset)
804804 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
805805 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
806806 let outAmAmount = $t03563835864._1
807807 let outPrAmount = $t03563835864._2
808808 let amBalanceNew = $t03563835864._3
809809 let prBalanceNew = $t03563835864._4
810810 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
811811 let priceNew = fromX18(priceNewX18, scale8)
812812 let commonState = if (isEval)
813813 then nil
814814 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)]
815815 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
816816 let priceOld = fromX18(priceOldX18, scale8)
817817 let loss = {
818818 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
819819 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
820820 }
821821 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
822822 }
823823 else throw("Strict value is not equal to itself.")
824824 }
825825
826826
827827 func managerPublicKeyOrUnit () = match getString(mpk()) {
828828 case s: String =>
829829 fromBase58String(s)
830830 case _: Unit =>
831831 unit
832832 case _ =>
833833 throw("Match error")
834834 }
835835
836836
837837 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
838838 case s: String =>
839839 fromBase58String(s)
840840 case _: Unit =>
841841 unit
842842 case _ =>
843843 throw("Match error")
844844 }
845845
846846
847847 func isManager (i) = match managerPublicKeyOrUnit() {
848848 case pk: ByteVector =>
849849 (i.callerPublicKey == pk)
850850 case _: Unit =>
851851 (i.caller == this)
852852 case _ =>
853853 throw("Match error")
854854 }
855855
856856
857857 func mustManager (i) = {
858858 let pd = throw("Permission denied")
859859 match managerPublicKeyOrUnit() {
860860 case pk: ByteVector =>
861861 if ((i.callerPublicKey == pk))
862862 then true
863863 else pd
864864 case _: Unit =>
865865 if ((i.caller == this))
866866 then true
867867 else pd
868868 case _ =>
869869 throw("Match error")
870870 }
871871 }
872872
873873
874874 @Callable(i)
875-func rebalance () = (rebalanceAsset(aa()) ++ rebalanceAsset(pa()))
875+func rebalance () = (rebalanceAsset(getStringOrFail(this, aa())) ++ rebalanceAsset(getStringOrFail(this, pa())))
876876
877877
878878
879879 @Callable(i)
880880 func calculateAmountOutForSwapREADONLY (cleanAmountIn,isReverse,feePoolAmount) = {
881- let $t03770438009 = if ((isReverse == false))
881+ let $t03775038055 = if ((isReverse == false))
882882 then {
883883 let assetOut = getStringOrFail(this, pa())
884884 let assetIn = getStringOrFail(this, aa())
885885 $Tuple2(assetOut, assetIn)
886886 }
887887 else {
888888 let assetOut = getStringOrFail(this, aa())
889889 let assetIn = getStringOrFail(this, pa())
890890 $Tuple2(assetOut, assetIn)
891891 }
892- let assetOut = $t03770438009._1
893- let assetIn = $t03770438009._2
892+ let assetOut = $t03775038055._1
893+ let assetIn = $t03775038055._2
894894 let poolAssetInBalance = getAccBalance(assetIn)
895895 let poolAssetOutBalance = getAccBalance(assetOut)
896896 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
897897 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
898898 let newK = (((toBigInt(getAccBalance(assetIn)) + toBigInt(cleanAmountIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
899899 let checkK = if ((newK >= oldK))
900900 then true
901901 else throw("new K is fewer error")
902902 if ((checkK == checkK))
903903 then $Tuple2(nil, amountOut)
904904 else throw("Strict value is not equal to itself.")
905905 }
906906
907907
908908
909909 @Callable(i)
910910 func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo,feePoolAmount) = {
911911 let swapContact = {
912912 let @ = invoke(factoryContract, "getSwapContractREADONLY", nil, nil)
913913 if ($isInstanceOf(@, "String"))
914914 then @
915915 else throw(($getType(@) + " couldn't be cast to String"))
916916 }
917917 let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
918918 then true
919919 else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(swapContact)))
920920 then true
921921 else throwErr("Permission denied")]
922922 if ((checks == checks))
923923 then {
924924 let pmt = value(i.payments[0])
925925 let assetIn = assetIdToString(pmt.assetId)
926926 let assetOut = if ((isReverse == false))
927927 then getStringOrFail(this, pa())
928928 else getStringOrFail(this, aa())
929929 let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
930930 let poolAssetOutBalance = getAccBalance(assetOut)
931931 let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, (poolAssetInBalance + cleanAmountIn))
932932 let oldK = (toBigInt(poolAssetInBalance) * toBigInt(poolAssetOutBalance))
933933 let newK = ((toBigInt(getAccBalance(assetIn)) + toBigInt(feePoolAmount)) * (toBigInt(getAccBalance(assetOut)) - toBigInt(amountOut)))
934934 let checkK = if ((newK >= oldK))
935935 then true
936936 else throw("new K is fewer error")
937937 if ((checkK == checkK))
938938 then {
939939 let checkMin = if ((amountOut >= amountOutMin))
940940 then true
941941 else throw("Exchange result is fewer coins than expected")
942942 if ((checkMin == checkMin))
943943 then {
944944 let lsConf = match getLeaseProxyConfig(assetOut) {
945945 case a: (Boolean, Int, Int, String, String, Int, String) =>
946946 a
947947 case _ =>
948948 throw("error lease config")
949949 }
950- let $t04001540129 = lsConf
951- let isLeasable = $t04001540129._1
952- let leasedRatio = $t04001540129._2
953- let minBalance = $t04001540129._3
954- let proxyAddress = $t04001540129._4
955- let proxyAssetId = $t04001540129._5
956- let proxyRateMul = $t04001540129._6
957- let stakingProfitAddress = $t04001540129._7
950+ let $t04006140175 = lsConf
951+ let isLeasable = $t04006140175._1
952+ let leasedRatio = $t04006140175._2
953+ let minBalance = $t04006140175._3
954+ let proxyAddress = $t04006140175._4
955+ let proxyAssetId = $t04006140175._5
956+ let proxyRateMul = $t04006140175._6
957+ let stakingProfitAddress = $t04006140175._7
958958 let assetOnPool = assetBalance(this, fromBase58String(assetOut))
959959 let amountOfProfit = if (if ((assetOut == "WAVES"))
960960 then (amountOut > assetOnPool)
961961 else false)
962962 then {
963963 let amountDiff = (amountOut - assetOnPool)
964964 let oldRatio = (getAdditionalBalance(assetOut) / getStakingAssetBalance(sWavesId()))
965965 let oldWavesRoughBalane = wavesBalance(this).available
966966 let wd = invoke(this, "withdraw", [assetOut, amountDiff, sWavesId(), sWavesProxy(), proxyRateMul], nil)
967967 if ((wd == wd))
968968 then {
969969 let newWavesRoughBalane = wavesBalance(this).available
970970 let wavesDiff = (newWavesRoughBalane - oldWavesRoughBalane)
971971 (wavesDiff - amountDiff)
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else 0
976976 let reb = invoke(this, "rebalance", nil, nil)
977977 if ((reb == reb))
978978 then $Tuple2([ScriptTransfer(addressFromStringValue(stakingProfitAddress), amountOfProfit, unit), ScriptTransfer(addressFromStringValue(addressTo), amountOut, parseAssetId(assetOut))], amountOut)
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 setManager (pendingManagerPublicKey) = {
992992 let checkCaller = mustManager(i)
993993 if ((checkCaller == checkCaller))
994994 then {
995995 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
996996 if ((checkManagerPublicKey == checkManagerPublicKey))
997997 then [StringEntry(pmpk(), pendingManagerPublicKey)]
998998 else throw("Strict value is not equal to itself.")
999999 }
10001000 else throw("Strict value is not equal to itself.")
10011001 }
10021002
10031003
10041004
10051005 @Callable(i)
10061006 func confirmManager () = {
10071007 let pm = pendingManagerPublicKeyOrUnit()
10081008 let hasPM = if (isDefined(pm))
10091009 then true
10101010 else throw("No pending manager")
10111011 if ((hasPM == hasPM))
10121012 then {
10131013 let checkPM = if ((i.callerPublicKey == value(pm)))
10141014 then true
10151015 else throw("You are not pending manager")
10161016 if ((checkPM == checkPM))
10171017 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
10181018 else throw("Strict value is not equal to itself.")
10191019 }
10201020 else throw("Strict value is not equal to itself.")
10211021 }
10221022
10231023
10241024
10251025 @Callable(i)
10261026 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
10271027 then throw("Invalid slippageTolerance passed")
10281028 else {
10291029 let estPut = commonPut(i, slippageTolerance, true)
10301030 let emitLpAmt = estPut._2
10311031 let lpAssetId = estPut._7
10321032 let state = estPut._9
10331033 let amDiff = estPut._10
10341034 let prDiff = estPut._11
10351035 let amId = estPut._12
10361036 let prId = estPut._13
10371037 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
10381038 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
10391039 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
10401040 if ((currentKLp == currentKLp))
10411041 then {
10421042 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
10431043 if ((emitInv == emitInv))
10441044 then {
10451045 let emitInvLegacy = match emitInv {
10461046 case legacyFactoryContract: Address =>
10471047 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
10481048 case _ =>
10491049 unit
10501050 }
10511051 if ((emitInvLegacy == emitInvLegacy))
10521052 then {
10531053 let slippageAInv = if ((amDiff > 0))
10541054 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
10551055 else nil
10561056 if ((slippageAInv == slippageAInv))
10571057 then {
10581058 let slippagePInv = if ((prDiff > 0))
10591059 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
10601060 else nil
10611061 if ((slippagePInv == slippagePInv))
10621062 then {
10631063 let lpTransfer = if (shouldAutoStake)
10641064 then {
10651065 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
10661066 if ((slpStakeInv == slpStakeInv))
10671067 then nil
10681068 else throw("Strict value is not equal to itself.")
10691069 }
10701070 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
1071- let $t04394044402 = refreshKLpInternal(0, 0, 0)
1072- if (($t04394044402 == $t04394044402))
1071+ let $t04398644448 = refreshKLpInternal(0, 0, 0)
1072+ if (($t04398644448 == $t04398644448))
10731073 then {
1074- let updatedKLp = $t04394044402._2
1075- let refreshKLpActions = $t04394044402._1
1074+ let updatedKLp = $t04398644448._2
1075+ let refreshKLpActions = $t04398644448._1
10761076 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10771077 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10781078 then ((state ++ lpTransfer) ++ refreshKLpActions)
10791079 else throw("Strict value is not equal to itself.")
10801080 }
10811081 else throw("Strict value is not equal to itself.")
10821082 }
10831083 else throw("Strict value is not equal to itself.")
10841084 }
10851085 else throw("Strict value is not equal to itself.")
10861086 }
10871087 else throw("Strict value is not equal to itself.")
10881088 }
10891089 else throw("Strict value is not equal to itself.")
10901090 }
10911091 else throw("Strict value is not equal to itself.")
10921092 }
10931093
10941094
10951095
10961096 @Callable(i)
10971097 func putForFree (maxSlippage) = if ((0 > maxSlippage))
10981098 then throw("Invalid value passed")
10991099 else {
11001100 let estPut = commonPut(i, maxSlippage, false)
11011101 let state = estPut._9
11021102 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
11031103 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
11041104 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
11051105 if ((currentKLp == currentKLp))
11061106 then {
1107- let $t04496445029 = refreshKLpInternal(0, 0, 0)
1108- let refreshKLpActions = $t04496445029._1
1109- let updatedKLp = $t04496445029._2
1107+ let $t04501045075 = refreshKLpInternal(0, 0, 0)
1108+ let refreshKLpActions = $t04501045075._1
1109+ let updatedKLp = $t04501045075._2
11101110 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11111111 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11121112 then (state ++ refreshKLpActions)
11131113 else throw("Strict value is not equal to itself.")
11141114 }
11151115 else throw("Strict value is not equal to itself.")
11161116 }
11171117
11181118
11191119
11201120 @Callable(i)
11211121 func putOneTkn (minOutAmount,autoStake) = {
11221122 let isPoolOneTokenOperationsDisabled = {
11231123 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
11241124 if ($isInstanceOf(@, "Boolean"))
11251125 then @
11261126 else throw(($getType(@) + " couldn't be cast to Boolean"))
11271127 }
11281128 let isPutDisabled = if (if (if (isGlobalShutdown())
11291129 then true
11301130 else (cfgPoolStatus == PoolPutDisabled))
11311131 then true
11321132 else (cfgPoolStatus == PoolShutdown))
11331133 then true
11341134 else isPoolOneTokenOperationsDisabled
11351135 let checks = [if (if (!(isPutDisabled))
11361136 then true
11371137 else isManager(i))
11381138 then true
11391139 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
11401140 then true
11411141 else throwErr("exactly 1 payment are expected")]
11421142 if ((checks == checks))
11431143 then {
11441144 let payment = i.payments[0]
11451145 let paymentAssetId = payment.assetId
11461146 let paymentAmountRaw = payment.amount
11471147 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
11481148 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
11491149 else if ((paymentAssetId == cfgPriceAssetId))
11501150 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
11511151 else throwErr("payment asset is not supported")
11521152 if ((currentKLp == currentKLp))
11531153 then {
11541154 let userAddress = i.caller
11551155 let txId = i.transactionId
1156- let $t04621746369 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1157- if (($t04621746369 == $t04621746369))
1156+ let $t04626346415 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
1157+ if (($t04626346415 == $t04626346415))
11581158 then {
1159- let paymentInAmountAsset = $t04621746369._5
1160- let bonus = $t04621746369._4
1161- let feeAmount = $t04621746369._3
1162- let commonState = $t04621746369._2
1163- let emitAmountEstimated = $t04621746369._1
1159+ let paymentInAmountAsset = $t04626346415._5
1160+ let bonus = $t04626346415._4
1161+ let feeAmount = $t04626346415._3
1162+ let commonState = $t04626346415._2
1163+ let emitAmountEstimated = $t04626346415._1
11641164 let emitAmount = if (if ((minOutAmount > 0))
11651165 then (minOutAmount > emitAmountEstimated)
11661166 else false)
11671167 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
11681168 else emitAmountEstimated
11691169 let emitInv = emit(emitAmount)
11701170 if ((emitInv == emitInv))
11711171 then {
11721172 let lpTransfer = if (autoStake)
11731173 then {
11741174 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
11751175 if ((stakeInv == stakeInv))
11761176 then nil
11771177 else throw("Strict value is not equal to itself.")
11781178 }
11791179 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
11801180 let sendFee = if ((feeAmount > 0))
11811181 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
11821182 else nil
1183- let $t04695547152 = if ((this == feeCollectorAddress))
1183+ let $t04700147198 = if ((this == feeCollectorAddress))
11841184 then $Tuple2(0, 0)
11851185 else if (paymentInAmountAsset)
11861186 then $Tuple2(-(feeAmount), 0)
11871187 else $Tuple2(0, -(feeAmount))
1188- let amountAssetBalanceDelta = $t04695547152._1
1189- let priceAssetBalanceDelta = $t04695547152._2
1190- let $t04715547263 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1191- let refreshKLpActions = $t04715547263._1
1192- let updatedKLp = $t04715547263._2
1188+ let amountAssetBalanceDelta = $t04700147198._1
1189+ let priceAssetBalanceDelta = $t04700147198._2
1190+ let $t04720147309 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1191+ let refreshKLpActions = $t04720147309._1
1192+ let updatedKLp = $t04720147309._2
11931193 let kLp = value(getString(keyKLp))
11941194 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11951195 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11961196 then {
11971197 let reb = invoke(this, "rebalance", nil, nil)
11981198 if ((reb == reb))
11991199 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
12001200 else throw("Strict value is not equal to itself.")
12011201 }
12021202 else throw("Strict value is not equal to itself.")
12031203 }
12041204 else throw("Strict value is not equal to itself.")
12051205 }
12061206 else throw("Strict value is not equal to itself.")
12071207 }
12081208 else throw("Strict value is not equal to itself.")
12091209 }
12101210 else throw("Strict value is not equal to itself.")
12111211 }
12121212
12131213
12141214
12151215 @Callable(i)
12161216 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
1217- let $t04761847775 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1218- let emitAmountEstimated = $t04761847775._1
1219- let commonState = $t04761847775._2
1220- let feeAmount = $t04761847775._3
1221- let bonus = $t04761847775._4
1222- let paymentInAmountAsset = $t04761847775._5
1217+ let $t04766447821 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
1218+ let emitAmountEstimated = $t04766447821._1
1219+ let commonState = $t04766447821._2
1220+ let feeAmount = $t04766447821._3
1221+ let bonus = $t04766447821._4
1222+ let paymentInAmountAsset = $t04766447821._5
12231223 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
12241224 }
12251225
12261226
12271227
12281228 @Callable(i)
12291229 func getOneTkn (outAssetIdStr,minOutAmount) = {
12301230 let isPoolOneTokenOperationsDisabled = {
12311231 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
12321232 if ($isInstanceOf(@, "Boolean"))
12331233 then @
12341234 else throw(($getType(@) + " couldn't be cast to Boolean"))
12351235 }
12361236 let isGetDisabled = if (if (isGlobalShutdown())
12371237 then true
12381238 else (cfgPoolStatus == PoolShutdown))
12391239 then true
12401240 else isPoolOneTokenOperationsDisabled
12411241 let checks = [if (if (!(isGetDisabled))
12421242 then true
12431243 else isManager(i))
12441244 then true
12451245 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
12461246 then true
12471247 else throwErr("exactly 1 payment are expected")]
12481248 if ((checks == checks))
12491249 then {
12501250 let outAssetId = parseAssetId(outAssetIdStr)
12511251 let payment = i.payments[0]
12521252 let paymentAssetId = payment.assetId
12531253 let paymentAmount = payment.amount
12541254 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12551255 if ((currentKLp == currentKLp))
12561256 then {
12571257 let userAddress = i.caller
12581258 let txId = i.transactionId
1259- let $t04866048813 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1260- if (($t04866048813 == $t04866048813))
1259+ let $t04870648859 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
1260+ if (($t04870648859 == $t04870648859))
12611261 then {
1262- let outInAmountAsset = $t04866048813._5
1263- let bonus = $t04866048813._4
1264- let feeAmount = $t04866048813._3
1265- let commonState = $t04866048813._2
1266- let amountEstimated = $t04866048813._1
1262+ let outInAmountAsset = $t04870648859._5
1263+ let bonus = $t04870648859._4
1264+ let feeAmount = $t04870648859._3
1265+ let commonState = $t04870648859._2
1266+ let amountEstimated = $t04870648859._1
12671267 let amount = if (if ((minOutAmount > 0))
12681268 then (minOutAmount > amountEstimated)
12691269 else false)
12701270 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
12711271 else amountEstimated
12721272 let lsConf = match getLeaseProxyConfig(outAssetIdStr) {
12731273 case a: (Boolean, Int, Int, String, String, Int, String) =>
12741274 a
12751275 case _ =>
12761276 throw("error lease config")
12771277 }
1278- let $t04919749311 = lsConf
1279- let isLeasable = $t04919749311._1
1280- let leasedRatio = $t04919749311._2
1281- let minBalance = $t04919749311._3
1282- let proxyAddress = $t04919749311._4
1283- let proxyAssetId = $t04919749311._5
1284- let proxyRateMul = $t04919749311._6
1285- let stakingProfitAddress = $t04919749311._7
1278+ let $t04924349357 = lsConf
1279+ let isLeasable = $t04924349357._1
1280+ let leasedRatio = $t04924349357._2
1281+ let minBalance = $t04924349357._3
1282+ let proxyAddress = $t04924349357._4
1283+ let proxyAssetId = $t04924349357._5
1284+ let proxyRateMul = $t04924349357._6
1285+ let stakingProfitAddress = $t04924349357._7
12861286 let assetOnPool = assetBalance(this, fromBase58String(outAssetIdStr))
12871287 let amountOfProfit = if (if ((outAssetIdStr == "WAVES"))
12881288 then (amount > assetOnPool)
12891289 else false)
12901290 then {
12911291 let amountDiff = (amount - assetOnPool)
12921292 let oldRatio = (getAdditionalBalance(outAssetIdStr) / getStakingAssetBalance(sWavesId()))
12931293 let oldWavesRoughBalane = wavesBalance(this).available
12941294 let wd = invoke(this, "withdraw", [outAssetIdStr, amountDiff, sWavesId(), sWavesProxy(), proxyRateMul], nil)
12951295 if ((wd == wd))
12961296 then {
12971297 let newWavesRoughBalane = wavesBalance(this).available
12981298 let wavesDiff = (newWavesRoughBalane - oldWavesRoughBalane)
12991299 (wavesDiff - amountDiff)
13001300 }
13011301 else throw("Strict value is not equal to itself.")
13021302 }
13031303 else 0
13041304 let profitTransfer = [ScriptTransfer(addressFromStringValue(stakingProfitAddress), amountOfProfit, unit)]
13051305 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
13061306 if ((burnInv == burnInv))
13071307 then {
13081308 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
13091309 let sendFee = if ((feeAmount > 0))
13101310 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
13111311 else nil
1312- let $t05035050597 = {
1312+ let $t05039650643 = {
13131313 let feeAmountForCalc = if ((this == feeCollectorAddress))
13141314 then 0
13151315 else feeAmount
13161316 if (outInAmountAsset)
13171317 then $Tuple2(-((amount + feeAmountForCalc)), 0)
13181318 else $Tuple2(0, -((amount + feeAmountForCalc)))
13191319 }
1320- let amountAssetBalanceDelta = $t05035050597._1
1321- let priceAssetBalanceDelta = $t05035050597._2
1322- let $t05060050708 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1323- let refreshKLpActions = $t05060050708._1
1324- let updatedKLp = $t05060050708._2
1320+ let amountAssetBalanceDelta = $t05039650643._1
1321+ let priceAssetBalanceDelta = $t05039650643._2
1322+ let $t05064650754 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1323+ let refreshKLpActions = $t05064650754._1
1324+ let updatedKLp = $t05064650754._2
13251325 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
13261326 if ((isUpdatedKLpValid == isUpdatedKLpValid))
13271327 then {
13281328 let reb = invoke(this, "rebalance", nil, nil)
13291329 if ((reb == reb))
13301330 then $Tuple2(((((commonState ++ assetTransfer) ++ profitTransfer) ++ sendFee) ++ refreshKLpActions), amount)
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 getOneTknREADONLY (outAssetId,paymentAmount) = {
1348- let $t05103551191 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1349- let amountEstimated = $t05103551191._1
1350- let commonState = $t05103551191._2
1351- let feeAmount = $t05103551191._3
1352- let bonus = $t05103551191._4
1353- let outInAmountAsset = $t05103551191._5
1348+ let $t05108151237 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1349+ let amountEstimated = $t05108151237._1
1350+ let commonState = $t05108151237._2
1351+ let feeAmount = $t05108151237._3
1352+ let bonus = $t05108151237._4
1353+ let outInAmountAsset = $t05108151237._5
13541354 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
13551355 }
13561356
13571357
13581358
13591359 @Callable(i)
13601360 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
13611361 let isPoolOneTokenOperationsDisabled = {
13621362 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
13631363 if ($isInstanceOf(@, "Boolean"))
13641364 then @
13651365 else throw(($getType(@) + " couldn't be cast to Boolean"))
13661366 }
13671367 let isGetDisabled = if (if (isGlobalShutdown())
13681368 then true
13691369 else (cfgPoolStatus == PoolShutdown))
13701370 then true
13711371 else isPoolOneTokenOperationsDisabled
13721372 let checks = [if (if (!(isGetDisabled))
13731373 then true
13741374 else isManager(i))
13751375 then true
13761376 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
13771377 then true
13781378 else throwErr("no payments are expected")]
13791379 if ((checks == checks))
13801380 then {
13811381 let outAssetId = parseAssetId(outAssetIdStr)
13821382 let userAddress = i.caller
13831383 let txId = i.transactionId
13841384 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
13851385 if ((currentKLp == currentKLp))
13861386 then {
13871387 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
13881388 if ((unstakeInv == unstakeInv))
13891389 then {
1390- let $t05209652247 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1391- if (($t05209652247 == $t05209652247))
1390+ let $t05214252293 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1391+ if (($t05214252293 == $t05214252293))
13921392 then {
1393- let outInAmountAsset = $t05209652247._5
1394- let bonus = $t05209652247._4
1395- let feeAmount = $t05209652247._3
1396- let commonState = $t05209652247._2
1397- let amountEstimated = $t05209652247._1
1393+ let outInAmountAsset = $t05214252293._5
1394+ let bonus = $t05214252293._4
1395+ let feeAmount = $t05214252293._3
1396+ let commonState = $t05214252293._2
1397+ let amountEstimated = $t05214252293._1
13981398 let amount = if (if ((minOutAmount > 0))
13991399 then (minOutAmount > amountEstimated)
14001400 else false)
14011401 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
14021402 else amountEstimated
14031403 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
14041404 if ((burnInv == burnInv))
14051405 then {
14061406 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
14071407 let sendFee = if ((feeAmount > 0))
14081408 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
14091409 else nil
1410- let $t05274252989 = {
1410+ let $t05278853035 = {
14111411 let feeAmountForCalc = if ((this == feeCollectorAddress))
14121412 then 0
14131413 else feeAmount
14141414 if (outInAmountAsset)
14151415 then $Tuple2(-((amount + feeAmountForCalc)), 0)
14161416 else $Tuple2(0, -((amount + feeAmountForCalc)))
14171417 }
1418- let amountAssetBalanceDelta = $t05274252989._1
1419- let priceAssetBalanceDelta = $t05274252989._2
1420- let $t05299253100 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421- let refreshKLpActions = $t05299253100._1
1422- let updatedKLp = $t05299253100._2
1418+ let amountAssetBalanceDelta = $t05278853035._1
1419+ let priceAssetBalanceDelta = $t05278853035._2
1420+ let $t05303853146 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1421+ let refreshKLpActions = $t05303853146._1
1422+ let updatedKLp = $t05303853146._2
14231423 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14241424 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14251425 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
14261426 else throw("Strict value is not equal to itself.")
14271427 }
14281428 else throw("Strict value is not equal to itself.")
14291429 }
14301430 else throw("Strict value is not equal to itself.")
14311431 }
14321432 else throw("Strict value is not equal to itself.")
14331433 }
14341434 else throw("Strict value is not equal to itself.")
14351435 }
14361436 else throw("Strict value is not equal to itself.")
14371437 }
14381438
14391439
14401440
14411441 @Callable(i)
14421442 func get () = {
14431443 let res = commonGet(i)
14441444 let outAmtAmt = res._1
14451445 let outPrAmt = res._2
14461446 let pmtAmt = res._3
14471447 let pmtAssetId = res._4
14481448 let state = res._5
14491449 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14501450 if ((currentKLp == currentKLp))
14511451 then {
14521452 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14531453 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14541454 then {
1455- let $t05404654128 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1456- let refreshKLpActions = $t05404654128._1
1457- let updatedKLp = $t05404654128._2
1455+ let $t05409254174 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1456+ let refreshKLpActions = $t05409254174._1
1457+ let updatedKLp = $t05409254174._2
14581458 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14591459 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14601460 then (state ++ refreshKLpActions)
14611461 else throw("Strict value is not equal to itself.")
14621462 }
14631463 else throw("Strict value is not equal to itself.")
14641464 }
14651465 else throw("Strict value is not equal to itself.")
14661466 }
14671467
14681468
14691469
14701470 @Callable(i)
14711471 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
14721472 let res = commonGet(i)
14731473 let outAmAmt = res._1
14741474 let outPrAmt = res._2
14751475 let pmtAmt = res._3
14761476 let pmtAssetId = res._4
14771477 let state = res._5
14781478 if ((noLessThenAmtAsset > outAmAmt))
14791479 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
14801480 else if ((noLessThenPriceAsset > outPrAmt))
14811481 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
14821482 else {
14831483 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
14841484 if ((currentKLp == currentKLp))
14851485 then {
14861486 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
14871487 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
14881488 then {
1489- let $t05507755158 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490- let refreshKLpActions = $t05507755158._1
1491- let updatedKLp = $t05507755158._2
1489+ let $t05512355204 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1490+ let refreshKLpActions = $t05512355204._1
1491+ let updatedKLp = $t05512355204._2
14921492 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
14931493 if ((isUpdatedKLpValid == isUpdatedKLpValid))
14941494 then (state ++ refreshKLpActions)
14951495 else throw("Strict value is not equal to itself.")
14961496 }
14971497 else throw("Strict value is not equal to itself.")
14981498 }
14991499 else throw("Strict value is not equal to itself.")
15001500 }
15011501 }
15021502
15031503
15041504
15051505 @Callable(i)
15061506 func unstakeAndGet (amount) = {
15071507 let checkPayments = if ((size(i.payments) != 0))
15081508 then throw("No payments are expected")
15091509 else true
15101510 if ((checkPayments == checkPayments))
15111511 then {
15121512 let cfg = getPoolConfig()
15131513 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
15141514 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15151515 if ((currentKLp == currentKLp))
15161516 then {
15171517 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
15181518 if ((unstakeInv == unstakeInv))
15191519 then {
15201520 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
15211521 let outAmAmt = res._1
15221522 let outPrAmt = res._2
15231523 let poolStatus = parseIntValue(res._9)
15241524 let state = res._10
15251525 let checkPoolStatus = if (if (isGlobalShutdown())
15261526 then true
15271527 else (poolStatus == PoolShutdown))
15281528 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
15291529 else true
15301530 if ((checkPoolStatus == checkPoolStatus))
15311531 then {
15321532 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
15331533 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15341534 then {
1535- let $t05628456365 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1536- let refreshKLpActions = $t05628456365._1
1537- let updatedKLp = $t05628456365._2
1535+ let $t05633056411 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1536+ let refreshKLpActions = $t05633056411._1
1537+ let updatedKLp = $t05633056411._2
15381538 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15391539 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15401540 then (state ++ refreshKLpActions)
15411541 else throw("Strict value is not equal to itself.")
15421542 }
15431543 else throw("Strict value is not equal to itself.")
15441544 }
15451545 else throw("Strict value is not equal to itself.")
15461546 }
15471547 else throw("Strict value is not equal to itself.")
15481548 }
15491549 else throw("Strict value is not equal to itself.")
15501550 }
15511551 else throw("Strict value is not equal to itself.")
15521552 }
15531553
15541554
15551555
15561556 @Callable(i)
15571557 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
15581558 let isGetDisabled = if (isGlobalShutdown())
15591559 then true
15601560 else (cfgPoolStatus == PoolShutdown)
15611561 let checks = [if (!(isGetDisabled))
15621562 then true
15631563 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
15641564 then true
15651565 else throw("no payments are expected")]
15661566 if ((checks == checks))
15671567 then {
15681568 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
15691569 if ((currentKLp == currentKLp))
15701570 then {
15711571 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
15721572 if ((unstakeInv == unstakeInv))
15731573 then {
15741574 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
15751575 let outAmAmt = res._1
15761576 let outPrAmt = res._2
15771577 let state = res._10
15781578 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
15791579 then true
15801580 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
15811581 then true
15821582 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
15831583 if ((checkAmounts == checkAmounts))
15841584 then {
15851585 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
15861586 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
15871587 then {
1588- let $t05766057741 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1589- let refreshKLpActions = $t05766057741._1
1590- let updatedKLp = $t05766057741._2
1588+ let $t05770657787 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1589+ let refreshKLpActions = $t05770657787._1
1590+ let updatedKLp = $t05770657787._2
15911591 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
15921592 if ((isUpdatedKLpValid == isUpdatedKLpValid))
15931593 then (state ++ refreshKLpActions)
15941594 else throw("Strict value is not equal to itself.")
15951595 }
15961596 else throw("Strict value is not equal to itself.")
15971597 }
15981598 else throw("Strict value is not equal to itself.")
15991599 }
16001600 else throw("Strict value is not equal to itself.")
16011601 }
16021602 else throw("Strict value is not equal to itself.")
16031603 }
16041604 else throw("Strict value is not equal to itself.")
16051605 }
16061606
16071607
16081608
16091609 @Callable(i)
16101610 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
16111611 then throw("permissions denied")
16121612 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
16131613
16141614
16151615
16161616 @Callable(i)
16171617 func refreshKLp () = {
16181618 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
16191619 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
16201620 then unit
16211621 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
16221622 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
16231623 then {
16241624 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1625- let $t05892858992 = refreshKLpInternal(0, 0, 0)
1626- let kLpUpdateActions = $t05892858992._1
1627- let updatedKLp = $t05892858992._2
1625+ let $t05897459038 = refreshKLpInternal(0, 0, 0)
1626+ let kLpUpdateActions = $t05897459038._1
1627+ let updatedKLp = $t05897459038._2
16281628 let actions = if ((kLp != updatedKLp))
16291629 then kLpUpdateActions
16301630 else throwErr("nothing to refresh")
16311631 $Tuple2(actions, toString(updatedKLp))
16321632 }
16331633 else throw("Strict value is not equal to itself.")
16341634 }
16351635
16361636
16371637
16381638 @Callable(i)
16391639 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
16401640
16411641
16421642
16431643 @Callable(i)
16441644 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
16451645
16461646
16471647
16481648 @Callable(i)
16491649 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
16501650 let prices = calcPrices(amAmt, prAmt, lpAmt)
16511651 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
16521652 }
16531653
16541654
16551655
16561656 @Callable(i)
16571657 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
16581658
16591659
16601660
16611661 @Callable(i)
16621662 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
16631663
16641664
16651665
16661666 @Callable(i)
16671667 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
16681668
16691669
16701670
16711671 @Callable(i)
16721672 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
16731673
16741674
16751675
16761676 @Callable(i)
16771677 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
16781678 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
16791679 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
16801680 }
16811681
16821682
16831683
16841684 @Callable(i)
16851685 func statsREADONLY () = {
16861686 let cfg = getPoolConfig()
16871687 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
16881688 let amtAssetId = cfg[idxAmtAssetId]
16891689 let priceAssetId = cfg[idxPriceAssetId]
16901690 let iAmtAssetId = cfg[idxIAmtAssetId]
16911691 let iPriceAssetId = cfg[idxIPriceAssetId]
16921692 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
16931693 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
16941694 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
16951695 let accAmtAssetBalance = getAccBalance(amtAssetId)
16961696 let accPriceAssetBalance = getAccBalance(priceAssetId)
16971697 let pricesList = if ((poolLPBalance == 0))
16981698 then [zeroBigInt, zeroBigInt, zeroBigInt]
16991699 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
17001700 let curPrice = 0
17011701 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
17021702 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
17031703 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
17041704 $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))
17051705 }
17061706
17071707
17081708
17091709 @Callable(i)
17101710 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
17111711 let cfg = getPoolConfig()
17121712 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17131713 let amAssetIdStr = cfg[idxAmtAssetId]
17141714 let amAssetId = fromBase58String(amAssetIdStr)
17151715 let prAssetIdStr = cfg[idxPriceAssetId]
17161716 let prAssetId = fromBase58String(prAssetIdStr)
17171717 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17181718 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17191719 let poolStatus = cfg[idxPoolStatus]
17201720 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17211721 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
17221722 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
17231723 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
17241724 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
17251725 let curPriceX18 = if ((poolLPBalance == 0))
17261726 then zeroBigInt
17271727 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
17281728 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
17291729 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
17301730 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
17311731 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17321732 let calcLpAmt = estPut._1
17331733 let curPriceCalc = estPut._3
17341734 let amBalance = estPut._4
17351735 let prBalance = estPut._5
17361736 let lpEmission = estPut._6
17371737 $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))
17381738 }
17391739
17401740
17411741
17421742 @Callable(i)
17431743 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
17441744 let cfg = getPoolConfig()
17451745 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
17461746 let amAssetIdStr = cfg[idxAmtAssetId]
17471747 let amAssetId = fromBase58String(amAssetIdStr)
17481748 let prAssetIdStr = cfg[idxPriceAssetId]
17491749 let prAssetId = fromBase58String(prAssetIdStr)
17501750 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
17511751 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
17521752 let poolStatus = cfg[idxPoolStatus]
17531753 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
17541754 let amBalanceRaw = getAccBalance(amAssetIdStr)
17551755 let prBalanceRaw = getAccBalance(prAssetIdStr)
17561756 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
17571757 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
17581758 let curPriceX18 = if ((poolLPBalance == 0))
17591759 then zeroBigInt
17601760 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
17611761 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
17621762 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
17631763 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
17641764 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
17651765 let calcLpAmt = estPut._1
17661766 let curPriceCalc = estPut._3
17671767 let amBalance = estPut._4
17681768 let prBalance = estPut._5
17691769 let lpEmission = estPut._6
17701770 $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))
17711771 }
17721772
17731773
17741774
17751775 @Callable(i)
17761776 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
17771777 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
17781778 let outAmAmt = res._1
17791779 let outPrAmt = res._2
17801780 let amBalance = res._5
17811781 let prBalance = res._6
17821782 let lpEmission = res._7
17831783 let curPrice = res._8
17841784 let poolStatus = parseIntValue(res._9)
17851785 $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))
17861786 }
17871787
17881788
17891789 @Verifier(tx)
17901790 func verify () = {
17911791 let targetPublicKey = match managerPublicKeyOrUnit() {
17921792 case pk: ByteVector =>
17931793 pk
17941794 case _: Unit =>
17951795 tx.senderPublicKey
17961796 case _ =>
17971797 throw("Match error")
17981798 }
17991799 match tx {
18001800 case order: Order =>
18011801 let matcherPub = getMatcherPubOrFail()
1802- let $t06765467723 = validateMatcherOrderAllowed(order)
1803- let orderValid = $t06765467723._1
1804- let orderValidInfo = $t06765467723._2
1802+ let $t06770067769 = validateMatcherOrderAllowed(order)
1803+ let orderValid = $t06770067769._1
1804+ let orderValidInfo = $t06770067769._2
18051805 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
18061806 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
18071807 if (if (if (orderValid)
18081808 then senderValid
18091809 else false)
18101810 then matcherValid
18111811 else false)
18121812 then true
18131813 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
18141814 case s: SetScriptTransaction =>
18151815 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
18161816 then true
18171817 else {
18181818 let newHash = blake2b256(value(s.script))
18191819 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
18201820 let currentHash = scriptHash(this)
18211821 if ((allowedHash == newHash))
18221822 then (currentHash != newHash)
18231823 else false
18241824 }
18251825 case _ =>
18261826 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
18271827 }
18281828 }
18291829

github/deemru/w8io/026f985 
214.79 ms