tx · buDa9GXgPvv9fj5bmEYdHRL4rWtrh8RLXNf1yujm8QS

3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2:  -0.03100000 Waves

2023.01.18 14:39 [2410321] smart account 3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2 > SELF 0.00000000 Waves

{ "type": 13, "id": "buDa9GXgPvv9fj5bmEYdHRL4rWtrh8RLXNf1yujm8QS", "fee": 3100000, "feeAssetId": null, "timestamp": 1674041974000, "version": 1, "sender": "3N4vUDe3oc1YPNwMyQi2h8f2tmGoA7wBZp2", "senderPublicKey": "6MuWw1pkme7UgQX2hZh8yTZyoWVkz8A4rmHZ1acrsrVm", "proofs": [ "74RdyMETZC6Rakk7ukVbQa77GaPa1acteByK3Byq6QpNPHe19KQMozZw1qjeV3V4iJ3soqkhhJmBYnxMszCqmVh" ], "script": "base64:BgK3JwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldEl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J5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAAgFAmNSD3NlbmRlclB1YmxpY0tleQQCYXQJAPQDAwgFAmNSCWJvZHlCeXRlcwkAkQMCCAUCY1IGcHJvb2ZzAAEFAmZMAwMDBQJhcgUCYXMHBQJhdAcGCQECYXEDBQJhcgUCYXMFAmF0AwkAAQIFAmRxAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXcFAmRxBAJmTQkA9gMBCQEFdmFsdWUBCAUCZXcGc2NyaXB0BAJmTgkA2wQBCQEFdmFsdWUBCQCdCAIFAmFBCQECYW8ABAJmTwkA8QcBBQR0aGlzAwMJAAACBQJmTgUCZk0JAQIhPQIFAmZPBQJmTQcGCQD0AwMIBQJmSQlib2R5Qnl0ZXMJAJEDAggFAmZJBnByb29mcwAABQJmSwkA9AMDCAUCZkkJYm9keUJ5dGVzCQCRAwIIBQJmSQZwcm9vZnMAAAUCZkvBwFdz", "chainId": 84, "height": 2410321, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7Zeh3WizMouDfg2BvyWTG7sx8KsEaFzLXz8BUXeUTxG3 Next: Dbd6rkXddZJpmEittg1gUgGc7dPiUg9mfRKzeNbd7MRH Diff:
OldNewDifferences
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
79-
80-
81-func swapContract () = "%s__swapContract"
8279
8380
8481 func fc () = "%s__factoryContract"
194191
195192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
196193
197-let $t076627828 = poolConfigParsed
194+let $t076017767 = poolConfigParsed
198195
199-let cfgPoolAddress = $t076627828._1
196+let cfgPoolAddress = $t076017767._1
200197
201-let cfgPoolStatus = $t076627828._2
198+let cfgPoolStatus = $t076017767._2
202199
203-let cfgLpAssetId = $t076627828._3
200+let cfgLpAssetId = $t076017767._3
204201
205-let cfgAmountAssetId = $t076627828._4
202+let cfgAmountAssetId = $t076017767._4
206203
207-let cfgPriceAssetId = $t076627828._5
204+let cfgPriceAssetId = $t076017767._5
208205
209-let cfgAmountAssetDecimals = $t076627828._6
206+let cfgAmountAssetDecimals = $t076017767._6
210207
211-let cfgPriceAssetDecimals = $t076627828._7
208+let cfgPriceAssetDecimals = $t076017767._7
212209
213210 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
214211
487484 else if ((paymentAssetId == cfgPriceAssetId))
488485 then false
489486 else throwErr("invalid asset")
490- let $t02272523018 = if (isEval)
487+ let $t02266422957 = if (isEval)
491488 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492489 else if (paymentInAmountAsset)
493490 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494491 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495- let amountBalanceOld = $t02272523018._1
496- let priceBalanceOld = $t02272523018._2
497- let $t02302223171 = if (paymentInAmountAsset)
492+ let amountBalanceOld = $t02266422957._1
493+ let priceBalanceOld = $t02266422957._2
494+ let $t02296123110 = if (paymentInAmountAsset)
498495 then $Tuple2(paymentAmountRaw, 0)
499496 else $Tuple2(0, paymentAmountRaw)
500- let amountAssetAmountRaw = $t02302223171._1
501- let priceAssetAmountRaw = $t02302223171._2
497+ let amountAssetAmountRaw = $t02296123110._1
498+ let priceAssetAmountRaw = $t02296123110._2
502499 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
503500 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
504- let $t02330323367 = takeFee(paymentAmountRaw, inFee)
505- let paymentAmount = $t02330323367._1
506- let feeAmount = $t02330323367._2
501+ let $t02324223306 = takeFee(paymentAmountRaw, inFee)
502+ let paymentAmount = $t02324223306._1
503+ let feeAmount = $t02324223306._2
507504 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508505 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509506 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
526523 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527524 let priceOld = fromX18(priceOldX18, scale8)
528525 let loss = {
529- let $t02484425011 = if (paymentInAmountAsset)
526+ let $t02478324950 = if (paymentInAmountAsset)
530527 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531528 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532- let amount = $t02484425011._1
533- let balance = $t02484425011._2
529+ let amount = $t02478324950._1
530+ let balance = $t02478324950._2
534531 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535532 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536533 }
564561 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565562 let redeemedBigInt = toBigInt(paymentAmount)
566563 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567- let $t02659126647 = takeFee(amountRaw, outFee)
568- let totalAmount = $t02659126647._1
569- let feeAmount = $t02659126647._2
570- let $t02665126877 = if (outInAmountAsset)
564+ let $t02653026586 = takeFee(amountRaw, outFee)
565+ let totalAmount = $t02653026586._1
566+ let feeAmount = $t02653026586._2
567+ let $t02659026816 = if (outInAmountAsset)
571568 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572569 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573- let outAmAmount = $t02665126877._1
574- let outPrAmount = $t02665126877._2
575- let amBalanceNew = $t02665126877._3
576- let prBalanceNew = $t02665126877._4
570+ let outAmAmount = $t02659026816._1
571+ let outPrAmount = $t02659026816._2
572+ let amBalanceNew = $t02659026816._3
573+ let prBalanceNew = $t02659026816._4
577574 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578575 let priceNew = fromX18(priceNewX18, scale8)
579576 let commonState = if (isEval)
636633 throw("Match error")
637634 }
638635 }
639-
640-
641-@Callable(i)
642-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
643- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
644- then true
645- else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(getStringOrFail(this, swapContract()))))
646- then true
647- else throwErr("Permission denied")]
648- if ((checks == checks))
649- then {
650- let pmt = value(i.payments[0])
651- let assetIn = toBase58String(value(pmt.assetId))
652- let assetOut = if ((isReverse == false))
653- then {
654- let assetOut = getStringOrFail(this, pa())
655- assetOut
656- }
657- else {
658- let assetOut = getStringOrFail(this, aa())
659- assetOut
660- }
661- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
662- let poolAssetOutBalance = getAccBalance(assetOut)
663- let amountOut = ((poolAssetOutBalance * cleanAmountIn) / (poolAssetInBalance + cleanAmountIn))
664- let checkMin = [(amountOut >= amountOutMin), "Exchange resulted in fewer coins than expected"]
665- if ((checkMin == checkMin))
666- then [ScriptTransfer(addressFromStringValue(addressTo), amountOut, fromBase58String(assetOut))]
667- else throw("Strict value is not equal to itself.")
668- }
669- else throw("Strict value is not equal to itself.")
670- }
671-
672-
673-
674-@Callable(i)
675-func setSwapContract (swappAddr) = {
676- let checkCaller = mustManager(i)
677- if ((checkCaller == checkCaller))
678- then [StringEntry(swapContract(), swappAddr)]
679- else throw("Strict value is not equal to itself.")
680- }
681-
682636
683637
684638 @Callable(i)
809763 let paymentAmountRaw = payment.amount
810764 let userAddress = i.caller
811765 let txId = i.transactionId
812- let $t03299433124 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
813- if (($t03299433124 == $t03299433124))
766+ let $t03172331853 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
767+ if (($t03172331853 == $t03172331853))
814768 then {
815- let bonus = $t03299433124._4
816- let feeAmount = $t03299433124._3
817- let commonState = $t03299433124._2
818- let emitAmountEstimated = $t03299433124._1
769+ let bonus = $t03172331853._4
770+ let feeAmount = $t03172331853._3
771+ let commonState = $t03172331853._2
772+ let emitAmountEstimated = $t03172331853._1
819773 let emitAmount = if (if ((minOutAmount > 0))
820774 then (minOutAmount > emitAmountEstimated)
821775 else false)
848802
849803 @Callable(i)
850804 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
851- let $t03385333988 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
852- let emitAmountEstimated = $t03385333988._1
853- let commonState = $t03385333988._2
854- let feeAmount = $t03385333988._3
855- let bonus = $t03385333988._4
805+ let $t03258232717 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
806+ let emitAmountEstimated = $t03258232717._1
807+ let commonState = $t03258232717._2
808+ let feeAmount = $t03258232717._3
809+ let bonus = $t03258232717._4
856810 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
857811 }
858812
886840 let paymentAmount = payment.amount
887841 let userAddress = i.caller
888842 let txId = i.transactionId
889- let $t03479334928 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
890- if (($t03479334928 == $t03479334928))
843+ let $t03352233657 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
844+ if (($t03352233657 == $t03352233657))
891845 then {
892- let bonus = $t03479334928._4
893- let feeAmount = $t03479334928._3
894- let commonState = $t03479334928._2
895- let amountEstimated = $t03479334928._1
846+ let bonus = $t03352233657._4
847+ let feeAmount = $t03352233657._3
848+ let commonState = $t03352233657._2
849+ let amountEstimated = $t03352233657._1
896850 let amount = if (if ((minOutAmount > 0))
897851 then (minOutAmount > amountEstimated)
898852 else false)
918872
919873 @Callable(i)
920874 func getOneTknREADONLY (outAssetId,paymentAmount) = {
921- let $t03556335701 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922- let amountEstimated = $t03556335701._1
923- let commonState = $t03556335701._2
924- let feeAmount = $t03556335701._3
925- let bonus = $t03556335701._4
875+ let $t03429234430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
876+ let amountEstimated = $t03429234430._1
877+ let commonState = $t03429234430._2
878+ let feeAmount = $t03429234430._3
879+ let bonus = $t03429234430._4
926880 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
927881 }
928882
956910 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
957911 if ((unstakeInv == unstakeInv))
958912 then {
959- let $t03652636659 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
960- if (($t03652636659 == $t03652636659))
913+ let $t03525535388 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
914+ if (($t03525535388 == $t03525535388))
961915 then {
962- let bonus = $t03652636659._4
963- let feeAmount = $t03652636659._3
964- let commonState = $t03652636659._2
965- let amountEstimated = $t03652636659._1
916+ let bonus = $t03525535388._4
917+ let feeAmount = $t03525535388._3
918+ let commonState = $t03525535388._2
919+ let amountEstimated = $t03525535388._1
966920 let amount = if (if ((minOutAmount > 0))
967921 then (minOutAmount > amountEstimated)
968922 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
79-
80-
81-func swapContract () = "%s__swapContract"
8279
8380
8481 func fc () = "%s__factoryContract"
8582
8683
8784 func mpk () = "%s__managerPublicKey"
8885
8986
9087 func pmpk () = "%s__pendingManagerPublicKey"
9188
9289
9390 func pl () = "%s%s__price__last"
9491
9592
9693 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9794
9895
9996 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
10097
10198
10299 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
103100
104101
105102 func aa () = "%s__amountAsset"
106103
107104
108105 func pa () = "%s__priceAsset"
109106
110107
111108 func keyFactoryConfig () = "%s__factoryConfig"
112109
113110
114111 func keyMatcherPub () = "%s%s__matcher__publicKey"
115112
116113
117114 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
118115
119116
120117 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
121118
122119
123120 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
124121
125122
126123 func keyAllPoolsShutdown () = "%s__shutdown"
127124
128125
129126 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
130127
131128
132129 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
133130
134131
135132 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
136133
137134 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
138135
139136
140137 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
141138
142139
143140 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
144141
145142
146143 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
147144
148145
149146 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
150147
151148 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
152149
153150 let inFee = {
154151 let @ = invoke(factoryContract, "getInFeeREADONLY", [toString(this)], nil)
155152 if ($isInstanceOf(@, "Int"))
156153 then @
157154 else throw(($getType(@) + " couldn't be cast to Int"))
158155 }
159156
160157 let outFee = {
161158 let @ = invoke(factoryContract, "getOutFeeREADONLY", [toString(this)], nil)
162159 if ($isInstanceOf(@, "Int"))
163160 then @
164161 else throw(($getType(@) + " couldn't be cast to Int"))
165162 }
166163
167164 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
168165
169166
170167 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
171168
172169
173170 func getPoolConfig () = {
174171 let amtAsset = getStringOrFail(this, aa())
175172 let priceAsset = getStringOrFail(this, pa())
176173 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
177174 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
178175 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
179176 }
180177
181178
182179 func parseAssetId (input) = if ((input == wavesString))
183180 then unit
184181 else fromBase58String(input)
185182
186183
187184 func assetIdToString (input) = if ((input == unit))
188185 then wavesString
189186 else toBase58String(value(input))
190187
191188
192189 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]))
193190
194191
195192 let poolConfigParsed = parsePoolConfig(getPoolConfig())
196193
197-let $t076627828 = poolConfigParsed
194+let $t076017767 = poolConfigParsed
198195
199-let cfgPoolAddress = $t076627828._1
196+let cfgPoolAddress = $t076017767._1
200197
201-let cfgPoolStatus = $t076627828._2
198+let cfgPoolStatus = $t076017767._2
202199
203-let cfgLpAssetId = $t076627828._3
200+let cfgLpAssetId = $t076017767._3
204201
205-let cfgAmountAssetId = $t076627828._4
202+let cfgAmountAssetId = $t076017767._4
206203
207-let cfgPriceAssetId = $t076627828._5
204+let cfgPriceAssetId = $t076017767._5
208205
209-let cfgAmountAssetDecimals = $t076627828._6
206+let cfgAmountAssetDecimals = $t076017767._6
210207
211-let cfgPriceAssetDecimals = $t076627828._7
208+let cfgPriceAssetDecimals = $t076017767._7
212209
213210 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
214211
215212
216213 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
217214
218215 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
219216
220217 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)
221218
222219
223220 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)
224221
225222
226223 func getAccBalance (assetId) = if ((assetId == "WAVES"))
227224 then wavesBalance(this).available
228225 else assetBalance(this, fromBase58String(assetId))
229226
230227
231228 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
232229
233230
234231 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
235232 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
236233 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
237234 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
238235 }
239236
240237
241238 func calcPrices (amAmt,prAmt,lpAmt) = {
242239 let cfg = getPoolConfig()
243240 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
244241 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
245242 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
246243 let amAmtX18 = toX18(amAmt, amtAssetDcm)
247244 let prAmtX18 = toX18(prAmt, priceAssetDcm)
248245 let lpAmtX18 = toX18(lpAmt, scale8)
249246 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
250247 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
251248 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
252249 }
253250
254251
255252 func calculatePrices (amAmt,prAmt,lpAmt) = {
256253 let prices = calcPrices(amAmt, prAmt, lpAmt)
257254 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
258255 }
259256
260257
261258 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
262259 let cfg = getPoolConfig()
263260 let lpAssetId = cfg[idxPoolLPAssetId]
264261 let amAssetId = cfg[idxAmtAssetId]
265262 let prAssetId = cfg[idxPriceAssetId]
266263 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
267264 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
268265 let poolStatus = cfg[idxPoolStatus]
269266 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
270267 if ((lpAssetId != pmtAssetId))
271268 then throw("Invalid asset passed.")
272269 else {
273270 let amBalance = getAccBalance(amAssetId)
274271 let amBalanceX18 = toX18(amBalance, amAssetDcm)
275272 let prBalance = getAccBalance(prAssetId)
276273 let prBalanceX18 = toX18(prBalance, prAssetDcm)
277274 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
278275 let curPrice = fromX18(curPriceX18, scale8)
279276 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
280277 let lpEmissionX18 = toX18(lpEmission, scale8)
281278 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
282279 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
283280 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
284281 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
285282 let state = if ((txId58 == ""))
286283 then nil
287284 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
288285 then unit
289286 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
290287 then unit
291288 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)]
292289 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
293290 }
294291 }
295292
296293
297294 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
298295 let cfg = getPoolConfig()
299296 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
300297 let amAssetIdStr = cfg[idxAmtAssetId]
301298 let prAssetIdStr = cfg[idxPriceAssetId]
302299 let iAmtAssetId = cfg[idxIAmtAssetId]
303300 let iPriceAssetId = cfg[idxIPriceAssetId]
304301 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
305302 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
306303 let poolStatus = cfg[idxPoolStatus]
307304 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
308305 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
309306 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
310307 if (if ((amAssetIdStr != inAmAssetIdStr))
311308 then true
312309 else (prAssetIdStr != inPrAssetIdStr))
313310 then throw("Invalid amt or price asset passed.")
314311 else {
315312 let amBalance = if (isEvaluate)
316313 then getAccBalance(amAssetIdStr)
317314 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
318315 let prBalance = if (isEvaluate)
319316 then getAccBalance(prAssetIdStr)
320317 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
321318 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
322319 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
323320 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
324321 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
325322 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
326323 let res = if ((lpEmission == 0))
327324 then {
328325 let curPriceX18 = zeroBigInt
329326 let slippageX18 = zeroBigInt
330327 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
331328 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
332329 }
333330 else {
334331 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
335332 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
336333 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
337334 if (if ((curPriceX18 != zeroBigInt))
338335 then (slippageX18 > slippageToleranceX18)
339336 else false)
340337 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
341338 else {
342339 let lpEmissionX18 = toX18(lpEmission, scale8)
343340 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
344341 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
345342 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
346343 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
347344 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
348345 let expAmtAssetAmtX18 = expectedAmts._1
349346 let expPriceAssetAmtX18 = expectedAmts._2
350347 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
351348 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
352349 }
353350 }
354351 let calcLpAmt = res._1
355352 let calcAmAssetPmt = res._2
356353 let calcPrAssetPmt = res._3
357354 let curPrice = fromX18(res._4, scale8)
358355 let slippageCalc = fromX18(res._5, scale8)
359356 if ((0 >= calcLpAmt))
360357 then throw("Invalid calculations. LP calculated is less than zero.")
361358 else {
362359 let emitLpAmt = if (!(emitLp))
363360 then 0
364361 else calcLpAmt
365362 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
366363 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
367364 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))]
368365 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
369366 }
370367 }
371368 }
372369
373370
374371 func validateMatcherOrderAllowed (order) = {
375372 let cfg = getPoolConfig()
376373 let amtAssetId = cfg[idxAmtAssetId]
377374 let priceAssetId = cfg[idxPriceAssetId]
378375 let poolStatus = parseIntValue(cfg[idxPoolStatus])
379376 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
380377 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
381378 let accAmtAssetBalance = getAccBalance(amtAssetId)
382379 let accPriceAssetBalance = getAccBalance(priceAssetId)
383380 let curPriceX18 = if ((order.orderType == Buy))
384381 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
385382 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
386383 let curPrice = fromX18(curPriceX18, scale8)
387384 if (if (if (isGlobalShutdown())
388385 then true
389386 else (poolStatus == PoolMatcherDisabled))
390387 then true
391388 else (poolStatus == PoolShutdown))
392389 then throw("Exchange operations disabled")
393390 else {
394391 let orderAmtAsset = order.assetPair.amountAsset
395392 let orderAmtAssetStr = if ((orderAmtAsset == unit))
396393 then "WAVES"
397394 else toBase58String(value(orderAmtAsset))
398395 let orderPriceAsset = order.assetPair.priceAsset
399396 let orderPriceAssetStr = if ((orderPriceAsset == unit))
400397 then "WAVES"
401398 else toBase58String(value(orderPriceAsset))
402399 if (if ((orderAmtAssetStr != amtAssetId))
403400 then true
404401 else (orderPriceAssetStr != priceAssetId))
405402 then throw("Wrong order assets.")
406403 else {
407404 let orderPrice = order.price
408405 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
409406 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
410407 let isOrderPriceValid = if ((order.orderType == Buy))
411408 then (curPrice >= castedOrderPrice)
412409 else (castedOrderPrice >= curPrice)
413410 true
414411 }
415412 }
416413 }
417414
418415
419416 func commonGet (i) = if ((size(i.payments) != 1))
420417 then throw("exactly 1 payment is expected")
421418 else {
422419 let pmt = value(i.payments[0])
423420 let pmtAssetId = value(pmt.assetId)
424421 let pmtAmt = pmt.amount
425422 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
426423 let outAmAmt = res._1
427424 let outPrAmt = res._2
428425 let poolStatus = parseIntValue(res._9)
429426 let state = res._10
430427 if (if (isGlobalShutdown())
431428 then true
432429 else (poolStatus == PoolShutdown))
433430 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
434431 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
435432 }
436433
437434
438435 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
439436 then throw("exactly 2 payments are expected")
440437 else {
441438 let amAssetPmt = value(i.payments[0])
442439 let prAssetPmt = value(i.payments[1])
443440 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
444441 let poolStatus = parseIntValue(estPut._8)
445442 if (if (if (isGlobalShutdown())
446443 then true
447444 else (poolStatus == PoolPutDisabled))
448445 then true
449446 else (poolStatus == PoolShutdown))
450447 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
451448 else estPut
452449 }
453450
454451
455452 func emit (amount) = {
456453 let emitInv = invoke(factoryContract, "emit", [amount], nil)
457454 if ((emitInv == emitInv))
458455 then {
459456 let emitInvLegacy = match emitInv {
460457 case legacyFactoryContract: Address =>
461458 invoke(legacyFactoryContract, "emit", [amount], nil)
462459 case _ =>
463460 unit
464461 }
465462 if ((emitInvLegacy == emitInvLegacy))
466463 then amount
467464 else throw("Strict value is not equal to itself.")
468465 }
469466 else throw("Strict value is not equal to itself.")
470467 }
471468
472469
473470 func takeFee (amount,fee) = {
474471 let feeAmount = if ((fee == 0))
475472 then 0
476473 else fraction(amount, fee, scale8)
477474 $Tuple2((amount - feeAmount), feeAmount)
478475 }
479476
480477
481478 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
482479 let isEval = (txId == unit)
483480 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
484481 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
485482 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
486483 then true
487484 else if ((paymentAssetId == cfgPriceAssetId))
488485 then false
489486 else throwErr("invalid asset")
490- let $t02272523018 = if (isEval)
487+ let $t02266422957 = if (isEval)
491488 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492489 else if (paymentInAmountAsset)
493490 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494491 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495- let amountBalanceOld = $t02272523018._1
496- let priceBalanceOld = $t02272523018._2
497- let $t02302223171 = if (paymentInAmountAsset)
492+ let amountBalanceOld = $t02266422957._1
493+ let priceBalanceOld = $t02266422957._2
494+ let $t02296123110 = if (paymentInAmountAsset)
498495 then $Tuple2(paymentAmountRaw, 0)
499496 else $Tuple2(0, paymentAmountRaw)
500- let amountAssetAmountRaw = $t02302223171._1
501- let priceAssetAmountRaw = $t02302223171._2
497+ let amountAssetAmountRaw = $t02296123110._1
498+ let priceAssetAmountRaw = $t02296123110._2
502499 let amountAssetAmount = takeFee(amountAssetAmountRaw, inFee)._1
503500 let priceAssetAmount = takeFee(priceAssetAmountRaw, inFee)._1
504- let $t02330323367 = takeFee(paymentAmountRaw, inFee)
505- let paymentAmount = $t02330323367._1
506- let feeAmount = $t02330323367._2
501+ let $t02324223306 = takeFee(paymentAmountRaw, inFee)
502+ let paymentAmount = $t02324223306._1
503+ let feeAmount = $t02324223306._2
507504 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508505 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509506 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
510507 let priceNew = fromX18(priceNewX18, scale8)
511508 let paymentBalance = if (paymentInAmountAsset)
512509 then amountBalanceOld
513510 else priceBalanceOld
514511 let paymentBalanceBigInt = toBigInt(paymentBalance)
515512 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
516513 let chechSupply = if ((supplyBigInt > big0))
517514 then true
518515 else throwErr("initial deposit requires all coins")
519516 if ((chechSupply == chechSupply))
520517 then {
521518 let depositBigInt = toBigInt(paymentAmount)
522519 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
523520 let commonState = if (isEval)
524521 then nil
525522 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))]
526523 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527524 let priceOld = fromX18(priceOldX18, scale8)
528525 let loss = {
529- let $t02484425011 = if (paymentInAmountAsset)
526+ let $t02478324950 = if (paymentInAmountAsset)
530527 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531528 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532- let amount = $t02484425011._1
533- let balance = $t02484425011._2
529+ let amount = $t02478324950._1
530+ let balance = $t02478324950._2
534531 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535532 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536533 }
537534 $Tuple4(issueAmount, commonState, feeAmount, loss)
538535 }
539536 else throw("Strict value is not equal to itself.")
540537 }
541538
542539
543540 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
544541 let isEval = (txId == unit)
545542 let checks = [if ((paymentAssetId == cfgLpAssetId))
546543 then true
547544 else throwErr("invalid lp asset")]
548545 if ((checks == checks))
549546 then {
550547 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
551548 then true
552549 else if ((outAssetId == cfgPriceAssetId))
553550 then false
554551 else throwErr("invalid asset")
555552 let balanceBigInt = if (outInAmountAsset)
556553 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
557554 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
558555 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
559556 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
560557 let outBalance = if (outInAmountAsset)
561558 then amBalanceOld
562559 else prBalanceOld
563560 let outBalanceBigInt = toBigInt(outBalance)
564561 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565562 let redeemedBigInt = toBigInt(paymentAmount)
566563 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567- let $t02659126647 = takeFee(amountRaw, outFee)
568- let totalAmount = $t02659126647._1
569- let feeAmount = $t02659126647._2
570- let $t02665126877 = if (outInAmountAsset)
564+ let $t02653026586 = takeFee(amountRaw, outFee)
565+ let totalAmount = $t02653026586._1
566+ let feeAmount = $t02653026586._2
567+ let $t02659026816 = if (outInAmountAsset)
571568 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572569 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573- let outAmAmount = $t02665126877._1
574- let outPrAmount = $t02665126877._2
575- let amBalanceNew = $t02665126877._3
576- let prBalanceNew = $t02665126877._4
570+ let outAmAmount = $t02659026816._1
571+ let outPrAmount = $t02659026816._2
572+ let amBalanceNew = $t02659026816._3
573+ let prBalanceNew = $t02659026816._4
577574 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578575 let priceNew = fromX18(priceNewX18, scale8)
579576 let commonState = if (isEval)
580577 then nil
581578 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)]
582579 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
583580 let priceOld = fromX18(priceOldX18, scale8)
584581 let loss = {
585582 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
586583 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
587584 }
588585 $Tuple4(totalAmount, commonState, feeAmount, loss)
589586 }
590587 else throw("Strict value is not equal to itself.")
591588 }
592589
593590
594591 func managerPublicKeyOrUnit () = match getString(mpk()) {
595592 case s: String =>
596593 fromBase58String(s)
597594 case _: Unit =>
598595 unit
599596 case _ =>
600597 throw("Match error")
601598 }
602599
603600
604601 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
605602 case s: String =>
606603 fromBase58String(s)
607604 case _: Unit =>
608605 unit
609606 case _ =>
610607 throw("Match error")
611608 }
612609
613610
614611 func isManager (i) = match managerPublicKeyOrUnit() {
615612 case pk: ByteVector =>
616613 (i.callerPublicKey == pk)
617614 case _: Unit =>
618615 (i.caller == this)
619616 case _ =>
620617 throw("Match error")
621618 }
622619
623620
624621 func mustManager (i) = {
625622 let pd = throw("Permission denied")
626623 match managerPublicKeyOrUnit() {
627624 case pk: ByteVector =>
628625 if ((i.callerPublicKey == pk))
629626 then true
630627 else pd
631628 case _: Unit =>
632629 if ((i.caller == this))
633630 then true
634631 else pd
635632 case _ =>
636633 throw("Match error")
637634 }
638635 }
639-
640-
641-@Callable(i)
642-func calculateAmountOutForSwapAndSendTokens (cleanAmountIn,isReverse,amountOutMin,addressTo) = {
643- let checks = [if ((value(i.payments[0]).amount >= cleanAmountIn))
644- then true
645- else throwErr("Wrong amount"), if ((i.caller == addressFromStringValue(getStringOrFail(this, swapContract()))))
646- then true
647- else throwErr("Permission denied")]
648- if ((checks == checks))
649- then {
650- let pmt = value(i.payments[0])
651- let assetIn = toBase58String(value(pmt.assetId))
652- let assetOut = if ((isReverse == false))
653- then {
654- let assetOut = getStringOrFail(this, pa())
655- assetOut
656- }
657- else {
658- let assetOut = getStringOrFail(this, aa())
659- assetOut
660- }
661- let poolAssetInBalance = (getAccBalance(assetIn) - value(i.payments[0]).amount)
662- let poolAssetOutBalance = getAccBalance(assetOut)
663- let amountOut = ((poolAssetOutBalance * cleanAmountIn) / (poolAssetInBalance + cleanAmountIn))
664- let checkMin = [(amountOut >= amountOutMin), "Exchange resulted in fewer coins than expected"]
665- if ((checkMin == checkMin))
666- then [ScriptTransfer(addressFromStringValue(addressTo), amountOut, fromBase58String(assetOut))]
667- else throw("Strict value is not equal to itself.")
668- }
669- else throw("Strict value is not equal to itself.")
670- }
671-
672-
673-
674-@Callable(i)
675-func setSwapContract (swappAddr) = {
676- let checkCaller = mustManager(i)
677- if ((checkCaller == checkCaller))
678- then [StringEntry(swapContract(), swappAddr)]
679- else throw("Strict value is not equal to itself.")
680- }
681-
682636
683637
684638 @Callable(i)
685639 func setManager (pendingManagerPublicKey) = {
686640 let checkCaller = mustManager(i)
687641 if ((checkCaller == checkCaller))
688642 then {
689643 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
690644 if ((checkManagerPublicKey == checkManagerPublicKey))
691645 then [StringEntry(pmpk(), pendingManagerPublicKey)]
692646 else throw("Strict value is not equal to itself.")
693647 }
694648 else throw("Strict value is not equal to itself.")
695649 }
696650
697651
698652
699653 @Callable(i)
700654 func confirmManager () = {
701655 let pm = pendingManagerPublicKeyOrUnit()
702656 let hasPM = if (isDefined(pm))
703657 then true
704658 else throw("No pending manager")
705659 if ((hasPM == hasPM))
706660 then {
707661 let checkPM = if ((i.callerPublicKey == value(pm)))
708662 then true
709663 else throw("You are not pending manager")
710664 if ((checkPM == checkPM))
711665 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
712666 else throw("Strict value is not equal to itself.")
713667 }
714668 else throw("Strict value is not equal to itself.")
715669 }
716670
717671
718672
719673 @Callable(i)
720674 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
721675 then throw("Invalid slippageTolerance passed")
722676 else {
723677 let estPut = commonPut(i, slippageTolerance, true)
724678 let emitLpAmt = estPut._2
725679 let lpAssetId = estPut._7
726680 let state = estPut._9
727681 let amDiff = estPut._10
728682 let prDiff = estPut._11
729683 let amId = estPut._12
730684 let prId = estPut._13
731685 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
732686 if ((emitInv == emitInv))
733687 then {
734688 let emitInvLegacy = match emitInv {
735689 case legacyFactoryContract: Address =>
736690 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
737691 case _ =>
738692 unit
739693 }
740694 if ((emitInvLegacy == emitInvLegacy))
741695 then {
742696 let slippageAInv = if ((amDiff > 0))
743697 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
744698 else nil
745699 if ((slippageAInv == slippageAInv))
746700 then {
747701 let slippagePInv = if ((prDiff > 0))
748702 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
749703 else nil
750704 if ((slippagePInv == slippagePInv))
751705 then {
752706 let lpTransfer = if (shouldAutoStake)
753707 then {
754708 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
755709 if ((slpStakeInv == slpStakeInv))
756710 then nil
757711 else throw("Strict value is not equal to itself.")
758712 }
759713 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
760714 (state ++ lpTransfer)
761715 }
762716 else throw("Strict value is not equal to itself.")
763717 }
764718 else throw("Strict value is not equal to itself.")
765719 }
766720 else throw("Strict value is not equal to itself.")
767721 }
768722 else throw("Strict value is not equal to itself.")
769723 }
770724
771725
772726
773727 @Callable(i)
774728 func putForFree (maxSlippage) = if ((0 > maxSlippage))
775729 then throw("Invalid value passed")
776730 else {
777731 let estPut = commonPut(i, maxSlippage, false)
778732 estPut._9
779733 }
780734
781735
782736
783737 @Callable(i)
784738 func putOneTkn (minOutAmount,autoStake) = {
785739 let isPoolOneTokenOperationsDisabled = {
786740 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
787741 if ($isInstanceOf(@, "Boolean"))
788742 then @
789743 else throw(($getType(@) + " couldn't be cast to Boolean"))
790744 }
791745 let isPutDisabled = if (if (if (isGlobalShutdown())
792746 then true
793747 else (cfgPoolStatus == PoolPutDisabled))
794748 then true
795749 else (cfgPoolStatus == PoolShutdown))
796750 then true
797751 else isPoolOneTokenOperationsDisabled
798752 let checks = [if (if (!(isPutDisabled))
799753 then true
800754 else isManager(i))
801755 then true
802756 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
803757 then true
804758 else throwErr("exactly 1 payment are expected")]
805759 if ((checks == checks))
806760 then {
807761 let payment = i.payments[0]
808762 let paymentAssetId = payment.assetId
809763 let paymentAmountRaw = payment.amount
810764 let userAddress = i.caller
811765 let txId = i.transactionId
812- let $t03299433124 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
813- if (($t03299433124 == $t03299433124))
766+ let $t03172331853 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
767+ if (($t03172331853 == $t03172331853))
814768 then {
815- let bonus = $t03299433124._4
816- let feeAmount = $t03299433124._3
817- let commonState = $t03299433124._2
818- let emitAmountEstimated = $t03299433124._1
769+ let bonus = $t03172331853._4
770+ let feeAmount = $t03172331853._3
771+ let commonState = $t03172331853._2
772+ let emitAmountEstimated = $t03172331853._1
819773 let emitAmount = if (if ((minOutAmount > 0))
820774 then (minOutAmount > emitAmountEstimated)
821775 else false)
822776 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
823777 else emitAmountEstimated
824778 let emitInv = emit(emitAmount)
825779 if ((emitInv == emitInv))
826780 then {
827781 let lpTransfer = if (autoStake)
828782 then {
829783 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
830784 if ((stakeInv == stakeInv))
831785 then nil
832786 else throw("Strict value is not equal to itself.")
833787 }
834788 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
835789 let sendFee = if ((feeAmount > 0))
836790 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
837791 else nil
838792 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
839793 }
840794 else throw("Strict value is not equal to itself.")
841795 }
842796 else throw("Strict value is not equal to itself.")
843797 }
844798 else throw("Strict value is not equal to itself.")
845799 }
846800
847801
848802
849803 @Callable(i)
850804 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
851- let $t03385333988 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
852- let emitAmountEstimated = $t03385333988._1
853- let commonState = $t03385333988._2
854- let feeAmount = $t03385333988._3
855- let bonus = $t03385333988._4
805+ let $t03258232717 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
806+ let emitAmountEstimated = $t03258232717._1
807+ let commonState = $t03258232717._2
808+ let feeAmount = $t03258232717._3
809+ let bonus = $t03258232717._4
856810 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
857811 }
858812
859813
860814
861815 @Callable(i)
862816 func getOneTkn (outAssetIdStr,minOutAmount) = {
863817 let isPoolOneTokenOperationsDisabled = {
864818 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
865819 if ($isInstanceOf(@, "Boolean"))
866820 then @
867821 else throw(($getType(@) + " couldn't be cast to Boolean"))
868822 }
869823 let isGetDisabled = if (if (isGlobalShutdown())
870824 then true
871825 else (cfgPoolStatus == PoolShutdown))
872826 then true
873827 else isPoolOneTokenOperationsDisabled
874828 let checks = [if (if (!(isGetDisabled))
875829 then true
876830 else isManager(i))
877831 then true
878832 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
879833 then true
880834 else throwErr("exactly 1 payment are expected")]
881835 if ((checks == checks))
882836 then {
883837 let outAssetId = parseAssetId(outAssetIdStr)
884838 let payment = i.payments[0]
885839 let paymentAssetId = payment.assetId
886840 let paymentAmount = payment.amount
887841 let userAddress = i.caller
888842 let txId = i.transactionId
889- let $t03479334928 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
890- if (($t03479334928 == $t03479334928))
843+ let $t03352233657 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
844+ if (($t03352233657 == $t03352233657))
891845 then {
892- let bonus = $t03479334928._4
893- let feeAmount = $t03479334928._3
894- let commonState = $t03479334928._2
895- let amountEstimated = $t03479334928._1
846+ let bonus = $t03352233657._4
847+ let feeAmount = $t03352233657._3
848+ let commonState = $t03352233657._2
849+ let amountEstimated = $t03352233657._1
896850 let amount = if (if ((minOutAmount > 0))
897851 then (minOutAmount > amountEstimated)
898852 else false)
899853 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
900854 else amountEstimated
901855 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
902856 if ((burnInv == burnInv))
903857 then {
904858 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
905859 let sendFee = if ((feeAmount > 0))
906860 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
907861 else nil
908862 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
909863 }
910864 else throw("Strict value is not equal to itself.")
911865 }
912866 else throw("Strict value is not equal to itself.")
913867 }
914868 else throw("Strict value is not equal to itself.")
915869 }
916870
917871
918872
919873 @Callable(i)
920874 func getOneTknREADONLY (outAssetId,paymentAmount) = {
921- let $t03556335701 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
922- let amountEstimated = $t03556335701._1
923- let commonState = $t03556335701._2
924- let feeAmount = $t03556335701._3
925- let bonus = $t03556335701._4
875+ let $t03429234430 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
876+ let amountEstimated = $t03429234430._1
877+ let commonState = $t03429234430._2
878+ let feeAmount = $t03429234430._3
879+ let bonus = $t03429234430._4
926880 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
927881 }
928882
929883
930884
931885 @Callable(i)
932886 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
933887 let isPoolOneTokenOperationsDisabled = {
934888 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
935889 if ($isInstanceOf(@, "Boolean"))
936890 then @
937891 else throw(($getType(@) + " couldn't be cast to Boolean"))
938892 }
939893 let isGetDisabled = if (if (isGlobalShutdown())
940894 then true
941895 else (cfgPoolStatus == PoolShutdown))
942896 then true
943897 else isPoolOneTokenOperationsDisabled
944898 let checks = [if (if (!(isGetDisabled))
945899 then true
946900 else isManager(i))
947901 then true
948902 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
949903 then true
950904 else throwErr("no payments are expected")]
951905 if ((checks == checks))
952906 then {
953907 let outAssetId = parseAssetId(outAssetIdStr)
954908 let userAddress = i.caller
955909 let txId = i.transactionId
956910 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
957911 if ((unstakeInv == unstakeInv))
958912 then {
959- let $t03652636659 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
960- if (($t03652636659 == $t03652636659))
913+ let $t03525535388 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
914+ if (($t03525535388 == $t03525535388))
961915 then {
962- let bonus = $t03652636659._4
963- let feeAmount = $t03652636659._3
964- let commonState = $t03652636659._2
965- let amountEstimated = $t03652636659._1
916+ let bonus = $t03525535388._4
917+ let feeAmount = $t03525535388._3
918+ let commonState = $t03525535388._2
919+ let amountEstimated = $t03525535388._1
966920 let amount = if (if ((minOutAmount > 0))
967921 then (minOutAmount > amountEstimated)
968922 else false)
969923 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
970924 else amountEstimated
971925 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
972926 if ((burnInv == burnInv))
973927 then {
974928 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
975929 let sendFee = if ((feeAmount > 0))
976930 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
977931 else nil
978932 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
979933 }
980934 else throw("Strict value is not equal to itself.")
981935 }
982936 else throw("Strict value is not equal to itself.")
983937 }
984938 else throw("Strict value is not equal to itself.")
985939 }
986940 else throw("Strict value is not equal to itself.")
987941 }
988942
989943
990944
991945 @Callable(i)
992946 func get () = {
993947 let res = commonGet(i)
994948 let outAmtAmt = res._1
995949 let outPrAmt = res._2
996950 let pmtAmt = res._3
997951 let pmtAssetId = res._4
998952 let state = res._5
999953 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1000954 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1001955 then state
1002956 else throw("Strict value is not equal to itself.")
1003957 }
1004958
1005959
1006960
1007961 @Callable(i)
1008962 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
1009963 let res = commonGet(i)
1010964 let outAmAmt = res._1
1011965 let outPrAmt = res._2
1012966 let pmtAmt = res._3
1013967 let pmtAssetId = res._4
1014968 let state = res._5
1015969 if ((noLessThenAmtAsset > outAmAmt))
1016970 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
1017971 else if ((noLessThenPriceAsset > outPrAmt))
1018972 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
1019973 else {
1020974 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
1021975 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1022976 then state
1023977 else throw("Strict value is not equal to itself.")
1024978 }
1025979 }
1026980
1027981
1028982
1029983 @Callable(i)
1030984 func unstakeAndGet (amount) = {
1031985 let checkPayments = if ((size(i.payments) != 0))
1032986 then throw("No payments are expected")
1033987 else true
1034988 if ((checkPayments == checkPayments))
1035989 then {
1036990 let cfg = getPoolConfig()
1037991 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
1038992 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1039993 if ((unstakeInv == unstakeInv))
1040994 then {
1041995 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1042996 let poolStatus = parseIntValue(res._9)
1043997 let state = res._10
1044998 let checkPoolStatus = if (if (isGlobalShutdown())
1045999 then true
10461000 else (poolStatus == PoolShutdown))
10471001 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10481002 else true
10491003 if ((checkPoolStatus == checkPoolStatus))
10501004 then {
10511005 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10521006 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10531007 then state
10541008 else throw("Strict value is not equal to itself.")
10551009 }
10561010 else throw("Strict value is not equal to itself.")
10571011 }
10581012 else throw("Strict value is not equal to itself.")
10591013 }
10601014 else throw("Strict value is not equal to itself.")
10611015 }
10621016
10631017
10641018
10651019 @Callable(i)
10661020 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10671021 let isGetDisabled = if (isGlobalShutdown())
10681022 then true
10691023 else (cfgPoolStatus == PoolShutdown)
10701024 let checks = [if (!(isGetDisabled))
10711025 then true
10721026 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10731027 then true
10741028 else throw("no payments are expected")]
10751029 if ((checks == checks))
10761030 then {
10771031 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10781032 if ((unstakeInv == unstakeInv))
10791033 then {
10801034 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
10811035 let outAmAmt = res._1
10821036 let outPrAmt = res._2
10831037 let state = res._10
10841038 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10851039 then true
10861040 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10871041 then true
10881042 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10891043 if ((checkAmounts == checkAmounts))
10901044 then {
10911045 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10921046 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10931047 then state
10941048 else throw("Strict value is not equal to itself.")
10951049 }
10961050 else throw("Strict value is not equal to itself.")
10971051 }
10981052 else throw("Strict value is not equal to itself.")
10991053 }
11001054 else throw("Strict value is not equal to itself.")
11011055 }
11021056
11031057
11041058
11051059 @Callable(i)
11061060 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
11071061 then throw("permissions denied")
11081062 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
11091063
11101064
11111065
11121066 @Callable(i)
11131067 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
11141068
11151069
11161070
11171071 @Callable(i)
11181072 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
11191073
11201074
11211075
11221076 @Callable(i)
11231077 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11241078 let prices = calcPrices(amAmt, prAmt, lpAmt)
11251079 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11261080 }
11271081
11281082
11291083
11301084 @Callable(i)
11311085 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11321086
11331087
11341088
11351089 @Callable(i)
11361090 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11371091
11381092
11391093
11401094 @Callable(i)
11411095 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11421096
11431097
11441098
11451099 @Callable(i)
11461100 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11471101
11481102
11491103
11501104 @Callable(i)
11511105 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
11521106 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
11531107 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
11541108 }
11551109
11561110
11571111
11581112 @Callable(i)
11591113 func statsREADONLY () = {
11601114 let cfg = getPoolConfig()
11611115 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11621116 let amtAssetId = cfg[idxAmtAssetId]
11631117 let priceAssetId = cfg[idxPriceAssetId]
11641118 let iAmtAssetId = cfg[idxIAmtAssetId]
11651119 let iPriceAssetId = cfg[idxIPriceAssetId]
11661120 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11671121 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11681122 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11691123 let accAmtAssetBalance = getAccBalance(amtAssetId)
11701124 let accPriceAssetBalance = getAccBalance(priceAssetId)
11711125 let pricesList = if ((poolLPBalance == 0))
11721126 then [zeroBigInt, zeroBigInt, zeroBigInt]
11731127 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
11741128 let curPrice = 0
11751129 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
11761130 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
11771131 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
11781132 $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))
11791133 }
11801134
11811135
11821136
11831137 @Callable(i)
11841138 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11851139 let cfg = getPoolConfig()
11861140 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11871141 let amAssetIdStr = cfg[idxAmtAssetId]
11881142 let amAssetId = fromBase58String(amAssetIdStr)
11891143 let prAssetIdStr = cfg[idxPriceAssetId]
11901144 let prAssetId = fromBase58String(prAssetIdStr)
11911145 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11921146 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11931147 let poolStatus = cfg[idxPoolStatus]
11941148 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11951149 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11961150 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11971151 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11981152 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11991153 let curPriceX18 = if ((poolLPBalance == 0))
12001154 then zeroBigInt
12011155 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
12021156 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
12031157 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
12041158 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
12051159 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12061160 let calcLpAmt = estPut._1
12071161 let curPriceCalc = estPut._3
12081162 let amBalance = estPut._4
12091163 let prBalance = estPut._5
12101164 let lpEmission = estPut._6
12111165 $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))
12121166 }
12131167
12141168
12151169
12161170 @Callable(i)
12171171 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
12181172 let cfg = getPoolConfig()
12191173 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
12201174 let amAssetIdStr = cfg[idxAmtAssetId]
12211175 let amAssetId = fromBase58String(amAssetIdStr)
12221176 let prAssetIdStr = cfg[idxPriceAssetId]
12231177 let prAssetId = fromBase58String(prAssetIdStr)
12241178 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12251179 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12261180 let poolStatus = cfg[idxPoolStatus]
12271181 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12281182 let amBalanceRaw = getAccBalance(amAssetIdStr)
12291183 let prBalanceRaw = getAccBalance(prAssetIdStr)
12301184 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12311185 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12321186 let curPriceX18 = if ((poolLPBalance == 0))
12331187 then zeroBigInt
12341188 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12351189 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12361190 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12371191 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12381192 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12391193 let calcLpAmt = estPut._1
12401194 let curPriceCalc = estPut._3
12411195 let amBalance = estPut._4
12421196 let prBalance = estPut._5
12431197 let lpEmission = estPut._6
12441198 $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))
12451199 }
12461200
12471201
12481202
12491203 @Callable(i)
12501204 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
12511205 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
12521206 let outAmAmt = res._1
12531207 let outPrAmt = res._2
12541208 let amBalance = res._5
12551209 let prBalance = res._6
12561210 let lpEmission = res._7
12571211 let curPrice = res._8
12581212 let poolStatus = parseIntValue(res._9)
12591213 $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))
12601214 }
12611215
12621216
12631217 @Verifier(tx)
12641218 func verify () = {
12651219 let targetPublicKey = match managerPublicKeyOrUnit() {
12661220 case pk: ByteVector =>
12671221 pk
12681222 case _: Unit =>
12691223 tx.senderPublicKey
12701224 case _ =>
12711225 throw("Match error")
12721226 }
12731227 match tx {
12741228 case order: Order =>
12751229 let matcherPub = getMatcherPubOrFail()
12761230 let orderValid = validateMatcherOrderAllowed(order)
12771231 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
12781232 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
12791233 if (if (if (orderValid)
12801234 then senderValid
12811235 else false)
12821236 then matcherValid
12831237 else false)
12841238 then true
12851239 else throwOrderError(orderValid, senderValid, matcherValid)
12861240 case s: SetScriptTransaction =>
12871241 let newHash = blake2b256(value(s.script))
12881242 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12891243 let currentHash = scriptHash(this)
12901244 if (if ((allowedHash == newHash))
12911245 then (currentHash != newHash)
12921246 else false)
12931247 then true
12941248 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12951249 case _ =>
12961250 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12971251 }
12981252 }
12991253

github/deemru/w8io/026f985 
134.85 ms