tx · 7HJwDaLc9DePe4NMifdx5tG7bJyCRm7rK5nkoAEuhuQ4

3NAvUjsRNTN1tcDqmaM1RcEygwZX9W5tQmg:  -0.03000000 Waves

2022.11.09 10:27 [2309294] smart account 3NAvUjsRNTN1tcDqmaM1RcEygwZX9W5tQmg > SELF 0.00000000 Waves

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

github/deemru/w8io/026f985 
125.81 ms