tx · 5k8KhDZYFiptdxD9wdT4TfqAnitvmP98rXAfWdXpQGMY

3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD:  -0.03500000 Waves

2022.12.07 12:13 [2349731] smart account 3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD > SELF 0.00000000 Waves

{ "type": 13, "id": "5k8KhDZYFiptdxD9wdT4TfqAnitvmP98rXAfWdXpQGMY", "fee": 3500000, "feeAssetId": null, "timestamp": 1670404309879, "version": 1, "sender": "3MsXwm6KeMva32skLvFrFfYYmcxT2ZDc4fD", "senderPublicKey": "33aHdznSeq5cGxgbnLJ54tzNfiqS5SCQYHgFGMFsNQzs", "proofs": [ "66emHky6RAvSWv9SGGUrXBYYYCRv1GkKqE4HQjQuAuU8zx131QWJGYiAZqEfjasspJ3e8UvWZAAHSyvCmMW1unQx" ], "script": "base64:BgLfLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZX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5Qnl0ZXMJAJEDAggFAmRwBnByb29mcwAACAUCZHAPc2VuZGVyUHVibGljS2V5BAJhQgkA9AMDCAUCZHAJYm9keUJ5dGVzCQCRAwIIBQJkcAZwcm9vZnMAAQUCZ0IDAwMFAmF6BQJhQQcFAmFCBwYJAQJheQMFAmF6BQJhQQUCYUIDCQABAgUCZEsCFFNldFNjcmlwdFRyYW5zYWN0aW9uBAJlTgUCZEsEAmdDCQD2AwEJAQV2YWx1ZQEIBQJlTgZzY3JpcHQEAmdECQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUoJAQJhdwAEAmdFCQDxBwEFBHRoaXMDAwkAAAIFAmdEBQJnQwkBAiE9AgUCZ0UFAmdDBwYJAPQDAwgFAmd5CWJvZHlCeXRlcwkAkQMCCAUCZ3kGcHJvb2ZzAAAFAmdBCQD0AwMIBQJneQlib2R5Qnl0ZXMJAJEDAggFAmd5BnByb29mcwAABQJnQdQ0z6o=", "chainId": 84, "height": 2349731, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 35K68qvQwipfDEQZ173J8Nxfk694LVu3FFyDDxeHzzDg Next: GcyyqxQsJKrBNEMMjDz5hyWzsFRSaB1ugnhA7smRQukQ Diff:
OldNewDifferences
738738 let $t03211432179 = refreshKLpInternal(0, 0, 0)
739739 let refreshKLpActions = $t03211432179._1
740740 let updatedKLp = $t03211432179._2
741- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
742- if ((isUpdatedKLpValid == isUpdatedKLpValid))
743- then ((state ++ lpTransfer) ++ refreshKLpActions)
741+ let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
742+ let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
743+ let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
744+ let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " "))
745+ if ((error == error))
746+ then {
747+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
748+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
749+ then ((state ++ lpTransfer) ++ refreshKLpActions)
750+ else throw("Strict value is not equal to itself.")
751+ }
744752 else throw("Strict value is not equal to itself.")
745753 }
746754 else throw("Strict value is not equal to itself.")
767775 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
768776 if ((currentKLp == currentKLp))
769777 then {
770- let $t03274132806 = refreshKLpInternal(0, 0, 0)
771- let refreshKLpActions = $t03274132806._1
772- let updatedKLp = $t03274132806._2
778+ let $t03324533310 = refreshKLpInternal(0, 0, 0)
779+ let refreshKLpActions = $t03324533310._1
780+ let updatedKLp = $t03324533310._2
773781 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
774782 if ((isUpdatedKLpValid == isUpdatedKLpValid))
775783 then (state ++ refreshKLpActions)
814822 else throwErr("payment asset is not supported")
815823 let userAddress = i.caller
816824 let txId = i.transactionId
817- let $t03399134143 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
818- if (($t03399134143 == $t03399134143))
825+ let $t03449534647 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
826+ if (($t03449534647 == $t03449534647))
819827 then {
820- let paymentInAmountAsset = $t03399134143._5
821- let bonus = $t03399134143._4
822- let feeAmount = $t03399134143._3
823- let commonState = $t03399134143._2
824- let emitAmountEstimated = $t03399134143._1
828+ let paymentInAmountAsset = $t03449534647._5
829+ let bonus = $t03449534647._4
830+ let feeAmount = $t03449534647._3
831+ let commonState = $t03449534647._2
832+ let emitAmountEstimated = $t03449534647._1
825833 let emitAmount = if (if ((minOutAmount > 0))
826834 then (minOutAmount > emitAmountEstimated)
827835 else false)
841849 let sendFee = if ((feeAmount > 0))
842850 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
843851 else nil
844- let $t03472934926 = if ((this == feeCollectorAddress))
852+ let $t03523335430 = if ((this == feeCollectorAddress))
845853 then $Tuple2(0, 0)
846854 else if (paymentInAmountAsset)
847855 then $Tuple2(-(feeAmount), 0)
848856 else $Tuple2(0, -(feeAmount))
849- let amountAssetBalanceDelta = $t03472934926._1
850- let priceAssetBalanceDelta = $t03472934926._2
851- let $t03492935037 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
852- let refreshKLpActions = $t03492935037._1
853- let updatedKLp = $t03492935037._2
857+ let amountAssetBalanceDelta = $t03523335430._1
858+ let priceAssetBalanceDelta = $t03523335430._2
859+ let $t03543335541 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
860+ let refreshKLpActions = $t03543335541._1
861+ let updatedKLp = $t03543335541._2
854862 let kLp = value(getString(keyKLp))
855- let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
856- if ((error == error))
857- then {
858- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
859- if ((isUpdatedKLpValid == isUpdatedKLpValid))
860- then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
861- else throw("Strict value is not equal to itself.")
862- }
863+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
864+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
865+ then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
863866 else throw("Strict value is not equal to itself.")
864867 }
865868 else throw("Strict value is not equal to itself.")
873876
874877 @Callable(i)
875878 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
876- let $t03553535692 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
877- let emitAmountEstimated = $t03553535692._1
878- let commonState = $t03553535692._2
879- let feeAmount = $t03553535692._3
880- let bonus = $t03553535692._4
881- let paymentInAmountAsset = $t03553535692._5
879+ let $t03584736004 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
880+ let emitAmountEstimated = $t03584736004._1
881+ let commonState = $t03584736004._2
882+ let feeAmount = $t03584736004._3
883+ let bonus = $t03584736004._4
884+ let paymentInAmountAsset = $t03584736004._5
882885 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
883886 }
884887
913916 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
914917 let userAddress = i.caller
915918 let txId = i.transactionId
916- let $t03658636739 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
917- if (($t03658636739 == $t03658636739))
919+ let $t03689837051 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
920+ if (($t03689837051 == $t03689837051))
918921 then {
919- let outInAmountAsset = $t03658636739._5
920- let bonus = $t03658636739._4
921- let feeAmount = $t03658636739._3
922- let commonState = $t03658636739._2
923- let amountEstimated = $t03658636739._1
922+ let outInAmountAsset = $t03689837051._5
923+ let bonus = $t03689837051._4
924+ let feeAmount = $t03689837051._3
925+ let commonState = $t03689837051._2
926+ let amountEstimated = $t03689837051._1
924927 let amount = if (if ((minOutAmount > 0))
925928 then (minOutAmount > amountEstimated)
926929 else false)
933936 let sendFee = if ((feeAmount > 0))
934937 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
935938 else nil
936- let $t03723937486 = {
939+ let $t03755137798 = {
937940 let feeAmountForCalc = if ((this == feeCollectorAddress))
938941 then 0
939942 else feeAmount
941944 then $Tuple2(-((amount + feeAmountForCalc)), 0)
942945 else $Tuple2(0, -((amount + feeAmountForCalc)))
943946 }
944- let amountAssetBalanceDelta = $t03723937486._1
945- let priceAssetBalanceDelta = $t03723937486._2
946- let $t03748937597 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
947- let refreshKLpActions = $t03748937597._1
948- let updatedKLp = $t03748937597._2
947+ let amountAssetBalanceDelta = $t03755137798._1
948+ let priceAssetBalanceDelta = $t03755137798._2
949+ let $t03780137909 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
950+ let refreshKLpActions = $t03780137909._1
951+ let updatedKLp = $t03780137909._2
949952 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
950953 if ((isUpdatedKLpValid == isUpdatedKLpValid))
951954 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
962965
963966 @Callable(i)
964967 func getOneTknREADONLY (outAssetId,paymentAmount) = {
965- let $t03785438010 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
966- let amountEstimated = $t03785438010._1
967- let commonState = $t03785438010._2
968- let feeAmount = $t03785438010._3
969- let bonus = $t03785438010._4
970- let outInAmountAsset = $t03785438010._5
968+ let $t03816638322 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
969+ let amountEstimated = $t03816638322._1
970+ let commonState = $t03816638322._2
971+ let feeAmount = $t03816638322._3
972+ let bonus = $t03816638322._4
973+ let outInAmountAsset = $t03816638322._5
971974 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
972975 }
973976
10021005 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10031006 if ((unstakeInv == unstakeInv))
10041007 then {
1005- let $t03891239063 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1006- if (($t03891239063 == $t03891239063))
1008+ let $t03922439375 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1009+ if (($t03922439375 == $t03922439375))
10071010 then {
1008- let outInAmountAsset = $t03891239063._5
1009- let bonus = $t03891239063._4
1010- let feeAmount = $t03891239063._3
1011- let commonState = $t03891239063._2
1012- let amountEstimated = $t03891239063._1
1011+ let outInAmountAsset = $t03922439375._5
1012+ let bonus = $t03922439375._4
1013+ let feeAmount = $t03922439375._3
1014+ let commonState = $t03922439375._2
1015+ let amountEstimated = $t03922439375._1
10131016 let amount = if (if ((minOutAmount > 0))
10141017 then (minOutAmount > amountEstimated)
10151018 else false)
10221025 let sendFee = if ((feeAmount > 0))
10231026 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10241027 else nil
1025- let $t03955839805 = {
1028+ let $t03987040117 = {
10261029 let feeAmountForCalc = if ((this == feeCollectorAddress))
10271030 then 0
10281031 else feeAmount
10301033 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10311034 else $Tuple2(0, -((amount + feeAmountForCalc)))
10321035 }
1033- let amountAssetBalanceDelta = $t03955839805._1
1034- let priceAssetBalanceDelta = $t03955839805._2
1035- let $t03980839916 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1036- let refreshKLpActions = $t03980839916._1
1037- let updatedKLp = $t03980839916._2
1036+ let amountAssetBalanceDelta = $t03987040117._1
1037+ let priceAssetBalanceDelta = $t03987040117._2
1038+ let $t04012040228 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1039+ let refreshKLpActions = $t04012040228._1
1040+ let updatedKLp = $t04012040228._2
10381041 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10391042 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10401043 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10631066 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10641067 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10651068 then {
1066- let $t04086440946 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1067- let refreshKLpActions = $t04086440946._1
1068- let updatedKLp = $t04086440946._2
1069+ let $t04117641258 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1070+ let refreshKLpActions = $t04117641258._1
1071+ let updatedKLp = $t04117641258._2
10691072 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10701073 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10711074 then (state ++ refreshKLpActions)
10931096 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10941097 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10951098 then {
1096- let $t04189741978 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1097- let refreshKLpActions = $t04189741978._1
1098- let updatedKLp = $t04189741978._2
1099+ let $t04220942290 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1100+ let refreshKLpActions = $t04220942290._1
1101+ let updatedKLp = $t04220942290._2
10991102 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11001103 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11011104 then (state ++ refreshKLpActions)
11351138 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11361139 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11371140 then {
1138- let $t04310143182 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1139- let refreshKLpActions = $t04310143182._1
1140- let updatedKLp = $t04310143182._2
1141+ let $t04341343494 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1142+ let refreshKLpActions = $t04341343494._1
1143+ let updatedKLp = $t04341343494._2
11411144 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11421145 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11431146 then (state ++ refreshKLpActions)
11841187 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11851188 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11861189 then {
1187- let $t04447444555 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188- let refreshKLpActions = $t04447444555._1
1189- let updatedKLp = $t04447444555._2
1190+ let $t04478644867 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1191+ let refreshKLpActions = $t04478644867._1
1192+ let updatedKLp = $t04478644867._2
11901193 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11911194 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11921195 then (state ++ refreshKLpActions)
12191222 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12201223 then {
12211224 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1222- let $t04574245806 = refreshKLpInternal(0, 0, 0)
1223- let kLpUpdateActions = $t04574245806._1
1224- let updatedKLp = $t04574245806._2
1225+ let $t04605446118 = refreshKLpInternal(0, 0, 0)
1226+ let kLpUpdateActions = $t04605446118._1
1227+ let updatedKLp = $t04605446118._2
12251228 let actions = if ((kLp != updatedKLp))
12261229 then kLpUpdateActions
12271230 else throwErr("nothing to refresh")
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 fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 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]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 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)
223223
224224
225225 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)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 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)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 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))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func calcKLp (amountBalance,priceBalance,lpEmission) = {
377377 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
378378 if ((lpEmission == big0))
379379 then big0
380380 else updatedKLp
381381 }
382382
383383
384384 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
385385 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
386386 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
387387 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
388388 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
389389 currentKLp
390390 }
391391
392392
393393 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
394394 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
395395 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
396396 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
397397 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
398398 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
399399 $Tuple2(actions, updatedKLp)
400400 }
401401
402402
403403 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
404404 then true
405405 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
406406
407407
408408 func validateMatcherOrderAllowed (order) = {
409409 let amountAssetAmount = order.amount
410410 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
411411 let $t02034120553 = if ((order.orderType == Buy))
412412 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
413413 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
414414 let amountAssetBalanceDelta = $t02034120553._1
415415 let priceAssetBalanceDelta = $t02034120553._2
416416 if (if (if (isGlobalShutdown())
417417 then true
418418 else (cfgPoolStatus == PoolMatcherDisabled))
419419 then true
420420 else (cfgPoolStatus == PoolShutdown))
421421 then throw("Exchange operations disabled")
422422 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
423423 then true
424424 else (order.assetPair.priceAsset != cfgPriceAssetId))
425425 then throw("Wrong order assets.")
426426 else {
427427 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
428428 let $t02102421124 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
429429 let unusedActions = $t02102421124._1
430430 let kLpNew = $t02102421124._2
431431 let isOrderValid = (kLpNew >= kLp)
432432 isOrderValid
433433 }
434434 }
435435
436436
437437 func commonGet (i) = if ((size(i.payments) != 1))
438438 then throw("exactly 1 payment is expected")
439439 else {
440440 let pmt = value(i.payments[0])
441441 let pmtAssetId = value(pmt.assetId)
442442 let pmtAmt = pmt.amount
443443 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
444444 let outAmAmt = res._1
445445 let outPrAmt = res._2
446446 let poolStatus = parseIntValue(res._9)
447447 let state = res._10
448448 if (if (isGlobalShutdown())
449449 then true
450450 else (poolStatus == PoolShutdown))
451451 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
452452 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
453453 }
454454
455455
456456 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
457457 then throw("exactly 2 payments are expected")
458458 else {
459459 let amAssetPmt = value(i.payments[0])
460460 let prAssetPmt = value(i.payments[1])
461461 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
462462 let poolStatus = parseIntValue(estPut._8)
463463 if (if (if (isGlobalShutdown())
464464 then true
465465 else (poolStatus == PoolPutDisabled))
466466 then true
467467 else (poolStatus == PoolShutdown))
468468 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
469469 else estPut
470470 }
471471
472472
473473 func emit (amount) = {
474474 let emitInv = invoke(factoryContract, "emit", [amount], nil)
475475 if ((emitInv == emitInv))
476476 then {
477477 let emitInvLegacy = match emitInv {
478478 case legacyFactoryContract: Address =>
479479 invoke(legacyFactoryContract, "emit", [amount], nil)
480480 case _ =>
481481 unit
482482 }
483483 if ((emitInvLegacy == emitInvLegacy))
484484 then amount
485485 else throw("Strict value is not equal to itself.")
486486 }
487487 else throw("Strict value is not equal to itself.")
488488 }
489489
490490
491491 func takeFee (amount) = {
492492 let feeAmount = fraction(amount, fee, scale8)
493493 $Tuple2((amount - feeAmount), feeAmount)
494494 }
495495
496496
497497 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
498498 let isEval = (txId == unit)
499499 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
500500 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
501501 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
502502 then true
503503 else if ((paymentAssetId == cfgPriceAssetId))
504504 then false
505505 else throwErr("invalid asset")
506506 let $t02380924102 = if (isEval)
507507 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
508508 else if (paymentInAmountAsset)
509509 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
510510 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
511511 let amountBalanceOld = $t02380924102._1
512512 let priceBalanceOld = $t02380924102._2
513513 let $t02410624255 = if (paymentInAmountAsset)
514514 then $Tuple2(paymentAmountRaw, 0)
515515 else $Tuple2(0, paymentAmountRaw)
516516 let amountAssetAmountRaw = $t02410624255._1
517517 let priceAssetAmountRaw = $t02410624255._2
518518 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
519519 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
520520 let $t02437724436 = takeFee(paymentAmountRaw)
521521 let paymentAmount = $t02437724436._1
522522 let feeAmount = $t02437724436._2
523523 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
524524 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
525525 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
526526 let priceNew = fromX18(priceNewX18, scale8)
527527 let paymentBalance = if (paymentInAmountAsset)
528528 then amountBalanceOld
529529 else priceBalanceOld
530530 let paymentBalanceBigInt = toBigInt(paymentBalance)
531531 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
532532 let chechSupply = if ((supplyBigInt > big0))
533533 then true
534534 else throwErr("initial deposit requires all coins")
535535 if ((chechSupply == chechSupply))
536536 then {
537537 let depositBigInt = toBigInt(paymentAmount)
538538 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
539539 let commonState = if (isEval)
540540 then nil
541541 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))]
542542 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
543543 let priceOld = fromX18(priceOldX18, scale8)
544544 let loss = {
545545 let $t02591326080 = if (paymentInAmountAsset)
546546 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
547547 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
548548 let amount = $t02591326080._1
549549 let balance = $t02591326080._2
550550 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
551551 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
552552 }
553553 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
554554 }
555555 else throw("Strict value is not equal to itself.")
556556 }
557557
558558
559559 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
560560 let isEval = (txId == unit)
561561 let checks = [if ((paymentAssetId == cfgLpAssetId))
562562 then true
563563 else throwErr("invalid lp asset")]
564564 if ((checks == checks))
565565 then {
566566 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
567567 then true
568568 else if ((outAssetId == cfgPriceAssetId))
569569 then false
570570 else throwErr("invalid asset")
571571 let balanceBigInt = if (outInAmountAsset)
572572 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
573573 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
574574 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
575575 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
576576 let outBalance = if (outInAmountAsset)
577577 then amBalanceOld
578578 else prBalanceOld
579579 let outBalanceBigInt = toBigInt(outBalance)
580580 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
581581 let redeemedBigInt = toBigInt(paymentAmount)
582582 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
583583 let $t02768227732 = takeFee(amountRaw)
584584 let totalAmount = $t02768227732._1
585585 let feeAmount = $t02768227732._2
586586 let $t02773627962 = if (outInAmountAsset)
587587 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
588588 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
589589 let outAmAmount = $t02773627962._1
590590 let outPrAmount = $t02773627962._2
591591 let amBalanceNew = $t02773627962._3
592592 let prBalanceNew = $t02773627962._4
593593 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
594594 let priceNew = fromX18(priceNewX18, scale8)
595595 let commonState = if (isEval)
596596 then nil
597597 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)]
598598 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
599599 let priceOld = fromX18(priceOldX18, scale8)
600600 let loss = {
601601 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
602602 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
603603 }
604604 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
605605 }
606606 else throw("Strict value is not equal to itself.")
607607 }
608608
609609
610610 func managerPublicKeyOrUnit () = match getString(mpk()) {
611611 case s: String =>
612612 fromBase58String(s)
613613 case _: Unit =>
614614 unit
615615 case _ =>
616616 throw("Match error")
617617 }
618618
619619
620620 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621621 case s: String =>
622622 fromBase58String(s)
623623 case _: Unit =>
624624 unit
625625 case _ =>
626626 throw("Match error")
627627 }
628628
629629
630630 func isManager (i) = match managerPublicKeyOrUnit() {
631631 case pk: ByteVector =>
632632 (i.callerPublicKey == pk)
633633 case _: Unit =>
634634 (i.caller == this)
635635 case _ =>
636636 throw("Match error")
637637 }
638638
639639
640640 func mustManager (i) = {
641641 let pd = throw("Permission denied")
642642 match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 if ((i.callerPublicKey == pk))
645645 then true
646646 else pd
647647 case _: Unit =>
648648 if ((i.caller == this))
649649 then true
650650 else pd
651651 case _ =>
652652 throw("Match error")
653653 }
654654 }
655655
656656
657657 @Callable(i)
658658 func setManager (pendingManagerPublicKey) = {
659659 let checkCaller = mustManager(i)
660660 if ((checkCaller == checkCaller))
661661 then {
662662 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663663 if ((checkManagerPublicKey == checkManagerPublicKey))
664664 then [StringEntry(pmpk(), pendingManagerPublicKey)]
665665 else throw("Strict value is not equal to itself.")
666666 }
667667 else throw("Strict value is not equal to itself.")
668668 }
669669
670670
671671
672672 @Callable(i)
673673 func confirmManager () = {
674674 let pm = pendingManagerPublicKeyOrUnit()
675675 let hasPM = if (isDefined(pm))
676676 then true
677677 else throw("No pending manager")
678678 if ((hasPM == hasPM))
679679 then {
680680 let checkPM = if ((i.callerPublicKey == value(pm)))
681681 then true
682682 else throw("You are not pending manager")
683683 if ((checkPM == checkPM))
684684 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685685 else throw("Strict value is not equal to itself.")
686686 }
687687 else throw("Strict value is not equal to itself.")
688688 }
689689
690690
691691
692692 @Callable(i)
693693 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694694 then throw("Invalid slippageTolerance passed")
695695 else {
696696 let estPut = commonPut(i, slippageTolerance, true)
697697 let emitLpAmt = estPut._2
698698 let lpAssetId = estPut._7
699699 let state = estPut._9
700700 let amDiff = estPut._10
701701 let prDiff = estPut._11
702702 let amId = estPut._12
703703 let prId = estPut._13
704704 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
705705 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
706706 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
707707 if ((currentKLp == currentKLp))
708708 then {
709709 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
710710 if ((emitInv == emitInv))
711711 then {
712712 let emitInvLegacy = match emitInv {
713713 case legacyFactoryContract: Address =>
714714 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
715715 case _ =>
716716 unit
717717 }
718718 if ((emitInvLegacy == emitInvLegacy))
719719 then {
720720 let slippageAInv = if ((amDiff > 0))
721721 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
722722 else nil
723723 if ((slippageAInv == slippageAInv))
724724 then {
725725 let slippagePInv = if ((prDiff > 0))
726726 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
727727 else nil
728728 if ((slippagePInv == slippagePInv))
729729 then {
730730 let lpTransfer = if (shouldAutoStake)
731731 then {
732732 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
733733 if ((slpStakeInv == slpStakeInv))
734734 then nil
735735 else throw("Strict value is not equal to itself.")
736736 }
737737 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
738738 let $t03211432179 = refreshKLpInternal(0, 0, 0)
739739 let refreshKLpActions = $t03211432179._1
740740 let updatedKLp = $t03211432179._2
741- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
742- if ((isUpdatedKLpValid == isUpdatedKLpValid))
743- then ((state ++ lpTransfer) ++ refreshKLpActions)
741+ let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt)
742+ let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt)
743+ let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
744+ let error = throwErr(makeString([toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentKLp), toString(updatedKLp)], " "))
745+ if ((error == error))
746+ then {
747+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
748+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
749+ then ((state ++ lpTransfer) ++ refreshKLpActions)
750+ else throw("Strict value is not equal to itself.")
751+ }
744752 else throw("Strict value is not equal to itself.")
745753 }
746754 else throw("Strict value is not equal to itself.")
747755 }
748756 else throw("Strict value is not equal to itself.")
749757 }
750758 else throw("Strict value is not equal to itself.")
751759 }
752760 else throw("Strict value is not equal to itself.")
753761 }
754762 else throw("Strict value is not equal to itself.")
755763 }
756764
757765
758766
759767 @Callable(i)
760768 func putForFree (maxSlippage) = if ((0 > maxSlippage))
761769 then throw("Invalid value passed")
762770 else {
763771 let estPut = commonPut(i, maxSlippage, false)
764772 let state = estPut._9
765773 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
766774 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
767775 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
768776 if ((currentKLp == currentKLp))
769777 then {
770- let $t03274132806 = refreshKLpInternal(0, 0, 0)
771- let refreshKLpActions = $t03274132806._1
772- let updatedKLp = $t03274132806._2
778+ let $t03324533310 = refreshKLpInternal(0, 0, 0)
779+ let refreshKLpActions = $t03324533310._1
780+ let updatedKLp = $t03324533310._2
773781 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
774782 if ((isUpdatedKLpValid == isUpdatedKLpValid))
775783 then (state ++ refreshKLpActions)
776784 else throw("Strict value is not equal to itself.")
777785 }
778786 else throw("Strict value is not equal to itself.")
779787 }
780788
781789
782790
783791 @Callable(i)
784792 func putOneTkn (minOutAmount,autoStake) = {
785793 let isPoolOneTokenOperationsDisabled = {
786794 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
787795 if ($isInstanceOf(@, "Boolean"))
788796 then @
789797 else throw(($getType(@) + " couldn't be cast to Boolean"))
790798 }
791799 let isPutDisabled = if (if (if (isGlobalShutdown())
792800 then true
793801 else (cfgPoolStatus == PoolPutDisabled))
794802 then true
795803 else (cfgPoolStatus == PoolShutdown))
796804 then true
797805 else isPoolOneTokenOperationsDisabled
798806 let checks = [if (if (!(isPutDisabled))
799807 then true
800808 else isManager(i))
801809 then true
802810 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
803811 then true
804812 else throwErr("exactly 1 payment are expected")]
805813 if ((checks == checks))
806814 then {
807815 let payment = i.payments[0]
808816 let paymentAssetId = payment.assetId
809817 let paymentAmountRaw = payment.amount
810818 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
811819 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
812820 else if ((paymentAssetId == cfgPriceAssetId))
813821 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
814822 else throwErr("payment asset is not supported")
815823 let userAddress = i.caller
816824 let txId = i.transactionId
817- let $t03399134143 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
818- if (($t03399134143 == $t03399134143))
825+ let $t03449534647 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
826+ if (($t03449534647 == $t03449534647))
819827 then {
820- let paymentInAmountAsset = $t03399134143._5
821- let bonus = $t03399134143._4
822- let feeAmount = $t03399134143._3
823- let commonState = $t03399134143._2
824- let emitAmountEstimated = $t03399134143._1
828+ let paymentInAmountAsset = $t03449534647._5
829+ let bonus = $t03449534647._4
830+ let feeAmount = $t03449534647._3
831+ let commonState = $t03449534647._2
832+ let emitAmountEstimated = $t03449534647._1
825833 let emitAmount = if (if ((minOutAmount > 0))
826834 then (minOutAmount > emitAmountEstimated)
827835 else false)
828836 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
829837 else emitAmountEstimated
830838 let emitInv = emit(emitAmount)
831839 if ((emitInv == emitInv))
832840 then {
833841 let lpTransfer = if (autoStake)
834842 then {
835843 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
836844 if ((stakeInv == stakeInv))
837845 then nil
838846 else throw("Strict value is not equal to itself.")
839847 }
840848 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
841849 let sendFee = if ((feeAmount > 0))
842850 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
843851 else nil
844- let $t03472934926 = if ((this == feeCollectorAddress))
852+ let $t03523335430 = if ((this == feeCollectorAddress))
845853 then $Tuple2(0, 0)
846854 else if (paymentInAmountAsset)
847855 then $Tuple2(-(feeAmount), 0)
848856 else $Tuple2(0, -(feeAmount))
849- let amountAssetBalanceDelta = $t03472934926._1
850- let priceAssetBalanceDelta = $t03472934926._2
851- let $t03492935037 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
852- let refreshKLpActions = $t03492935037._1
853- let updatedKLp = $t03492935037._2
857+ let amountAssetBalanceDelta = $t03523335430._1
858+ let priceAssetBalanceDelta = $t03523335430._2
859+ let $t03543335541 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
860+ let refreshKLpActions = $t03543335541._1
861+ let updatedKLp = $t03543335541._2
854862 let kLp = value(getString(keyKLp))
855- let error = throwErr(makeString([toString(amountAssetBalanceDelta), toString(priceAssetBalanceDelta), kLp, toString(currentKLp), toString(updatedKLp)], " "))
856- if ((error == error))
857- then {
858- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
859- if ((isUpdatedKLpValid == isUpdatedKLpValid))
860- then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
861- else throw("Strict value is not equal to itself.")
862- }
863+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
864+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
865+ then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
863866 else throw("Strict value is not equal to itself.")
864867 }
865868 else throw("Strict value is not equal to itself.")
866869 }
867870 else throw("Strict value is not equal to itself.")
868871 }
869872 else throw("Strict value is not equal to itself.")
870873 }
871874
872875
873876
874877 @Callable(i)
875878 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
876- let $t03553535692 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
877- let emitAmountEstimated = $t03553535692._1
878- let commonState = $t03553535692._2
879- let feeAmount = $t03553535692._3
880- let bonus = $t03553535692._4
881- let paymentInAmountAsset = $t03553535692._5
879+ let $t03584736004 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
880+ let emitAmountEstimated = $t03584736004._1
881+ let commonState = $t03584736004._2
882+ let feeAmount = $t03584736004._3
883+ let bonus = $t03584736004._4
884+ let paymentInAmountAsset = $t03584736004._5
882885 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
883886 }
884887
885888
886889
887890 @Callable(i)
888891 func getOneTkn (outAssetIdStr,minOutAmount) = {
889892 let isPoolOneTokenOperationsDisabled = {
890893 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
891894 if ($isInstanceOf(@, "Boolean"))
892895 then @
893896 else throw(($getType(@) + " couldn't be cast to Boolean"))
894897 }
895898 let isGetDisabled = if (if (isGlobalShutdown())
896899 then true
897900 else (cfgPoolStatus == PoolShutdown))
898901 then true
899902 else isPoolOneTokenOperationsDisabled
900903 let checks = [if (if (!(isGetDisabled))
901904 then true
902905 else isManager(i))
903906 then true
904907 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
905908 then true
906909 else throwErr("exactly 1 payment are expected")]
907910 if ((checks == checks))
908911 then {
909912 let outAssetId = parseAssetId(outAssetIdStr)
910913 let payment = i.payments[0]
911914 let paymentAssetId = payment.assetId
912915 let paymentAmount = payment.amount
913916 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(paymentAmount))
914917 let userAddress = i.caller
915918 let txId = i.transactionId
916- let $t03658636739 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
917- if (($t03658636739 == $t03658636739))
919+ let $t03689837051 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
920+ if (($t03689837051 == $t03689837051))
918921 then {
919- let outInAmountAsset = $t03658636739._5
920- let bonus = $t03658636739._4
921- let feeAmount = $t03658636739._3
922- let commonState = $t03658636739._2
923- let amountEstimated = $t03658636739._1
922+ let outInAmountAsset = $t03689837051._5
923+ let bonus = $t03689837051._4
924+ let feeAmount = $t03689837051._3
925+ let commonState = $t03689837051._2
926+ let amountEstimated = $t03689837051._1
924927 let amount = if (if ((minOutAmount > 0))
925928 then (minOutAmount > amountEstimated)
926929 else false)
927930 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
928931 else amountEstimated
929932 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
930933 if ((burnInv == burnInv))
931934 then {
932935 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
933936 let sendFee = if ((feeAmount > 0))
934937 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
935938 else nil
936- let $t03723937486 = {
939+ let $t03755137798 = {
937940 let feeAmountForCalc = if ((this == feeCollectorAddress))
938941 then 0
939942 else feeAmount
940943 if (outInAmountAsset)
941944 then $Tuple2(-((amount + feeAmountForCalc)), 0)
942945 else $Tuple2(0, -((amount + feeAmountForCalc)))
943946 }
944- let amountAssetBalanceDelta = $t03723937486._1
945- let priceAssetBalanceDelta = $t03723937486._2
946- let $t03748937597 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
947- let refreshKLpActions = $t03748937597._1
948- let updatedKLp = $t03748937597._2
947+ let amountAssetBalanceDelta = $t03755137798._1
948+ let priceAssetBalanceDelta = $t03755137798._2
949+ let $t03780137909 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
950+ let refreshKLpActions = $t03780137909._1
951+ let updatedKLp = $t03780137909._2
949952 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
950953 if ((isUpdatedKLpValid == isUpdatedKLpValid))
951954 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
952955 else throw("Strict value is not equal to itself.")
953956 }
954957 else throw("Strict value is not equal to itself.")
955958 }
956959 else throw("Strict value is not equal to itself.")
957960 }
958961 else throw("Strict value is not equal to itself.")
959962 }
960963
961964
962965
963966 @Callable(i)
964967 func getOneTknREADONLY (outAssetId,paymentAmount) = {
965- let $t03785438010 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
966- let amountEstimated = $t03785438010._1
967- let commonState = $t03785438010._2
968- let feeAmount = $t03785438010._3
969- let bonus = $t03785438010._4
970- let outInAmountAsset = $t03785438010._5
968+ let $t03816638322 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
969+ let amountEstimated = $t03816638322._1
970+ let commonState = $t03816638322._2
971+ let feeAmount = $t03816638322._3
972+ let bonus = $t03816638322._4
973+ let outInAmountAsset = $t03816638322._5
971974 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
972975 }
973976
974977
975978
976979 @Callable(i)
977980 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
978981 let isPoolOneTokenOperationsDisabled = {
979982 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
980983 if ($isInstanceOf(@, "Boolean"))
981984 then @
982985 else throw(($getType(@) + " couldn't be cast to Boolean"))
983986 }
984987 let isGetDisabled = if (if (isGlobalShutdown())
985988 then true
986989 else (cfgPoolStatus == PoolShutdown))
987990 then true
988991 else isPoolOneTokenOperationsDisabled
989992 let checks = [if (if (!(isGetDisabled))
990993 then true
991994 else isManager(i))
992995 then true
993996 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
994997 then true
995998 else throwErr("no payments are expected")]
996999 if ((checks == checks))
9971000 then {
9981001 let outAssetId = parseAssetId(outAssetIdStr)
9991002 let userAddress = i.caller
10001003 let txId = i.transactionId
10011004 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10021005 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10031006 if ((unstakeInv == unstakeInv))
10041007 then {
1005- let $t03891239063 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1006- if (($t03891239063 == $t03891239063))
1008+ let $t03922439375 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1009+ if (($t03922439375 == $t03922439375))
10071010 then {
1008- let outInAmountAsset = $t03891239063._5
1009- let bonus = $t03891239063._4
1010- let feeAmount = $t03891239063._3
1011- let commonState = $t03891239063._2
1012- let amountEstimated = $t03891239063._1
1011+ let outInAmountAsset = $t03922439375._5
1012+ let bonus = $t03922439375._4
1013+ let feeAmount = $t03922439375._3
1014+ let commonState = $t03922439375._2
1015+ let amountEstimated = $t03922439375._1
10131016 let amount = if (if ((minOutAmount > 0))
10141017 then (minOutAmount > amountEstimated)
10151018 else false)
10161019 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10171020 else amountEstimated
10181021 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10191022 if ((burnInv == burnInv))
10201023 then {
10211024 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10221025 let sendFee = if ((feeAmount > 0))
10231026 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10241027 else nil
1025- let $t03955839805 = {
1028+ let $t03987040117 = {
10261029 let feeAmountForCalc = if ((this == feeCollectorAddress))
10271030 then 0
10281031 else feeAmount
10291032 if (outInAmountAsset)
10301033 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10311034 else $Tuple2(0, -((amount + feeAmountForCalc)))
10321035 }
1033- let amountAssetBalanceDelta = $t03955839805._1
1034- let priceAssetBalanceDelta = $t03955839805._2
1035- let $t03980839916 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1036- let refreshKLpActions = $t03980839916._1
1037- let updatedKLp = $t03980839916._2
1036+ let amountAssetBalanceDelta = $t03987040117._1
1037+ let priceAssetBalanceDelta = $t03987040117._2
1038+ let $t04012040228 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1039+ let refreshKLpActions = $t04012040228._1
1040+ let updatedKLp = $t04012040228._2
10381041 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10391042 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10401043 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10411044 else throw("Strict value is not equal to itself.")
10421045 }
10431046 else throw("Strict value is not equal to itself.")
10441047 }
10451048 else throw("Strict value is not equal to itself.")
10461049 }
10471050 else throw("Strict value is not equal to itself.")
10481051 }
10491052 else throw("Strict value is not equal to itself.")
10501053 }
10511054
10521055
10531056
10541057 @Callable(i)
10551058 func get () = {
10561059 let res = commonGet(i)
10571060 let outAmtAmt = res._1
10581061 let outPrAmt = res._2
10591062 let pmtAmt = res._3
10601063 let pmtAssetId = res._4
10611064 let state = res._5
10621065 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10631066 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10641067 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10651068 then {
1066- let $t04086440946 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1067- let refreshKLpActions = $t04086440946._1
1068- let updatedKLp = $t04086440946._2
1069+ let $t04117641258 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1070+ let refreshKLpActions = $t04117641258._1
1071+ let updatedKLp = $t04117641258._2
10691072 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10701073 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10711074 then (state ++ refreshKLpActions)
10721075 else throw("Strict value is not equal to itself.")
10731076 }
10741077 else throw("Strict value is not equal to itself.")
10751078 }
10761079
10771080
10781081
10791082 @Callable(i)
10801083 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
10811084 let res = commonGet(i)
10821085 let outAmAmt = res._1
10831086 let outPrAmt = res._2
10841087 let pmtAmt = res._3
10851088 let pmtAssetId = res._4
10861089 let state = res._5
10871090 if ((noLessThenAmtAsset > outAmAmt))
10881091 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
10891092 else if ((noLessThenPriceAsset > outPrAmt))
10901093 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
10911094 else {
10921095 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt))
10931096 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10941097 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10951098 then {
1096- let $t04189741978 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1097- let refreshKLpActions = $t04189741978._1
1098- let updatedKLp = $t04189741978._2
1099+ let $t04220942290 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1100+ let refreshKLpActions = $t04220942290._1
1101+ let updatedKLp = $t04220942290._2
10991102 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11001103 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11011104 then (state ++ refreshKLpActions)
11021105 else throw("Strict value is not equal to itself.")
11031106 }
11041107 else throw("Strict value is not equal to itself.")
11051108 }
11061109 }
11071110
11081111
11091112
11101113 @Callable(i)
11111114 func unstakeAndGet (amount) = {
11121115 let checkPayments = if ((size(i.payments) != 0))
11131116 then throw("No payments are expected")
11141117 else true
11151118 if ((checkPayments == checkPayments))
11161119 then {
11171120 let cfg = getPoolConfig()
11181121 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11191122 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11201123 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11211124 if ((unstakeInv == unstakeInv))
11221125 then {
11231126 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11241127 let outAmAmt = res._1
11251128 let outPrAmt = res._2
11261129 let poolStatus = parseIntValue(res._9)
11271130 let state = res._10
11281131 let checkPoolStatus = if (if (isGlobalShutdown())
11291132 then true
11301133 else (poolStatus == PoolShutdown))
11311134 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11321135 else true
11331136 if ((checkPoolStatus == checkPoolStatus))
11341137 then {
11351138 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11361139 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11371140 then {
1138- let $t04310143182 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1139- let refreshKLpActions = $t04310143182._1
1140- let updatedKLp = $t04310143182._2
1141+ let $t04341343494 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1142+ let refreshKLpActions = $t04341343494._1
1143+ let updatedKLp = $t04341343494._2
11411144 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11421145 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11431146 then (state ++ refreshKLpActions)
11441147 else throw("Strict value is not equal to itself.")
11451148 }
11461149 else throw("Strict value is not equal to itself.")
11471150 }
11481151 else throw("Strict value is not equal to itself.")
11491152 }
11501153 else throw("Strict value is not equal to itself.")
11511154 }
11521155 else throw("Strict value is not equal to itself.")
11531156 }
11541157
11551158
11561159
11571160 @Callable(i)
11581161 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11591162 let isGetDisabled = if (isGlobalShutdown())
11601163 then true
11611164 else (cfgPoolStatus == PoolShutdown)
11621165 let checks = [if (!(isGetDisabled))
11631166 then true
11641167 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11651168 then true
11661169 else throw("no payments are expected")]
11671170 if ((checks == checks))
11681171 then {
11691172 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11701173 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
11711174 if ((unstakeInv == unstakeInv))
11721175 then {
11731176 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
11741177 let outAmAmt = res._1
11751178 let outPrAmt = res._2
11761179 let state = res._10
11771180 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
11781181 then true
11791182 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
11801183 then true
11811184 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
11821185 if ((checkAmounts == checkAmounts))
11831186 then {
11841187 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
11851188 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11861189 then {
1187- let $t04447444555 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1188- let refreshKLpActions = $t04447444555._1
1189- let updatedKLp = $t04447444555._2
1190+ let $t04478644867 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1191+ let refreshKLpActions = $t04478644867._1
1192+ let updatedKLp = $t04478644867._2
11901193 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11911194 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11921195 then (state ++ refreshKLpActions)
11931196 else throw("Strict value is not equal to itself.")
11941197 }
11951198 else throw("Strict value is not equal to itself.")
11961199 }
11971200 else throw("Strict value is not equal to itself.")
11981201 }
11991202 else throw("Strict value is not equal to itself.")
12001203 }
12011204 else throw("Strict value is not equal to itself.")
12021205 }
12031206
12041207
12051208
12061209 @Callable(i)
12071210 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12081211 then throw("permissions denied")
12091212 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12101213
12111214
12121215
12131216 @Callable(i)
12141217 func refreshKLp () = {
12151218 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12161219 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12171220 then unit
12181221 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12191222 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12201223 then {
12211224 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1222- let $t04574245806 = refreshKLpInternal(0, 0, 0)
1223- let kLpUpdateActions = $t04574245806._1
1224- let updatedKLp = $t04574245806._2
1225+ let $t04605446118 = refreshKLpInternal(0, 0, 0)
1226+ let kLpUpdateActions = $t04605446118._1
1227+ let updatedKLp = $t04605446118._2
12251228 let actions = if ((kLp != updatedKLp))
12261229 then kLpUpdateActions
12271230 else throwErr("nothing to refresh")
12281231 $Tuple2(actions, toString(updatedKLp))
12291232 }
12301233 else throw("Strict value is not equal to itself.")
12311234 }
12321235
12331236
12341237
12351238 @Callable(i)
12361239 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12371240
12381241
12391242
12401243 @Callable(i)
12411244 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12421245
12431246
12441247
12451248 @Callable(i)
12461249 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12471250 let prices = calcPrices(amAmt, prAmt, lpAmt)
12481251 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12491252 }
12501253
12511254
12521255
12531256 @Callable(i)
12541257 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12551258
12561259
12571260
12581261 @Callable(i)
12591262 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12601263
12611264
12621265
12631266 @Callable(i)
12641267 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
12651268
12661269
12671270
12681271 @Callable(i)
12691272 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
12701273
12711274
12721275
12731276 @Callable(i)
12741277 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
12751278 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
12761279 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
12771280 }
12781281
12791282
12801283
12811284 @Callable(i)
12821285 func statsREADONLY () = {
12831286 let cfg = getPoolConfig()
12841287 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12851288 let amtAssetId = cfg[idxAmtAssetId]
12861289 let priceAssetId = cfg[idxPriceAssetId]
12871290 let iAmtAssetId = cfg[idxIAmtAssetId]
12881291 let iPriceAssetId = cfg[idxIPriceAssetId]
12891292 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12901293 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12911294 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12921295 let accAmtAssetBalance = getAccBalance(amtAssetId)
12931296 let accPriceAssetBalance = getAccBalance(priceAssetId)
12941297 let pricesList = if ((poolLPBalance == 0))
12951298 then [zeroBigInt, zeroBigInt, zeroBigInt]
12961299 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
12971300 let curPrice = 0
12981301 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
12991302 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13001303 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13011304 $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))
13021305 }
13031306
13041307
13051308
13061309 @Callable(i)
13071310 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13081311 let cfg = getPoolConfig()
13091312 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13101313 let amAssetIdStr = cfg[idxAmtAssetId]
13111314 let amAssetId = fromBase58String(amAssetIdStr)
13121315 let prAssetIdStr = cfg[idxPriceAssetId]
13131316 let prAssetId = fromBase58String(prAssetIdStr)
13141317 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13151318 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13161319 let poolStatus = cfg[idxPoolStatus]
13171320 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13181321 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13191322 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13201323 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13211324 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13221325 let curPriceX18 = if ((poolLPBalance == 0))
13231326 then zeroBigInt
13241327 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13251328 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13261329 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13271330 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13281331 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13291332 let calcLpAmt = estPut._1
13301333 let curPriceCalc = estPut._3
13311334 let amBalance = estPut._4
13321335 let prBalance = estPut._5
13331336 let lpEmission = estPut._6
13341337 $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))
13351338 }
13361339
13371340
13381341
13391342 @Callable(i)
13401343 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13411344 let cfg = getPoolConfig()
13421345 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13431346 let amAssetIdStr = cfg[idxAmtAssetId]
13441347 let amAssetId = fromBase58String(amAssetIdStr)
13451348 let prAssetIdStr = cfg[idxPriceAssetId]
13461349 let prAssetId = fromBase58String(prAssetIdStr)
13471350 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13481351 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13491352 let poolStatus = cfg[idxPoolStatus]
13501353 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13511354 let amBalanceRaw = getAccBalance(amAssetIdStr)
13521355 let prBalanceRaw = getAccBalance(prAssetIdStr)
13531356 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13541357 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13551358 let curPriceX18 = if ((poolLPBalance == 0))
13561359 then zeroBigInt
13571360 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13581361 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13591362 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13601363 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13611364 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13621365 let calcLpAmt = estPut._1
13631366 let curPriceCalc = estPut._3
13641367 let amBalance = estPut._4
13651368 let prBalance = estPut._5
13661369 let lpEmission = estPut._6
13671370 $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))
13681371 }
13691372
13701373
13711374
13721375 @Callable(i)
13731376 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
13741377 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
13751378 let outAmAmt = res._1
13761379 let outPrAmt = res._2
13771380 let amBalance = res._5
13781381 let prBalance = res._6
13791382 let lpEmission = res._7
13801383 let curPrice = res._8
13811384 let poolStatus = parseIntValue(res._9)
13821385 $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))
13831386 }
13841387
13851388
13861389 @Verifier(tx)
13871390 func verify () = {
13881391 let targetPublicKey = match managerPublicKeyOrUnit() {
13891392 case pk: ByteVector =>
13901393 pk
13911394 case _: Unit =>
13921395 tx.senderPublicKey
13931396 case _ =>
13941397 throw("Match error")
13951398 }
13961399 match tx {
13971400 case order: Order =>
13981401 let matcherPub = getMatcherPubOrFail()
13991402 let orderValid = validateMatcherOrderAllowed(order)
14001403 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14011404 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14021405 if (if (if (orderValid)
14031406 then senderValid
14041407 else false)
14051408 then matcherValid
14061409 else false)
14071410 then true
14081411 else throwOrderError(orderValid, senderValid, matcherValid)
14091412 case s: SetScriptTransaction =>
14101413 let newHash = blake2b256(value(s.script))
14111414 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14121415 let currentHash = scriptHash(this)
14131416 if (if ((allowedHash == newHash))
14141417 then (currentHash != newHash)
14151418 else false)
14161419 then true
14171420 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14181421 case _ =>
14191422 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14201423 }
14211424 }
14221425

github/deemru/w8io/026f985 
154.79 ms