tx · G79jx5RoCFXrjn65CLRyceifcpU9z1egz2WFkiUtZF9g

3Msa444cj3rGwoUM28fK5iMwFXn61SfJpqs:  -0.03000000 Waves

2022.11.09 10:30 [2309299] smart account 3Msa444cj3rGwoUM28fK5iMwFXn61SfJpqs > SELF 0.00000000 Waves

{ "type": 13, "id": "G79jx5RoCFXrjn65CLRyceifcpU9z1egz2WFkiUtZF9g", "fee": 3000000, "feeAssetId": null, "timestamp": 1667979111116, "version": 1, "sender": "3Msa444cj3rGwoUM28fK5iMwFXn61SfJpqs", "senderPublicKey": "Fv4cVRzKj6MwfJQ2BrrtpyPyc3dSbKxA91GqxHZCCqC3", "proofs": [ "2gD7ZdV6iv5sNyLt6TENUwrim134c5YzJp7JhwnfLrThiKWSe8Vg3pKuDcSBPQubXrhC4KywbKJMDdTZoq5eMw7Y" ], "script": "base64:BgLNJwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3NldElkIg1pZHhM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gCCQCkAwEFAmNqCQDMCAIJAKQDAQUCYlkJAMwIAgkApAMBBQJjYQkAzAgCCQCkAwEFAmJYCQDMCAIJAKYDAQUCY2QJAMwIAgkApAMBBQJiVwUDbmlsBQFqAQJmSgECZksABAJmTAQCZHMJAQJldwADCQABAgUCZHMCCkJ5dGVWZWN0b3IEAmVCBQJkcwUCZUIDCQABAgUCZHMCBFVuaXQIBQJmSg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCZHMFAmZKAwkAAQIFAmRzAgVPcmRlcgQCY1QFAmRzBAJmTQkBAmFJAAQCYXcJAQJjUwEFAmNUBAJheAkA9AMDCAUCY1QJYm9keUJ5dGVzCQCRAwIIBQJjVAZwcm9vZnMAAAgFAmNUD3NlbmRlclB1YmxpY0tleQQCYXkJAPQDAwgFAmNUCWJvZHlCeXRlcwkAkQMCCAUCY1QGcHJvb2ZzAAEFAmZNAwMDBQJhdwUCYXgHBQJheQcGCQECYXYDBQJhdwUCYXgFAmF5AwkAAQIFAmRzAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXgFAmRzBAJmTgkA9gMBCQEFdmFsdWUBCAUCZXgGc2NyaXB0BAJmTwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFGCQECYXQABAJmUAkA8QcBBQR0aGlzAwMJAAACBQJmTwUCZk4JAQIhPQIFAmZQBQJmTgcGCQD0AwMIBQJmSglib2R5Qnl0ZXMJAJEDAggFAmZKBnByb29mcwAABQJmTAkA9AMDCAUCZkoJYm9keUJ5dGVzCQCRAwIIBQJmSgZwcm9vZnMAAAUCZkypkbtG", "chainId": 84, "height": 2309299, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CvAsEsZDD14Rwn7HNhF4tv2PtB2uQTb6E28AnasWrKvf Next: 6XkUQCj4SRKrb8riFSXocoSunxCT2ddCFr3zRywyTf2X Diff:
OldNewDifferences
6060 let idxFactorySlippageContract = 7
6161
6262 let testingggggg = 1
63+
64+let ssssssssssss = 1
6365
6466 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6567
185187
186188 let poolConfigParsed = parsePoolConfig(getPoolConfig())
187189
188-let $t075667732 = poolConfigParsed
190+let $t075877753 = poolConfigParsed
189191
190-let cfgPoolAddress = $t075667732._1
192+let cfgPoolAddress = $t075877753._1
191193
192-let cfgPoolStatus = $t075667732._2
194+let cfgPoolStatus = $t075877753._2
193195
194-let cfgLpAssetId = $t075667732._3
196+let cfgLpAssetId = $t075877753._3
195197
196-let cfgAmountAssetId = $t075667732._4
198+let cfgAmountAssetId = $t075877753._4
197199
198-let cfgPriceAssetId = $t075667732._5
200+let cfgPriceAssetId = $t075877753._5
199201
200-let cfgAmountAssetDecimals = $t075667732._6
202+let cfgAmountAssetDecimals = $t075877753._6
201203
202-let cfgPriceAssetDecimals = $t075667732._7
204+let cfgPriceAssetDecimals = $t075877753._7
203205
204206 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
205207
476478 else if ((paymentAssetId == cfgPriceAssetId))
477479 then false
478480 else throwErr("invalid asset")
479- let $t02259322886 = if (isEval)
481+ let $t02261422907 = if (isEval)
480482 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
481483 else if (paymentInAmountAsset)
482484 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
483485 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
484- let amountBalanceOld = $t02259322886._1
485- let priceBalanceOld = $t02259322886._2
486- let $t02289023039 = if (paymentInAmountAsset)
486+ let amountBalanceOld = $t02261422907._1
487+ let priceBalanceOld = $t02261422907._2
488+ let $t02291123060 = if (paymentInAmountAsset)
487489 then $Tuple2(paymentAmountRaw, 0)
488490 else $Tuple2(0, paymentAmountRaw)
489- let amountAssetAmountRaw = $t02289023039._1
490- let priceAssetAmountRaw = $t02289023039._2
491+ let amountAssetAmountRaw = $t02291123060._1
492+ let priceAssetAmountRaw = $t02291123060._2
491493 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
492494 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
493- let $t02316123220 = takeFee(paymentAmountRaw)
494- let paymentAmount = $t02316123220._1
495- let feeAmount = $t02316123220._2
495+ let $t02318223241 = takeFee(paymentAmountRaw)
496+ let paymentAmount = $t02318223241._1
497+ let feeAmount = $t02318223241._2
496498 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
497499 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
498500 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
515517 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
516518 let priceOld = fromX18(priceOldX18, scale8)
517519 let loss = {
518- let $t02469724864 = if (paymentInAmountAsset)
520+ let $t02471824885 = if (paymentInAmountAsset)
519521 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
520522 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
521- let amount = $t02469724864._1
522- let balance = $t02469724864._2
523+ let amount = $t02471824885._1
524+ let balance = $t02471824885._2
523525 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
524526 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
525527 }
553555 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
554556 let redeemedBigInt = toBigInt(paymentAmount)
555557 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
556- let $t02644426494 = takeFee(amountRaw)
557- let totalAmount = $t02644426494._1
558- let feeAmount = $t02644426494._2
559- let $t02649826724 = if (outInAmountAsset)
558+ let $t02646526515 = takeFee(amountRaw)
559+ let totalAmount = $t02646526515._1
560+ let feeAmount = $t02646526515._2
561+ let $t02651926745 = if (outInAmountAsset)
560562 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
561563 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
562- let outAmAmount = $t02649826724._1
563- let outPrAmount = $t02649826724._2
564- let amBalanceNew = $t02649826724._3
565- let prBalanceNew = $t02649826724._4
564+ let outAmAmount = $t02651926745._1
565+ let outPrAmount = $t02651926745._2
566+ let amBalanceNew = $t02651926745._3
567+ let prBalanceNew = $t02651926745._4
566568 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
567569 let priceNew = fromX18(priceNewX18, scale8)
568570 let commonState = if (isEval)
743745 let paymentAmountRaw = payment.amount
744746 let userAddress = i.caller
745747 let txId = i.transactionId
746- let $t03143431561 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
747- let emitAmountEstimated = $t03143431561._1
748- let commonState = $t03143431561._2
749- let feeAmount = $t03143431561._3
750- let bonus = $t03143431561._4
748+ let $t03145531582 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
749+ let emitAmountEstimated = $t03145531582._1
750+ let commonState = $t03145531582._2
751+ let feeAmount = $t03145531582._3
752+ let bonus = $t03145531582._4
751753 let emitAmount = if (if ((minOutAmount > 0))
752754 then (minOutAmount > emitAmountEstimated)
753755 else false)
778780
779781 @Callable(i)
780782 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
781- let $t03229032425 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
782- let emitAmountEstimated = $t03229032425._1
783- let commonState = $t03229032425._2
784- let feeAmount = $t03229032425._3
785- let bonus = $t03229032425._4
783+ let $t03231132446 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
784+ let emitAmountEstimated = $t03231132446._1
785+ let commonState = $t03231132446._2
786+ let feeAmount = $t03231132446._3
787+ let bonus = $t03231132446._4
786788 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
787789 }
788790
814816 let paymentAmount = payment.amount
815817 let userAddress = i.caller
816818 let txId = i.transactionId
817- let $t03319733329 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
818- let amountEstimated = $t03319733329._1
819- let commonState = $t03319733329._2
820- let feeAmount = $t03319733329._3
821- let bonus = $t03319733329._4
819+ let $t03321833350 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
820+ let amountEstimated = $t03321833350._1
821+ let commonState = $t03321833350._2
822+ let feeAmount = $t03321833350._3
823+ let bonus = $t03321833350._4
822824 let amount = if (if ((minOutAmount > 0))
823825 then (minOutAmount > amountEstimated)
824826 else false)
842844
843845 @Callable(i)
844846 func getOneTknREADONLY (outAssetId,paymentAmount) = {
845- let $t03396434102 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
846- let amountEstimated = $t03396434102._1
847- let commonState = $t03396434102._2
848- let feeAmount = $t03396434102._3
849- let bonus = $t03396434102._4
847+ let $t03398534123 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
848+ let amountEstimated = $t03398534123._1
849+ let commonState = $t03398534123._2
850+ let feeAmount = $t03398534123._3
851+ let bonus = $t03398534123._4
850852 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
851853 }
852854
878880 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
879881 if ((unstakeInv == unstakeInv))
880882 then {
881- let $t03489435024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
882- let amountEstimated = $t03489435024._1
883- let commonState = $t03489435024._2
884- let feeAmount = $t03489435024._3
885- let bonus = $t03489435024._4
883+ let $t03491535045 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
884+ let amountEstimated = $t03491535045._1
885+ let commonState = $t03491535045._2
886+ let feeAmount = $t03491535045._3
887+ let bonus = $t03491535045._4
886888 let amount = if (if ((minOutAmount > 0))
887889 then (minOutAmount > amountEstimated)
888890 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 let testingggggg = 1
63+
64+let ssssssssssss = 1
6365
6466 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6567
6668
6769 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6870
6971
7072 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7173
7274
7375 func abs (val) = if ((0 > val))
7476 then -(val)
7577 else val
7678
7779
7880 func absBigInt (val) = if ((zeroBigInt > val))
7981 then -(val)
8082 else val
8183
8284
8385 func fc () = "%s__factoryContract"
8486
8587
8688 func mpk () = "%s__managerPublicKey"
8789
8890
8991 func pmpk () = "%s__pendingManagerPublicKey"
9092
9193
9294 func pl () = "%s%s__price__last"
9395
9496
9597 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9698
9799
98100 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
99101
100102
101103 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
102104
103105
104106 func aa () = "%s__amountAsset"
105107
106108
107109 func pa () = "%s__priceAsset"
108110
109111
110112 let keyFee = "%s__fee"
111113
112114 let feeDefault = fraction(10, scale8, 10000)
113115
114116 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
115117
116118 func keyFactoryConfig () = "%s__factoryConfig"
117119
118120
119121 func keyMatcherPub () = "%s%s__matcher__publicKey"
120122
121123
122124 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
123125
124126
125127 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
126128
127129
128130 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
129131
130132
131133 func keyAllPoolsShutdown () = "%s__shutdown"
132134
133135
134136 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
135137
136138
137139 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
138140
139141
140142 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
141143
142144 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
143145
144146
145147 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
146148
147149
148150 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
149151
150152
151153 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
152154
153155
154156 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
155157
156158 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
157159
158160 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
159161
160162
161163 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
162164
163165
164166 func getPoolConfig () = {
165167 let amtAsset = getStringOrFail(this, aa())
166168 let priceAsset = getStringOrFail(this, pa())
167169 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
168170 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
169171 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
170172 }
171173
172174
173175 func parseAssetId (input) = if ((input == wavesString))
174176 then unit
175177 else fromBase58String(input)
176178
177179
178180 func assetIdToString (input) = if ((input == unit))
179181 then wavesString
180182 else toBase58String(value(input))
181183
182184
183185 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]))
184186
185187
186188 let poolConfigParsed = parsePoolConfig(getPoolConfig())
187189
188-let $t075667732 = poolConfigParsed
190+let $t075877753 = poolConfigParsed
189191
190-let cfgPoolAddress = $t075667732._1
192+let cfgPoolAddress = $t075877753._1
191193
192-let cfgPoolStatus = $t075667732._2
194+let cfgPoolStatus = $t075877753._2
193195
194-let cfgLpAssetId = $t075667732._3
196+let cfgLpAssetId = $t075877753._3
195197
196-let cfgAmountAssetId = $t075667732._4
198+let cfgAmountAssetId = $t075877753._4
197199
198-let cfgPriceAssetId = $t075667732._5
200+let cfgPriceAssetId = $t075877753._5
199201
200-let cfgAmountAssetDecimals = $t075667732._6
202+let cfgAmountAssetDecimals = $t075877753._6
201203
202-let cfgPriceAssetDecimals = $t075667732._7
204+let cfgPriceAssetDecimals = $t075877753._7
203205
204206 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
205207
206208
207209 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
208210
209211 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
210212
211213 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)
212214
213215
214216 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)
215217
216218
217219 func getAccBalance (assetId) = if ((assetId == "WAVES"))
218220 then wavesBalance(this).available
219221 else assetBalance(this, fromBase58String(assetId))
220222
221223
222224 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
223225
224226
225227 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
226228 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
227229 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
228230 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
229231 }
230232
231233
232234 func calcPrices (amAmt,prAmt,lpAmt) = {
233235 let cfg = getPoolConfig()
234236 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
235237 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
236238 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
237239 let amAmtX18 = toX18(amAmt, amtAssetDcm)
238240 let prAmtX18 = toX18(prAmt, priceAssetDcm)
239241 let lpAmtX18 = toX18(lpAmt, scale8)
240242 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
241243 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
242244 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
243245 }
244246
245247
246248 func calculatePrices (amAmt,prAmt,lpAmt) = {
247249 let prices = calcPrices(amAmt, prAmt, lpAmt)
248250 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
249251 }
250252
251253
252254 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
253255 let cfg = getPoolConfig()
254256 let lpAssetId = cfg[idxPoolLPAssetId]
255257 let amAssetId = cfg[idxAmtAssetId]
256258 let prAssetId = cfg[idxPriceAssetId]
257259 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
258260 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
259261 let poolStatus = cfg[idxPoolStatus]
260262 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
261263 if ((lpAssetId != pmtAssetId))
262264 then throw("Invalid asset passed.")
263265 else {
264266 let amBalance = getAccBalance(amAssetId)
265267 let amBalanceX18 = toX18(amBalance, amAssetDcm)
266268 let prBalance = getAccBalance(prAssetId)
267269 let prBalanceX18 = toX18(prBalance, prAssetDcm)
268270 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
269271 let curPrice = fromX18(curPriceX18, scale8)
270272 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
271273 let lpEmissionX18 = toX18(lpEmission, scale8)
272274 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
273275 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
274276 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
275277 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
276278 let state = if ((txId58 == ""))
277279 then nil
278280 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
279281 then unit
280282 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
281283 then unit
282284 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)]
283285 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
284286 }
285287 }
286288
287289
288290 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
289291 let cfg = getPoolConfig()
290292 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
291293 let amAssetIdStr = cfg[idxAmtAssetId]
292294 let prAssetIdStr = cfg[idxPriceAssetId]
293295 let iAmtAssetId = cfg[idxIAmtAssetId]
294296 let iPriceAssetId = cfg[idxIPriceAssetId]
295297 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
296298 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
297299 let poolStatus = cfg[idxPoolStatus]
298300 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
299301 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
300302 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
301303 if (if ((amAssetIdStr != inAmAssetIdStr))
302304 then true
303305 else (prAssetIdStr != inPrAssetIdStr))
304306 then throw("Invalid amt or price asset passed.")
305307 else {
306308 let amBalance = if (isEvaluate)
307309 then getAccBalance(amAssetIdStr)
308310 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
309311 let prBalance = if (isEvaluate)
310312 then getAccBalance(prAssetIdStr)
311313 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
312314 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
313315 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
314316 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
315317 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
316318 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
317319 let res = if ((lpEmission == 0))
318320 then {
319321 let curPriceX18 = zeroBigInt
320322 let slippageX18 = zeroBigInt
321323 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
322324 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
323325 }
324326 else {
325327 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
326328 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
327329 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
328330 if (if ((curPriceX18 != zeroBigInt))
329331 then (slippageX18 > slippageToleranceX18)
330332 else false)
331333 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
332334 else {
333335 let lpEmissionX18 = toX18(lpEmission, scale8)
334336 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
335337 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
336338 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
337339 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
338340 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
339341 let expAmtAssetAmtX18 = expectedAmts._1
340342 let expPriceAssetAmtX18 = expectedAmts._2
341343 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
342344 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
343345 }
344346 }
345347 let calcLpAmt = res._1
346348 let calcAmAssetPmt = res._2
347349 let calcPrAssetPmt = res._3
348350 let curPrice = fromX18(res._4, scale8)
349351 let slippageCalc = fromX18(res._5, scale8)
350352 if ((0 >= calcLpAmt))
351353 then throw("Invalid calculations. LP calculated is less than zero.")
352354 else {
353355 let emitLpAmt = if (!(emitLp))
354356 then 0
355357 else calcLpAmt
356358 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
357359 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
358360 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))]
359361 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
360362 }
361363 }
362364 }
363365
364366
365367 func validateMatcherOrderAllowed (order) = {
366368 let cfg = getPoolConfig()
367369 let amtAssetId = cfg[idxAmtAssetId]
368370 let priceAssetId = cfg[idxPriceAssetId]
369371 let poolStatus = parseIntValue(cfg[idxPoolStatus])
370372 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
371373 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
372374 let accAmtAssetBalance = getAccBalance(amtAssetId)
373375 let accPriceAssetBalance = getAccBalance(priceAssetId)
374376 let curPriceX18 = if ((order.orderType == Buy))
375377 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
376378 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
377379 let curPrice = fromX18(curPriceX18, scale8)
378380 if (if (if (isGlobalShutdown())
379381 then true
380382 else (poolStatus == PoolMatcherDisabled))
381383 then true
382384 else (poolStatus == PoolShutdown))
383385 then throw("Exchange operations disabled")
384386 else {
385387 let orderAmtAsset = order.assetPair.amountAsset
386388 let orderAmtAssetStr = if ((orderAmtAsset == unit))
387389 then "WAVES"
388390 else toBase58String(value(orderAmtAsset))
389391 let orderPriceAsset = order.assetPair.priceAsset
390392 let orderPriceAssetStr = if ((orderPriceAsset == unit))
391393 then "WAVES"
392394 else toBase58String(value(orderPriceAsset))
393395 if (if ((orderAmtAssetStr != amtAssetId))
394396 then true
395397 else (orderPriceAssetStr != priceAssetId))
396398 then throw("Wrong order assets.")
397399 else {
398400 let orderPrice = order.price
399401 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
400402 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
401403 let isOrderPriceValid = if ((order.orderType == Buy))
402404 then (curPrice >= castedOrderPrice)
403405 else (castedOrderPrice >= curPrice)
404406 true
405407 }
406408 }
407409 }
408410
409411
410412 func commonGet (i) = if ((size(i.payments) != 1))
411413 then throw("exactly 1 payment is expected")
412414 else {
413415 let pmt = value(i.payments[0])
414416 let pmtAssetId = value(pmt.assetId)
415417 let pmtAmt = pmt.amount
416418 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
417419 let outAmAmt = res._1
418420 let outPrAmt = res._2
419421 let poolStatus = parseIntValue(res._9)
420422 let state = res._10
421423 if (if (isGlobalShutdown())
422424 then true
423425 else (poolStatus == PoolShutdown))
424426 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
425427 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
426428 }
427429
428430
429431 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
430432 then throw("exactly 2 payments are expected")
431433 else {
432434 let amAssetPmt = value(i.payments[0])
433435 let prAssetPmt = value(i.payments[1])
434436 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
435437 let poolStatus = parseIntValue(estPut._8)
436438 if (if (if (isGlobalShutdown())
437439 then true
438440 else (poolStatus == PoolPutDisabled))
439441 then true
440442 else (poolStatus == PoolShutdown))
441443 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
442444 else estPut
443445 }
444446
445447
446448 func emit (amount) = {
447449 let emitInv = invoke(factoryContract, "emit", [amount], nil)
448450 if ((emitInv == emitInv))
449451 then {
450452 let emitInvLegacy = match emitInv {
451453 case legacyFactoryContract: Address =>
452454 invoke(legacyFactoryContract, "emit", [amount], nil)
453455 case _ =>
454456 unit
455457 }
456458 if ((emitInvLegacy == emitInvLegacy))
457459 then amount
458460 else throw("Strict value is not equal to itself.")
459461 }
460462 else throw("Strict value is not equal to itself.")
461463 }
462464
463465
464466 func takeFee (amount) = {
465467 let feeAmount = fraction(amount, fee, scale8)
466468 $Tuple2((amount - feeAmount), feeAmount)
467469 }
468470
469471
470472 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
471473 let isEval = (txId == unit)
472474 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
473475 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
474476 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
475477 then true
476478 else if ((paymentAssetId == cfgPriceAssetId))
477479 then false
478480 else throwErr("invalid asset")
479- let $t02259322886 = if (isEval)
481+ let $t02261422907 = if (isEval)
480482 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
481483 else if (paymentInAmountAsset)
482484 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
483485 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
484- let amountBalanceOld = $t02259322886._1
485- let priceBalanceOld = $t02259322886._2
486- let $t02289023039 = if (paymentInAmountAsset)
486+ let amountBalanceOld = $t02261422907._1
487+ let priceBalanceOld = $t02261422907._2
488+ let $t02291123060 = if (paymentInAmountAsset)
487489 then $Tuple2(paymentAmountRaw, 0)
488490 else $Tuple2(0, paymentAmountRaw)
489- let amountAssetAmountRaw = $t02289023039._1
490- let priceAssetAmountRaw = $t02289023039._2
491+ let amountAssetAmountRaw = $t02291123060._1
492+ let priceAssetAmountRaw = $t02291123060._2
491493 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
492494 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
493- let $t02316123220 = takeFee(paymentAmountRaw)
494- let paymentAmount = $t02316123220._1
495- let feeAmount = $t02316123220._2
495+ let $t02318223241 = takeFee(paymentAmountRaw)
496+ let paymentAmount = $t02318223241._1
497+ let feeAmount = $t02318223241._2
496498 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
497499 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
498500 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
499501 let priceNew = fromX18(priceNewX18, scale8)
500502 let paymentBalance = if (paymentInAmountAsset)
501503 then amountBalanceOld
502504 else priceBalanceOld
503505 let paymentBalanceBigInt = toBigInt(paymentBalance)
504506 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
505507 let chechSupply = if ((supplyBigInt > big0))
506508 then true
507509 else throwErr("initial deposit requires all coins")
508510 if ((chechSupply == chechSupply))
509511 then {
510512 let depositBigInt = toBigInt(paymentAmount)
511513 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
512514 let commonState = if (isEval)
513515 then nil
514516 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))]
515517 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
516518 let priceOld = fromX18(priceOldX18, scale8)
517519 let loss = {
518- let $t02469724864 = if (paymentInAmountAsset)
520+ let $t02471824885 = if (paymentInAmountAsset)
519521 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
520522 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
521- let amount = $t02469724864._1
522- let balance = $t02469724864._2
523+ let amount = $t02471824885._1
524+ let balance = $t02471824885._2
523525 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
524526 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
525527 }
526528 $Tuple4(issueAmount, commonState, feeAmount, loss)
527529 }
528530 else throw("Strict value is not equal to itself.")
529531 }
530532
531533
532534 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
533535 let isEval = (txId == unit)
534536 let checks = [if ((paymentAssetId == cfgLpAssetId))
535537 then true
536538 else throwErr("invalid lp asset")]
537539 if ((checks == checks))
538540 then {
539541 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
540542 then true
541543 else if ((outAssetId == cfgPriceAssetId))
542544 then false
543545 else throwErr("invalid asset")
544546 let balanceBigInt = if (outInAmountAsset)
545547 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
546548 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
547549 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
548550 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
549551 let outBalance = if (outInAmountAsset)
550552 then amBalanceOld
551553 else prBalanceOld
552554 let outBalanceBigInt = toBigInt(outBalance)
553555 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
554556 let redeemedBigInt = toBigInt(paymentAmount)
555557 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
556- let $t02644426494 = takeFee(amountRaw)
557- let totalAmount = $t02644426494._1
558- let feeAmount = $t02644426494._2
559- let $t02649826724 = if (outInAmountAsset)
558+ let $t02646526515 = takeFee(amountRaw)
559+ let totalAmount = $t02646526515._1
560+ let feeAmount = $t02646526515._2
561+ let $t02651926745 = if (outInAmountAsset)
560562 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
561563 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
562- let outAmAmount = $t02649826724._1
563- let outPrAmount = $t02649826724._2
564- let amBalanceNew = $t02649826724._3
565- let prBalanceNew = $t02649826724._4
564+ let outAmAmount = $t02651926745._1
565+ let outPrAmount = $t02651926745._2
566+ let amBalanceNew = $t02651926745._3
567+ let prBalanceNew = $t02651926745._4
566568 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
567569 let priceNew = fromX18(priceNewX18, scale8)
568570 let commonState = if (isEval)
569571 then nil
570572 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)]
571573 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
572574 let priceOld = fromX18(priceOldX18, scale8)
573575 let loss = {
574576 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
575577 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
576578 }
577579 $Tuple4(totalAmount, commonState, feeAmount, loss)
578580 }
579581 else throw("Strict value is not equal to itself.")
580582 }
581583
582584
583585 func managerPublicKeyOrUnit () = match getString(mpk()) {
584586 case s: String =>
585587 fromBase58String(s)
586588 case _: Unit =>
587589 unit
588590 case _ =>
589591 throw("Match error")
590592 }
591593
592594
593595 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
594596 case s: String =>
595597 fromBase58String(s)
596598 case _: Unit =>
597599 unit
598600 case _ =>
599601 throw("Match error")
600602 }
601603
602604
603605 func mustManager (i) = {
604606 let pd = throw("Permission denied")
605607 match managerPublicKeyOrUnit() {
606608 case pk: ByteVector =>
607609 if ((i.callerPublicKey == pk))
608610 then true
609611 else pd
610612 case _: Unit =>
611613 if ((i.caller == this))
612614 then true
613615 else pd
614616 case _ =>
615617 throw("Match error")
616618 }
617619 }
618620
619621
620622 @Callable(i)
621623 func setManager (pendingManagerPublicKey) = {
622624 let checkCaller = mustManager(i)
623625 if ((checkCaller == checkCaller))
624626 then {
625627 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
626628 if ((checkManagerPublicKey == checkManagerPublicKey))
627629 then [StringEntry(pmpk(), pendingManagerPublicKey)]
628630 else throw("Strict value is not equal to itself.")
629631 }
630632 else throw("Strict value is not equal to itself.")
631633 }
632634
633635
634636
635637 @Callable(i)
636638 func confirmManager () = {
637639 let pm = pendingManagerPublicKeyOrUnit()
638640 let hasPM = if (isDefined(pm))
639641 then true
640642 else throw("No pending manager")
641643 if ((hasPM == hasPM))
642644 then {
643645 let checkPM = if ((i.callerPublicKey == value(pm)))
644646 then true
645647 else throw("You are not pending manager")
646648 if ((checkPM == checkPM))
647649 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
648650 else throw("Strict value is not equal to itself.")
649651 }
650652 else throw("Strict value is not equal to itself.")
651653 }
652654
653655
654656
655657 @Callable(i)
656658 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
657659 then throw("Invalid slippageTolerance passed")
658660 else {
659661 let estPut = commonPut(i, slippageTolerance, true)
660662 let emitLpAmt = estPut._2
661663 let lpAssetId = estPut._7
662664 let state = estPut._9
663665 let amDiff = estPut._10
664666 let prDiff = estPut._11
665667 let amId = estPut._12
666668 let prId = estPut._13
667669 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
668670 if ((emitInv == emitInv))
669671 then {
670672 let emitInvLegacy = match emitInv {
671673 case legacyFactoryContract: Address =>
672674 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
673675 case _ =>
674676 unit
675677 }
676678 if ((emitInvLegacy == emitInvLegacy))
677679 then {
678680 let slippageAInv = if ((amDiff > 0))
679681 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
680682 else nil
681683 if ((slippageAInv == slippageAInv))
682684 then {
683685 let slippagePInv = if ((prDiff > 0))
684686 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
685687 else nil
686688 if ((slippagePInv == slippagePInv))
687689 then {
688690 let lpTransfer = if (shouldAutoStake)
689691 then {
690692 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
691693 if ((slpStakeInv == slpStakeInv))
692694 then nil
693695 else throw("Strict value is not equal to itself.")
694696 }
695697 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
696698 (state ++ lpTransfer)
697699 }
698700 else throw("Strict value is not equal to itself.")
699701 }
700702 else throw("Strict value is not equal to itself.")
701703 }
702704 else throw("Strict value is not equal to itself.")
703705 }
704706 else throw("Strict value is not equal to itself.")
705707 }
706708
707709
708710
709711 @Callable(i)
710712 func putForFree (maxSlippage) = if ((0 > maxSlippage))
711713 then throw("Invalid value passed")
712714 else {
713715 let estPut = commonPut(i, maxSlippage, false)
714716 estPut._9
715717 }
716718
717719
718720
719721 @Callable(i)
720722 func putOneTkn (minOutAmount,autoStake) = {
721723 let isPoolOneTokenOperationsDisabled = {
722724 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
723725 if ($isInstanceOf(@, "Boolean"))
724726 then @
725727 else throw(($getType(@) + " couldn't be cast to Boolean"))
726728 }
727729 let isPutDisabled = if (if (if (isGlobalShutdown())
728730 then true
729731 else (cfgPoolStatus == PoolPutDisabled))
730732 then true
731733 else (cfgPoolStatus == PoolShutdown))
732734 then true
733735 else isPoolOneTokenOperationsDisabled
734736 let checks = [if (!(isPutDisabled))
735737 then true
736738 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
737739 then true
738740 else throwErr("exactly 1 payment are expected")]
739741 if ((checks == checks))
740742 then {
741743 let payment = i.payments[0]
742744 let paymentAssetId = payment.assetId
743745 let paymentAmountRaw = payment.amount
744746 let userAddress = i.caller
745747 let txId = i.transactionId
746- let $t03143431561 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
747- let emitAmountEstimated = $t03143431561._1
748- let commonState = $t03143431561._2
749- let feeAmount = $t03143431561._3
750- let bonus = $t03143431561._4
748+ let $t03145531582 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
749+ let emitAmountEstimated = $t03145531582._1
750+ let commonState = $t03145531582._2
751+ let feeAmount = $t03145531582._3
752+ let bonus = $t03145531582._4
751753 let emitAmount = if (if ((minOutAmount > 0))
752754 then (minOutAmount > emitAmountEstimated)
753755 else false)
754756 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
755757 else emitAmountEstimated
756758 let emitInv = emit(emitAmount)
757759 if ((emitInv == emitInv))
758760 then {
759761 let lpTransfer = if (autoStake)
760762 then {
761763 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
762764 if ((stakeInv == stakeInv))
763765 then nil
764766 else throw("Strict value is not equal to itself.")
765767 }
766768 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
767769 let sendFee = if ((feeAmount > 0))
768770 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
769771 else nil
770772 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
771773 }
772774 else throw("Strict value is not equal to itself.")
773775 }
774776 else throw("Strict value is not equal to itself.")
775777 }
776778
777779
778780
779781 @Callable(i)
780782 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
781- let $t03229032425 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
782- let emitAmountEstimated = $t03229032425._1
783- let commonState = $t03229032425._2
784- let feeAmount = $t03229032425._3
785- let bonus = $t03229032425._4
783+ let $t03231132446 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
784+ let emitAmountEstimated = $t03231132446._1
785+ let commonState = $t03231132446._2
786+ let feeAmount = $t03231132446._3
787+ let bonus = $t03231132446._4
786788 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
787789 }
788790
789791
790792
791793 @Callable(i)
792794 func getOneTkn (outAssetIdStr,minOutAmount) = {
793795 let isPoolOneTokenOperationsDisabled = {
794796 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
795797 if ($isInstanceOf(@, "Boolean"))
796798 then @
797799 else throw(($getType(@) + " couldn't be cast to Boolean"))
798800 }
799801 let isGetDisabled = if (if (isGlobalShutdown())
800802 then true
801803 else (cfgPoolStatus == PoolShutdown))
802804 then true
803805 else isPoolOneTokenOperationsDisabled
804806 let checks = [if (!(isGetDisabled))
805807 then true
806808 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
807809 then true
808810 else throwErr("exactly 1 payment are expected")]
809811 if ((checks == checks))
810812 then {
811813 let outAssetId = parseAssetId(outAssetIdStr)
812814 let payment = i.payments[0]
813815 let paymentAssetId = payment.assetId
814816 let paymentAmount = payment.amount
815817 let userAddress = i.caller
816818 let txId = i.transactionId
817- let $t03319733329 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
818- let amountEstimated = $t03319733329._1
819- let commonState = $t03319733329._2
820- let feeAmount = $t03319733329._3
821- let bonus = $t03319733329._4
819+ let $t03321833350 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
820+ let amountEstimated = $t03321833350._1
821+ let commonState = $t03321833350._2
822+ let feeAmount = $t03321833350._3
823+ let bonus = $t03321833350._4
822824 let amount = if (if ((minOutAmount > 0))
823825 then (minOutAmount > amountEstimated)
824826 else false)
825827 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
826828 else amountEstimated
827829 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
828830 if ((burnInv == burnInv))
829831 then {
830832 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
831833 let sendFee = if ((feeAmount > 0))
832834 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
833835 else nil
834836 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
835837 }
836838 else throw("Strict value is not equal to itself.")
837839 }
838840 else throw("Strict value is not equal to itself.")
839841 }
840842
841843
842844
843845 @Callable(i)
844846 func getOneTknREADONLY (outAssetId,paymentAmount) = {
845- let $t03396434102 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
846- let amountEstimated = $t03396434102._1
847- let commonState = $t03396434102._2
848- let feeAmount = $t03396434102._3
849- let bonus = $t03396434102._4
847+ let $t03398534123 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
848+ let amountEstimated = $t03398534123._1
849+ let commonState = $t03398534123._2
850+ let feeAmount = $t03398534123._3
851+ let bonus = $t03398534123._4
850852 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
851853 }
852854
853855
854856
855857 @Callable(i)
856858 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
857859 let isPoolOneTokenOperationsDisabled = {
858860 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
859861 if ($isInstanceOf(@, "Boolean"))
860862 then @
861863 else throw(($getType(@) + " couldn't be cast to Boolean"))
862864 }
863865 let isGetDisabled = if (if (isGlobalShutdown())
864866 then true
865867 else (cfgPoolStatus == PoolShutdown))
866868 then true
867869 else isPoolOneTokenOperationsDisabled
868870 let checks = [if (!(isGetDisabled))
869871 then true
870872 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
871873 then true
872874 else throwErr("no payments are expected")]
873875 if ((checks == checks))
874876 then {
875877 let outAssetId = parseAssetId(outAssetIdStr)
876878 let userAddress = i.caller
877879 let txId = i.transactionId
878880 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
879881 if ((unstakeInv == unstakeInv))
880882 then {
881- let $t03489435024 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
882- let amountEstimated = $t03489435024._1
883- let commonState = $t03489435024._2
884- let feeAmount = $t03489435024._3
885- let bonus = $t03489435024._4
883+ let $t03491535045 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
884+ let amountEstimated = $t03491535045._1
885+ let commonState = $t03491535045._2
886+ let feeAmount = $t03491535045._3
887+ let bonus = $t03491535045._4
886888 let amount = if (if ((minOutAmount > 0))
887889 then (minOutAmount > amountEstimated)
888890 else false)
889891 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
890892 else amountEstimated
891893 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
892894 if ((burnInv == burnInv))
893895 then {
894896 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
895897 let sendFee = if ((feeAmount > 0))
896898 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
897899 else nil
898900 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
899901 }
900902 else throw("Strict value is not equal to itself.")
901903 }
902904 else throw("Strict value is not equal to itself.")
903905 }
904906 else throw("Strict value is not equal to itself.")
905907 }
906908
907909
908910
909911 @Callable(i)
910912 func get () = {
911913 let res = commonGet(i)
912914 let outAmtAmt = res._1
913915 let outPrAmt = res._2
914916 let pmtAmt = res._3
915917 let pmtAssetId = res._4
916918 let state = res._5
917919 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
918920 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
919921 then state
920922 else throw("Strict value is not equal to itself.")
921923 }
922924
923925
924926
925927 @Callable(i)
926928 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
927929 let res = commonGet(i)
928930 let outAmAmt = res._1
929931 let outPrAmt = res._2
930932 let pmtAmt = res._3
931933 let pmtAssetId = res._4
932934 let state = res._5
933935 if ((noLessThenAmtAsset > outAmAmt))
934936 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
935937 else if ((noLessThenPriceAsset > outPrAmt))
936938 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
937939 else {
938940 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
939941 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
940942 then state
941943 else throw("Strict value is not equal to itself.")
942944 }
943945 }
944946
945947
946948
947949 @Callable(i)
948950 func unstakeAndGet (amount) = {
949951 let checkPayments = if ((size(i.payments) != 0))
950952 then throw("No payments are expected")
951953 else true
952954 if ((checkPayments == checkPayments))
953955 then {
954956 let cfg = getPoolConfig()
955957 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
956958 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
957959 if ((unstakeInv == unstakeInv))
958960 then {
959961 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
960962 let poolStatus = parseIntValue(res._9)
961963 let state = res._10
962964 let checkPoolStatus = if (if (isGlobalShutdown())
963965 then true
964966 else (poolStatus == PoolShutdown))
965967 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
966968 else true
967969 if ((checkPoolStatus == checkPoolStatus))
968970 then {
969971 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
970972 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
971973 then state
972974 else throw("Strict value is not equal to itself.")
973975 }
974976 else throw("Strict value is not equal to itself.")
975977 }
976978 else throw("Strict value is not equal to itself.")
977979 }
978980 else throw("Strict value is not equal to itself.")
979981 }
980982
981983
982984
983985 @Callable(i)
984986 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
985987 let isGetDisabled = if (isGlobalShutdown())
986988 then true
987989 else (cfgPoolStatus == PoolShutdown)
988990 let checks = [if (!(isGetDisabled))
989991 then true
990992 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
991993 then true
992994 else throw("no payments are expected")]
993995 if ((checks == checks))
994996 then {
995997 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
996998 if ((unstakeInv == unstakeInv))
997999 then {
9981000 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
9991001 let outAmAmt = res._1
10001002 let outPrAmt = res._2
10011003 let state = res._10
10021004 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10031005 then true
10041006 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10051007 then true
10061008 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10071009 if ((checkAmounts == checkAmounts))
10081010 then {
10091011 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10101012 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10111013 then state
10121014 else throw("Strict value is not equal to itself.")
10131015 }
10141016 else throw("Strict value is not equal to itself.")
10151017 }
10161018 else throw("Strict value is not equal to itself.")
10171019 }
10181020 else throw("Strict value is not equal to itself.")
10191021 }
10201022
10211023
10221024
10231025 @Callable(i)
10241026 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10251027 then throw("permissions denied")
10261028 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10271029
10281030
10291031
10301032 @Callable(i)
10311033 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10321034
10331035
10341036
10351037 @Callable(i)
10361038 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10371039
10381040
10391041
10401042 @Callable(i)
10411043 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
10421044 let prices = calcPrices(amAmt, prAmt, lpAmt)
10431045 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
10441046 }
10451047
10461048
10471049
10481050 @Callable(i)
10491051 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
10501052
10511053
10521054
10531055 @Callable(i)
10541056 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
10551057
10561058
10571059
10581060 @Callable(i)
10591061 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
10601062
10611063
10621064
10631065 @Callable(i)
10641066 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
10651067
10661068
10671069
10681070 @Callable(i)
10691071 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
10701072 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
10711073 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
10721074 }
10731075
10741076
10751077
10761078 @Callable(i)
10771079 func statsREADONLY () = {
10781080 let cfg = getPoolConfig()
10791081 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10801082 let amtAssetId = cfg[idxAmtAssetId]
10811083 let priceAssetId = cfg[idxPriceAssetId]
10821084 let iAmtAssetId = cfg[idxIAmtAssetId]
10831085 let iPriceAssetId = cfg[idxIPriceAssetId]
10841086 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10851087 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10861088 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10871089 let accAmtAssetBalance = getAccBalance(amtAssetId)
10881090 let accPriceAssetBalance = getAccBalance(priceAssetId)
10891091 let pricesList = if ((poolLPBalance == 0))
10901092 then [zeroBigInt, zeroBigInt, zeroBigInt]
10911093 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
10921094 let curPrice = 0
10931095 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
10941096 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
10951097 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
10961098 $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))
10971099 }
10981100
10991101
11001102
11011103 @Callable(i)
11021104 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11031105 let cfg = getPoolConfig()
11041106 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11051107 let amAssetIdStr = cfg[idxAmtAssetId]
11061108 let amAssetId = fromBase58String(amAssetIdStr)
11071109 let prAssetIdStr = cfg[idxPriceAssetId]
11081110 let prAssetId = fromBase58String(prAssetIdStr)
11091111 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11101112 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11111113 let poolStatus = cfg[idxPoolStatus]
11121114 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11131115 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11141116 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11151117 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11161118 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11171119 let curPriceX18 = if ((poolLPBalance == 0))
11181120 then zeroBigInt
11191121 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11201122 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11211123 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11221124 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11231125 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11241126 let calcLpAmt = estPut._1
11251127 let curPriceCalc = estPut._3
11261128 let amBalance = estPut._4
11271129 let prBalance = estPut._5
11281130 let lpEmission = estPut._6
11291131 $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))
11301132 }
11311133
11321134
11331135
11341136 @Callable(i)
11351137 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11361138 let cfg = getPoolConfig()
11371139 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11381140 let amAssetIdStr = cfg[idxAmtAssetId]
11391141 let amAssetId = fromBase58String(amAssetIdStr)
11401142 let prAssetIdStr = cfg[idxPriceAssetId]
11411143 let prAssetId = fromBase58String(prAssetIdStr)
11421144 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11431145 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11441146 let poolStatus = cfg[idxPoolStatus]
11451147 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11461148 let amBalanceRaw = getAccBalance(amAssetIdStr)
11471149 let prBalanceRaw = getAccBalance(prAssetIdStr)
11481150 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
11491151 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
11501152 let curPriceX18 = if ((poolLPBalance == 0))
11511153 then zeroBigInt
11521154 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
11531155 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
11541156 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
11551157 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
11561158 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11571159 let calcLpAmt = estPut._1
11581160 let curPriceCalc = estPut._3
11591161 let amBalance = estPut._4
11601162 let prBalance = estPut._5
11611163 let lpEmission = estPut._6
11621164 $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))
11631165 }
11641166
11651167
11661168
11671169 @Callable(i)
11681170 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
11691171 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
11701172 let outAmAmt = res._1
11711173 let outPrAmt = res._2
11721174 let amBalance = res._5
11731175 let prBalance = res._6
11741176 let lpEmission = res._7
11751177 let curPrice = res._8
11761178 let poolStatus = parseIntValue(res._9)
11771179 $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))
11781180 }
11791181
11801182
11811183 @Verifier(tx)
11821184 func verify () = {
11831185 let targetPublicKey = match managerPublicKeyOrUnit() {
11841186 case pk: ByteVector =>
11851187 pk
11861188 case _: Unit =>
11871189 tx.senderPublicKey
11881190 case _ =>
11891191 throw("Match error")
11901192 }
11911193 match tx {
11921194 case order: Order =>
11931195 let matcherPub = getMatcherPubOrFail()
11941196 let orderValid = validateMatcherOrderAllowed(order)
11951197 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
11961198 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
11971199 if (if (if (orderValid)
11981200 then senderValid
11991201 else false)
12001202 then matcherValid
12011203 else false)
12021204 then true
12031205 else throwOrderError(orderValid, senderValid, matcherValid)
12041206 case s: SetScriptTransaction =>
12051207 let newHash = blake2b256(value(s.script))
12061208 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12071209 let currentHash = scriptHash(this)
12081210 if (if ((allowedHash == newHash))
12091211 then (currentHash != newHash)
12101212 else false)
12111213 then true
12121214 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12131215 case _ =>
12141216 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12151217 }
12161218 }
12171219

github/deemru/w8io/026f985 
129.37 ms