tx · 6ybzmt66DPDiEwu2CChng5bbe46KEdSnzYPa5bicC63G

3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT:  -0.03500000 Waves

2023.01.20 12:08 [2413085] smart account 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT > SELF 0.00000000 Waves

{ "type": 13, "id": "6ybzmt66DPDiEwu2CChng5bbe46KEdSnzYPa5bicC63G", "fee": 3500000, "feeAssetId": null, "timestamp": 1674205770960, "version": 2, "chainId": 84, "sender": "3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT", "senderPublicKey": "AYbpHveq7zviKTDV7SGTB1pZGFbkumgfq3jSwVv6BznT", "proofs": [ "5RzdJhCTKoP9Y4PTt81aeDKsnV4hDvXoJf8RVDDkhRNMqcfhaxh4sDpTwG5KgFN4sXCTQkG55aDRQGfgZfAJWLxg" ], "script": "base64:BgLkLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIGc2NhbGU4IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldElkIhlpZHhGYWN0b3J5U3Rha2luZ0NvbnRyYWN0IhppZHhGYWN0b3J5U2xp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md6D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkTAUCZ3oDCQABAgUCZEwCBU9yZGVyBAJkaQUCZEwEAmdDCQECYUYABAJnRAkBAmRoAQUCZGkEAmFvCAUCZ0QCXzEEAmFwCAUCZ0QCXzIEAmFxCQD0AwMIBQJkaQlib2R5Qnl0ZXMJAJEDAggFAmRpBnByb29mcwAACAUCZGkPc2VuZGVyUHVibGljS2V5BAJhcgkA9AMDCAUCZGkJYm9keUJ5dGVzCQCRAwIIBQJkaQZwcm9vZnMAAQUCZ0MDAwMFAmFvBQJhcQcFAmFyBwYJAQJhbgQFAmFvBQJhcAUCYXEFAmFyAwkAAQIFAmRMAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZVAFAmRMBAJnRQkA9gMBCQEFdmFsdWUBCAUCZVAGc2NyaXB0BAJnRgkA2wQBCQEFdmFsdWUBCQCdCAIFAmF6CQECYWwABAJnRwkA8QcBBQR0aGlzAwMJAAACBQJnRgUCZ0UJAQIhPQIFAmdHBQJnRQcGCQD0AwMIBQJneglib2R5Qnl0ZXMJAJEDAggFAmd6BnByb29mcwAABQJnQgkA9AMDCAUCZ3oJYm9keUJ5dGVzCQCRAwIIBQJnegZwcm9vZnMAAAUCZ0JnyEZ4", "height": 2413085, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4homFNZJEVav37BawJrV3MJEQnjyd25cTmTcZYvAUqcr Next: 7wXQx9mHF7gVGG8uaTCAQa1ERj3jvRhoVbTPf7MiHuzH Diff:
OldNewDifferences
427427 let amountBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
428428 let priceBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
429429 let amountBalanceX18 = toX18(amountBalance, cfgAmountAssetDecimals)
430- let amountBalanceNew = (amountBalance + amountAssetBalanceDelta)
430+ let amountBalanceX18New = (amountBalanceX18 + toX18(amountAssetBalanceDelta, cfgAmountAssetDecimals))
431431 let priceBalanceX18 = toX18(priceBalance, cfgPriceAssetDecimals)
432- let priceBalanceNew = (priceBalance + priceAssetBalanceDelta)
433- let k = pow((toBigInt(amountBalance) * toBigInt(priceBalance)), 0, toBigInt(5), 1, 18, DOWN)
434- let kNew = pow((toBigInt(amountBalanceNew) * toBigInt(priceBalanceNew)), 0, toBigInt(5), 1, 18, DOWN)
432+ let priceBalanceX18New = (priceBalanceX18 + toX18(priceAssetBalanceDelta, cfgPriceAssetDecimals))
433+ let k = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
434+ let kNew = pow((amountBalanceX18New * priceBalanceX18New), 0, toBigInt(5), 1, 18, DOWN)
435435 let info = makeString([toString(kLp), toString(kLpNew), toString(k), toString(kNew)], " ")
436436 $Tuple2(isOrderValid, info)
437437 }
509509 else if ((paymentAssetId == cfgPriceAssetId))
510510 then false
511511 else throwErr("invalid asset")
512- let $t02565725950 = if (isEval)
512+ let $t02569625989 = if (isEval)
513513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
514514 else if (paymentInAmountAsset)
515515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
516516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
517- let amountBalanceOld = $t02565725950._1
518- let priceBalanceOld = $t02565725950._2
519- let $t02595426103 = if (paymentInAmountAsset)
517+ let amountBalanceOld = $t02569625989._1
518+ let priceBalanceOld = $t02569625989._2
519+ let $t02599326142 = if (paymentInAmountAsset)
520520 then $Tuple2(paymentAmountRaw, 0)
521521 else $Tuple2(0, paymentAmountRaw)
522- let amountAssetAmountRaw = $t02595426103._1
523- let priceAssetAmountRaw = $t02595426103._2
522+ let amountAssetAmountRaw = $t02599326142._1
523+ let priceAssetAmountRaw = $t02599326142._2
524524 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
525525 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
526- let $t02623526299 = takeFee(paymentAmountRaw, inFee)
527- let paymentAmount = $t02623526299._1
528- let feeAmount = $t02623526299._2
526+ let $t02627426338 = takeFee(paymentAmountRaw, inFee)
527+ let paymentAmount = $t02627426338._1
528+ let feeAmount = $t02627426338._2
529529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
530530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
531531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551- let $t02798028147 = if (paymentInAmountAsset)
551+ let $t02801928186 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554- let amount = $t02798028147._1
555- let balance = $t02798028147._2
554+ let amount = $t02801928186._1
555+ let balance = $t02801928186._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594594 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
595- let $t03022530281 = takeFee(amountRaw, outFee)
596- let totalAmount = $t03022530281._1
597- let feeAmount = $t03022530281._2
598- let $t03028530511 = if (outInAmountAsset)
595+ let $t03026430320 = takeFee(amountRaw, outFee)
596+ let totalAmount = $t03026430320._1
597+ let feeAmount = $t03026430320._2
598+ let $t03032430550 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601- let outAmAmount = $t03028530511._1
602- let outPrAmount = $t03028530511._2
603- let amBalanceNew = $t03028530511._3
604- let prBalanceNew = $t03028530511._4
601+ let outAmAmount = $t03032430550._1
602+ let outPrAmount = $t03032430550._2
603+ let amBalanceNew = $t03032430550._3
604+ let prBalanceNew = $t03032430550._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750- let $t03503935501 = refreshKLpInternal(0, 0, 0)
751- if (($t03503935501 == $t03503935501))
750+ let $t03507835540 = refreshKLpInternal(0, 0, 0)
751+ if (($t03507835540 == $t03507835540))
752752 then {
753- let updatedKLp = $t03503935501._2
754- let refreshKLpActions = $t03503935501._1
753+ let updatedKLp = $t03507835540._2
754+ let refreshKLpActions = $t03507835540._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786- let $t03606336128 = refreshKLpInternal(0, 0, 0)
787- let refreshKLpActions = $t03606336128._1
788- let updatedKLp = $t03606336128._2
786+ let $t03610236167 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03610236167._1
788+ let updatedKLp = $t03610236167._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835- let $t03731637468 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836- if (($t03731637468 == $t03731637468))
835+ let $t03735537507 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03735537507 == $t03735537507))
837837 then {
838- let paymentInAmountAsset = $t03731637468._5
839- let bonus = $t03731637468._4
840- let feeAmount = $t03731637468._3
841- let commonState = $t03731637468._2
842- let emitAmountEstimated = $t03731637468._1
838+ let paymentInAmountAsset = $t03735537507._5
839+ let bonus = $t03735537507._4
840+ let feeAmount = $t03735537507._3
841+ let commonState = $t03735537507._2
842+ let emitAmountEstimated = $t03735537507._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862- let $t03805438251 = if ((this == feeCollectorAddress))
862+ let $t03809338290 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867- let amountAssetBalanceDelta = $t03805438251._1
868- let priceAssetBalanceDelta = $t03805438251._2
869- let $t03825438362 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870- let refreshKLpActions = $t03825438362._1
871- let updatedKLp = $t03825438362._2
867+ let amountAssetBalanceDelta = $t03809338290._1
868+ let priceAssetBalanceDelta = $t03809338290._2
869+ let $t03829338401 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03829338401._1
871+ let updatedKLp = $t03829338401._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891- let $t03866838825 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892- let emitAmountEstimated = $t03866838825._1
893- let commonState = $t03866838825._2
894- let feeAmount = $t03866838825._3
895- let bonus = $t03866838825._4
896- let paymentInAmountAsset = $t03866838825._5
891+ let $t03870738864 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03870738864._1
893+ let commonState = $t03870738864._2
894+ let feeAmount = $t03870738864._3
895+ let bonus = $t03870738864._4
896+ let paymentInAmountAsset = $t03870738864._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933- let $t03971039863 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934- if (($t03971039863 == $t03971039863))
933+ let $t03974939902 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03974939902 == $t03974939902))
935935 then {
936- let outInAmountAsset = $t03971039863._5
937- let bonus = $t03971039863._4
938- let feeAmount = $t03971039863._3
939- let commonState = $t03971039863._2
940- let amountEstimated = $t03971039863._1
936+ let outInAmountAsset = $t03974939902._5
937+ let bonus = $t03974939902._4
938+ let feeAmount = $t03974939902._3
939+ let commonState = $t03974939902._2
940+ let amountEstimated = $t03974939902._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953- let $t04036340610 = {
953+ let $t04040240649 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961- let amountAssetBalanceDelta = $t04036340610._1
962- let priceAssetBalanceDelta = $t04036340610._2
963- let $t04061340721 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964- let refreshKLpActions = $t04061340721._1
965- let updatedKLp = $t04061340721._2
961+ let amountAssetBalanceDelta = $t04040240649._1
962+ let priceAssetBalanceDelta = $t04040240649._2
963+ let $t04065240760 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t04065240760._1
965+ let updatedKLp = $t04065240760._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984- let $t04097841134 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985- let amountEstimated = $t04097841134._1
986- let commonState = $t04097841134._2
987- let feeAmount = $t04097841134._3
988- let bonus = $t04097841134._4
989- let outInAmountAsset = $t04097841134._5
984+ let $t04101741173 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t04101741173._1
986+ let commonState = $t04101741173._2
987+ let feeAmount = $t04101741173._3
988+ let bonus = $t04101741173._4
989+ let outInAmountAsset = $t04101741173._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
10231023 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10241024 if ((unstakeInv == unstakeInv))
10251025 then {
1026- let $t04203942190 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027- if (($t04203942190 == $t04203942190))
1026+ let $t04207842229 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04207842229 == $t04207842229))
10281028 then {
1029- let outInAmountAsset = $t04203942190._5
1030- let bonus = $t04203942190._4
1031- let feeAmount = $t04203942190._3
1032- let commonState = $t04203942190._2
1033- let amountEstimated = $t04203942190._1
1029+ let outInAmountAsset = $t04207842229._5
1030+ let bonus = $t04207842229._4
1031+ let feeAmount = $t04207842229._3
1032+ let commonState = $t04207842229._2
1033+ let amountEstimated = $t04207842229._1
10341034 let amount = if (if ((minOutAmount > 0))
10351035 then (minOutAmount > amountEstimated)
10361036 else false)
10431043 let sendFee = if ((feeAmount > 0))
10441044 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10451045 else nil
1046- let $t04268542932 = {
1046+ let $t04272442971 = {
10471047 let feeAmountForCalc = if ((this == feeCollectorAddress))
10481048 then 0
10491049 else feeAmount
10511051 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10521052 else $Tuple2(0, -((amount + feeAmountForCalc)))
10531053 }
1054- let amountAssetBalanceDelta = $t04268542932._1
1055- let priceAssetBalanceDelta = $t04268542932._2
1056- let $t04293543043 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057- let refreshKLpActions = $t04293543043._1
1058- let updatedKLp = $t04293543043._2
1054+ let amountAssetBalanceDelta = $t04272442971._1
1055+ let priceAssetBalanceDelta = $t04272442971._2
1056+ let $t04297443082 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04297443082._1
1058+ let updatedKLp = $t04297443082._2
10591059 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10601060 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10611061 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10881088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10891089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10901090 then {
1091- let $t04398944071 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092- let refreshKLpActions = $t04398944071._1
1093- let updatedKLp = $t04398944071._2
1091+ let $t04402844110 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04402844110._1
1093+ let updatedKLp = $t04402844110._2
10941094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10951095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10961096 then (state ++ refreshKLpActions)
11221122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11231123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11241124 then {
1125- let $t04502045101 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126- let refreshKLpActions = $t04502045101._1
1127- let updatedKLp = $t04502045101._2
1125+ let $t04505945140 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04505945140._1
1127+ let updatedKLp = $t04505945140._2
11281128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11291129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11301130 then (state ++ refreshKLpActions)
11681168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11691169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11701170 then {
1171- let $t04622746308 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172- let refreshKLpActions = $t04622746308._1
1173- let updatedKLp = $t04622746308._2
1171+ let $t04626646347 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04626646347._1
1173+ let updatedKLp = $t04626646347._2
11741174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11751175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11761176 then (state ++ refreshKLpActions)
12211221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12221222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12231223 then {
1224- let $t04760347684 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225- let refreshKLpActions = $t04760347684._1
1226- let updatedKLp = $t04760347684._2
1224+ let $t04764247723 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04764247723._1
1226+ let updatedKLp = $t04764247723._2
12271227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12281228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12291229 then (state ++ refreshKLpActions)
12581258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12591259 then {
12601260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1261- let $t04887148935 = refreshKLpInternal(0, 0, 0)
1262- let kLpUpdateActions = $t04887148935._1
1263- let updatedKLp = $t04887148935._2
1261+ let $t04891048974 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04891048974._1
1263+ let updatedKLp = $t04891048974._2
12641264 let actions = if ((kLp != updatedKLp))
12651265 then kLpUpdateActions
12661266 else throwErr("nothing to refresh")
14351435 match tx {
14361436 case order: Order =>
14371437 let matcherPub = getMatcherPubOrFail()
1438- let $t05759757666 = validateMatcherOrderAllowed(order)
1439- let orderValid = $t05759757666._1
1440- let orderValidInfo = $t05759757666._2
1438+ let $t05763657705 = validateMatcherOrderAllowed(order)
1439+ let orderValid = $t05763657705._1
1440+ let orderValidInfo = $t05763657705._2
14411441 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14421442 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14431443 if (if (if (orderValid)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale18 = toBigInt(1000000000000000000)
77
88 let zeroBigInt = toBigInt(0)
99
1010 let big0 = toBigInt(0)
1111
1212 let big1 = toBigInt(1)
1313
1414 let big2 = toBigInt(2)
1515
1616 let wavesString = "WAVES"
1717
1818 let SEP = "__"
1919
2020 let PoolPutDisabled = 2
2121
2222 let PoolMatcherDisabled = 3
2323
2424 let PoolShutdown = 4
2525
2626 let idxPoolAddress = 1
2727
2828 let idxPoolStatus = 2
2929
3030 let idxPoolLPAssetId = 3
3131
3232 let idxAmtAssetId = 4
3333
3434 let idxPriceAssetId = 5
3535
3636 let idxAmtAssetDcm = 6
3737
3838 let idxPriceAssetDcm = 7
3939
4040 let idxIAmtAssetId = 8
4141
4242 let idxIPriceAssetId = 9
4343
4444 let idxFactoryStakingContract = 1
4545
4646 let idxFactorySlippageContract = 7
4747
4848 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
4949
5050
5151 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
5252
5353
5454 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
5555
5656
5757 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
5858
5959
6060 func absBigInt (val) = if ((zeroBigInt > val))
6161 then -(val)
6262 else val
6363
6464
6565 func fc () = "%s__factoryContract"
6666
6767
6868 func mpk () = "%s__managerPublicKey"
6969
7070
7171 func pmpk () = "%s__pendingManagerPublicKey"
7272
7373
7474 func pl () = "%s%s__price__last"
7575
7676
7777 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
7878
7979
8080 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
8181
8282
8383 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
8484
8585
8686 func aa () = "%s__amountAsset"
8787
8888
8989 func pa () = "%s__priceAsset"
9090
9191
9292 let keyFee = "%s__fee"
9393
9494 let feeDefault = fraction(10, scale8, 10000)
9595
9696 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
9797
9898 let keyKLp = makeString(["%s", "kLp"], SEP)
9999
100100 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
101101
102102 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
103103
104104 let kLpRefreshDelayDefault = 30
105105
106106 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
107107
108108 func keyFactoryConfig () = "%s__factoryConfig"
109109
110110
111111 func keyMatcherPub () = "%s%s__matcher__publicKey"
112112
113113
114114 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
115115
116116
117117 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
118118
119119
120120 func keyAllPoolsShutdown () = "%s__shutdown"
121121
122122
123123 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
124124
125125
126126 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
127127
128128
129129 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
130130
131131 func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
132132
133133
134134 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
135135
136136
137137 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
138138
139139
140140 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
141141
142142
143143 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
144144
145145
146146 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
147147
148148 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
149149
150150 let inFee = {
151151 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
152152 if ($isInstanceOf(@, "Int"))
153153 then @
154154 else throw(($getType(@) + " couldn't be cast to Int"))
155155 }
156156
157157 let outFee = {
158158 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
159159 if ($isInstanceOf(@, "Int"))
160160 then @
161161 else throw(($getType(@) + " couldn't be cast to Int"))
162162 }
163163
164164 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
165165
166166
167167 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
168168
169169
170170 func getPoolConfig () = {
171171 let amtAsset = getStringOrFail(this, aa())
172172 let priceAsset = getStringOrFail(this, pa())
173173 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
174174 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
175175 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
176176 }
177177
178178
179179 func parseAssetId (input) = if ((input == wavesString))
180180 then unit
181181 else fromBase58String(input)
182182
183183
184184 func assetIdToString (input) = if ((input == unit))
185185 then wavesString
186186 else toBase58String(value(input))
187187
188188
189189 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]))
190190
191191
192192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
193193
194194 let $t084088574 = poolConfigParsed
195195
196196 let cfgPoolStatus = $t084088574._2
197197
198198 let cfgLpAssetId = $t084088574._3
199199
200200 let cfgAmountAssetId = $t084088574._4
201201
202202 let cfgPriceAssetId = $t084088574._5
203203
204204 let cfgAmountAssetDecimals = $t084088574._6
205205
206206 let cfgPriceAssetDecimals = $t084088574._7
207207
208208 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
209209
210210
211211 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
212212
213213 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
214214
215215 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)
216216
217217
218218 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)
219219
220220
221221 func getAccBalance (assetId) = if ((assetId == "WAVES"))
222222 then wavesBalance(this).available
223223 else assetBalance(this, fromBase58String(assetId))
224224
225225
226226 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
227227
228228
229229 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
230230
231231
232232 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
233233 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
234234 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
235235 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
236236 }
237237
238238
239239 func calcPrices (amAmt,prAmt,lpAmt) = {
240240 let cfg = getPoolConfig()
241241 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
242242 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
243243 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
244244 let amAmtX18 = toX18(amAmt, amtAssetDcm)
245245 let prAmtX18 = toX18(prAmt, priceAssetDcm)
246246 let lpAmtX18 = toX18(lpAmt, scale8)
247247 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
248248 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
249249 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
250250 }
251251
252252
253253 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
254254 let cfg = getPoolConfig()
255255 let lpAssetId = cfg[idxPoolLPAssetId]
256256 let amAssetId = cfg[idxAmtAssetId]
257257 let prAssetId = cfg[idxPriceAssetId]
258258 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
259259 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
260260 let poolStatus = cfg[idxPoolStatus]
261261 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
262262 if ((lpAssetId != pmtAssetId))
263263 then throw("Invalid asset passed.")
264264 else {
265265 let amBalance = getAccBalance(amAssetId)
266266 let amBalanceX18 = toX18(amBalance, amAssetDcm)
267267 let prBalance = getAccBalance(prAssetId)
268268 let prBalanceX18 = toX18(prBalance, prAssetDcm)
269269 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
270270 let curPrice = fromX18(curPriceX18, scale8)
271271 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
272272 let lpEmissionX18 = toX18(lpEmission, scale8)
273273 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
274274 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
275275 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
276276 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
277277 let state = if ((txId58 == ""))
278278 then nil
279279 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
280280 then unit
281281 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
282282 then unit
283283 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)]
284284 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
285285 }
286286 }
287287
288288
289289 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
290290 let cfg = getPoolConfig()
291291 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
292292 let amAssetIdStr = cfg[idxAmtAssetId]
293293 let prAssetIdStr = cfg[idxPriceAssetId]
294294 let iAmtAssetId = cfg[idxIAmtAssetId]
295295 let iPriceAssetId = cfg[idxIPriceAssetId]
296296 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
297297 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
298298 let poolStatus = cfg[idxPoolStatus]
299299 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
300300 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
301301 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
302302 if (if ((amAssetIdStr != inAmAssetIdStr))
303303 then true
304304 else (prAssetIdStr != inPrAssetIdStr))
305305 then throw("Invalid amt or price asset passed.")
306306 else {
307307 let amBalance = if (isEvaluate)
308308 then getAccBalance(amAssetIdStr)
309309 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
310310 let prBalance = if (isEvaluate)
311311 then getAccBalance(prAssetIdStr)
312312 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
313313 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
314314 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
315315 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
316316 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
317317 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
318318 let res = if ((lpEmission == 0))
319319 then {
320320 let curPriceX18 = zeroBigInt
321321 let slippageX18 = zeroBigInt
322322 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
323323 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
324324 }
325325 else {
326326 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
327327 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
328328 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
329329 if (if ((curPriceX18 != zeroBigInt))
330330 then (slippageX18 > slippageToleranceX18)
331331 else false)
332332 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
333333 else {
334334 let lpEmissionX18 = toX18(lpEmission, scale8)
335335 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
336336 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
337337 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
338338 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
339339 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
340340 let expAmtAssetAmtX18 = expectedAmts._1
341341 let expPriceAssetAmtX18 = expectedAmts._2
342342 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
343343 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
344344 }
345345 }
346346 let calcLpAmt = res._1
347347 let calcAmAssetPmt = res._2
348348 let calcPrAssetPmt = res._3
349349 let curPrice = fromX18(res._4, scale8)
350350 let slippageCalc = fromX18(res._5, scale8)
351351 if ((0 >= calcLpAmt))
352352 then throw("Invalid calculations. LP calculated is less than zero.")
353353 else {
354354 let emitLpAmt = if (!(emitLp))
355355 then 0
356356 else calcLpAmt
357357 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
358358 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
359359 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))]
360360 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
361361 }
362362 }
363363 }
364364
365365
366366 func calcKLp (amountBalance,priceBalance,lpEmission) = {
367367 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
368368 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
369369 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
370370 if ((lpEmission == big0))
371371 then big0
372372 else updatedKLp
373373 }
374374
375375
376376 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
377377 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
378378 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
379379 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
380380 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
381381 currentKLp
382382 }
383383
384384
385385 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
386386 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
387387 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
388388 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
389389 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
390390 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
391391 $Tuple2(actions, updatedKLp)
392392 }
393393
394394
395395 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
396396 then true
397397 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
398398
399399
400400 func validateMatcherOrderAllowed (order) = {
401401 let amountAssetAmount = order.amount
402402 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
403403 let $t02132621538 = if ((order.orderType == Buy))
404404 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
405405 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
406406 let amountAssetBalanceDelta = $t02132621538._1
407407 let priceAssetBalanceDelta = $t02132621538._2
408408 if (if (if (isGlobalShutdown())
409409 then true
410410 else (cfgPoolStatus == PoolMatcherDisabled))
411411 then true
412412 else (cfgPoolStatus == PoolShutdown))
413413 then throw("Exchange operations disabled")
414414 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
415415 then true
416416 else (order.assetPair.priceAsset != cfgPriceAssetId))
417417 then throw("Wrong order assets.")
418418 else {
419419 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
420420 let $t02200922109 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
421421 let unusedActions = $t02200922109._1
422422 let kLpNew = $t02200922109._2
423423 let $t02211222174 = refreshKLpInternal(0, 0, 0)
424424 let unusedActions0 = $t02211222174._1
425425 let kLpCurrent = $t02211222174._2
426426 let isOrderValid = (kLpNew >= kLp)
427427 let amountBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
428428 let priceBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
429429 let amountBalanceX18 = toX18(amountBalance, cfgAmountAssetDecimals)
430- let amountBalanceNew = (amountBalance + amountAssetBalanceDelta)
430+ let amountBalanceX18New = (amountBalanceX18 + toX18(amountAssetBalanceDelta, cfgAmountAssetDecimals))
431431 let priceBalanceX18 = toX18(priceBalance, cfgPriceAssetDecimals)
432- let priceBalanceNew = (priceBalance + priceAssetBalanceDelta)
433- let k = pow((toBigInt(amountBalance) * toBigInt(priceBalance)), 0, toBigInt(5), 1, 18, DOWN)
434- let kNew = pow((toBigInt(amountBalanceNew) * toBigInt(priceBalanceNew)), 0, toBigInt(5), 1, 18, DOWN)
432+ let priceBalanceX18New = (priceBalanceX18 + toX18(priceAssetBalanceDelta, cfgPriceAssetDecimals))
433+ let k = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
434+ let kNew = pow((amountBalanceX18New * priceBalanceX18New), 0, toBigInt(5), 1, 18, DOWN)
435435 let info = makeString([toString(kLp), toString(kLpNew), toString(k), toString(kNew)], " ")
436436 $Tuple2(isOrderValid, info)
437437 }
438438 }
439439
440440
441441 func commonGet (i) = if ((size(i.payments) != 1))
442442 then throw("exactly 1 payment is expected")
443443 else {
444444 let pmt = value(i.payments[0])
445445 let pmtAssetId = value(pmt.assetId)
446446 let pmtAmt = pmt.amount
447447 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
448448 let outAmAmt = res._1
449449 let outPrAmt = res._2
450450 let poolStatus = parseIntValue(res._9)
451451 let state = res._10
452452 if (if (isGlobalShutdown())
453453 then true
454454 else (poolStatus == PoolShutdown))
455455 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
456456 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
457457 }
458458
459459
460460 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
461461 then throw("exactly 2 payments are expected")
462462 else {
463463 let amAssetPmt = value(i.payments[0])
464464 let prAssetPmt = value(i.payments[1])
465465 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
466466 let poolStatus = parseIntValue(estPut._8)
467467 if (if (if (isGlobalShutdown())
468468 then true
469469 else (poolStatus == PoolPutDisabled))
470470 then true
471471 else (poolStatus == PoolShutdown))
472472 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
473473 else estPut
474474 }
475475
476476
477477 func emit (amount) = {
478478 let emitInv = invoke(factoryContract, "emit", [amount], nil)
479479 if ((emitInv == emitInv))
480480 then {
481481 let emitInvLegacy = match emitInv {
482482 case legacyFactoryContract: Address =>
483483 invoke(legacyFactoryContract, "emit", [amount], nil)
484484 case _ =>
485485 unit
486486 }
487487 if ((emitInvLegacy == emitInvLegacy))
488488 then amount
489489 else throw("Strict value is not equal to itself.")
490490 }
491491 else throw("Strict value is not equal to itself.")
492492 }
493493
494494
495495 func takeFee (amount,fee) = {
496496 let feeAmount = if ((fee == 0))
497497 then 0
498498 else fraction(amount, fee, scale8)
499499 $Tuple2((amount - feeAmount), feeAmount)
500500 }
501501
502502
503503 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
504504 let isEval = (txId == unit)
505505 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
506506 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
507507 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
508508 then true
509509 else if ((paymentAssetId == cfgPriceAssetId))
510510 then false
511511 else throwErr("invalid asset")
512- let $t02565725950 = if (isEval)
512+ let $t02569625989 = if (isEval)
513513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
514514 else if (paymentInAmountAsset)
515515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
516516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
517- let amountBalanceOld = $t02565725950._1
518- let priceBalanceOld = $t02565725950._2
519- let $t02595426103 = if (paymentInAmountAsset)
517+ let amountBalanceOld = $t02569625989._1
518+ let priceBalanceOld = $t02569625989._2
519+ let $t02599326142 = if (paymentInAmountAsset)
520520 then $Tuple2(paymentAmountRaw, 0)
521521 else $Tuple2(0, paymentAmountRaw)
522- let amountAssetAmountRaw = $t02595426103._1
523- let priceAssetAmountRaw = $t02595426103._2
522+ let amountAssetAmountRaw = $t02599326142._1
523+ let priceAssetAmountRaw = $t02599326142._2
524524 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
525525 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
526- let $t02623526299 = takeFee(paymentAmountRaw, inFee)
527- let paymentAmount = $t02623526299._1
528- let feeAmount = $t02623526299._2
526+ let $t02627426338 = takeFee(paymentAmountRaw, inFee)
527+ let paymentAmount = $t02627426338._1
528+ let feeAmount = $t02627426338._2
529529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
530530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
531531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
532532 let priceNew = fromX18(priceNewX18, scale8)
533533 let paymentBalance = if (paymentInAmountAsset)
534534 then amountBalanceOld
535535 else priceBalanceOld
536536 let paymentBalanceBigInt = toBigInt(paymentBalance)
537537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
538538 let chechSupply = if ((supplyBigInt > big0))
539539 then true
540540 else throwErr("initial deposit requires all coins")
541541 if ((chechSupply == chechSupply))
542542 then {
543543 let depositBigInt = toBigInt(paymentAmount)
544544 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
545545 let commonState = if (isEval)
546546 then nil
547547 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))]
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551- let $t02798028147 = if (paymentInAmountAsset)
551+ let $t02801928186 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554- let amount = $t02798028147._1
555- let balance = $t02798028147._2
554+ let amount = $t02801928186._1
555+ let balance = $t02801928186._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
559559 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
560560 }
561561 else throw("Strict value is not equal to itself.")
562562 }
563563
564564
565565 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
566566 let isEval = (txId == unit)
567567 let cfg = getPoolConfig()
568568 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
569569 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
570570 let checks = [if ((paymentAssetId == cfgLpAssetId))
571571 then true
572572 else throwErr("invalid lp asset")]
573573 if ((checks == checks))
574574 then {
575575 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
576576 then true
577577 else if ((outAssetId == cfgPriceAssetId))
578578 then false
579579 else throwErr("invalid asset")
580580 let balanceBigInt = if (outInAmountAsset)
581581 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
582582 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
583583 let outInAmountAssetDecimals = if (outInAmountAsset)
584584 then amtAssetDcm
585585 else priceAssetDcm
586586 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
587587 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
588588 let outBalance = if (outInAmountAsset)
589589 then amBalanceOld
590590 else prBalanceOld
591591 let outBalanceBigInt = toBigInt(outBalance)
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594594 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
595- let $t03022530281 = takeFee(amountRaw, outFee)
596- let totalAmount = $t03022530281._1
597- let feeAmount = $t03022530281._2
598- let $t03028530511 = if (outInAmountAsset)
595+ let $t03026430320 = takeFee(amountRaw, outFee)
596+ let totalAmount = $t03026430320._1
597+ let feeAmount = $t03026430320._2
598+ let $t03032430550 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601- let outAmAmount = $t03028530511._1
602- let outPrAmount = $t03028530511._2
603- let amBalanceNew = $t03028530511._3
604- let prBalanceNew = $t03028530511._4
601+ let outAmAmount = $t03032430550._1
602+ let outPrAmount = $t03032430550._2
603+ let amBalanceNew = $t03032430550._3
604+ let prBalanceNew = $t03032430550._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
608608 then nil
609609 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)]
610610 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
611611 let priceOld = fromX18(priceOldX18, scale8)
612612 let loss = {
613613 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
614614 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
615615 }
616616 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
617617 }
618618 else throw("Strict value is not equal to itself.")
619619 }
620620
621621
622622 func managerPublicKeyOrUnit () = match getString(mpk()) {
623623 case s: String =>
624624 fromBase58String(s)
625625 case _: Unit =>
626626 unit
627627 case _ =>
628628 throw("Match error")
629629 }
630630
631631
632632 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
633633 case s: String =>
634634 fromBase58String(s)
635635 case _: Unit =>
636636 unit
637637 case _ =>
638638 throw("Match error")
639639 }
640640
641641
642642 func isManager (i) = match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 (i.callerPublicKey == pk)
645645 case _: Unit =>
646646 (i.caller == this)
647647 case _ =>
648648 throw("Match error")
649649 }
650650
651651
652652 func mustManager (i) = {
653653 let pd = throw("Permission denied")
654654 match managerPublicKeyOrUnit() {
655655 case pk: ByteVector =>
656656 if ((i.callerPublicKey == pk))
657657 then true
658658 else pd
659659 case _: Unit =>
660660 if ((i.caller == this))
661661 then true
662662 else pd
663663 case _ =>
664664 throw("Match error")
665665 }
666666 }
667667
668668
669669 @Callable(i)
670670 func setManager (pendingManagerPublicKey) = {
671671 let checkCaller = mustManager(i)
672672 if ((checkCaller == checkCaller))
673673 then {
674674 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
675675 if ((checkManagerPublicKey == checkManagerPublicKey))
676676 then [StringEntry(pmpk(), pendingManagerPublicKey)]
677677 else throw("Strict value is not equal to itself.")
678678 }
679679 else throw("Strict value is not equal to itself.")
680680 }
681681
682682
683683
684684 @Callable(i)
685685 func confirmManager () = {
686686 let pm = pendingManagerPublicKeyOrUnit()
687687 let hasPM = if (isDefined(pm))
688688 then true
689689 else throw("No pending manager")
690690 if ((hasPM == hasPM))
691691 then {
692692 let checkPM = if ((i.callerPublicKey == value(pm)))
693693 then true
694694 else throw("You are not pending manager")
695695 if ((checkPM == checkPM))
696696 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
697697 else throw("Strict value is not equal to itself.")
698698 }
699699 else throw("Strict value is not equal to itself.")
700700 }
701701
702702
703703
704704 @Callable(i)
705705 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
706706 then throw("Invalid slippageTolerance passed")
707707 else {
708708 let estPut = commonPut(i, slippageTolerance, true)
709709 let emitLpAmt = estPut._2
710710 let lpAssetId = estPut._7
711711 let state = estPut._9
712712 let amDiff = estPut._10
713713 let prDiff = estPut._11
714714 let amId = estPut._12
715715 let prId = estPut._13
716716 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
717717 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
718718 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
719719 if ((currentKLp == currentKLp))
720720 then {
721721 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
722722 if ((emitInv == emitInv))
723723 then {
724724 let emitInvLegacy = match emitInv {
725725 case legacyFactoryContract: Address =>
726726 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
727727 case _ =>
728728 unit
729729 }
730730 if ((emitInvLegacy == emitInvLegacy))
731731 then {
732732 let slippageAInv = if ((amDiff > 0))
733733 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
734734 else nil
735735 if ((slippageAInv == slippageAInv))
736736 then {
737737 let slippagePInv = if ((prDiff > 0))
738738 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
739739 else nil
740740 if ((slippagePInv == slippagePInv))
741741 then {
742742 let lpTransfer = if (shouldAutoStake)
743743 then {
744744 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
745745 if ((slpStakeInv == slpStakeInv))
746746 then nil
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750- let $t03503935501 = refreshKLpInternal(0, 0, 0)
751- if (($t03503935501 == $t03503935501))
750+ let $t03507835540 = refreshKLpInternal(0, 0, 0)
751+ if (($t03507835540 == $t03507835540))
752752 then {
753- let updatedKLp = $t03503935501._2
754- let refreshKLpActions = $t03503935501._1
753+ let updatedKLp = $t03507835540._2
754+ let refreshKLpActions = $t03507835540._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
758758 else throw("Strict value is not equal to itself.")
759759 }
760760 else throw("Strict value is not equal to itself.")
761761 }
762762 else throw("Strict value is not equal to itself.")
763763 }
764764 else throw("Strict value is not equal to itself.")
765765 }
766766 else throw("Strict value is not equal to itself.")
767767 }
768768 else throw("Strict value is not equal to itself.")
769769 }
770770 else throw("Strict value is not equal to itself.")
771771 }
772772
773773
774774
775775 @Callable(i)
776776 func putForFree (maxSlippage) = if ((0 > maxSlippage))
777777 then throw("Invalid value passed")
778778 else {
779779 let estPut = commonPut(i, maxSlippage, false)
780780 let state = estPut._9
781781 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
782782 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786- let $t03606336128 = refreshKLpInternal(0, 0, 0)
787- let refreshKLpActions = $t03606336128._1
788- let updatedKLp = $t03606336128._2
786+ let $t03610236167 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03610236167._1
788+ let updatedKLp = $t03610236167._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
792792 else throw("Strict value is not equal to itself.")
793793 }
794794 else throw("Strict value is not equal to itself.")
795795 }
796796
797797
798798
799799 @Callable(i)
800800 func putOneTkn (minOutAmount,autoStake) = {
801801 let isPoolOneTokenOperationsDisabled = {
802802 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
803803 if ($isInstanceOf(@, "Boolean"))
804804 then @
805805 else throw(($getType(@) + " couldn't be cast to Boolean"))
806806 }
807807 let isPutDisabled = if (if (if (isGlobalShutdown())
808808 then true
809809 else (cfgPoolStatus == PoolPutDisabled))
810810 then true
811811 else (cfgPoolStatus == PoolShutdown))
812812 then true
813813 else isPoolOneTokenOperationsDisabled
814814 let checks = [if (if (!(isPutDisabled))
815815 then true
816816 else isManager(i))
817817 then true
818818 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
819819 then true
820820 else throwErr("exactly 1 payment are expected")]
821821 if ((checks == checks))
822822 then {
823823 let payment = i.payments[0]
824824 let paymentAssetId = payment.assetId
825825 let paymentAmountRaw = payment.amount
826826 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
827827 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
828828 else if ((paymentAssetId == cfgPriceAssetId))
829829 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
830830 else throwErr("payment asset is not supported")
831831 if ((currentKLp == currentKLp))
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835- let $t03731637468 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836- if (($t03731637468 == $t03731637468))
835+ let $t03735537507 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03735537507 == $t03735537507))
837837 then {
838- let paymentInAmountAsset = $t03731637468._5
839- let bonus = $t03731637468._4
840- let feeAmount = $t03731637468._3
841- let commonState = $t03731637468._2
842- let emitAmountEstimated = $t03731637468._1
838+ let paymentInAmountAsset = $t03735537507._5
839+ let bonus = $t03735537507._4
840+ let feeAmount = $t03735537507._3
841+ let commonState = $t03735537507._2
842+ let emitAmountEstimated = $t03735537507._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
846846 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
847847 else emitAmountEstimated
848848 let emitInv = emit(emitAmount)
849849 if ((emitInv == emitInv))
850850 then {
851851 let lpTransfer = if (autoStake)
852852 then {
853853 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
854854 if ((stakeInv == stakeInv))
855855 then nil
856856 else throw("Strict value is not equal to itself.")
857857 }
858858 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862- let $t03805438251 = if ((this == feeCollectorAddress))
862+ let $t03809338290 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867- let amountAssetBalanceDelta = $t03805438251._1
868- let priceAssetBalanceDelta = $t03805438251._2
869- let $t03825438362 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870- let refreshKLpActions = $t03825438362._1
871- let updatedKLp = $t03825438362._2
867+ let amountAssetBalanceDelta = $t03809338290._1
868+ let priceAssetBalanceDelta = $t03809338290._2
869+ let $t03829338401 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03829338401._1
871+ let updatedKLp = $t03829338401._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
875875 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
876876 else throw("Strict value is not equal to itself.")
877877 }
878878 else throw("Strict value is not equal to itself.")
879879 }
880880 else throw("Strict value is not equal to itself.")
881881 }
882882 else throw("Strict value is not equal to itself.")
883883 }
884884 else throw("Strict value is not equal to itself.")
885885 }
886886
887887
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891- let $t03866838825 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892- let emitAmountEstimated = $t03866838825._1
893- let commonState = $t03866838825._2
894- let feeAmount = $t03866838825._3
895- let bonus = $t03866838825._4
896- let paymentInAmountAsset = $t03866838825._5
891+ let $t03870738864 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03870738864._1
893+ let commonState = $t03870738864._2
894+ let feeAmount = $t03870738864._3
895+ let bonus = $t03870738864._4
896+ let paymentInAmountAsset = $t03870738864._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
900900
901901
902902 @Callable(i)
903903 func getOneTkn (outAssetIdStr,minOutAmount) = {
904904 let isPoolOneTokenOperationsDisabled = {
905905 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
906906 if ($isInstanceOf(@, "Boolean"))
907907 then @
908908 else throw(($getType(@) + " couldn't be cast to Boolean"))
909909 }
910910 let isGetDisabled = if (if (isGlobalShutdown())
911911 then true
912912 else (cfgPoolStatus == PoolShutdown))
913913 then true
914914 else isPoolOneTokenOperationsDisabled
915915 let checks = [if (if (!(isGetDisabled))
916916 then true
917917 else isManager(i))
918918 then true
919919 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
920920 then true
921921 else throwErr("exactly 1 payment are expected")]
922922 if ((checks == checks))
923923 then {
924924 let outAssetId = parseAssetId(outAssetIdStr)
925925 let payment = i.payments[0]
926926 let paymentAssetId = payment.assetId
927927 let paymentAmount = payment.amount
928928 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
929929 if ((currentKLp == currentKLp))
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933- let $t03971039863 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934- if (($t03971039863 == $t03971039863))
933+ let $t03974939902 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03974939902 == $t03974939902))
935935 then {
936- let outInAmountAsset = $t03971039863._5
937- let bonus = $t03971039863._4
938- let feeAmount = $t03971039863._3
939- let commonState = $t03971039863._2
940- let amountEstimated = $t03971039863._1
936+ let outInAmountAsset = $t03974939902._5
937+ let bonus = $t03974939902._4
938+ let feeAmount = $t03974939902._3
939+ let commonState = $t03974939902._2
940+ let amountEstimated = $t03974939902._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
944944 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
945945 else amountEstimated
946946 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
947947 if ((burnInv == burnInv))
948948 then {
949949 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953- let $t04036340610 = {
953+ let $t04040240649 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
957957 if (outInAmountAsset)
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961- let amountAssetBalanceDelta = $t04036340610._1
962- let priceAssetBalanceDelta = $t04036340610._2
963- let $t04061340721 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964- let refreshKLpActions = $t04061340721._1
965- let updatedKLp = $t04061340721._2
961+ let amountAssetBalanceDelta = $t04040240649._1
962+ let priceAssetBalanceDelta = $t04040240649._2
963+ let $t04065240760 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t04065240760._1
965+ let updatedKLp = $t04065240760._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
969969 else throw("Strict value is not equal to itself.")
970970 }
971971 else throw("Strict value is not equal to itself.")
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else throw("Strict value is not equal to itself.")
976976 }
977977 else throw("Strict value is not equal to itself.")
978978 }
979979
980980
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984- let $t04097841134 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985- let amountEstimated = $t04097841134._1
986- let commonState = $t04097841134._2
987- let feeAmount = $t04097841134._3
988- let bonus = $t04097841134._4
989- let outInAmountAsset = $t04097841134._5
984+ let $t04101741173 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t04101741173._1
986+ let commonState = $t04101741173._2
987+ let feeAmount = $t04101741173._3
988+ let bonus = $t04101741173._4
989+ let outInAmountAsset = $t04101741173._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
993993
994994
995995 @Callable(i)
996996 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
997997 let isPoolOneTokenOperationsDisabled = {
998998 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
999999 if ($isInstanceOf(@, "Boolean"))
10001000 then @
10011001 else throw(($getType(@) + " couldn't be cast to Boolean"))
10021002 }
10031003 let isGetDisabled = if (if (isGlobalShutdown())
10041004 then true
10051005 else (cfgPoolStatus == PoolShutdown))
10061006 then true
10071007 else isPoolOneTokenOperationsDisabled
10081008 let checks = [if (if (!(isGetDisabled))
10091009 then true
10101010 else isManager(i))
10111011 then true
10121012 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10131013 then true
10141014 else throwErr("no payments are expected")]
10151015 if ((checks == checks))
10161016 then {
10171017 let outAssetId = parseAssetId(outAssetIdStr)
10181018 let userAddress = i.caller
10191019 let txId = i.transactionId
10201020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10211021 if ((currentKLp == currentKLp))
10221022 then {
10231023 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10241024 if ((unstakeInv == unstakeInv))
10251025 then {
1026- let $t04203942190 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027- if (($t04203942190 == $t04203942190))
1026+ let $t04207842229 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04207842229 == $t04207842229))
10281028 then {
1029- let outInAmountAsset = $t04203942190._5
1030- let bonus = $t04203942190._4
1031- let feeAmount = $t04203942190._3
1032- let commonState = $t04203942190._2
1033- let amountEstimated = $t04203942190._1
1029+ let outInAmountAsset = $t04207842229._5
1030+ let bonus = $t04207842229._4
1031+ let feeAmount = $t04207842229._3
1032+ let commonState = $t04207842229._2
1033+ let amountEstimated = $t04207842229._1
10341034 let amount = if (if ((minOutAmount > 0))
10351035 then (minOutAmount > amountEstimated)
10361036 else false)
10371037 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10381038 else amountEstimated
10391039 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10401040 if ((burnInv == burnInv))
10411041 then {
10421042 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10431043 let sendFee = if ((feeAmount > 0))
10441044 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10451045 else nil
1046- let $t04268542932 = {
1046+ let $t04272442971 = {
10471047 let feeAmountForCalc = if ((this == feeCollectorAddress))
10481048 then 0
10491049 else feeAmount
10501050 if (outInAmountAsset)
10511051 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10521052 else $Tuple2(0, -((amount + feeAmountForCalc)))
10531053 }
1054- let amountAssetBalanceDelta = $t04268542932._1
1055- let priceAssetBalanceDelta = $t04268542932._2
1056- let $t04293543043 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057- let refreshKLpActions = $t04293543043._1
1058- let updatedKLp = $t04293543043._2
1054+ let amountAssetBalanceDelta = $t04272442971._1
1055+ let priceAssetBalanceDelta = $t04272442971._2
1056+ let $t04297443082 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04297443082._1
1058+ let updatedKLp = $t04297443082._2
10591059 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10601060 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10611061 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10621062 else throw("Strict value is not equal to itself.")
10631063 }
10641064 else throw("Strict value is not equal to itself.")
10651065 }
10661066 else throw("Strict value is not equal to itself.")
10671067 }
10681068 else throw("Strict value is not equal to itself.")
10691069 }
10701070 else throw("Strict value is not equal to itself.")
10711071 }
10721072 else throw("Strict value is not equal to itself.")
10731073 }
10741074
10751075
10761076
10771077 @Callable(i)
10781078 func get () = {
10791079 let res = commonGet(i)
10801080 let outAmtAmt = res._1
10811081 let outPrAmt = res._2
10821082 let pmtAmt = res._3
10831083 let pmtAssetId = res._4
10841084 let state = res._5
10851085 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10861086 if ((currentKLp == currentKLp))
10871087 then {
10881088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10891089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10901090 then {
1091- let $t04398944071 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092- let refreshKLpActions = $t04398944071._1
1093- let updatedKLp = $t04398944071._2
1091+ let $t04402844110 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04402844110._1
1093+ let updatedKLp = $t04402844110._2
10941094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10951095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10961096 then (state ++ refreshKLpActions)
10971097 else throw("Strict value is not equal to itself.")
10981098 }
10991099 else throw("Strict value is not equal to itself.")
11001100 }
11011101 else throw("Strict value is not equal to itself.")
11021102 }
11031103
11041104
11051105
11061106 @Callable(i)
11071107 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11081108 let res = commonGet(i)
11091109 let outAmAmt = res._1
11101110 let outPrAmt = res._2
11111111 let pmtAmt = res._3
11121112 let pmtAssetId = res._4
11131113 let state = res._5
11141114 if ((noLessThenAmtAsset > outAmAmt))
11151115 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11161116 else if ((noLessThenPriceAsset > outPrAmt))
11171117 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11181118 else {
11191119 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11201120 if ((currentKLp == currentKLp))
11211121 then {
11221122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11231123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11241124 then {
1125- let $t04502045101 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126- let refreshKLpActions = $t04502045101._1
1127- let updatedKLp = $t04502045101._2
1125+ let $t04505945140 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04505945140._1
1127+ let updatedKLp = $t04505945140._2
11281128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11291129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11301130 then (state ++ refreshKLpActions)
11311131 else throw("Strict value is not equal to itself.")
11321132 }
11331133 else throw("Strict value is not equal to itself.")
11341134 }
11351135 else throw("Strict value is not equal to itself.")
11361136 }
11371137 }
11381138
11391139
11401140
11411141 @Callable(i)
11421142 func unstakeAndGet (amount) = {
11431143 let checkPayments = if ((size(i.payments) != 0))
11441144 then throw("No payments are expected")
11451145 else true
11461146 if ((checkPayments == checkPayments))
11471147 then {
11481148 let cfg = getPoolConfig()
11491149 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11501150 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11511151 if ((currentKLp == currentKLp))
11521152 then {
11531153 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11541154 if ((unstakeInv == unstakeInv))
11551155 then {
11561156 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11571157 let outAmAmt = res._1
11581158 let outPrAmt = res._2
11591159 let poolStatus = parseIntValue(res._9)
11601160 let state = res._10
11611161 let checkPoolStatus = if (if (isGlobalShutdown())
11621162 then true
11631163 else (poolStatus == PoolShutdown))
11641164 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11651165 else true
11661166 if ((checkPoolStatus == checkPoolStatus))
11671167 then {
11681168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11691169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11701170 then {
1171- let $t04622746308 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172- let refreshKLpActions = $t04622746308._1
1173- let updatedKLp = $t04622746308._2
1171+ let $t04626646347 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04626646347._1
1173+ let updatedKLp = $t04626646347._2
11741174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11751175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11761176 then (state ++ refreshKLpActions)
11771177 else throw("Strict value is not equal to itself.")
11781178 }
11791179 else throw("Strict value is not equal to itself.")
11801180 }
11811181 else throw("Strict value is not equal to itself.")
11821182 }
11831183 else throw("Strict value is not equal to itself.")
11841184 }
11851185 else throw("Strict value is not equal to itself.")
11861186 }
11871187 else throw("Strict value is not equal to itself.")
11881188 }
11891189
11901190
11911191
11921192 @Callable(i)
11931193 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11941194 let isGetDisabled = if (isGlobalShutdown())
11951195 then true
11961196 else (cfgPoolStatus == PoolShutdown)
11971197 let checks = [if (!(isGetDisabled))
11981198 then true
11991199 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
12001200 then true
12011201 else throw("no payments are expected")]
12021202 if ((checks == checks))
12031203 then {
12041204 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12051205 if ((currentKLp == currentKLp))
12061206 then {
12071207 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12081208 if ((unstakeInv == unstakeInv))
12091209 then {
12101210 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12111211 let outAmAmt = res._1
12121212 let outPrAmt = res._2
12131213 let state = res._10
12141214 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12151215 then true
12161216 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12171217 then true
12181218 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12191219 if ((checkAmounts == checkAmounts))
12201220 then {
12211221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12221222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12231223 then {
1224- let $t04760347684 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225- let refreshKLpActions = $t04760347684._1
1226- let updatedKLp = $t04760347684._2
1224+ let $t04764247723 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04764247723._1
1226+ let updatedKLp = $t04764247723._2
12271227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12281228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12291229 then (state ++ refreshKLpActions)
12301230 else throw("Strict value is not equal to itself.")
12311231 }
12321232 else throw("Strict value is not equal to itself.")
12331233 }
12341234 else throw("Strict value is not equal to itself.")
12351235 }
12361236 else throw("Strict value is not equal to itself.")
12371237 }
12381238 else throw("Strict value is not equal to itself.")
12391239 }
12401240 else throw("Strict value is not equal to itself.")
12411241 }
12421242
12431243
12441244
12451245 @Callable(i)
12461246 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12471247 then throw("permissions denied")
12481248 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12491249
12501250
12511251
12521252 @Callable(i)
12531253 func refreshKLp () = {
12541254 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12551255 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12561256 then unit
12571257 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12581258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12591259 then {
12601260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1261- let $t04887148935 = refreshKLpInternal(0, 0, 0)
1262- let kLpUpdateActions = $t04887148935._1
1263- let updatedKLp = $t04887148935._2
1261+ let $t04891048974 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04891048974._1
1263+ let updatedKLp = $t04891048974._2
12641264 let actions = if ((kLp != updatedKLp))
12651265 then kLpUpdateActions
12661266 else throwErr("nothing to refresh")
12671267 $Tuple2(actions, toString(updatedKLp))
12681268 }
12691269 else throw("Strict value is not equal to itself.")
12701270 }
12711271
12721272
12731273
12741274 @Callable(i)
12751275 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12761276
12771277
12781278
12791279 @Callable(i)
12801280 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12811281
12821282
12831283
12841284 @Callable(i)
12851285 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12861286 let prices = calcPrices(amAmt, prAmt, lpAmt)
12871287 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12881288 }
12891289
12901290
12911291
12921292 @Callable(i)
12931293 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12941294
12951295
12961296
12971297 @Callable(i)
12981298 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12991299
13001300
13011301
13021302 @Callable(i)
13031303 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13041304
13051305
13061306
13071307 @Callable(i)
13081308 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
13091309
13101310
13111311
13121312 @Callable(i)
13131313 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
13141314 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13151315 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13161316 }
13171317
13181318
13191319
13201320 @Callable(i)
13211321 func statsREADONLY () = {
13221322 let cfg = getPoolConfig()
13231323 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13241324 let amtAssetId = cfg[idxAmtAssetId]
13251325 let priceAssetId = cfg[idxPriceAssetId]
13261326 let iAmtAssetId = cfg[idxIAmtAssetId]
13271327 let iPriceAssetId = cfg[idxIPriceAssetId]
13281328 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13291329 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13301330 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13311331 let accAmtAssetBalance = getAccBalance(amtAssetId)
13321332 let accPriceAssetBalance = getAccBalance(priceAssetId)
13331333 let pricesList = if ((poolLPBalance == 0))
13341334 then [zeroBigInt, zeroBigInt, zeroBigInt]
13351335 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13361336 let curPrice = 0
13371337 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13381338 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13391339 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13401340 $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))
13411341 }
13421342
13431343
13441344
13451345 @Callable(i)
13461346 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13471347 let cfg = getPoolConfig()
13481348 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13491349 let amAssetIdStr = cfg[idxAmtAssetId]
13501350 let amAssetId = fromBase58String(amAssetIdStr)
13511351 let prAssetIdStr = cfg[idxPriceAssetId]
13521352 let prAssetId = fromBase58String(prAssetIdStr)
13531353 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13541354 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13551355 let poolStatus = cfg[idxPoolStatus]
13561356 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13571357 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13581358 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13591359 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13601360 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13611361 let curPriceX18 = if ((poolLPBalance == 0))
13621362 then zeroBigInt
13631363 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13641364 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13651365 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13661366 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13671367 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13681368 let calcLpAmt = estPut._1
13691369 let curPriceCalc = estPut._3
13701370 let amBalance = estPut._4
13711371 let prBalance = estPut._5
13721372 let lpEmission = estPut._6
13731373 $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))
13741374 }
13751375
13761376
13771377
13781378 @Callable(i)
13791379 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13801380 let cfg = getPoolConfig()
13811381 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13821382 let amAssetIdStr = cfg[idxAmtAssetId]
13831383 let amAssetId = fromBase58String(amAssetIdStr)
13841384 let prAssetIdStr = cfg[idxPriceAssetId]
13851385 let prAssetId = fromBase58String(prAssetIdStr)
13861386 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13871387 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13881388 let poolStatus = cfg[idxPoolStatus]
13891389 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13901390 let amBalanceRaw = getAccBalance(amAssetIdStr)
13911391 let prBalanceRaw = getAccBalance(prAssetIdStr)
13921392 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13931393 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13941394 let curPriceX18 = if ((poolLPBalance == 0))
13951395 then zeroBigInt
13961396 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13971397 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13981398 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13991399 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
14001400 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
14011401 let calcLpAmt = estPut._1
14021402 let curPriceCalc = estPut._3
14031403 let amBalance = estPut._4
14041404 let prBalance = estPut._5
14051405 let lpEmission = estPut._6
14061406 $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))
14071407 }
14081408
14091409
14101410
14111411 @Callable(i)
14121412 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
14131413 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
14141414 let outAmAmt = res._1
14151415 let outPrAmt = res._2
14161416 let amBalance = res._5
14171417 let prBalance = res._6
14181418 let lpEmission = res._7
14191419 let curPrice = res._8
14201420 let poolStatus = parseIntValue(res._9)
14211421 $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))
14221422 }
14231423
14241424
14251425 @Verifier(tx)
14261426 func verify () = {
14271427 let targetPublicKey = match managerPublicKeyOrUnit() {
14281428 case pk: ByteVector =>
14291429 pk
14301430 case _: Unit =>
14311431 tx.senderPublicKey
14321432 case _ =>
14331433 throw("Match error")
14341434 }
14351435 match tx {
14361436 case order: Order =>
14371437 let matcherPub = getMatcherPubOrFail()
1438- let $t05759757666 = validateMatcherOrderAllowed(order)
1439- let orderValid = $t05759757666._1
1440- let orderValidInfo = $t05759757666._2
1438+ let $t05763657705 = validateMatcherOrderAllowed(order)
1439+ let orderValid = $t05763657705._1
1440+ let orderValidInfo = $t05763657705._2
14411441 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14421442 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14431443 if (if (if (orderValid)
14441444 then senderValid
14451445 else false)
14461446 then matcherValid
14471447 else false)
14481448 then true
14491449 else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
14501450 case s: SetScriptTransaction =>
14511451 let newHash = blake2b256(value(s.script))
14521452 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14531453 let currentHash = scriptHash(this)
14541454 if (if ((allowedHash == newHash))
14551455 then (currentHash != newHash)
14561456 else false)
14571457 then true
14581458 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14591459 case _ =>
14601460 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14611461 }
14621462 }
14631463

github/deemru/w8io/169f3d6 
296.30 ms