tx · 5bnYPqKyURrGQzCLanFBGp4urmaYn5FcHLVzpKyuATxK

3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS:  -0.03100000 Waves

2022.11.28 12:39 [2336784] smart account 3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS > SELF 0.00000000 Waves

{ "type": 13, "id": "5bnYPqKyURrGQzCLanFBGp4urmaYn5FcHLVzpKyuATxK", "fee": 3100000, "feeAssetId": null, "timestamp": 1669628316588, "version": 1, "sender": "3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS", "senderPublicKey": "8rqHfvDx1Q95zF6SWwiQWVTu2vr2wNQpxUzAx84ZAedj", "proofs": [ "5ZWaWuLgbUdXMW8f4FBsDKAf6sBe7WCftTyfcJ4knAcUXYqY1bhT6aQYnSjC5D8WCU6kEnKY6PyL7hTjijAAKHDK" ], "script": "base64:BgLgKQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQ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XoFAmFBBQJhQgMJAAECBQJkdwIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmVKBQJkdwQCZ2QJAPYDAQkBBXZhbHVlAQgFAmVKBnNjcmlwdAQCZ2UJANsEAQkBBXZhbHVlAQkAnQgCBQJhSgkBAmF3AAQCZ2YJAPEHAQUEdGhpcwMDCQAAAgUCZ2UFAmdkCQECIT0CBQJnZgUCZ2QHBgkA9AMDCAUCZloJYm9keUJ5dGVzCQCRAwIIBQJmWgZwcm9vZnMAAAUCZ2IJAPQDAwgFAmZaCWJvZHlCeXRlcwkAkQMCCAUCZloGcHJvb2ZzAAAFAmdiEgvigg==", "chainId": 84, "height": 2336784, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5cJXLtffw8eF26DbwWpSB7U1zE5WZooEKd2D2JCWKJwM Next: 5wn9bGWFz7pbNjZB8rPcV9kDd3b2A6Hm51m7vhsHvH97 Diff:
OldNewDifferences
591591 }
592592
593593
594-func calcKLp (amountBalance,priceBalance,lpEmission) = fraction(amountBalance, priceBalance, lpEmission)
594+func calcKLp (amountBalance,priceBalance,lpEmission) = {
595+ let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
596+ updatedKLp
597+ }
595598
596599
597600 func refreshKLpInternal () = {
598601 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
599602 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
600603 let lpEmission = value(assetInfo(cfgLpAssetId)).quantity
601- let updatedKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpEmission)
602- updatedKLp
604+ let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpEmission))
605+ let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
606+ $Tuple2(actions, updatedKLp)
603607 }
604608
605609
778782 let paymentAmountRaw = payment.amount
779783 let userAddress = i.caller
780784 let txId = i.transactionId
781- let $t03249132618 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
782- let emitAmountEstimated = $t03249132618._1
783- let commonState = $t03249132618._2
784- let feeAmount = $t03249132618._3
785- let bonus = $t03249132618._4
785+ let $t03275432881 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
786+ let emitAmountEstimated = $t03275432881._1
787+ let commonState = $t03275432881._2
788+ let feeAmount = $t03275432881._3
789+ let bonus = $t03275432881._4
786790 let emitAmount = if (if ((minOutAmount > 0))
787791 then (minOutAmount > emitAmountEstimated)
788792 else false)
813817
814818 @Callable(i)
815819 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
816- let $t03334733482 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
817- let emitAmountEstimated = $t03334733482._1
818- let commonState = $t03334733482._2
819- let feeAmount = $t03334733482._3
820- let bonus = $t03334733482._4
820+ let $t03361033745 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
821+ let emitAmountEstimated = $t03361033745._1
822+ let commonState = $t03361033745._2
823+ let feeAmount = $t03361033745._3
824+ let bonus = $t03361033745._4
821825 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
822826 }
823827
851855 let paymentAmount = payment.amount
852856 let userAddress = i.caller
853857 let txId = i.transactionId
854- let $t03428734419 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
855- let amountEstimated = $t03428734419._1
856- let commonState = $t03428734419._2
857- let feeAmount = $t03428734419._3
858- let bonus = $t03428734419._4
858+ let $t03455034682 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
859+ let amountEstimated = $t03455034682._1
860+ let commonState = $t03455034682._2
861+ let feeAmount = $t03455034682._3
862+ let bonus = $t03455034682._4
859863 let amount = if (if ((minOutAmount > 0))
860864 then (minOutAmount > amountEstimated)
861865 else false)
879883
880884 @Callable(i)
881885 func getOneTknREADONLY (outAssetId,paymentAmount) = {
882- let $t03505435192 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
883- let amountEstimated = $t03505435192._1
884- let commonState = $t03505435192._2
885- let feeAmount = $t03505435192._3
886- let bonus = $t03505435192._4
886+ let $t03531735455 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
887+ let amountEstimated = $t03531735455._1
888+ let commonState = $t03531735455._2
889+ let feeAmount = $t03531735455._3
890+ let bonus = $t03531735455._4
887891 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
888892 }
889893
917921 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
918922 if ((unstakeInv == unstakeInv))
919923 then {
920- let $t03601736147 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
921- let amountEstimated = $t03601736147._1
922- let commonState = $t03601736147._2
923- let feeAmount = $t03601736147._3
924- let bonus = $t03601736147._4
924+ let $t03628036410 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
925+ let amountEstimated = $t03628036410._1
926+ let commonState = $t03628036410._2
927+ let feeAmount = $t03628036410._3
928+ let bonus = $t03628036410._4
925929 let amount = if (if ((minOutAmount > 0))
926930 then (minOutAmount > amountEstimated)
927931 else false)
10741078 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
10751079 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
10761080 then {
1077- let updatedKLp = refreshKLpInternal()
1078-[IntegerEntry(keyKLpRefreshedHeight, height), IntegerEntry(keyKLp, updatedKLp)]
1081+ let $t04139341441 = refreshKLpInternal()
1082+ let actions = $t04139341441._1
1083+ let updatedKLp = $t04139341441._2
1084+ $Tuple2(actions, updatedKLp)
10791085 }
10801086 else throw("Strict value is not equal to itself.")
10811087 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
6161
6262 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6363
6464
6565 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
6666
6767
6868 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
6969
7070
7171 func abs (val) = if ((0 > val))
7272 then -(val)
7373 else val
7474
7575
7676 func absBigInt (val) = if ((zeroBigInt > val))
7777 then -(val)
7878 else val
7979
8080
8181 func fc () = "%s__factoryContract"
8282
8383
8484 func mpk () = "%s__managerPublicKey"
8585
8686
8787 func pmpk () = "%s__pendingManagerPublicKey"
8888
8989
9090 func pl () = "%s%s__price__last"
9191
9292
9393 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9494
9595
9696 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
9797
9898
9999 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100100
101101
102102 func aa () = "%s__amountAsset"
103103
104104
105105 func pa () = "%s__priceAsset"
106106
107107
108108 let keyFee = "%s__fee"
109109
110110 let feeDefault = fraction(10, scale8, 10000)
111111
112112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113113
114114 let keyKLp = makeString(["%s", "kLp"], SEP)
115115
116116 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117117
118118 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119119
120120 let kLpRefreshDelayDefault = 30
121121
122122 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123123
124124 func keyFactoryConfig () = "%s__factoryConfig"
125125
126126
127127 func keyMatcherPub () = "%s%s__matcher__publicKey"
128128
129129
130130 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131131
132132
133133 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134134
135135
136136 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137137
138138
139139 func keyAllPoolsShutdown () = "%s__shutdown"
140140
141141
142142 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143143
144144
145145 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146146
147147
148148 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149149
150150 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151151
152152
153153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154154
155155
156156 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160160
161161
162162 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163163
164164
165165 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166166
167167 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168168
169169 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170170
171171
172172 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173173
174174
175175 func getPoolConfig () = {
176176 let amtAsset = getStringOrFail(this, aa())
177177 let priceAsset = getStringOrFail(this, pa())
178178 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179179 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180180 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181181 }
182182
183183
184184 func parseAssetId (input) = if ((input == wavesString))
185185 then unit
186186 else fromBase58String(input)
187187
188188
189189 func assetIdToString (input) = if ((input == unit))
190190 then wavesString
191191 else toBase58String(value(input))
192192
193193
194194 func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolStatus]), fromBase58String(poolConfig[idxPoolLPAssetId]), parseAssetId(poolConfig[idxAmtAssetId]), parseAssetId(poolConfig[idxPriceAssetId]), parseIntValue(poolConfig[idxAmtAssetDcm]), parseIntValue(poolConfig[idxPriceAssetDcm]))
195195
196196
197197 let poolConfigParsed = parsePoolConfig(getPoolConfig())
198198
199199 let $t079158081 = poolConfigParsed
200200
201201 let cfgPoolAddress = $t079158081._1
202202
203203 let cfgPoolStatus = $t079158081._2
204204
205205 let cfgLpAssetId = $t079158081._3
206206
207207 let cfgAmountAssetId = $t079158081._4
208208
209209 let cfgPriceAssetId = $t079158081._5
210210
211211 let cfgAmountAssetDecimals = $t079158081._6
212212
213213 let cfgPriceAssetDecimals = $t079158081._7
214214
215215 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216216
217217
218218 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219219
220220 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221221
222222 func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slippageTolerancePassedByUser,slippageToleranceReal,txHeight,txTimestamp,slipageAmtAssetAmt,slipagePriceAssetAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slippageTolerancePassedByUser), toString(slippageToleranceReal), toString(txHeight), toString(txTimestamp), toString(slipageAmtAssetAmt), toString(slipagePriceAssetAmt)], SEP)
223223
224224
225225 func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP)
226226
227227
228228 func getAccBalance (assetId) = if ((assetId == "WAVES"))
229229 then wavesBalance(this).available
230230 else assetBalance(this, fromBase58String(assetId))
231231
232232
233233 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234234
235235
236236 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237237 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238238 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239239 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240240 }
241241
242242
243243 func calcPrices (amAmt,prAmt,lpAmt) = {
244244 let cfg = getPoolConfig()
245245 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246246 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247247 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248248 let amAmtX18 = toX18(amAmt, amtAssetDcm)
249249 let prAmtX18 = toX18(prAmt, priceAssetDcm)
250250 let lpAmtX18 = toX18(lpAmt, scale8)
251251 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252252 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253253 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254254 }
255255
256256
257257 func calculatePrices (amAmt,prAmt,lpAmt) = {
258258 let prices = calcPrices(amAmt, prAmt, lpAmt)
259259 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260260 }
261261
262262
263263 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264264 let cfg = getPoolConfig()
265265 let lpAssetId = cfg[idxPoolLPAssetId]
266266 let amAssetId = cfg[idxAmtAssetId]
267267 let prAssetId = cfg[idxPriceAssetId]
268268 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269269 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270270 let poolStatus = cfg[idxPoolStatus]
271271 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272272 if ((lpAssetId != pmtAssetId))
273273 then throw("Invalid asset passed.")
274274 else {
275275 let amBalance = getAccBalance(amAssetId)
276276 let amBalanceX18 = toX18(amBalance, amAssetDcm)
277277 let prBalance = getAccBalance(prAssetId)
278278 let prBalanceX18 = toX18(prBalance, prAssetDcm)
279279 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280280 let curPrice = fromX18(curPriceX18, scale8)
281281 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282282 let lpEmissionX18 = toX18(lpEmission, scale8)
283283 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284284 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285285 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286286 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287287 let state = if ((txId58 == ""))
288288 then nil
289289 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290290 then unit
291291 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292292 then unit
293293 else fromBase58String(prAssetId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)]
294294 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295295 }
296296 }
297297
298298
299299 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300300 let cfg = getPoolConfig()
301301 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302302 let amAssetIdStr = cfg[idxAmtAssetId]
303303 let prAssetIdStr = cfg[idxPriceAssetId]
304304 let iAmtAssetId = cfg[idxIAmtAssetId]
305305 let iPriceAssetId = cfg[idxIPriceAssetId]
306306 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307307 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308308 let poolStatus = cfg[idxPoolStatus]
309309 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310310 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311311 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312312 if (if ((amAssetIdStr != inAmAssetIdStr))
313313 then true
314314 else (prAssetIdStr != inPrAssetIdStr))
315315 then throw("Invalid amt or price asset passed.")
316316 else {
317317 let amBalance = if (isEvaluate)
318318 then getAccBalance(amAssetIdStr)
319319 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320320 let prBalance = if (isEvaluate)
321321 then getAccBalance(prAssetIdStr)
322322 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323323 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324324 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325325 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326326 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327327 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328328 let res = if ((lpEmission == 0))
329329 then {
330330 let curPriceX18 = zeroBigInt
331331 let slippageX18 = zeroBigInt
332332 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333333 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334334 }
335335 else {
336336 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337337 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338338 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339339 if (if ((curPriceX18 != zeroBigInt))
340340 then (slippageX18 > slippageToleranceX18)
341341 else false)
342342 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343343 else {
344344 let lpEmissionX18 = toX18(lpEmission, scale8)
345345 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346346 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347347 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348348 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349349 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350350 let expAmtAssetAmtX18 = expectedAmts._1
351351 let expPriceAssetAmtX18 = expectedAmts._2
352352 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353353 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354354 }
355355 }
356356 let calcLpAmt = res._1
357357 let calcAmAssetPmt = res._2
358358 let calcPrAssetPmt = res._3
359359 let curPrice = fromX18(res._4, scale8)
360360 let slippageCalc = fromX18(res._5, scale8)
361361 if ((0 >= calcLpAmt))
362362 then throw("Invalid calculations. LP calculated is less than zero.")
363363 else {
364364 let emitLpAmt = if (!(emitLp))
365365 then 0
366366 else calcLpAmt
367367 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368368 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369369 let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(calcAmAssetPmt, calcPrAssetPmt, emitLpAmt, curPrice, slippageTolerance, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))]
370370 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371371 }
372372 }
373373 }
374374
375375
376376 func validateMatcherOrderAllowed (order) = {
377377 let cfg = getPoolConfig()
378378 let amtAssetId = cfg[idxAmtAssetId]
379379 let priceAssetId = cfg[idxPriceAssetId]
380380 let poolStatus = parseIntValue(cfg[idxPoolStatus])
381381 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
382382 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
383383 let accAmtAssetBalance = getAccBalance(amtAssetId)
384384 let accPriceAssetBalance = getAccBalance(priceAssetId)
385385 let curPriceX18 = if ((order.orderType == Buy))
386386 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
387387 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
388388 let curPrice = fromX18(curPriceX18, scale8)
389389 if (if (if (isGlobalShutdown())
390390 then true
391391 else (poolStatus == PoolMatcherDisabled))
392392 then true
393393 else (poolStatus == PoolShutdown))
394394 then throw("Exchange operations disabled")
395395 else {
396396 let orderAmtAsset = order.assetPair.amountAsset
397397 let orderAmtAssetStr = if ((orderAmtAsset == unit))
398398 then "WAVES"
399399 else toBase58String(value(orderAmtAsset))
400400 let orderPriceAsset = order.assetPair.priceAsset
401401 let orderPriceAssetStr = if ((orderPriceAsset == unit))
402402 then "WAVES"
403403 else toBase58String(value(orderPriceAsset))
404404 if (if ((orderAmtAssetStr != amtAssetId))
405405 then true
406406 else (orderPriceAssetStr != priceAssetId))
407407 then throw("Wrong order assets.")
408408 else {
409409 let orderPrice = order.price
410410 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
411411 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
412412 let isOrderPriceValid = if ((order.orderType == Buy))
413413 then (curPrice >= castedOrderPrice)
414414 else (castedOrderPrice >= curPrice)
415415 true
416416 }
417417 }
418418 }
419419
420420
421421 func commonGet (i) = if ((size(i.payments) != 1))
422422 then throw("exactly 1 payment is expected")
423423 else {
424424 let pmt = value(i.payments[0])
425425 let pmtAssetId = value(pmt.assetId)
426426 let pmtAmt = pmt.amount
427427 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
428428 let outAmAmt = res._1
429429 let outPrAmt = res._2
430430 let poolStatus = parseIntValue(res._9)
431431 let state = res._10
432432 if (if (isGlobalShutdown())
433433 then true
434434 else (poolStatus == PoolShutdown))
435435 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
436436 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
437437 }
438438
439439
440440 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
441441 then throw("exactly 2 payments are expected")
442442 else {
443443 let amAssetPmt = value(i.payments[0])
444444 let prAssetPmt = value(i.payments[1])
445445 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
446446 let poolStatus = parseIntValue(estPut._8)
447447 if (if (if (isGlobalShutdown())
448448 then true
449449 else (poolStatus == PoolPutDisabled))
450450 then true
451451 else (poolStatus == PoolShutdown))
452452 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
453453 else estPut
454454 }
455455
456456
457457 func emit (amount) = {
458458 let emitInv = invoke(factoryContract, "emit", [amount], nil)
459459 if ((emitInv == emitInv))
460460 then {
461461 let emitInvLegacy = match emitInv {
462462 case legacyFactoryContract: Address =>
463463 invoke(legacyFactoryContract, "emit", [amount], nil)
464464 case _ =>
465465 unit
466466 }
467467 if ((emitInvLegacy == emitInvLegacy))
468468 then amount
469469 else throw("Strict value is not equal to itself.")
470470 }
471471 else throw("Strict value is not equal to itself.")
472472 }
473473
474474
475475 func takeFee (amount) = {
476476 let feeAmount = fraction(amount, fee, scale8)
477477 $Tuple2((amount - feeAmount), feeAmount)
478478 }
479479
480480
481481 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
482482 let isEval = (txId == unit)
483483 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
484484 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
485485 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
486486 then true
487487 else if ((paymentAssetId == cfgPriceAssetId))
488488 then false
489489 else throwErr("invalid asset")
490490 let $t02294223235 = if (isEval)
491491 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492492 else if (paymentInAmountAsset)
493493 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494494 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495495 let amountBalanceOld = $t02294223235._1
496496 let priceBalanceOld = $t02294223235._2
497497 let $t02323923388 = if (paymentInAmountAsset)
498498 then $Tuple2(paymentAmountRaw, 0)
499499 else $Tuple2(0, paymentAmountRaw)
500500 let amountAssetAmountRaw = $t02323923388._1
501501 let priceAssetAmountRaw = $t02323923388._2
502502 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
503503 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
504504 let $t02351023569 = takeFee(paymentAmountRaw)
505505 let paymentAmount = $t02351023569._1
506506 let feeAmount = $t02351023569._2
507507 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508508 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509509 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
510510 let priceNew = fromX18(priceNewX18, scale8)
511511 let paymentBalance = if (paymentInAmountAsset)
512512 then amountBalanceOld
513513 else priceBalanceOld
514514 let paymentBalanceBigInt = toBigInt(paymentBalance)
515515 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
516516 let chechSupply = if ((supplyBigInt > big0))
517517 then true
518518 else throwErr("initial deposit requires all coins")
519519 if ((chechSupply == chechSupply))
520520 then {
521521 let depositBigInt = toBigInt(paymentAmount)
522522 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
523523 let commonState = if (isEval)
524524 then nil
525525 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))]
526526 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527527 let priceOld = fromX18(priceOldX18, scale8)
528528 let loss = {
529529 let $t02504625213 = if (paymentInAmountAsset)
530530 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531531 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532532 let amount = $t02504625213._1
533533 let balance = $t02504625213._2
534534 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535535 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536536 }
537537 $Tuple4(issueAmount, commonState, feeAmount, loss)
538538 }
539539 else throw("Strict value is not equal to itself.")
540540 }
541541
542542
543543 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
544544 let isEval = (txId == unit)
545545 let checks = [if ((paymentAssetId == cfgLpAssetId))
546546 then true
547547 else throwErr("invalid lp asset")]
548548 if ((checks == checks))
549549 then {
550550 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
551551 then true
552552 else if ((outAssetId == cfgPriceAssetId))
553553 then false
554554 else throwErr("invalid asset")
555555 let balanceBigInt = if (outInAmountAsset)
556556 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
557557 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
558558 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
559559 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
560560 let outBalance = if (outInAmountAsset)
561561 then amBalanceOld
562562 else prBalanceOld
563563 let outBalanceBigInt = toBigInt(outBalance)
564564 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565565 let redeemedBigInt = toBigInt(paymentAmount)
566566 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567567 let $t02679326843 = takeFee(amountRaw)
568568 let totalAmount = $t02679326843._1
569569 let feeAmount = $t02679326843._2
570570 let $t02684727073 = if (outInAmountAsset)
571571 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572572 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573573 let outAmAmount = $t02684727073._1
574574 let outPrAmount = $t02684727073._2
575575 let amBalanceNew = $t02684727073._3
576576 let prBalanceNew = $t02684727073._4
577577 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578578 let priceNew = fromX18(priceNewX18, scale8)
579579 let commonState = if (isEval)
580580 then nil
581581 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)]
582582 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
583583 let priceOld = fromX18(priceOldX18, scale8)
584584 let loss = {
585585 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
586586 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
587587 }
588588 $Tuple4(totalAmount, commonState, feeAmount, loss)
589589 }
590590 else throw("Strict value is not equal to itself.")
591591 }
592592
593593
594-func calcKLp (amountBalance,priceBalance,lpEmission) = fraction(amountBalance, priceBalance, lpEmission)
594+func calcKLp (amountBalance,priceBalance,lpEmission) = {
595+ let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
596+ updatedKLp
597+ }
595598
596599
597600 func refreshKLpInternal () = {
598601 let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
599602 let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
600603 let lpEmission = value(assetInfo(cfgLpAssetId)).quantity
601- let updatedKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpEmission)
602- updatedKLp
604+ let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpEmission))
605+ let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
606+ $Tuple2(actions, updatedKLp)
603607 }
604608
605609
606610 func managerPublicKeyOrUnit () = match getString(mpk()) {
607611 case s: String =>
608612 fromBase58String(s)
609613 case _: Unit =>
610614 unit
611615 case _ =>
612616 throw("Match error")
613617 }
614618
615619
616620 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
617621 case s: String =>
618622 fromBase58String(s)
619623 case _: Unit =>
620624 unit
621625 case _ =>
622626 throw("Match error")
623627 }
624628
625629
626630 func isManager (i) = match managerPublicKeyOrUnit() {
627631 case pk: ByteVector =>
628632 (i.callerPublicKey == pk)
629633 case _: Unit =>
630634 (i.caller == this)
631635 case _ =>
632636 throw("Match error")
633637 }
634638
635639
636640 func mustManager (i) = {
637641 let pd = throw("Permission denied")
638642 match managerPublicKeyOrUnit() {
639643 case pk: ByteVector =>
640644 if ((i.callerPublicKey == pk))
641645 then true
642646 else pd
643647 case _: Unit =>
644648 if ((i.caller == this))
645649 then true
646650 else pd
647651 case _ =>
648652 throw("Match error")
649653 }
650654 }
651655
652656
653657 @Callable(i)
654658 func setManager (pendingManagerPublicKey) = {
655659 let checkCaller = mustManager(i)
656660 if ((checkCaller == checkCaller))
657661 then {
658662 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
659663 if ((checkManagerPublicKey == checkManagerPublicKey))
660664 then [StringEntry(pmpk(), pendingManagerPublicKey)]
661665 else throw("Strict value is not equal to itself.")
662666 }
663667 else throw("Strict value is not equal to itself.")
664668 }
665669
666670
667671
668672 @Callable(i)
669673 func confirmManager () = {
670674 let pm = pendingManagerPublicKeyOrUnit()
671675 let hasPM = if (isDefined(pm))
672676 then true
673677 else throw("No pending manager")
674678 if ((hasPM == hasPM))
675679 then {
676680 let checkPM = if ((i.callerPublicKey == value(pm)))
677681 then true
678682 else throw("You are not pending manager")
679683 if ((checkPM == checkPM))
680684 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
681685 else throw("Strict value is not equal to itself.")
682686 }
683687 else throw("Strict value is not equal to itself.")
684688 }
685689
686690
687691
688692 @Callable(i)
689693 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
690694 then throw("Invalid slippageTolerance passed")
691695 else {
692696 let estPut = commonPut(i, slippageTolerance, true)
693697 let emitLpAmt = estPut._2
694698 let lpAssetId = estPut._7
695699 let state = estPut._9
696700 let amDiff = estPut._10
697701 let prDiff = estPut._11
698702 let amId = estPut._12
699703 let prId = estPut._13
700704 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
701705 if ((emitInv == emitInv))
702706 then {
703707 let emitInvLegacy = match emitInv {
704708 case legacyFactoryContract: Address =>
705709 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
706710 case _ =>
707711 unit
708712 }
709713 if ((emitInvLegacy == emitInvLegacy))
710714 then {
711715 let slippageAInv = if ((amDiff > 0))
712716 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
713717 else nil
714718 if ((slippageAInv == slippageAInv))
715719 then {
716720 let slippagePInv = if ((prDiff > 0))
717721 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
718722 else nil
719723 if ((slippagePInv == slippagePInv))
720724 then {
721725 let lpTransfer = if (shouldAutoStake)
722726 then {
723727 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
724728 if ((slpStakeInv == slpStakeInv))
725729 then nil
726730 else throw("Strict value is not equal to itself.")
727731 }
728732 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
729733 (state ++ lpTransfer)
730734 }
731735 else throw("Strict value is not equal to itself.")
732736 }
733737 else throw("Strict value is not equal to itself.")
734738 }
735739 else throw("Strict value is not equal to itself.")
736740 }
737741 else throw("Strict value is not equal to itself.")
738742 }
739743
740744
741745
742746 @Callable(i)
743747 func putForFree (maxSlippage) = if ((0 > maxSlippage))
744748 then throw("Invalid value passed")
745749 else {
746750 let estPut = commonPut(i, maxSlippage, false)
747751 estPut._9
748752 }
749753
750754
751755
752756 @Callable(i)
753757 func putOneTkn (minOutAmount,autoStake) = {
754758 let isPoolOneTokenOperationsDisabled = {
755759 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
756760 if ($isInstanceOf(@, "Boolean"))
757761 then @
758762 else throw(($getType(@) + " couldn't be cast to Boolean"))
759763 }
760764 let isPutDisabled = if (if (if (isGlobalShutdown())
761765 then true
762766 else (cfgPoolStatus == PoolPutDisabled))
763767 then true
764768 else (cfgPoolStatus == PoolShutdown))
765769 then true
766770 else isPoolOneTokenOperationsDisabled
767771 let checks = [if (if (!(isPutDisabled))
768772 then true
769773 else isManager(i))
770774 then true
771775 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
772776 then true
773777 else throwErr("exactly 1 payment are expected")]
774778 if ((checks == checks))
775779 then {
776780 let payment = i.payments[0]
777781 let paymentAssetId = payment.assetId
778782 let paymentAmountRaw = payment.amount
779783 let userAddress = i.caller
780784 let txId = i.transactionId
781- let $t03249132618 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
782- let emitAmountEstimated = $t03249132618._1
783- let commonState = $t03249132618._2
784- let feeAmount = $t03249132618._3
785- let bonus = $t03249132618._4
785+ let $t03275432881 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
786+ let emitAmountEstimated = $t03275432881._1
787+ let commonState = $t03275432881._2
788+ let feeAmount = $t03275432881._3
789+ let bonus = $t03275432881._4
786790 let emitAmount = if (if ((minOutAmount > 0))
787791 then (minOutAmount > emitAmountEstimated)
788792 else false)
789793 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
790794 else emitAmountEstimated
791795 let emitInv = emit(emitAmount)
792796 if ((emitInv == emitInv))
793797 then {
794798 let lpTransfer = if (autoStake)
795799 then {
796800 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
797801 if ((stakeInv == stakeInv))
798802 then nil
799803 else throw("Strict value is not equal to itself.")
800804 }
801805 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
802806 let sendFee = if ((feeAmount > 0))
803807 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
804808 else nil
805809 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
806810 }
807811 else throw("Strict value is not equal to itself.")
808812 }
809813 else throw("Strict value is not equal to itself.")
810814 }
811815
812816
813817
814818 @Callable(i)
815819 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
816- let $t03334733482 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
817- let emitAmountEstimated = $t03334733482._1
818- let commonState = $t03334733482._2
819- let feeAmount = $t03334733482._3
820- let bonus = $t03334733482._4
820+ let $t03361033745 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
821+ let emitAmountEstimated = $t03361033745._1
822+ let commonState = $t03361033745._2
823+ let feeAmount = $t03361033745._3
824+ let bonus = $t03361033745._4
821825 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
822826 }
823827
824828
825829
826830 @Callable(i)
827831 func getOneTkn (outAssetIdStr,minOutAmount) = {
828832 let isPoolOneTokenOperationsDisabled = {
829833 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
830834 if ($isInstanceOf(@, "Boolean"))
831835 then @
832836 else throw(($getType(@) + " couldn't be cast to Boolean"))
833837 }
834838 let isGetDisabled = if (if (isGlobalShutdown())
835839 then true
836840 else (cfgPoolStatus == PoolShutdown))
837841 then true
838842 else isPoolOneTokenOperationsDisabled
839843 let checks = [if (if (!(isGetDisabled))
840844 then true
841845 else isManager(i))
842846 then true
843847 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
844848 then true
845849 else throwErr("exactly 1 payment are expected")]
846850 if ((checks == checks))
847851 then {
848852 let outAssetId = parseAssetId(outAssetIdStr)
849853 let payment = i.payments[0]
850854 let paymentAssetId = payment.assetId
851855 let paymentAmount = payment.amount
852856 let userAddress = i.caller
853857 let txId = i.transactionId
854- let $t03428734419 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
855- let amountEstimated = $t03428734419._1
856- let commonState = $t03428734419._2
857- let feeAmount = $t03428734419._3
858- let bonus = $t03428734419._4
858+ let $t03455034682 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
859+ let amountEstimated = $t03455034682._1
860+ let commonState = $t03455034682._2
861+ let feeAmount = $t03455034682._3
862+ let bonus = $t03455034682._4
859863 let amount = if (if ((minOutAmount > 0))
860864 then (minOutAmount > amountEstimated)
861865 else false)
862866 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
863867 else amountEstimated
864868 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
865869 if ((burnInv == burnInv))
866870 then {
867871 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
868872 let sendFee = if ((feeAmount > 0))
869873 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
870874 else nil
871875 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
872876 }
873877 else throw("Strict value is not equal to itself.")
874878 }
875879 else throw("Strict value is not equal to itself.")
876880 }
877881
878882
879883
880884 @Callable(i)
881885 func getOneTknREADONLY (outAssetId,paymentAmount) = {
882- let $t03505435192 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
883- let amountEstimated = $t03505435192._1
884- let commonState = $t03505435192._2
885- let feeAmount = $t03505435192._3
886- let bonus = $t03505435192._4
886+ let $t03531735455 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
887+ let amountEstimated = $t03531735455._1
888+ let commonState = $t03531735455._2
889+ let feeAmount = $t03531735455._3
890+ let bonus = $t03531735455._4
887891 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
888892 }
889893
890894
891895
892896 @Callable(i)
893897 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
894898 let isPoolOneTokenOperationsDisabled = {
895899 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
896900 if ($isInstanceOf(@, "Boolean"))
897901 then @
898902 else throw(($getType(@) + " couldn't be cast to Boolean"))
899903 }
900904 let isGetDisabled = if (if (isGlobalShutdown())
901905 then true
902906 else (cfgPoolStatus == PoolShutdown))
903907 then true
904908 else isPoolOneTokenOperationsDisabled
905909 let checks = [if (if (!(isGetDisabled))
906910 then true
907911 else isManager(i))
908912 then true
909913 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
910914 then true
911915 else throwErr("no payments are expected")]
912916 if ((checks == checks))
913917 then {
914918 let outAssetId = parseAssetId(outAssetIdStr)
915919 let userAddress = i.caller
916920 let txId = i.transactionId
917921 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
918922 if ((unstakeInv == unstakeInv))
919923 then {
920- let $t03601736147 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
921- let amountEstimated = $t03601736147._1
922- let commonState = $t03601736147._2
923- let feeAmount = $t03601736147._3
924- let bonus = $t03601736147._4
924+ let $t03628036410 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
925+ let amountEstimated = $t03628036410._1
926+ let commonState = $t03628036410._2
927+ let feeAmount = $t03628036410._3
928+ let bonus = $t03628036410._4
925929 let amount = if (if ((minOutAmount > 0))
926930 then (minOutAmount > amountEstimated)
927931 else false)
928932 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
929933 else amountEstimated
930934 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
931935 if ((burnInv == burnInv))
932936 then {
933937 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
934938 let sendFee = if ((feeAmount > 0))
935939 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
936940 else nil
937941 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
938942 }
939943 else throw("Strict value is not equal to itself.")
940944 }
941945 else throw("Strict value is not equal to itself.")
942946 }
943947 else throw("Strict value is not equal to itself.")
944948 }
945949
946950
947951
948952 @Callable(i)
949953 func get () = {
950954 let res = commonGet(i)
951955 let outAmtAmt = res._1
952956 let outPrAmt = res._2
953957 let pmtAmt = res._3
954958 let pmtAssetId = res._4
955959 let state = res._5
956960 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
957961 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
958962 then state
959963 else throw("Strict value is not equal to itself.")
960964 }
961965
962966
963967
964968 @Callable(i)
965969 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
966970 let res = commonGet(i)
967971 let outAmAmt = res._1
968972 let outPrAmt = res._2
969973 let pmtAmt = res._3
970974 let pmtAssetId = res._4
971975 let state = res._5
972976 if ((noLessThenAmtAsset > outAmAmt))
973977 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
974978 else if ((noLessThenPriceAsset > outPrAmt))
975979 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
976980 else {
977981 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
978982 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
979983 then state
980984 else throw("Strict value is not equal to itself.")
981985 }
982986 }
983987
984988
985989
986990 @Callable(i)
987991 func unstakeAndGet (amount) = {
988992 let checkPayments = if ((size(i.payments) != 0))
989993 then throw("No payments are expected")
990994 else true
991995 if ((checkPayments == checkPayments))
992996 then {
993997 let cfg = getPoolConfig()
994998 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
995999 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
9961000 if ((unstakeInv == unstakeInv))
9971001 then {
9981002 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
9991003 let poolStatus = parseIntValue(res._9)
10001004 let state = res._10
10011005 let checkPoolStatus = if (if (isGlobalShutdown())
10021006 then true
10031007 else (poolStatus == PoolShutdown))
10041008 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
10051009 else true
10061010 if ((checkPoolStatus == checkPoolStatus))
10071011 then {
10081012 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
10091013 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10101014 then state
10111015 else throw("Strict value is not equal to itself.")
10121016 }
10131017 else throw("Strict value is not equal to itself.")
10141018 }
10151019 else throw("Strict value is not equal to itself.")
10161020 }
10171021 else throw("Strict value is not equal to itself.")
10181022 }
10191023
10201024
10211025
10221026 @Callable(i)
10231027 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10241028 let isGetDisabled = if (isGlobalShutdown())
10251029 then true
10261030 else (cfgPoolStatus == PoolShutdown)
10271031 let checks = [if (!(isGetDisabled))
10281032 then true
10291033 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10301034 then true
10311035 else throw("no payments are expected")]
10321036 if ((checks == checks))
10331037 then {
10341038 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10351039 if ((unstakeInv == unstakeInv))
10361040 then {
10371041 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
10381042 let outAmAmt = res._1
10391043 let outPrAmt = res._2
10401044 let state = res._10
10411045 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10421046 then true
10431047 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10441048 then true
10451049 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10461050 if ((checkAmounts == checkAmounts))
10471051 then {
10481052 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10491053 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10501054 then state
10511055 else throw("Strict value is not equal to itself.")
10521056 }
10531057 else throw("Strict value is not equal to itself.")
10541058 }
10551059 else throw("Strict value is not equal to itself.")
10561060 }
10571061 else throw("Strict value is not equal to itself.")
10581062 }
10591063
10601064
10611065
10621066 @Callable(i)
10631067 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10641068 then throw("permissions denied")
10651069 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10661070
10671071
10681072
10691073 @Callable(i)
10701074 func refreshKLp () = {
10711075 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
10721076 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
10731077 then unit
10741078 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
10751079 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
10761080 then {
1077- let updatedKLp = refreshKLpInternal()
1078-[IntegerEntry(keyKLpRefreshedHeight, height), IntegerEntry(keyKLp, updatedKLp)]
1081+ let $t04139341441 = refreshKLpInternal()
1082+ let actions = $t04139341441._1
1083+ let updatedKLp = $t04139341441._2
1084+ $Tuple2(actions, updatedKLp)
10791085 }
10801086 else throw("Strict value is not equal to itself.")
10811087 }
10821088
10831089
10841090
10851091 @Callable(i)
10861092 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10871093
10881094
10891095
10901096 @Callable(i)
10911097 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10921098
10931099
10941100
10951101 @Callable(i)
10961102 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
10971103 let prices = calcPrices(amAmt, prAmt, lpAmt)
10981104 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
10991105 }
11001106
11011107
11021108
11031109 @Callable(i)
11041110 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11051111
11061112
11071113
11081114 @Callable(i)
11091115 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11101116
11111117
11121118
11131119 @Callable(i)
11141120 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11151121
11161122
11171123
11181124 @Callable(i)
11191125 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11201126
11211127
11221128
11231129 @Callable(i)
11241130 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
11251131 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
11261132 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
11271133 }
11281134
11291135
11301136
11311137 @Callable(i)
11321138 func statsREADONLY () = {
11331139 let cfg = getPoolConfig()
11341140 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11351141 let amtAssetId = cfg[idxAmtAssetId]
11361142 let priceAssetId = cfg[idxPriceAssetId]
11371143 let iAmtAssetId = cfg[idxIAmtAssetId]
11381144 let iPriceAssetId = cfg[idxIPriceAssetId]
11391145 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11401146 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11411147 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11421148 let accAmtAssetBalance = getAccBalance(amtAssetId)
11431149 let accPriceAssetBalance = getAccBalance(priceAssetId)
11441150 let pricesList = if ((poolLPBalance == 0))
11451151 then [zeroBigInt, zeroBigInt, zeroBigInt]
11461152 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
11471153 let curPrice = 0
11481154 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
11491155 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
11501156 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
11511157 $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))
11521158 }
11531159
11541160
11551161
11561162 @Callable(i)
11571163 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11581164 let cfg = getPoolConfig()
11591165 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11601166 let amAssetIdStr = cfg[idxAmtAssetId]
11611167 let amAssetId = fromBase58String(amAssetIdStr)
11621168 let prAssetIdStr = cfg[idxPriceAssetId]
11631169 let prAssetId = fromBase58String(prAssetIdStr)
11641170 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11651171 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11661172 let poolStatus = cfg[idxPoolStatus]
11671173 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11681174 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11691175 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11701176 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11711177 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11721178 let curPriceX18 = if ((poolLPBalance == 0))
11731179 then zeroBigInt
11741180 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11751181 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11761182 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11771183 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11781184 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11791185 let calcLpAmt = estPut._1
11801186 let curPriceCalc = estPut._3
11811187 let amBalance = estPut._4
11821188 let prBalance = estPut._5
11831189 let lpEmission = estPut._6
11841190 $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))
11851191 }
11861192
11871193
11881194
11891195 @Callable(i)
11901196 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11911197 let cfg = getPoolConfig()
11921198 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11931199 let amAssetIdStr = cfg[idxAmtAssetId]
11941200 let amAssetId = fromBase58String(amAssetIdStr)
11951201 let prAssetIdStr = cfg[idxPriceAssetId]
11961202 let prAssetId = fromBase58String(prAssetIdStr)
11971203 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11981204 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11991205 let poolStatus = cfg[idxPoolStatus]
12001206 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12011207 let amBalanceRaw = getAccBalance(amAssetIdStr)
12021208 let prBalanceRaw = getAccBalance(prAssetIdStr)
12031209 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12041210 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12051211 let curPriceX18 = if ((poolLPBalance == 0))
12061212 then zeroBigInt
12071213 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12081214 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12091215 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12101216 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12111217 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12121218 let calcLpAmt = estPut._1
12131219 let curPriceCalc = estPut._3
12141220 let amBalance = estPut._4
12151221 let prBalance = estPut._5
12161222 let lpEmission = estPut._6
12171223 $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))
12181224 }
12191225
12201226
12211227
12221228 @Callable(i)
12231229 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
12241230 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
12251231 let outAmAmt = res._1
12261232 let outPrAmt = res._2
12271233 let amBalance = res._5
12281234 let prBalance = res._6
12291235 let lpEmission = res._7
12301236 let curPrice = res._8
12311237 let poolStatus = parseIntValue(res._9)
12321238 $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))
12331239 }
12341240
12351241
12361242 @Verifier(tx)
12371243 func verify () = {
12381244 let targetPublicKey = match managerPublicKeyOrUnit() {
12391245 case pk: ByteVector =>
12401246 pk
12411247 case _: Unit =>
12421248 tx.senderPublicKey
12431249 case _ =>
12441250 throw("Match error")
12451251 }
12461252 match tx {
12471253 case order: Order =>
12481254 let matcherPub = getMatcherPubOrFail()
12491255 let orderValid = validateMatcherOrderAllowed(order)
12501256 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
12511257 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
12521258 if (if (if (orderValid)
12531259 then senderValid
12541260 else false)
12551261 then matcherValid
12561262 else false)
12571263 then true
12581264 else throwOrderError(orderValid, senderValid, matcherValid)
12591265 case s: SetScriptTransaction =>
12601266 let newHash = blake2b256(value(s.script))
12611267 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12621268 let currentHash = scriptHash(this)
12631269 if (if ((allowedHash == newHash))
12641270 then (currentHash != newHash)
12651271 else false)
12661272 then true
12671273 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12681274 case _ =>
12691275 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12701276 }
12711277 }
12721278

github/deemru/w8io/026f985 
120.97 ms