tx · 3uAE5iqhn5nnvF1rkNd8AMPkbJCxeJFxEZgkmce3x3uy

3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT:  -0.03500000 Waves

2023.01.20 11:51 [2413067] smart account 3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT > SELF 0.00000000 Waves

{ "type": 13, "id": "3uAE5iqhn5nnvF1rkNd8AMPkbJCxeJFxEZgkmce3x3uy", "fee": 3500000, "feeAssetId": null, "timestamp": 1674204705253, "version": 2, "chainId": 84, "sender": "3N7b3kPunHUXhZp1vMG9NhPMARNEprCMWxT", "senderPublicKey": "AYbpHveq7zviKTDV7SGTB1pZGFbkumgfq3jSwVv6BznT", "proofs": [ "XDHPmdGCR9ngcBYcbGrbeQMvwt9CiSY86S4c12bUKm5VqKk92EZbJ8t2gCxP3YLwV2U2zSJDZeCmJUXeYZv1JmT" ], "script": "base64:BgLkLAgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIGc2NhbGU4IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldElkIhlpZHhGYWN0b3J5U3Rha2luZ0NvbnRyYWN0IhppZHhGYWN0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IEVW5pdAgFAmd6D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yBAJkTAUCZ3oDCQABAgUCZEwCBU9yZGVyBAJkaQUCZEwEAmdDCQECYUYABAJnRAkBAmRoAQUCZGkEAmFvCAUCZ0QCXzEEAmFwCAUCZ0QCXzIEAmFxCQD0AwMIBQJkaQlib2R5Qnl0ZXMJAJEDAggFAmRpBnByb29mcwAACAUCZGkPc2VuZGVyUHVibGljS2V5BAJhcgkA9AMDCAUCZGkJYm9keUJ5dGVzCQCRAwIIBQJkaQZwcm9vZnMAAQUCZ0MDAwMFAmFvBQJhcQcFAmFyBwYJAQJhbgQFAmFvBQJhcAUCYXEFAmFyAwkAAQIFAmRMAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZVAFAmRMBAJnRQkA9gMBCQEFdmFsdWUBCAUCZVAGc2NyaXB0BAJnRgkA2wQBCQEFdmFsdWUBCQCdCAIFAmF6CQECYWwABAJnRwkA8QcBBQR0aGlzAwMJAAACBQJnRgUCZ0UJAQIhPQIFAmdHBQJnRQcGCQD0AwMIBQJneglib2R5Qnl0ZXMJAJEDAggFAmd6BnByb29mcwAABQJnQgkA9AMDCAUCZ3oJYm9keUJ5dGVzCQCRAwIIBQJnegZwcm9vZnMAAAUCZ0I9yuVy", "height": 2413067, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8J2Fvf5ScyjQoNhZMJoXNsgfNFkatwhKvfTEwqj55c9t Next: sUT2dHrpzqkj67ZkySpwznuN2BVmxyj5YFNqAXEFstr Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let lPdecimals = 8
5-
64 let scale8 = 100000000
7-
8-let scale8BigInt = toBigInt(100000000)
95
106 let scale18 = toBigInt(1000000000000000000)
117
2016 let wavesString = "WAVES"
2117
2218 let SEP = "__"
23-
24-let PoolActive = 1
2519
2620 let PoolPutDisabled = 2
2721
4741
4842 let idxIPriceAssetId = 9
4943
50-let idxLPAssetDcm = 10
51-
52-let idxPoolAmtAssetAmt = 1
53-
54-let idxPoolPriceAssetAmt = 2
55-
56-let idxPoolLPAssetAmt = 3
57-
5844 let idxFactoryStakingContract = 1
5945
6046 let idxFactorySlippageContract = 7
6955
7056
7157 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
72-
73-
74-func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
75-
76-
77-func abs (val) = if ((0 > val))
78- then -(val)
79- else val
8058
8159
8260 func absBigInt (val) = if ((zeroBigInt > val))
133111 func keyMatcherPub () = "%s%s__matcher__publicKey"
134112
135113
136-func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
137-
138-
139114 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
140115
141116
153128
154129 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
155130
156-func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
131+func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
157132
158133
159134 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
216191
217192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
218193
219-let $t083448510 = poolConfigParsed
194+let $t084088574 = poolConfigParsed
220195
221-let cfgPoolAddress = $t083448510._1
196+let cfgPoolStatus = $t084088574._2
222197
223-let cfgPoolStatus = $t083448510._2
198+let cfgLpAssetId = $t084088574._3
224199
225-let cfgLpAssetId = $t083448510._3
200+let cfgAmountAssetId = $t084088574._4
226201
227-let cfgAmountAssetId = $t083448510._4
202+let cfgPriceAssetId = $t084088574._5
228203
229-let cfgPriceAssetId = $t083448510._5
204+let cfgAmountAssetDecimals = $t084088574._6
230205
231-let cfgAmountAssetDecimals = $t083448510._6
232-
233-let cfgPriceAssetDecimals = $t083448510._7
206+let cfgPriceAssetDecimals = $t084088574._7
234207
235208 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
236209
274247 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
275248 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
276249 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
277- }
278-
279-
280-func calculatePrices (amAmt,prAmt,lpAmt) = {
281- let prices = calcPrices(amAmt, prAmt, lpAmt)
282-[fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
283250 }
284251
285252
433400 func validateMatcherOrderAllowed (order) = {
434401 let amountAssetAmount = order.amount
435402 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
436- let $t02126221474 = if ((order.orderType == Buy))
403+ let $t02132621538 = if ((order.orderType == Buy))
437404 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
438405 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
439- let amountAssetBalanceDelta = $t02126221474._1
440- let priceAssetBalanceDelta = $t02126221474._2
406+ let amountAssetBalanceDelta = $t02132621538._1
407+ let priceAssetBalanceDelta = $t02132621538._2
441408 if (if (if (isGlobalShutdown())
442409 then true
443410 else (cfgPoolStatus == PoolMatcherDisabled))
450417 then throw("Wrong order assets.")
451418 else {
452419 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
453- let $t02194522045 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
454- let unusedActions = $t02194522045._1
455- let kLpNew = $t02194522045._2
420+ let $t02200922109 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
421+ let unusedActions = $t02200922109._1
422+ let kLpNew = $t02200922109._2
423+ let $t02211222174 = refreshKLpInternal(0, 0, 0)
424+ let unusedActions0 = $t02211222174._1
425+ let kLpCurrent = $t02211222174._2
456426 let isOrderValid = (kLpNew >= kLp)
457- isOrderValid
427+ let amountBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
428+ let priceBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
429+ let amountBalanceX18 = toX18(amountBalance, cfgAmountAssetDecimals)
430+ let amountBalanceX18New = (amountBalanceX18 + toX18(amountAssetBalanceDelta, cfgAmountAssetDecimals))
431+ let priceBalanceX18 = toX18(priceBalance, cfgPriceAssetDecimals)
432+ let priceBalanceX18New = (priceBalanceX18 + toX18(priceAssetBalanceDelta, cfgPriceAssetDecimals))
433+ let k = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
434+ let kNew = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
435+ let info = makeString([toString(kLp), toString(kLpNew), toString(k), toString(kNew)], " ")
436+ $Tuple2(isOrderValid, info)
458437 }
459438 }
460439
530509 else if ((paymentAssetId == cfgPriceAssetId))
531510 then false
532511 else throwErr("invalid asset")
533- let $t02476625059 = if (isEval)
512+ let $t02569025983 = if (isEval)
534513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
535514 else if (paymentInAmountAsset)
536515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
537516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
538- let amountBalanceOld = $t02476625059._1
539- let priceBalanceOld = $t02476625059._2
540- let $t02506325212 = if (paymentInAmountAsset)
517+ let amountBalanceOld = $t02569025983._1
518+ let priceBalanceOld = $t02569025983._2
519+ let $t02598726136 = if (paymentInAmountAsset)
541520 then $Tuple2(paymentAmountRaw, 0)
542521 else $Tuple2(0, paymentAmountRaw)
543- let amountAssetAmountRaw = $t02506325212._1
544- let priceAssetAmountRaw = $t02506325212._2
522+ let amountAssetAmountRaw = $t02598726136._1
523+ let priceAssetAmountRaw = $t02598726136._2
545524 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
546525 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
547- let $t02534425408 = takeFee(paymentAmountRaw, inFee)
548- let paymentAmount = $t02534425408._1
549- let feeAmount = $t02534425408._2
526+ let $t02626826332 = takeFee(paymentAmountRaw, inFee)
527+ let paymentAmount = $t02626826332._1
528+ let feeAmount = $t02626826332._2
550529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
551530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
552531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
569548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
570549 let priceOld = fromX18(priceOldX18, scale8)
571550 let loss = {
572- let $t02708927256 = if (paymentInAmountAsset)
551+ let $t02801328180 = if (paymentInAmountAsset)
573552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
574553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
575- let amount = $t02708927256._1
576- let balance = $t02708927256._2
554+ let amount = $t02801328180._1
555+ let balance = $t02801328180._2
577556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
578557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
579558 }
613592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
614593 let redeemedBigInt = toBigInt(paymentAmount)
615594 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
616- let $t02933429390 = takeFee(amountRaw, outFee)
617- let totalAmount = $t02933429390._1
618- let feeAmount = $t02933429390._2
619- let $t02939429620 = if (outInAmountAsset)
595+ let $t03025830314 = takeFee(amountRaw, outFee)
596+ let totalAmount = $t03025830314._1
597+ let feeAmount = $t03025830314._2
598+ let $t03031830544 = if (outInAmountAsset)
620599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
621600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
622- let outAmAmount = $t02939429620._1
623- let outPrAmount = $t02939429620._2
624- let amBalanceNew = $t02939429620._3
625- let prBalanceNew = $t02939429620._4
601+ let outAmAmount = $t03031830544._1
602+ let outPrAmount = $t03031830544._2
603+ let amBalanceNew = $t03031830544._3
604+ let prBalanceNew = $t03031830544._4
626605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
627606 let priceNew = fromX18(priceNewX18, scale8)
628607 let commonState = if (isEval)
768747 else throw("Strict value is not equal to itself.")
769748 }
770749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
771- let $t03414834610 = refreshKLpInternal(0, 0, 0)
772- if (($t03414834610 == $t03414834610))
750+ let $t03507235534 = refreshKLpInternal(0, 0, 0)
751+ if (($t03507235534 == $t03507235534))
773752 then {
774- let updatedKLp = $t03414834610._2
775- let refreshKLpActions = $t03414834610._1
753+ let updatedKLp = $t03507235534._2
754+ let refreshKLpActions = $t03507235534._1
776755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
777756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
778757 then ((state ++ lpTransfer) ++ refreshKLpActions)
804783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
805784 if ((currentKLp == currentKLp))
806785 then {
807- let $t03517235237 = refreshKLpInternal(0, 0, 0)
808- let refreshKLpActions = $t03517235237._1
809- let updatedKLp = $t03517235237._2
786+ let $t03609636161 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03609636161._1
788+ let updatedKLp = $t03609636161._2
810789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
811790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
812791 then (state ++ refreshKLpActions)
853832 then {
854833 let userAddress = i.caller
855834 let txId = i.transactionId
856- let $t03642536577 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
857- if (($t03642536577 == $t03642536577))
835+ let $t03734937501 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03734937501 == $t03734937501))
858837 then {
859- let paymentInAmountAsset = $t03642536577._5
860- let bonus = $t03642536577._4
861- let feeAmount = $t03642536577._3
862- let commonState = $t03642536577._2
863- let emitAmountEstimated = $t03642536577._1
838+ let paymentInAmountAsset = $t03734937501._5
839+ let bonus = $t03734937501._4
840+ let feeAmount = $t03734937501._3
841+ let commonState = $t03734937501._2
842+ let emitAmountEstimated = $t03734937501._1
864843 let emitAmount = if (if ((minOutAmount > 0))
865844 then (minOutAmount > emitAmountEstimated)
866845 else false)
880859 let sendFee = if ((feeAmount > 0))
881860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
882861 else nil
883- let $t03716337360 = if ((this == feeCollectorAddress))
862+ let $t03808738284 = if ((this == feeCollectorAddress))
884863 then $Tuple2(0, 0)
885864 else if (paymentInAmountAsset)
886865 then $Tuple2(-(feeAmount), 0)
887866 else $Tuple2(0, -(feeAmount))
888- let amountAssetBalanceDelta = $t03716337360._1
889- let priceAssetBalanceDelta = $t03716337360._2
890- let $t03736337471 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
891- let refreshKLpActions = $t03736337471._1
892- let updatedKLp = $t03736337471._2
867+ let amountAssetBalanceDelta = $t03808738284._1
868+ let priceAssetBalanceDelta = $t03808738284._2
869+ let $t03828738395 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03828738395._1
871+ let updatedKLp = $t03828738395._2
893872 let kLp = value(getString(keyKLp))
894873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
895874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
909888
910889 @Callable(i)
911890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
912- let $t03777737934 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
913- let emitAmountEstimated = $t03777737934._1
914- let commonState = $t03777737934._2
915- let feeAmount = $t03777737934._3
916- let bonus = $t03777737934._4
917- let paymentInAmountAsset = $t03777737934._5
891+ let $t03870138858 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03870138858._1
893+ let commonState = $t03870138858._2
894+ let feeAmount = $t03870138858._3
895+ let bonus = $t03870138858._4
896+ let paymentInAmountAsset = $t03870138858._5
918897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
919898 }
920899
951930 then {
952931 let userAddress = i.caller
953932 let txId = i.transactionId
954- let $t03881938972 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
955- if (($t03881938972 == $t03881938972))
933+ let $t03974339896 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03974339896 == $t03974339896))
956935 then {
957- let outInAmountAsset = $t03881938972._5
958- let bonus = $t03881938972._4
959- let feeAmount = $t03881938972._3
960- let commonState = $t03881938972._2
961- let amountEstimated = $t03881938972._1
936+ let outInAmountAsset = $t03974339896._5
937+ let bonus = $t03974339896._4
938+ let feeAmount = $t03974339896._3
939+ let commonState = $t03974339896._2
940+ let amountEstimated = $t03974339896._1
962941 let amount = if (if ((minOutAmount > 0))
963942 then (minOutAmount > amountEstimated)
964943 else false)
971950 let sendFee = if ((feeAmount > 0))
972951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
973952 else nil
974- let $t03947239719 = {
953+ let $t04039640643 = {
975954 let feeAmountForCalc = if ((this == feeCollectorAddress))
976955 then 0
977956 else feeAmount
979958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
980959 else $Tuple2(0, -((amount + feeAmountForCalc)))
981960 }
982- let amountAssetBalanceDelta = $t03947239719._1
983- let priceAssetBalanceDelta = $t03947239719._2
984- let $t03972239830 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
985- let refreshKLpActions = $t03972239830._1
986- let updatedKLp = $t03972239830._2
961+ let amountAssetBalanceDelta = $t04039640643._1
962+ let priceAssetBalanceDelta = $t04039640643._2
963+ let $t04064640754 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t04064640754._1
965+ let updatedKLp = $t04064640754._2
987966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
988967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
989968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1002981
1003982 @Callable(i)
1004983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1005- let $t04008740243 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1006- let amountEstimated = $t04008740243._1
1007- let commonState = $t04008740243._2
1008- let feeAmount = $t04008740243._3
1009- let bonus = $t04008740243._4
1010- let outInAmountAsset = $t04008740243._5
984+ let $t04101141167 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t04101141167._1
986+ let commonState = $t04101141167._2
987+ let feeAmount = $t04101141167._3
988+ let bonus = $t04101141167._4
989+ let outInAmountAsset = $t04101141167._5
1011990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
1012991 }
1013992
10441023 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10451024 if ((unstakeInv == unstakeInv))
10461025 then {
1047- let $t04114841299 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1048- if (($t04114841299 == $t04114841299))
1026+ let $t04207242223 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04207242223 == $t04207242223))
10491028 then {
1050- let outInAmountAsset = $t04114841299._5
1051- let bonus = $t04114841299._4
1052- let feeAmount = $t04114841299._3
1053- let commonState = $t04114841299._2
1054- let amountEstimated = $t04114841299._1
1029+ let outInAmountAsset = $t04207242223._5
1030+ let bonus = $t04207242223._4
1031+ let feeAmount = $t04207242223._3
1032+ let commonState = $t04207242223._2
1033+ let amountEstimated = $t04207242223._1
10551034 let amount = if (if ((minOutAmount > 0))
10561035 then (minOutAmount > amountEstimated)
10571036 else false)
10641043 let sendFee = if ((feeAmount > 0))
10651044 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10661045 else nil
1067- let $t04179442041 = {
1046+ let $t04271842965 = {
10681047 let feeAmountForCalc = if ((this == feeCollectorAddress))
10691048 then 0
10701049 else feeAmount
10721051 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10731052 else $Tuple2(0, -((amount + feeAmountForCalc)))
10741053 }
1075- let amountAssetBalanceDelta = $t04179442041._1
1076- let priceAssetBalanceDelta = $t04179442041._2
1077- let $t04204442152 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1078- let refreshKLpActions = $t04204442152._1
1079- let updatedKLp = $t04204442152._2
1054+ let amountAssetBalanceDelta = $t04271842965._1
1055+ let priceAssetBalanceDelta = $t04271842965._2
1056+ let $t04296843076 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04296843076._1
1058+ let updatedKLp = $t04296843076._2
10801059 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10811060 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10821061 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
11091088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11101089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11111090 then {
1112- let $t04309843180 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1113- let refreshKLpActions = $t04309843180._1
1114- let updatedKLp = $t04309843180._2
1091+ let $t04402244104 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04402244104._1
1093+ let updatedKLp = $t04402244104._2
11151094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11161095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11171096 then (state ++ refreshKLpActions)
11431122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11441123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11451124 then {
1146- let $t04412944210 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1147- let refreshKLpActions = $t04412944210._1
1148- let updatedKLp = $t04412944210._2
1125+ let $t04505345134 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04505345134._1
1127+ let updatedKLp = $t04505345134._2
11491128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11501129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11511130 then (state ++ refreshKLpActions)
11891168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11901169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11911170 then {
1192- let $t04533645417 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1193- let refreshKLpActions = $t04533645417._1
1194- let updatedKLp = $t04533645417._2
1171+ let $t04626046341 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04626046341._1
1173+ let updatedKLp = $t04626046341._2
11951174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11961175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11971176 then (state ++ refreshKLpActions)
12421221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12431222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12441223 then {
1245- let $t04671246793 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1246- let refreshKLpActions = $t04671246793._1
1247- let updatedKLp = $t04671246793._2
1224+ let $t04763647717 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04763647717._1
1226+ let updatedKLp = $t04763647717._2
12481227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12491228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12501229 then (state ++ refreshKLpActions)
12791258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12801259 then {
12811260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1282- let $t04798048044 = refreshKLpInternal(0, 0, 0)
1283- let kLpUpdateActions = $t04798048044._1
1284- let updatedKLp = $t04798048044._2
1261+ let $t04890448968 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04890448968._1
1263+ let updatedKLp = $t04890448968._2
12851264 let actions = if ((kLp != updatedKLp))
12861265 then kLpUpdateActions
12871266 else throwErr("nothing to refresh")
14561435 match tx {
14571436 case order: Order =>
14581437 let matcherPub = getMatcherPubOrFail()
1459- let orderValid = validateMatcherOrderAllowed(order)
1438+ let $t05763057699 = validateMatcherOrderAllowed(order)
1439+ let orderValid = $t05763057699._1
1440+ let orderValidInfo = $t05763057699._2
14601441 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14611442 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14621443 if (if (if (orderValid)
14651446 then matcherValid
14661447 else false)
14671448 then true
1468- else throwOrderError(orderValid, senderValid, matcherValid)
1449+ else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
14691450 case s: SetScriptTransaction =>
14701451 let newHash = blake2b256(value(s.script))
14711452 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let lPdecimals = 8
5-
64 let scale8 = 100000000
7-
8-let scale8BigInt = toBigInt(100000000)
95
106 let scale18 = toBigInt(1000000000000000000)
117
128 let zeroBigInt = toBigInt(0)
139
1410 let big0 = toBigInt(0)
1511
1612 let big1 = toBigInt(1)
1713
1814 let big2 = toBigInt(2)
1915
2016 let wavesString = "WAVES"
2117
2218 let SEP = "__"
23-
24-let PoolActive = 1
2519
2620 let PoolPutDisabled = 2
2721
2822 let PoolMatcherDisabled = 3
2923
3024 let PoolShutdown = 4
3125
3226 let idxPoolAddress = 1
3327
3428 let idxPoolStatus = 2
3529
3630 let idxPoolLPAssetId = 3
3731
3832 let idxAmtAssetId = 4
3933
4034 let idxPriceAssetId = 5
4135
4236 let idxAmtAssetDcm = 6
4337
4438 let idxPriceAssetDcm = 7
4539
4640 let idxIAmtAssetId = 8
4741
4842 let idxIPriceAssetId = 9
4943
50-let idxLPAssetDcm = 10
51-
52-let idxPoolAmtAssetAmt = 1
53-
54-let idxPoolPriceAssetAmt = 2
55-
56-let idxPoolLPAssetAmt = 3
57-
5844 let idxFactoryStakingContract = 1
5945
6046 let idxFactorySlippageContract = 7
6147
6248 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6349
6450
6551 func toX18BigInt (origVal,origScaleMult) = fraction(origVal, scale18, origScaleMult)
6652
6753
6854 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6955
7056
7157 func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
72-
73-
74-func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
75-
76-
77-func abs (val) = if ((0 > val))
78- then -(val)
79- else val
8058
8159
8260 func absBigInt (val) = if ((zeroBigInt > val))
8361 then -(val)
8462 else val
8563
8664
8765 func fc () = "%s__factoryContract"
8866
8967
9068 func mpk () = "%s__managerPublicKey"
9169
9270
9371 func pmpk () = "%s__pendingManagerPublicKey"
9472
9573
9674 func pl () = "%s%s__price__last"
9775
9876
9977 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
10078
10179
10280 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
10381
10482
10583 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
10684
10785
10886 func aa () = "%s__amountAsset"
10987
11088
11189 func pa () = "%s__priceAsset"
11290
11391
11492 let keyFee = "%s__fee"
11593
11694 let feeDefault = fraction(10, scale8, 10000)
11795
11896 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
11997
12098 let keyKLp = makeString(["%s", "kLp"], SEP)
12199
122100 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
123101
124102 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
125103
126104 let kLpRefreshDelayDefault = 30
127105
128106 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
129107
130108 func keyFactoryConfig () = "%s__factoryConfig"
131109
132110
133111 func keyMatcherPub () = "%s%s__matcher__publicKey"
134112
135113
136-func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
137-
138-
139114 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
140115
141116
142117 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
143118
144119
145120 func keyAllPoolsShutdown () = "%s__shutdown"
146121
147122
148123 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
149124
150125
151126 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
152127
153128
154129 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
155130
156-func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
131+func throwOrderError (orderValid,orderValidInfo,senderValid,matcherValid) = throw((((((((("order validation failed: orderValid=" + toString(orderValid)) + " (") + orderValidInfo) + ")") + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
157132
158133
159134 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
160135
161136
162137 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
163138
164139
165140 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
166141
167142
168143 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
169144
170145
171146 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
172147
173148 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
174149
175150 let inFee = {
176151 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
177152 if ($isInstanceOf(@, "Int"))
178153 then @
179154 else throw(($getType(@) + " couldn't be cast to Int"))
180155 }
181156
182157 let outFee = {
183158 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
184159 if ($isInstanceOf(@, "Int"))
185160 then @
186161 else throw(($getType(@) + " couldn't be cast to Int"))
187162 }
188163
189164 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
190165
191166
192167 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
193168
194169
195170 func getPoolConfig () = {
196171 let amtAsset = getStringOrFail(this, aa())
197172 let priceAsset = getStringOrFail(this, pa())
198173 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
199174 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
200175 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
201176 }
202177
203178
204179 func parseAssetId (input) = if ((input == wavesString))
205180 then unit
206181 else fromBase58String(input)
207182
208183
209184 func assetIdToString (input) = if ((input == unit))
210185 then wavesString
211186 else toBase58String(value(input))
212187
213188
214189 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]))
215190
216191
217192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
218193
219-let $t083448510 = poolConfigParsed
194+let $t084088574 = poolConfigParsed
220195
221-let cfgPoolAddress = $t083448510._1
196+let cfgPoolStatus = $t084088574._2
222197
223-let cfgPoolStatus = $t083448510._2
198+let cfgLpAssetId = $t084088574._3
224199
225-let cfgLpAssetId = $t083448510._3
200+let cfgAmountAssetId = $t084088574._4
226201
227-let cfgAmountAssetId = $t083448510._4
202+let cfgPriceAssetId = $t084088574._5
228203
229-let cfgPriceAssetId = $t083448510._5
204+let cfgAmountAssetDecimals = $t084088574._6
230205
231-let cfgAmountAssetDecimals = $t083448510._6
232-
233-let cfgPriceAssetDecimals = $t083448510._7
206+let cfgPriceAssetDecimals = $t084088574._7
234207
235208 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
236209
237210
238211 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
239212
240213 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
241214
242215 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)
243216
244217
245218 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)
246219
247220
248221 func getAccBalance (assetId) = if ((assetId == "WAVES"))
249222 then wavesBalance(this).available
250223 else assetBalance(this, fromBase58String(assetId))
251224
252225
253226 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
254227
255228
256229 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
257230
258231
259232 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
260233 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
261234 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
262235 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
263236 }
264237
265238
266239 func calcPrices (amAmt,prAmt,lpAmt) = {
267240 let cfg = getPoolConfig()
268241 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269242 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270243 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
271244 let amAmtX18 = toX18(amAmt, amtAssetDcm)
272245 let prAmtX18 = toX18(prAmt, priceAssetDcm)
273246 let lpAmtX18 = toX18(lpAmt, scale8)
274247 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
275248 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
276249 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
277- }
278-
279-
280-func calculatePrices (amAmt,prAmt,lpAmt) = {
281- let prices = calcPrices(amAmt, prAmt, lpAmt)
282-[fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
283250 }
284251
285252
286253 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
287254 let cfg = getPoolConfig()
288255 let lpAssetId = cfg[idxPoolLPAssetId]
289256 let amAssetId = cfg[idxAmtAssetId]
290257 let prAssetId = cfg[idxPriceAssetId]
291258 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
292259 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
293260 let poolStatus = cfg[idxPoolStatus]
294261 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
295262 if ((lpAssetId != pmtAssetId))
296263 then throw("Invalid asset passed.")
297264 else {
298265 let amBalance = getAccBalance(amAssetId)
299266 let amBalanceX18 = toX18(amBalance, amAssetDcm)
300267 let prBalance = getAccBalance(prAssetId)
301268 let prBalanceX18 = toX18(prBalance, prAssetDcm)
302269 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
303270 let curPrice = fromX18(curPriceX18, scale8)
304271 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
305272 let lpEmissionX18 = toX18(lpEmission, scale8)
306273 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
307274 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
308275 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
309276 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
310277 let state = if ((txId58 == ""))
311278 then nil
312279 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
313280 then unit
314281 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
315282 then unit
316283 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)]
317284 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
318285 }
319286 }
320287
321288
322289 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
323290 let cfg = getPoolConfig()
324291 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
325292 let amAssetIdStr = cfg[idxAmtAssetId]
326293 let prAssetIdStr = cfg[idxPriceAssetId]
327294 let iAmtAssetId = cfg[idxIAmtAssetId]
328295 let iPriceAssetId = cfg[idxIPriceAssetId]
329296 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
330297 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
331298 let poolStatus = cfg[idxPoolStatus]
332299 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
333300 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
334301 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
335302 if (if ((amAssetIdStr != inAmAssetIdStr))
336303 then true
337304 else (prAssetIdStr != inPrAssetIdStr))
338305 then throw("Invalid amt or price asset passed.")
339306 else {
340307 let amBalance = if (isEvaluate)
341308 then getAccBalance(amAssetIdStr)
342309 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
343310 let prBalance = if (isEvaluate)
344311 then getAccBalance(prAssetIdStr)
345312 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
346313 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
347314 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
348315 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
349316 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
350317 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
351318 let res = if ((lpEmission == 0))
352319 then {
353320 let curPriceX18 = zeroBigInt
354321 let slippageX18 = zeroBigInt
355322 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
356323 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
357324 }
358325 else {
359326 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
360327 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
361328 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
362329 if (if ((curPriceX18 != zeroBigInt))
363330 then (slippageX18 > slippageToleranceX18)
364331 else false)
365332 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
366333 else {
367334 let lpEmissionX18 = toX18(lpEmission, scale8)
368335 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
369336 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
370337 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
371338 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
372339 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
373340 let expAmtAssetAmtX18 = expectedAmts._1
374341 let expPriceAssetAmtX18 = expectedAmts._2
375342 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
376343 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
377344 }
378345 }
379346 let calcLpAmt = res._1
380347 let calcAmAssetPmt = res._2
381348 let calcPrAssetPmt = res._3
382349 let curPrice = fromX18(res._4, scale8)
383350 let slippageCalc = fromX18(res._5, scale8)
384351 if ((0 >= calcLpAmt))
385352 then throw("Invalid calculations. LP calculated is less than zero.")
386353 else {
387354 let emitLpAmt = if (!(emitLp))
388355 then 0
389356 else calcLpAmt
390357 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
391358 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
392359 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))]
393360 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
394361 }
395362 }
396363 }
397364
398365
399366 func calcKLp (amountBalance,priceBalance,lpEmission) = {
400367 let amountBalanceX18 = toX18BigInt(amountBalance, toBigInt(cfgAmountAssetDecimals))
401368 let priceBalanceX18 = toX18BigInt(priceBalance, toBigInt(cfgPriceAssetDecimals))
402369 let updatedKLp = fraction(pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
403370 if ((lpEmission == big0))
404371 then big0
405372 else updatedKLp
406373 }
407374
408375
409376 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
410377 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
411378 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
412379 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
413380 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
414381 currentKLp
415382 }
416383
417384
418385 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
419386 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
420387 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
421388 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
422389 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
423390 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
424391 $Tuple2(actions, updatedKLp)
425392 }
426393
427394
428395 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
429396 then true
430397 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
431398
432399
433400 func validateMatcherOrderAllowed (order) = {
434401 let amountAssetAmount = order.amount
435402 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
436- let $t02126221474 = if ((order.orderType == Buy))
403+ let $t02132621538 = if ((order.orderType == Buy))
437404 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
438405 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
439- let amountAssetBalanceDelta = $t02126221474._1
440- let priceAssetBalanceDelta = $t02126221474._2
406+ let amountAssetBalanceDelta = $t02132621538._1
407+ let priceAssetBalanceDelta = $t02132621538._2
441408 if (if (if (isGlobalShutdown())
442409 then true
443410 else (cfgPoolStatus == PoolMatcherDisabled))
444411 then true
445412 else (cfgPoolStatus == PoolShutdown))
446413 then throw("Exchange operations disabled")
447414 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
448415 then true
449416 else (order.assetPair.priceAsset != cfgPriceAssetId))
450417 then throw("Wrong order assets.")
451418 else {
452419 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
453- let $t02194522045 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
454- let unusedActions = $t02194522045._1
455- let kLpNew = $t02194522045._2
420+ let $t02200922109 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
421+ let unusedActions = $t02200922109._1
422+ let kLpNew = $t02200922109._2
423+ let $t02211222174 = refreshKLpInternal(0, 0, 0)
424+ let unusedActions0 = $t02211222174._1
425+ let kLpCurrent = $t02211222174._2
456426 let isOrderValid = (kLpNew >= kLp)
457- isOrderValid
427+ let amountBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
428+ let priceBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
429+ let amountBalanceX18 = toX18(amountBalance, cfgAmountAssetDecimals)
430+ let amountBalanceX18New = (amountBalanceX18 + toX18(amountAssetBalanceDelta, cfgAmountAssetDecimals))
431+ let priceBalanceX18 = toX18(priceBalance, cfgPriceAssetDecimals)
432+ let priceBalanceX18New = (priceBalanceX18 + toX18(priceAssetBalanceDelta, cfgPriceAssetDecimals))
433+ let k = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
434+ let kNew = pow((amountBalanceX18 * priceBalanceX18), 0, toBigInt(5), 1, 18, DOWN)
435+ let info = makeString([toString(kLp), toString(kLpNew), toString(k), toString(kNew)], " ")
436+ $Tuple2(isOrderValid, info)
458437 }
459438 }
460439
461440
462441 func commonGet (i) = if ((size(i.payments) != 1))
463442 then throw("exactly 1 payment is expected")
464443 else {
465444 let pmt = value(i.payments[0])
466445 let pmtAssetId = value(pmt.assetId)
467446 let pmtAmt = pmt.amount
468447 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
469448 let outAmAmt = res._1
470449 let outPrAmt = res._2
471450 let poolStatus = parseIntValue(res._9)
472451 let state = res._10
473452 if (if (isGlobalShutdown())
474453 then true
475454 else (poolStatus == PoolShutdown))
476455 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
477456 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
478457 }
479458
480459
481460 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
482461 then throw("exactly 2 payments are expected")
483462 else {
484463 let amAssetPmt = value(i.payments[0])
485464 let prAssetPmt = value(i.payments[1])
486465 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
487466 let poolStatus = parseIntValue(estPut._8)
488467 if (if (if (isGlobalShutdown())
489468 then true
490469 else (poolStatus == PoolPutDisabled))
491470 then true
492471 else (poolStatus == PoolShutdown))
493472 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
494473 else estPut
495474 }
496475
497476
498477 func emit (amount) = {
499478 let emitInv = invoke(factoryContract, "emit", [amount], nil)
500479 if ((emitInv == emitInv))
501480 then {
502481 let emitInvLegacy = match emitInv {
503482 case legacyFactoryContract: Address =>
504483 invoke(legacyFactoryContract, "emit", [amount], nil)
505484 case _ =>
506485 unit
507486 }
508487 if ((emitInvLegacy == emitInvLegacy))
509488 then amount
510489 else throw("Strict value is not equal to itself.")
511490 }
512491 else throw("Strict value is not equal to itself.")
513492 }
514493
515494
516495 func takeFee (amount,fee) = {
517496 let feeAmount = if ((fee == 0))
518497 then 0
519498 else fraction(amount, fee, scale8)
520499 $Tuple2((amount - feeAmount), feeAmount)
521500 }
522501
523502
524503 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
525504 let isEval = (txId == unit)
526505 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
527506 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
528507 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
529508 then true
530509 else if ((paymentAssetId == cfgPriceAssetId))
531510 then false
532511 else throwErr("invalid asset")
533- let $t02476625059 = if (isEval)
512+ let $t02569025983 = if (isEval)
534513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
535514 else if (paymentInAmountAsset)
536515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
537516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
538- let amountBalanceOld = $t02476625059._1
539- let priceBalanceOld = $t02476625059._2
540- let $t02506325212 = if (paymentInAmountAsset)
517+ let amountBalanceOld = $t02569025983._1
518+ let priceBalanceOld = $t02569025983._2
519+ let $t02598726136 = if (paymentInAmountAsset)
541520 then $Tuple2(paymentAmountRaw, 0)
542521 else $Tuple2(0, paymentAmountRaw)
543- let amountAssetAmountRaw = $t02506325212._1
544- let priceAssetAmountRaw = $t02506325212._2
522+ let amountAssetAmountRaw = $t02598726136._1
523+ let priceAssetAmountRaw = $t02598726136._2
545524 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
546525 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
547- let $t02534425408 = takeFee(paymentAmountRaw, inFee)
548- let paymentAmount = $t02534425408._1
549- let feeAmount = $t02534425408._2
526+ let $t02626826332 = takeFee(paymentAmountRaw, inFee)
527+ let paymentAmount = $t02626826332._1
528+ let feeAmount = $t02626826332._2
550529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
551530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
552531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
553532 let priceNew = fromX18(priceNewX18, scale8)
554533 let paymentBalance = if (paymentInAmountAsset)
555534 then amountBalanceOld
556535 else priceBalanceOld
557536 let paymentBalanceBigInt = toBigInt(paymentBalance)
558537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
559538 let chechSupply = if ((supplyBigInt > big0))
560539 then true
561540 else throwErr("initial deposit requires all coins")
562541 if ((chechSupply == chechSupply))
563542 then {
564543 let depositBigInt = toBigInt(paymentAmount)
565544 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
566545 let commonState = if (isEval)
567546 then nil
568547 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))]
569548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
570549 let priceOld = fromX18(priceOldX18, scale8)
571550 let loss = {
572- let $t02708927256 = if (paymentInAmountAsset)
551+ let $t02801328180 = if (paymentInAmountAsset)
573552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
574553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
575- let amount = $t02708927256._1
576- let balance = $t02708927256._2
554+ let amount = $t02801328180._1
555+ let balance = $t02801328180._2
577556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
578557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
579558 }
580559 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
581560 }
582561 else throw("Strict value is not equal to itself.")
583562 }
584563
585564
586565 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
587566 let isEval = (txId == unit)
588567 let cfg = getPoolConfig()
589568 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
590569 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
591570 let checks = [if ((paymentAssetId == cfgLpAssetId))
592571 then true
593572 else throwErr("invalid lp asset")]
594573 if ((checks == checks))
595574 then {
596575 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
597576 then true
598577 else if ((outAssetId == cfgPriceAssetId))
599578 then false
600579 else throwErr("invalid asset")
601580 let balanceBigInt = if (outInAmountAsset)
602581 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
603582 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
604583 let outInAmountAssetDecimals = if (outInAmountAsset)
605584 then amtAssetDcm
606585 else priceAssetDcm
607586 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
608587 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
609588 let outBalance = if (outInAmountAsset)
610589 then amBalanceOld
611590 else prBalanceOld
612591 let outBalanceBigInt = toBigInt(outBalance)
613592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
614593 let redeemedBigInt = toBigInt(paymentAmount)
615594 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
616- let $t02933429390 = takeFee(amountRaw, outFee)
617- let totalAmount = $t02933429390._1
618- let feeAmount = $t02933429390._2
619- let $t02939429620 = if (outInAmountAsset)
595+ let $t03025830314 = takeFee(amountRaw, outFee)
596+ let totalAmount = $t03025830314._1
597+ let feeAmount = $t03025830314._2
598+ let $t03031830544 = if (outInAmountAsset)
620599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
621600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
622- let outAmAmount = $t02939429620._1
623- let outPrAmount = $t02939429620._2
624- let amBalanceNew = $t02939429620._3
625- let prBalanceNew = $t02939429620._4
601+ let outAmAmount = $t03031830544._1
602+ let outPrAmount = $t03031830544._2
603+ let amBalanceNew = $t03031830544._3
604+ let prBalanceNew = $t03031830544._4
626605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
627606 let priceNew = fromX18(priceNewX18, scale8)
628607 let commonState = if (isEval)
629608 then nil
630609 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)]
631610 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
632611 let priceOld = fromX18(priceOldX18, scale8)
633612 let loss = {
634613 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
635614 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
636615 }
637616 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
638617 }
639618 else throw("Strict value is not equal to itself.")
640619 }
641620
642621
643622 func managerPublicKeyOrUnit () = match getString(mpk()) {
644623 case s: String =>
645624 fromBase58String(s)
646625 case _: Unit =>
647626 unit
648627 case _ =>
649628 throw("Match error")
650629 }
651630
652631
653632 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
654633 case s: String =>
655634 fromBase58String(s)
656635 case _: Unit =>
657636 unit
658637 case _ =>
659638 throw("Match error")
660639 }
661640
662641
663642 func isManager (i) = match managerPublicKeyOrUnit() {
664643 case pk: ByteVector =>
665644 (i.callerPublicKey == pk)
666645 case _: Unit =>
667646 (i.caller == this)
668647 case _ =>
669648 throw("Match error")
670649 }
671650
672651
673652 func mustManager (i) = {
674653 let pd = throw("Permission denied")
675654 match managerPublicKeyOrUnit() {
676655 case pk: ByteVector =>
677656 if ((i.callerPublicKey == pk))
678657 then true
679658 else pd
680659 case _: Unit =>
681660 if ((i.caller == this))
682661 then true
683662 else pd
684663 case _ =>
685664 throw("Match error")
686665 }
687666 }
688667
689668
690669 @Callable(i)
691670 func setManager (pendingManagerPublicKey) = {
692671 let checkCaller = mustManager(i)
693672 if ((checkCaller == checkCaller))
694673 then {
695674 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
696675 if ((checkManagerPublicKey == checkManagerPublicKey))
697676 then [StringEntry(pmpk(), pendingManagerPublicKey)]
698677 else throw("Strict value is not equal to itself.")
699678 }
700679 else throw("Strict value is not equal to itself.")
701680 }
702681
703682
704683
705684 @Callable(i)
706685 func confirmManager () = {
707686 let pm = pendingManagerPublicKeyOrUnit()
708687 let hasPM = if (isDefined(pm))
709688 then true
710689 else throw("No pending manager")
711690 if ((hasPM == hasPM))
712691 then {
713692 let checkPM = if ((i.callerPublicKey == value(pm)))
714693 then true
715694 else throw("You are not pending manager")
716695 if ((checkPM == checkPM))
717696 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
718697 else throw("Strict value is not equal to itself.")
719698 }
720699 else throw("Strict value is not equal to itself.")
721700 }
722701
723702
724703
725704 @Callable(i)
726705 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
727706 then throw("Invalid slippageTolerance passed")
728707 else {
729708 let estPut = commonPut(i, slippageTolerance, true)
730709 let emitLpAmt = estPut._2
731710 let lpAssetId = estPut._7
732711 let state = estPut._9
733712 let amDiff = estPut._10
734713 let prDiff = estPut._11
735714 let amId = estPut._12
736715 let prId = estPut._13
737716 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
738717 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
739718 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
740719 if ((currentKLp == currentKLp))
741720 then {
742721 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
743722 if ((emitInv == emitInv))
744723 then {
745724 let emitInvLegacy = match emitInv {
746725 case legacyFactoryContract: Address =>
747726 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
748727 case _ =>
749728 unit
750729 }
751730 if ((emitInvLegacy == emitInvLegacy))
752731 then {
753732 let slippageAInv = if ((amDiff > 0))
754733 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
755734 else nil
756735 if ((slippageAInv == slippageAInv))
757736 then {
758737 let slippagePInv = if ((prDiff > 0))
759738 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
760739 else nil
761740 if ((slippagePInv == slippagePInv))
762741 then {
763742 let lpTransfer = if (shouldAutoStake)
764743 then {
765744 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
766745 if ((slpStakeInv == slpStakeInv))
767746 then nil
768747 else throw("Strict value is not equal to itself.")
769748 }
770749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
771- let $t03414834610 = refreshKLpInternal(0, 0, 0)
772- if (($t03414834610 == $t03414834610))
750+ let $t03507235534 = refreshKLpInternal(0, 0, 0)
751+ if (($t03507235534 == $t03507235534))
773752 then {
774- let updatedKLp = $t03414834610._2
775- let refreshKLpActions = $t03414834610._1
753+ let updatedKLp = $t03507235534._2
754+ let refreshKLpActions = $t03507235534._1
776755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
777756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
778757 then ((state ++ lpTransfer) ++ refreshKLpActions)
779758 else throw("Strict value is not equal to itself.")
780759 }
781760 else throw("Strict value is not equal to itself.")
782761 }
783762 else throw("Strict value is not equal to itself.")
784763 }
785764 else throw("Strict value is not equal to itself.")
786765 }
787766 else throw("Strict value is not equal to itself.")
788767 }
789768 else throw("Strict value is not equal to itself.")
790769 }
791770 else throw("Strict value is not equal to itself.")
792771 }
793772
794773
795774
796775 @Callable(i)
797776 func putForFree (maxSlippage) = if ((0 > maxSlippage))
798777 then throw("Invalid value passed")
799778 else {
800779 let estPut = commonPut(i, maxSlippage, false)
801780 let state = estPut._9
802781 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
803782 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
804783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
805784 if ((currentKLp == currentKLp))
806785 then {
807- let $t03517235237 = refreshKLpInternal(0, 0, 0)
808- let refreshKLpActions = $t03517235237._1
809- let updatedKLp = $t03517235237._2
786+ let $t03609636161 = refreshKLpInternal(0, 0, 0)
787+ let refreshKLpActions = $t03609636161._1
788+ let updatedKLp = $t03609636161._2
810789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
811790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
812791 then (state ++ refreshKLpActions)
813792 else throw("Strict value is not equal to itself.")
814793 }
815794 else throw("Strict value is not equal to itself.")
816795 }
817796
818797
819798
820799 @Callable(i)
821800 func putOneTkn (minOutAmount,autoStake) = {
822801 let isPoolOneTokenOperationsDisabled = {
823802 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
824803 if ($isInstanceOf(@, "Boolean"))
825804 then @
826805 else throw(($getType(@) + " couldn't be cast to Boolean"))
827806 }
828807 let isPutDisabled = if (if (if (isGlobalShutdown())
829808 then true
830809 else (cfgPoolStatus == PoolPutDisabled))
831810 then true
832811 else (cfgPoolStatus == PoolShutdown))
833812 then true
834813 else isPoolOneTokenOperationsDisabled
835814 let checks = [if (if (!(isPutDisabled))
836815 then true
837816 else isManager(i))
838817 then true
839818 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
840819 then true
841820 else throwErr("exactly 1 payment are expected")]
842821 if ((checks == checks))
843822 then {
844823 let payment = i.payments[0]
845824 let paymentAssetId = payment.assetId
846825 let paymentAmountRaw = payment.amount
847826 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
848827 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
849828 else if ((paymentAssetId == cfgPriceAssetId))
850829 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
851830 else throwErr("payment asset is not supported")
852831 if ((currentKLp == currentKLp))
853832 then {
854833 let userAddress = i.caller
855834 let txId = i.transactionId
856- let $t03642536577 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
857- if (($t03642536577 == $t03642536577))
835+ let $t03734937501 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836+ if (($t03734937501 == $t03734937501))
858837 then {
859- let paymentInAmountAsset = $t03642536577._5
860- let bonus = $t03642536577._4
861- let feeAmount = $t03642536577._3
862- let commonState = $t03642536577._2
863- let emitAmountEstimated = $t03642536577._1
838+ let paymentInAmountAsset = $t03734937501._5
839+ let bonus = $t03734937501._4
840+ let feeAmount = $t03734937501._3
841+ let commonState = $t03734937501._2
842+ let emitAmountEstimated = $t03734937501._1
864843 let emitAmount = if (if ((minOutAmount > 0))
865844 then (minOutAmount > emitAmountEstimated)
866845 else false)
867846 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
868847 else emitAmountEstimated
869848 let emitInv = emit(emitAmount)
870849 if ((emitInv == emitInv))
871850 then {
872851 let lpTransfer = if (autoStake)
873852 then {
874853 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
875854 if ((stakeInv == stakeInv))
876855 then nil
877856 else throw("Strict value is not equal to itself.")
878857 }
879858 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
880859 let sendFee = if ((feeAmount > 0))
881860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
882861 else nil
883- let $t03716337360 = if ((this == feeCollectorAddress))
862+ let $t03808738284 = if ((this == feeCollectorAddress))
884863 then $Tuple2(0, 0)
885864 else if (paymentInAmountAsset)
886865 then $Tuple2(-(feeAmount), 0)
887866 else $Tuple2(0, -(feeAmount))
888- let amountAssetBalanceDelta = $t03716337360._1
889- let priceAssetBalanceDelta = $t03716337360._2
890- let $t03736337471 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
891- let refreshKLpActions = $t03736337471._1
892- let updatedKLp = $t03736337471._2
867+ let amountAssetBalanceDelta = $t03808738284._1
868+ let priceAssetBalanceDelta = $t03808738284._2
869+ let $t03828738395 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870+ let refreshKLpActions = $t03828738395._1
871+ let updatedKLp = $t03828738395._2
893872 let kLp = value(getString(keyKLp))
894873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
895874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
896875 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
897876 else throw("Strict value is not equal to itself.")
898877 }
899878 else throw("Strict value is not equal to itself.")
900879 }
901880 else throw("Strict value is not equal to itself.")
902881 }
903882 else throw("Strict value is not equal to itself.")
904883 }
905884 else throw("Strict value is not equal to itself.")
906885 }
907886
908887
909888
910889 @Callable(i)
911890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
912- let $t03777737934 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
913- let emitAmountEstimated = $t03777737934._1
914- let commonState = $t03777737934._2
915- let feeAmount = $t03777737934._3
916- let bonus = $t03777737934._4
917- let paymentInAmountAsset = $t03777737934._5
891+ let $t03870138858 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892+ let emitAmountEstimated = $t03870138858._1
893+ let commonState = $t03870138858._2
894+ let feeAmount = $t03870138858._3
895+ let bonus = $t03870138858._4
896+ let paymentInAmountAsset = $t03870138858._5
918897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
919898 }
920899
921900
922901
923902 @Callable(i)
924903 func getOneTkn (outAssetIdStr,minOutAmount) = {
925904 let isPoolOneTokenOperationsDisabled = {
926905 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
927906 if ($isInstanceOf(@, "Boolean"))
928907 then @
929908 else throw(($getType(@) + " couldn't be cast to Boolean"))
930909 }
931910 let isGetDisabled = if (if (isGlobalShutdown())
932911 then true
933912 else (cfgPoolStatus == PoolShutdown))
934913 then true
935914 else isPoolOneTokenOperationsDisabled
936915 let checks = [if (if (!(isGetDisabled))
937916 then true
938917 else isManager(i))
939918 then true
940919 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
941920 then true
942921 else throwErr("exactly 1 payment are expected")]
943922 if ((checks == checks))
944923 then {
945924 let outAssetId = parseAssetId(outAssetIdStr)
946925 let payment = i.payments[0]
947926 let paymentAssetId = payment.assetId
948927 let paymentAmount = payment.amount
949928 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
950929 if ((currentKLp == currentKLp))
951930 then {
952931 let userAddress = i.caller
953932 let txId = i.transactionId
954- let $t03881938972 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
955- if (($t03881938972 == $t03881938972))
933+ let $t03974339896 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934+ if (($t03974339896 == $t03974339896))
956935 then {
957- let outInAmountAsset = $t03881938972._5
958- let bonus = $t03881938972._4
959- let feeAmount = $t03881938972._3
960- let commonState = $t03881938972._2
961- let amountEstimated = $t03881938972._1
936+ let outInAmountAsset = $t03974339896._5
937+ let bonus = $t03974339896._4
938+ let feeAmount = $t03974339896._3
939+ let commonState = $t03974339896._2
940+ let amountEstimated = $t03974339896._1
962941 let amount = if (if ((minOutAmount > 0))
963942 then (minOutAmount > amountEstimated)
964943 else false)
965944 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
966945 else amountEstimated
967946 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
968947 if ((burnInv == burnInv))
969948 then {
970949 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
971950 let sendFee = if ((feeAmount > 0))
972951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
973952 else nil
974- let $t03947239719 = {
953+ let $t04039640643 = {
975954 let feeAmountForCalc = if ((this == feeCollectorAddress))
976955 then 0
977956 else feeAmount
978957 if (outInAmountAsset)
979958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
980959 else $Tuple2(0, -((amount + feeAmountForCalc)))
981960 }
982- let amountAssetBalanceDelta = $t03947239719._1
983- let priceAssetBalanceDelta = $t03947239719._2
984- let $t03972239830 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
985- let refreshKLpActions = $t03972239830._1
986- let updatedKLp = $t03972239830._2
961+ let amountAssetBalanceDelta = $t04039640643._1
962+ let priceAssetBalanceDelta = $t04039640643._2
963+ let $t04064640754 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964+ let refreshKLpActions = $t04064640754._1
965+ let updatedKLp = $t04064640754._2
987966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
988967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
989968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
990969 else throw("Strict value is not equal to itself.")
991970 }
992971 else throw("Strict value is not equal to itself.")
993972 }
994973 else throw("Strict value is not equal to itself.")
995974 }
996975 else throw("Strict value is not equal to itself.")
997976 }
998977 else throw("Strict value is not equal to itself.")
999978 }
1000979
1001980
1002981
1003982 @Callable(i)
1004983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
1005- let $t04008740243 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
1006- let amountEstimated = $t04008740243._1
1007- let commonState = $t04008740243._2
1008- let feeAmount = $t04008740243._3
1009- let bonus = $t04008740243._4
1010- let outInAmountAsset = $t04008740243._5
984+ let $t04101141167 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985+ let amountEstimated = $t04101141167._1
986+ let commonState = $t04101141167._2
987+ let feeAmount = $t04101141167._3
988+ let bonus = $t04101141167._4
989+ let outInAmountAsset = $t04101141167._5
1011990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
1012991 }
1013992
1014993
1015994
1016995 @Callable(i)
1017996 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
1018997 let isPoolOneTokenOperationsDisabled = {
1019998 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1020999 if ($isInstanceOf(@, "Boolean"))
10211000 then @
10221001 else throw(($getType(@) + " couldn't be cast to Boolean"))
10231002 }
10241003 let isGetDisabled = if (if (isGlobalShutdown())
10251004 then true
10261005 else (cfgPoolStatus == PoolShutdown))
10271006 then true
10281007 else isPoolOneTokenOperationsDisabled
10291008 let checks = [if (if (!(isGetDisabled))
10301009 then true
10311010 else isManager(i))
10321011 then true
10331012 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10341013 then true
10351014 else throwErr("no payments are expected")]
10361015 if ((checks == checks))
10371016 then {
10381017 let outAssetId = parseAssetId(outAssetIdStr)
10391018 let userAddress = i.caller
10401019 let txId = i.transactionId
10411020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10421021 if ((currentKLp == currentKLp))
10431022 then {
10441023 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10451024 if ((unstakeInv == unstakeInv))
10461025 then {
1047- let $t04114841299 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1048- if (($t04114841299 == $t04114841299))
1026+ let $t04207242223 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04207242223 == $t04207242223))
10491028 then {
1050- let outInAmountAsset = $t04114841299._5
1051- let bonus = $t04114841299._4
1052- let feeAmount = $t04114841299._3
1053- let commonState = $t04114841299._2
1054- let amountEstimated = $t04114841299._1
1029+ let outInAmountAsset = $t04207242223._5
1030+ let bonus = $t04207242223._4
1031+ let feeAmount = $t04207242223._3
1032+ let commonState = $t04207242223._2
1033+ let amountEstimated = $t04207242223._1
10551034 let amount = if (if ((minOutAmount > 0))
10561035 then (minOutAmount > amountEstimated)
10571036 else false)
10581037 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
10591038 else amountEstimated
10601039 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10611040 if ((burnInv == burnInv))
10621041 then {
10631042 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
10641043 let sendFee = if ((feeAmount > 0))
10651044 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
10661045 else nil
1067- let $t04179442041 = {
1046+ let $t04271842965 = {
10681047 let feeAmountForCalc = if ((this == feeCollectorAddress))
10691048 then 0
10701049 else feeAmount
10711050 if (outInAmountAsset)
10721051 then $Tuple2(-((amount + feeAmountForCalc)), 0)
10731052 else $Tuple2(0, -((amount + feeAmountForCalc)))
10741053 }
1075- let amountAssetBalanceDelta = $t04179442041._1
1076- let priceAssetBalanceDelta = $t04179442041._2
1077- let $t04204442152 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1078- let refreshKLpActions = $t04204442152._1
1079- let updatedKLp = $t04204442152._2
1054+ let amountAssetBalanceDelta = $t04271842965._1
1055+ let priceAssetBalanceDelta = $t04271842965._2
1056+ let $t04296843076 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04296843076._1
1058+ let updatedKLp = $t04296843076._2
10801059 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10811060 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10821061 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
10831062 else throw("Strict value is not equal to itself.")
10841063 }
10851064 else throw("Strict value is not equal to itself.")
10861065 }
10871066 else throw("Strict value is not equal to itself.")
10881067 }
10891068 else throw("Strict value is not equal to itself.")
10901069 }
10911070 else throw("Strict value is not equal to itself.")
10921071 }
10931072 else throw("Strict value is not equal to itself.")
10941073 }
10951074
10961075
10971076
10981077 @Callable(i)
10991078 func get () = {
11001079 let res = commonGet(i)
11011080 let outAmtAmt = res._1
11021081 let outPrAmt = res._2
11031082 let pmtAmt = res._3
11041083 let pmtAssetId = res._4
11051084 let state = res._5
11061085 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11071086 if ((currentKLp == currentKLp))
11081087 then {
11091088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11101089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11111090 then {
1112- let $t04309843180 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1113- let refreshKLpActions = $t04309843180._1
1114- let updatedKLp = $t04309843180._2
1091+ let $t04402244104 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04402244104._1
1093+ let updatedKLp = $t04402244104._2
11151094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11161095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11171096 then (state ++ refreshKLpActions)
11181097 else throw("Strict value is not equal to itself.")
11191098 }
11201099 else throw("Strict value is not equal to itself.")
11211100 }
11221101 else throw("Strict value is not equal to itself.")
11231102 }
11241103
11251104
11261105
11271106 @Callable(i)
11281107 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11291108 let res = commonGet(i)
11301109 let outAmAmt = res._1
11311110 let outPrAmt = res._2
11321111 let pmtAmt = res._3
11331112 let pmtAssetId = res._4
11341113 let state = res._5
11351114 if ((noLessThenAmtAsset > outAmAmt))
11361115 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11371116 else if ((noLessThenPriceAsset > outPrAmt))
11381117 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11391118 else {
11401119 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11411120 if ((currentKLp == currentKLp))
11421121 then {
11431122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11441123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11451124 then {
1146- let $t04412944210 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1147- let refreshKLpActions = $t04412944210._1
1148- let updatedKLp = $t04412944210._2
1125+ let $t04505345134 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04505345134._1
1127+ let updatedKLp = $t04505345134._2
11491128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11501129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11511130 then (state ++ refreshKLpActions)
11521131 else throw("Strict value is not equal to itself.")
11531132 }
11541133 else throw("Strict value is not equal to itself.")
11551134 }
11561135 else throw("Strict value is not equal to itself.")
11571136 }
11581137 }
11591138
11601139
11611140
11621141 @Callable(i)
11631142 func unstakeAndGet (amount) = {
11641143 let checkPayments = if ((size(i.payments) != 0))
11651144 then throw("No payments are expected")
11661145 else true
11671146 if ((checkPayments == checkPayments))
11681147 then {
11691148 let cfg = getPoolConfig()
11701149 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11711150 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11721151 if ((currentKLp == currentKLp))
11731152 then {
11741153 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11751154 if ((unstakeInv == unstakeInv))
11761155 then {
11771156 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11781157 let outAmAmt = res._1
11791158 let outPrAmt = res._2
11801159 let poolStatus = parseIntValue(res._9)
11811160 let state = res._10
11821161 let checkPoolStatus = if (if (isGlobalShutdown())
11831162 then true
11841163 else (poolStatus == PoolShutdown))
11851164 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11861165 else true
11871166 if ((checkPoolStatus == checkPoolStatus))
11881167 then {
11891168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11901169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11911170 then {
1192- let $t04533645417 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1193- let refreshKLpActions = $t04533645417._1
1194- let updatedKLp = $t04533645417._2
1171+ let $t04626046341 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04626046341._1
1173+ let updatedKLp = $t04626046341._2
11951174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11961175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11971176 then (state ++ refreshKLpActions)
11981177 else throw("Strict value is not equal to itself.")
11991178 }
12001179 else throw("Strict value is not equal to itself.")
12011180 }
12021181 else throw("Strict value is not equal to itself.")
12031182 }
12041183 else throw("Strict value is not equal to itself.")
12051184 }
12061185 else throw("Strict value is not equal to itself.")
12071186 }
12081187 else throw("Strict value is not equal to itself.")
12091188 }
12101189
12111190
12121191
12131192 @Callable(i)
12141193 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
12151194 let isGetDisabled = if (isGlobalShutdown())
12161195 then true
12171196 else (cfgPoolStatus == PoolShutdown)
12181197 let checks = [if (!(isGetDisabled))
12191198 then true
12201199 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
12211200 then true
12221201 else throw("no payments are expected")]
12231202 if ((checks == checks))
12241203 then {
12251204 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12261205 if ((currentKLp == currentKLp))
12271206 then {
12281207 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12291208 if ((unstakeInv == unstakeInv))
12301209 then {
12311210 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12321211 let outAmAmt = res._1
12331212 let outPrAmt = res._2
12341213 let state = res._10
12351214 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12361215 then true
12371216 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12381217 then true
12391218 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12401219 if ((checkAmounts == checkAmounts))
12411220 then {
12421221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12431222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12441223 then {
1245- let $t04671246793 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1246- let refreshKLpActions = $t04671246793._1
1247- let updatedKLp = $t04671246793._2
1224+ let $t04763647717 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04763647717._1
1226+ let updatedKLp = $t04763647717._2
12481227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12491228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12501229 then (state ++ refreshKLpActions)
12511230 else throw("Strict value is not equal to itself.")
12521231 }
12531232 else throw("Strict value is not equal to itself.")
12541233 }
12551234 else throw("Strict value is not equal to itself.")
12561235 }
12571236 else throw("Strict value is not equal to itself.")
12581237 }
12591238 else throw("Strict value is not equal to itself.")
12601239 }
12611240 else throw("Strict value is not equal to itself.")
12621241 }
12631242
12641243
12651244
12661245 @Callable(i)
12671246 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12681247 then throw("permissions denied")
12691248 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12701249
12711250
12721251
12731252 @Callable(i)
12741253 func refreshKLp () = {
12751254 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12761255 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12771256 then unit
12781257 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12791258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12801259 then {
12811260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1282- let $t04798048044 = refreshKLpInternal(0, 0, 0)
1283- let kLpUpdateActions = $t04798048044._1
1284- let updatedKLp = $t04798048044._2
1261+ let $t04890448968 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04890448968._1
1263+ let updatedKLp = $t04890448968._2
12851264 let actions = if ((kLp != updatedKLp))
12861265 then kLpUpdateActions
12871266 else throwErr("nothing to refresh")
12881267 $Tuple2(actions, toString(updatedKLp))
12891268 }
12901269 else throw("Strict value is not equal to itself.")
12911270 }
12921271
12931272
12941273
12951274 @Callable(i)
12961275 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12971276
12981277
12991278
13001279 @Callable(i)
13011280 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
13021281
13031282
13041283
13051284 @Callable(i)
13061285 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
13071286 let prices = calcPrices(amAmt, prAmt, lpAmt)
13081287 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
13091288 }
13101289
13111290
13121291
13131292 @Callable(i)
13141293 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
13151294
13161295
13171296
13181297 @Callable(i)
13191298 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
13201299
13211300
13221301
13231302 @Callable(i)
13241303 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13251304
13261305
13271306
13281307 @Callable(i)
13291308 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
13301309
13311310
13321311
13331312 @Callable(i)
13341313 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
13351314 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13361315 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13371316 }
13381317
13391318
13401319
13411320 @Callable(i)
13421321 func statsREADONLY () = {
13431322 let cfg = getPoolConfig()
13441323 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13451324 let amtAssetId = cfg[idxAmtAssetId]
13461325 let priceAssetId = cfg[idxPriceAssetId]
13471326 let iAmtAssetId = cfg[idxIAmtAssetId]
13481327 let iPriceAssetId = cfg[idxIPriceAssetId]
13491328 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13501329 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13511330 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13521331 let accAmtAssetBalance = getAccBalance(amtAssetId)
13531332 let accPriceAssetBalance = getAccBalance(priceAssetId)
13541333 let pricesList = if ((poolLPBalance == 0))
13551334 then [zeroBigInt, zeroBigInt, zeroBigInt]
13561335 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13571336 let curPrice = 0
13581337 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13591338 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13601339 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13611340 $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))
13621341 }
13631342
13641343
13651344
13661345 @Callable(i)
13671346 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13681347 let cfg = getPoolConfig()
13691348 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13701349 let amAssetIdStr = cfg[idxAmtAssetId]
13711350 let amAssetId = fromBase58String(amAssetIdStr)
13721351 let prAssetIdStr = cfg[idxPriceAssetId]
13731352 let prAssetId = fromBase58String(prAssetIdStr)
13741353 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13751354 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13761355 let poolStatus = cfg[idxPoolStatus]
13771356 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13781357 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13791358 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13801359 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13811360 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13821361 let curPriceX18 = if ((poolLPBalance == 0))
13831362 then zeroBigInt
13841363 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13851364 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13861365 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13871366 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13881367 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13891368 let calcLpAmt = estPut._1
13901369 let curPriceCalc = estPut._3
13911370 let amBalance = estPut._4
13921371 let prBalance = estPut._5
13931372 let lpEmission = estPut._6
13941373 $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))
13951374 }
13961375
13971376
13981377
13991378 @Callable(i)
14001379 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
14011380 let cfg = getPoolConfig()
14021381 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
14031382 let amAssetIdStr = cfg[idxAmtAssetId]
14041383 let amAssetId = fromBase58String(amAssetIdStr)
14051384 let prAssetIdStr = cfg[idxPriceAssetId]
14061385 let prAssetId = fromBase58String(prAssetIdStr)
14071386 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
14081387 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
14091388 let poolStatus = cfg[idxPoolStatus]
14101389 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
14111390 let amBalanceRaw = getAccBalance(amAssetIdStr)
14121391 let prBalanceRaw = getAccBalance(prAssetIdStr)
14131392 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
14141393 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
14151394 let curPriceX18 = if ((poolLPBalance == 0))
14161395 then zeroBigInt
14171396 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
14181397 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
14191398 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
14201399 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
14211400 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
14221401 let calcLpAmt = estPut._1
14231402 let curPriceCalc = estPut._3
14241403 let amBalance = estPut._4
14251404 let prBalance = estPut._5
14261405 let lpEmission = estPut._6
14271406 $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))
14281407 }
14291408
14301409
14311410
14321411 @Callable(i)
14331412 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
14341413 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
14351414 let outAmAmt = res._1
14361415 let outPrAmt = res._2
14371416 let amBalance = res._5
14381417 let prBalance = res._6
14391418 let lpEmission = res._7
14401419 let curPrice = res._8
14411420 let poolStatus = parseIntValue(res._9)
14421421 $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))
14431422 }
14441423
14451424
14461425 @Verifier(tx)
14471426 func verify () = {
14481427 let targetPublicKey = match managerPublicKeyOrUnit() {
14491428 case pk: ByteVector =>
14501429 pk
14511430 case _: Unit =>
14521431 tx.senderPublicKey
14531432 case _ =>
14541433 throw("Match error")
14551434 }
14561435 match tx {
14571436 case order: Order =>
14581437 let matcherPub = getMatcherPubOrFail()
1459- let orderValid = validateMatcherOrderAllowed(order)
1438+ let $t05763057699 = validateMatcherOrderAllowed(order)
1439+ let orderValid = $t05763057699._1
1440+ let orderValidInfo = $t05763057699._2
14601441 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14611442 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14621443 if (if (if (orderValid)
14631444 then senderValid
14641445 else false)
14651446 then matcherValid
14661447 else false)
14671448 then true
1468- else throwOrderError(orderValid, senderValid, matcherValid)
1449+ else throwOrderError(orderValid, orderValidInfo, senderValid, matcherValid)
14691450 case s: SetScriptTransaction =>
14701451 let newHash = blake2b256(value(s.script))
14711452 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14721453 let currentHash = scriptHash(this)
14731454 if (if ((allowedHash == newHash))
14741455 then (currentHash != newHash)
14751456 else false)
14761457 then true
14771458 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14781459 case _ =>
14791460 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14801461 }
14811462 }
14821463

github/deemru/w8io/026f985 
220.20 ms