tx · 97QJvyYm8wTcpzSosgTM79LFAFQsMD4LaDwFAqYFcEQ9

3MrrBfr6a5nDL9q6RY3JnifJDYpKXhiMzeK:  -0.03100000 Waves

2022.12.05 16:10 [2347092] smart account 3MrrBfr6a5nDL9q6RY3JnifJDYpKXhiMzeK > SELF 0.00000000 Waves

{ "type": 13, "id": "97QJvyYm8wTcpzSosgTM79LFAFQsMD4LaDwFAqYFcEQ9", "fee": 3100000, "feeAssetId": null, "timestamp": 1670245854438, "version": 1, "sender": "3MrrBfr6a5nDL9q6RY3JnifJDYpKXhiMzeK", "senderPublicKey": "AD9KZBhdGzDEZ9VsjHGcbBDzVgtUFycMe74pn3n8uYiC", "proofs": [ "4TZiDfuJo6tJbqLXouZ3RE9ZUScqPaqcPH7NjQrXVQdCZsuWFEn8mmFWZo2MyyihvDuuMy3eZWGjPyyTQ9jFHogL" ], "script": "base64:BgLgKQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiD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ECY1cBBQJjWAQCYUEJAPQDAwgFAmNYCWJvZHlCeXRlcwkAkQMCCAUCY1gGcHJvb2ZzAAAIBQJjWA9zZW5kZXJQdWJsaWNLZXkEAmFCCQD0AwMIBQJjWAlib2R5Qnl0ZXMJAJEDAggFAmNYBnByb29mcwABBQJnYwMDAwUCYXoFAmFBBwUCYUIHBgkBAmF5AwUCYXoFAmFBBQJhQgMJAAECBQJkdwIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAmVKBQJkdwQCZ2QJAPYDAQkBBXZhbHVlAQgFAmVKBnNjcmlwdAQCZ2UJANsEAQkBBXZhbHVlAQkAnQgCBQJhSgkBAmF3AAQCZ2YJAPEHAQUEdGhpcwMDCQAAAgUCZ2UFAmdkCQECIT0CBQJnZgUCZ2QHBgkA9AMDCAUCZloJYm9keUJ5dGVzCQCRAwIIBQJmWgZwcm9vZnMAAAUCZ2IJAPQDAwgFAmZaCWJvZHlCeXRlcwkAkQMCCAUCZloGcHJvb2ZzAAAFAmdiUyeFdQ==", "chainId": 84, "height": 2347092, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: BmkSApUwLkGF55j3pgUoLiy9RKD9xsMSJ4aAZT6uR48D Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let lPdecimals = 8
5+
6+let scale8 = 100000000
7+
8+let scale8BigInt = toBigInt(100000000)
9+
10+let scale18 = toBigInt(1000000000000000000)
11+
12+let zeroBigInt = toBigInt(0)
13+
14+let big0 = toBigInt(0)
15+
16+let big1 = toBigInt(1)
17+
18+let big2 = toBigInt(2)
19+
20+let wavesString = "WAVES"
21+
22+let SEP = "__"
23+
24+let PoolActive = 1
25+
26+let PoolPutDisabled = 2
27+
28+let PoolMatcherDisabled = 3
29+
30+let PoolShutdown = 4
31+
32+let idxPoolAddress = 1
33+
34+let idxPoolStatus = 2
35+
36+let idxPoolLPAssetId = 3
37+
38+let idxAmtAssetId = 4
39+
40+let idxPriceAssetId = 5
41+
42+let idxAmtAssetDcm = 6
43+
44+let idxPriceAssetDcm = 7
45+
46+let idxIAmtAssetId = 8
47+
48+let idxIPriceAssetId = 9
49+
50+let idxLPAssetDcm = 10
51+
52+let idxPoolAmtAssetAmt = 1
53+
54+let idxPoolPriceAssetAmt = 2
55+
56+let idxPoolLPAssetAmt = 3
57+
58+let idxFactoryStakingContract = 1
59+
60+let idxFactorySlippageContract = 7
61+
62+func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
63+
64+
65+func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
66+
67+
68+func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
69+
70+
71+func abs (val) = if ((0 > val))
72+ then -(val)
73+ else val
74+
75+
76+func absBigInt (val) = if ((zeroBigInt > val))
77+ then -(val)
78+ else val
79+
80+
81+func fc () = "%s__factoryContract"
82+
83+
84+func mpk () = "%s__managerPublicKey"
85+
86+
87+func pmpk () = "%s__pendingManagerPublicKey"
88+
89+
90+func pl () = "%s%s__price__last"
91+
92+
93+func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
94+
95+
96+func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
97+
98+
99+func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
100+
101+
102+func aa () = "%s__amountAsset"
103+
104+
105+func pa () = "%s__priceAsset"
106+
107+
108+let keyFee = "%s__fee"
109+
110+let feeDefault = fraction(10, scale8, 10000)
111+
112+let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
113+
114+let keyKLp = makeString(["%s", "kLp"], SEP)
115+
116+let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
117+
118+let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
119+
120+let kLpRefreshDelayDefault = 30
121+
122+let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
123+
124+func keyFactoryConfig () = "%s__factoryConfig"
125+
126+
127+func keyMatcherPub () = "%s%s__matcher__publicKey"
128+
129+
130+func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
131+
132+
133+func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
134+
135+
136+func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
137+
138+
139+func keyAllPoolsShutdown () = "%s__shutdown"
140+
141+
142+func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
143+
144+
145+func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
146+
147+
148+let keyFeeCollectorAddress = "%s__feeCollectorAddress"
149+
150+func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
151+
152+
153+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
154+
155+
156+func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157+
158+
159+func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
160+
161+
162+func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
163+
164+
165+let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
166+
167+let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
168+
169+func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
170+
171+
172+func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
173+
174+
175+func getPoolConfig () = {
176+ let amtAsset = getStringOrFail(this, aa())
177+ let priceAsset = getStringOrFail(this, pa())
178+ let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
179+ let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
180+ split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
181+ }
182+
183+
184+func parseAssetId (input) = if ((input == wavesString))
185+ then unit
186+ else fromBase58String(input)
187+
188+
189+func assetIdToString (input) = if ((input == unit))
190+ then wavesString
191+ else toBase58String(value(input))
192+
193+
194+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]))
195+
196+
197+let poolConfigParsed = parsePoolConfig(getPoolConfig())
198+
199+let $t079158081 = poolConfigParsed
200+
201+let cfgPoolAddress = $t079158081._1
202+
203+let cfgPoolStatus = $t079158081._2
204+
205+let cfgLpAssetId = $t079158081._3
206+
207+let cfgAmountAssetId = $t079158081._4
208+
209+let cfgPriceAssetId = $t079158081._5
210+
211+let cfgAmountAssetDecimals = $t079158081._6
212+
213+let cfgPriceAssetDecimals = $t079158081._7
214+
215+func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
216+
217+
218+let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
219+
220+let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
221+
222+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)
223+
224+
225+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)
226+
227+
228+func getAccBalance (assetId) = if ((assetId == "WAVES"))
229+ then wavesBalance(this).available
230+ else assetBalance(this, fromBase58String(assetId))
231+
232+
233+func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
234+
235+
236+func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
237+ let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
238+ let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
239+ calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
240+ }
241+
242+
243+func calcPrices (amAmt,prAmt,lpAmt) = {
244+ let cfg = getPoolConfig()
245+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
246+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
247+ let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
248+ let amAmtX18 = toX18(amAmt, amtAssetDcm)
249+ let prAmtX18 = toX18(prAmt, priceAssetDcm)
250+ let lpAmtX18 = toX18(lpAmt, scale8)
251+ let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
252+ let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
253+[priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
254+ }
255+
256+
257+func calculatePrices (amAmt,prAmt,lpAmt) = {
258+ let prices = calcPrices(amAmt, prAmt, lpAmt)
259+[fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
260+ }
261+
262+
263+func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
264+ let cfg = getPoolConfig()
265+ let lpAssetId = cfg[idxPoolLPAssetId]
266+ let amAssetId = cfg[idxAmtAssetId]
267+ let prAssetId = cfg[idxPriceAssetId]
268+ let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
269+ let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
270+ let poolStatus = cfg[idxPoolStatus]
271+ let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
272+ if ((lpAssetId != pmtAssetId))
273+ then throw("Invalid asset passed.")
274+ else {
275+ let amBalance = getAccBalance(amAssetId)
276+ let amBalanceX18 = toX18(amBalance, amAssetDcm)
277+ let prBalance = getAccBalance(prAssetId)
278+ let prBalanceX18 = toX18(prBalance, prAssetDcm)
279+ let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
280+ let curPrice = fromX18(curPriceX18, scale8)
281+ let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
282+ let lpEmissionX18 = toX18(lpEmission, scale8)
283+ let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
284+ let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
285+ let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
286+ let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
287+ let state = if ((txId58 == ""))
288+ then nil
289+ else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
290+ then unit
291+ else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
292+ then unit
293+ 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)]
294+ $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
295+ }
296+ }
297+
298+
299+func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
300+ let cfg = getPoolConfig()
301+ let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
302+ let amAssetIdStr = cfg[idxAmtAssetId]
303+ let prAssetIdStr = cfg[idxPriceAssetId]
304+ let iAmtAssetId = cfg[idxIAmtAssetId]
305+ let iPriceAssetId = cfg[idxIPriceAssetId]
306+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
307+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
308+ let poolStatus = cfg[idxPoolStatus]
309+ let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
310+ let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
311+ let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
312+ if (if ((amAssetIdStr != inAmAssetIdStr))
313+ then true
314+ else (prAssetIdStr != inPrAssetIdStr))
315+ then throw("Invalid amt or price asset passed.")
316+ else {
317+ let amBalance = if (isEvaluate)
318+ then getAccBalance(amAssetIdStr)
319+ else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
320+ let prBalance = if (isEvaluate)
321+ then getAccBalance(prAssetIdStr)
322+ else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
323+ let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
324+ let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
325+ let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
326+ let amBalanceX18 = toX18(amBalance, amtAssetDcm)
327+ let prBalanceX18 = toX18(prBalance, priceAssetDcm)
328+ let res = if ((lpEmission == 0))
329+ then {
330+ let curPriceX18 = zeroBigInt
331+ let slippageX18 = zeroBigInt
332+ let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
333+ $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
334+ }
335+ else {
336+ let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
337+ let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
338+ let slippageToleranceX18 = toX18(slippageTolerance, scale8)
339+ if (if ((curPriceX18 != zeroBigInt))
340+ then (slippageX18 > slippageToleranceX18)
341+ else false)
342+ then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
343+ else {
344+ let lpEmissionX18 = toX18(lpEmission, scale8)
345+ let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
346+ let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
347+ let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
348+ then $Tuple2(amViaPrX18, inPrAssetAmtX18)
349+ else $Tuple2(inAmAssetAmtX18, prViaAmX18)
350+ let expAmtAssetAmtX18 = expectedAmts._1
351+ let expPriceAssetAmtX18 = expectedAmts._2
352+ let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
353+ $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
354+ }
355+ }
356+ let calcLpAmt = res._1
357+ let calcAmAssetPmt = res._2
358+ let calcPrAssetPmt = res._3
359+ let curPrice = fromX18(res._4, scale8)
360+ let slippageCalc = fromX18(res._5, scale8)
361+ if ((0 >= calcLpAmt))
362+ then throw("Invalid calculations. LP calculated is less than zero.")
363+ else {
364+ let emitLpAmt = if (!(emitLp))
365+ then 0
366+ else calcLpAmt
367+ let amDiff = (inAmAssetAmt - calcAmAssetPmt)
368+ let prDiff = (inPrAssetAmt - calcPrAssetPmt)
369+ 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))]
370+ $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
371+ }
372+ }
373+ }
374+
375+
376+func validateMatcherOrderAllowed (order) = {
377+ let cfg = getPoolConfig()
378+ let amtAssetId = cfg[idxAmtAssetId]
379+ let priceAssetId = cfg[idxPriceAssetId]
380+ let poolStatus = parseIntValue(cfg[idxPoolStatus])
381+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
382+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
383+ let accAmtAssetBalance = getAccBalance(amtAssetId)
384+ let accPriceAssetBalance = getAccBalance(priceAssetId)
385+ let curPriceX18 = if ((order.orderType == Buy))
386+ then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
387+ else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
388+ let curPrice = fromX18(curPriceX18, scale8)
389+ if (if (if (isGlobalShutdown())
390+ then true
391+ else (poolStatus == PoolMatcherDisabled))
392+ then true
393+ else (poolStatus == PoolShutdown))
394+ then throw("Exchange operations disabled")
395+ else {
396+ let orderAmtAsset = order.assetPair.amountAsset
397+ let orderAmtAssetStr = if ((orderAmtAsset == unit))
398+ then "WAVES"
399+ else toBase58String(value(orderAmtAsset))
400+ let orderPriceAsset = order.assetPair.priceAsset
401+ let orderPriceAssetStr = if ((orderPriceAsset == unit))
402+ then "WAVES"
403+ else toBase58String(value(orderPriceAsset))
404+ if (if ((orderAmtAssetStr != amtAssetId))
405+ then true
406+ else (orderPriceAssetStr != priceAssetId))
407+ then throw("Wrong order assets.")
408+ else {
409+ let orderPrice = order.price
410+ let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
411+ let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
412+ let isOrderPriceValid = if ((order.orderType == Buy))
413+ then (curPrice >= castedOrderPrice)
414+ else (castedOrderPrice >= curPrice)
415+ true
416+ }
417+ }
418+ }
419+
420+
421+func commonGet (i) = if ((size(i.payments) != 1))
422+ then throw("exactly 1 payment is expected")
423+ else {
424+ let pmt = value(i.payments[0])
425+ let pmtAssetId = value(pmt.assetId)
426+ let pmtAmt = pmt.amount
427+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
428+ let outAmAmt = res._1
429+ let outPrAmt = res._2
430+ let poolStatus = parseIntValue(res._9)
431+ let state = res._10
432+ if (if (isGlobalShutdown())
433+ then true
434+ else (poolStatus == PoolShutdown))
435+ then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
436+ else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
437+ }
438+
439+
440+func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
441+ then throw("exactly 2 payments are expected")
442+ else {
443+ let amAssetPmt = value(i.payments[0])
444+ let prAssetPmt = value(i.payments[1])
445+ let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
446+ let poolStatus = parseIntValue(estPut._8)
447+ if (if (if (isGlobalShutdown())
448+ then true
449+ else (poolStatus == PoolPutDisabled))
450+ then true
451+ else (poolStatus == PoolShutdown))
452+ then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
453+ else estPut
454+ }
455+
456+
457+func emit (amount) = {
458+ let emitInv = invoke(factoryContract, "emit", [amount], nil)
459+ if ((emitInv == emitInv))
460+ then {
461+ let emitInvLegacy = match emitInv {
462+ case legacyFactoryContract: Address =>
463+ invoke(legacyFactoryContract, "emit", [amount], nil)
464+ case _ =>
465+ unit
466+ }
467+ if ((emitInvLegacy == emitInvLegacy))
468+ then amount
469+ else throw("Strict value is not equal to itself.")
470+ }
471+ else throw("Strict value is not equal to itself.")
472+ }
473+
474+
475+func takeFee (amount) = {
476+ let feeAmount = fraction(amount, fee, scale8)
477+ $Tuple2((amount - feeAmount), feeAmount)
478+ }
479+
480+
481+func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
482+ let isEval = (txId == unit)
483+ let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
484+ let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
485+ let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
486+ then true
487+ else if ((paymentAssetId == cfgPriceAssetId))
488+ then false
489+ else throwErr("invalid asset")
490+ let $t02294223235 = if (isEval)
491+ then $Tuple2(amountBalanceRaw, priceBalanceRaw)
492+ else if (paymentInAmountAsset)
493+ then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
494+ else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
495+ let amountBalanceOld = $t02294223235._1
496+ let priceBalanceOld = $t02294223235._2
497+ let $t02323923388 = if (paymentInAmountAsset)
498+ then $Tuple2(paymentAmountRaw, 0)
499+ else $Tuple2(0, paymentAmountRaw)
500+ let amountAssetAmountRaw = $t02323923388._1
501+ let priceAssetAmountRaw = $t02323923388._2
502+ let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
503+ let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
504+ let $t02351023569 = takeFee(paymentAmountRaw)
505+ let paymentAmount = $t02351023569._1
506+ let feeAmount = $t02351023569._2
507+ let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
508+ let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
509+ let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
510+ let priceNew = fromX18(priceNewX18, scale8)
511+ let paymentBalance = if (paymentInAmountAsset)
512+ then amountBalanceOld
513+ else priceBalanceOld
514+ let paymentBalanceBigInt = toBigInt(paymentBalance)
515+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
516+ let chechSupply = if ((supplyBigInt > big0))
517+ then true
518+ else throwErr("initial deposit requires all coins")
519+ if ((chechSupply == chechSupply))
520+ then {
521+ let depositBigInt = toBigInt(paymentAmount)
522+ let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
523+ let commonState = if (isEval)
524+ then nil
525+ 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))]
526+ let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
527+ let priceOld = fromX18(priceOldX18, scale8)
528+ let loss = {
529+ let $t02504625213 = if (paymentInAmountAsset)
530+ then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
531+ else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
532+ let amount = $t02504625213._1
533+ let balance = $t02504625213._2
534+ let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
535+ fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
536+ }
537+ $Tuple4(issueAmount, commonState, feeAmount, loss)
538+ }
539+ else throw("Strict value is not equal to itself.")
540+ }
541+
542+
543+func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
544+ let isEval = (txId == unit)
545+ let checks = [if ((paymentAssetId == cfgLpAssetId))
546+ then true
547+ else throwErr("invalid lp asset")]
548+ if ((checks == checks))
549+ then {
550+ let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
551+ then true
552+ else if ((outAssetId == cfgPriceAssetId))
553+ then false
554+ else throwErr("invalid asset")
555+ let balanceBigInt = if (outInAmountAsset)
556+ then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
557+ else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
558+ let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
559+ let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
560+ let outBalance = if (outInAmountAsset)
561+ then amBalanceOld
562+ else prBalanceOld
563+ let outBalanceBigInt = toBigInt(outBalance)
564+ let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
565+ let redeemedBigInt = toBigInt(paymentAmount)
566+ let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
567+ let $t02679326843 = takeFee(amountRaw)
568+ let totalAmount = $t02679326843._1
569+ let feeAmount = $t02679326843._2
570+ let $t02684727073 = if (outInAmountAsset)
571+ then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
572+ else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
573+ let outAmAmount = $t02684727073._1
574+ let outPrAmount = $t02684727073._2
575+ let amBalanceNew = $t02684727073._3
576+ let prBalanceNew = $t02684727073._4
577+ let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
578+ let priceNew = fromX18(priceNewX18, scale8)
579+ let commonState = if (isEval)
580+ then nil
581+ 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)]
582+ let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
583+ let priceOld = fromX18(priceOldX18, scale8)
584+ let loss = {
585+ let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
586+ fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
587+ }
588+ $Tuple4(totalAmount, commonState, feeAmount, loss)
589+ }
590+ else throw("Strict value is not equal to itself.")
591+ }
592+
593+
594+func calcKLp (amountBalance,priceBalance,lpEmission) = {
595+ let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpEmission)
596+ updatedKLp
597+ }
598+
599+
600+func refreshKLpInternal () = {
601+ let amountAssetBalance = getAccBalance(assetIdToString(cfgAmountAssetId))
602+ let priceAssetBalance = getAccBalance(assetIdToString(cfgPriceAssetId))
603+ let lpEmission = value(assetInfo(cfgLpAssetId)).quantity
604+ let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpEmission))
605+ let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
606+ $Tuple2(actions, updatedKLp)
607+ }
608+
609+
610+func managerPublicKeyOrUnit () = match getString(mpk()) {
611+ case s: String =>
612+ fromBase58String(s)
613+ case _: Unit =>
614+ unit
615+ case _ =>
616+ throw("Match error")
617+}
618+
619+
620+func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621+ case s: String =>
622+ fromBase58String(s)
623+ case _: Unit =>
624+ unit
625+ case _ =>
626+ throw("Match error")
627+}
628+
629+
630+func isManager (i) = match managerPublicKeyOrUnit() {
631+ case pk: ByteVector =>
632+ (i.callerPublicKey == pk)
633+ case _: Unit =>
634+ (i.caller == this)
635+ case _ =>
636+ throw("Match error")
637+}
638+
639+
640+func mustManager (i) = {
641+ let pd = throw("Permission denied")
642+ match managerPublicKeyOrUnit() {
643+ case pk: ByteVector =>
644+ if ((i.callerPublicKey == pk))
645+ then true
646+ else pd
647+ case _: Unit =>
648+ if ((i.caller == this))
649+ then true
650+ else pd
651+ case _ =>
652+ throw("Match error")
653+ }
654+ }
655+
656+
657+@Callable(i)
658+func setManager (pendingManagerPublicKey) = {
659+ let checkCaller = mustManager(i)
660+ if ((checkCaller == checkCaller))
661+ then {
662+ let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663+ if ((checkManagerPublicKey == checkManagerPublicKey))
664+ then [StringEntry(pmpk(), pendingManagerPublicKey)]
665+ else throw("Strict value is not equal to itself.")
666+ }
667+ else throw("Strict value is not equal to itself.")
668+ }
669+
670+
671+
672+@Callable(i)
673+func confirmManager () = {
674+ let pm = pendingManagerPublicKeyOrUnit()
675+ let hasPM = if (isDefined(pm))
676+ then true
677+ else throw("No pending manager")
678+ if ((hasPM == hasPM))
679+ then {
680+ let checkPM = if ((i.callerPublicKey == value(pm)))
681+ then true
682+ else throw("You are not pending manager")
683+ if ((checkPM == checkPM))
684+ then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685+ else throw("Strict value is not equal to itself.")
686+ }
687+ else throw("Strict value is not equal to itself.")
688+ }
689+
690+
691+
692+@Callable(i)
693+func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694+ then throw("Invalid slippageTolerance passed")
695+ else {
696+ let estPut = commonPut(i, slippageTolerance, true)
697+ let emitLpAmt = estPut._2
698+ let lpAssetId = estPut._7
699+ let state = estPut._9
700+ let amDiff = estPut._10
701+ let prDiff = estPut._11
702+ let amId = estPut._12
703+ let prId = estPut._13
704+ let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
705+ if ((emitInv == emitInv))
706+ then {
707+ let emitInvLegacy = match emitInv {
708+ case legacyFactoryContract: Address =>
709+ invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
710+ case _ =>
711+ unit
712+ }
713+ if ((emitInvLegacy == emitInvLegacy))
714+ then {
715+ let slippageAInv = if ((amDiff > 0))
716+ then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
717+ else nil
718+ if ((slippageAInv == slippageAInv))
719+ then {
720+ let slippagePInv = if ((prDiff > 0))
721+ then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
722+ else nil
723+ if ((slippagePInv == slippagePInv))
724+ then {
725+ let lpTransfer = if (shouldAutoStake)
726+ then {
727+ let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
728+ if ((slpStakeInv == slpStakeInv))
729+ then nil
730+ else throw("Strict value is not equal to itself.")
731+ }
732+ else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
733+ (state ++ lpTransfer)
734+ }
735+ else throw("Strict value is not equal to itself.")
736+ }
737+ else throw("Strict value is not equal to itself.")
738+ }
739+ else throw("Strict value is not equal to itself.")
740+ }
741+ else throw("Strict value is not equal to itself.")
742+ }
743+
744+
745+
746+@Callable(i)
747+func putForFree (maxSlippage) = if ((0 > maxSlippage))
748+ then throw("Invalid value passed")
749+ else {
750+ let estPut = commonPut(i, maxSlippage, false)
751+ estPut._9
752+ }
753+
754+
755+
756+@Callable(i)
757+func putOneTkn (minOutAmount,autoStake) = {
758+ let isPoolOneTokenOperationsDisabled = {
759+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
760+ if ($isInstanceOf(@, "Boolean"))
761+ then @
762+ else throw(($getType(@) + " couldn't be cast to Boolean"))
763+ }
764+ let isPutDisabled = if (if (if (isGlobalShutdown())
765+ then true
766+ else (cfgPoolStatus == PoolPutDisabled))
767+ then true
768+ else (cfgPoolStatus == PoolShutdown))
769+ then true
770+ else isPoolOneTokenOperationsDisabled
771+ let checks = [if (if (!(isPutDisabled))
772+ then true
773+ else isManager(i))
774+ then true
775+ else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
776+ then true
777+ else throwErr("exactly 1 payment are expected")]
778+ if ((checks == checks))
779+ then {
780+ let payment = i.payments[0]
781+ let paymentAssetId = payment.assetId
782+ let paymentAmountRaw = payment.amount
783+ let userAddress = i.caller
784+ let txId = i.transactionId
785+ let $t03275432884 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
786+ if (($t03275432884 == $t03275432884))
787+ then {
788+ let bonus = $t03275432884._4
789+ let feeAmount = $t03275432884._3
790+ let commonState = $t03275432884._2
791+ let emitAmountEstimated = $t03275432884._1
792+ let emitAmount = if (if ((minOutAmount > 0))
793+ then (minOutAmount > emitAmountEstimated)
794+ else false)
795+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
796+ else emitAmountEstimated
797+ let emitInv = emit(emitAmount)
798+ if ((emitInv == emitInv))
799+ then {
800+ let lpTransfer = if (autoStake)
801+ then {
802+ let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
803+ if ((stakeInv == stakeInv))
804+ then nil
805+ else throw("Strict value is not equal to itself.")
806+ }
807+ else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
808+ let sendFee = if ((feeAmount > 0))
809+ then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
810+ else nil
811+ $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
812+ }
813+ else throw("Strict value is not equal to itself.")
814+ }
815+ else throw("Strict value is not equal to itself.")
816+ }
817+ else throw("Strict value is not equal to itself.")
818+ }
819+
820+
821+
822+@Callable(i)
823+func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
824+ let $t03361333748 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
825+ let emitAmountEstimated = $t03361333748._1
826+ let commonState = $t03361333748._2
827+ let feeAmount = $t03361333748._3
828+ let bonus = $t03361333748._4
829+ $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
830+ }
831+
832+
833+
834+@Callable(i)
835+func getOneTkn (outAssetIdStr,minOutAmount) = {
836+ let isPoolOneTokenOperationsDisabled = {
837+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
838+ if ($isInstanceOf(@, "Boolean"))
839+ then @
840+ else throw(($getType(@) + " couldn't be cast to Boolean"))
841+ }
842+ let isGetDisabled = if (if (isGlobalShutdown())
843+ then true
844+ else (cfgPoolStatus == PoolShutdown))
845+ then true
846+ else isPoolOneTokenOperationsDisabled
847+ let checks = [if (if (!(isGetDisabled))
848+ then true
849+ else isManager(i))
850+ then true
851+ else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
852+ then true
853+ else throwErr("exactly 1 payment are expected")]
854+ if ((checks == checks))
855+ then {
856+ let outAssetId = parseAssetId(outAssetIdStr)
857+ let payment = i.payments[0]
858+ let paymentAssetId = payment.assetId
859+ let paymentAmount = payment.amount
860+ let userAddress = i.caller
861+ let txId = i.transactionId
862+ let $t03455334688 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
863+ if (($t03455334688 == $t03455334688))
864+ then {
865+ let bonus = $t03455334688._4
866+ let feeAmount = $t03455334688._3
867+ let commonState = $t03455334688._2
868+ let amountEstimated = $t03455334688._1
869+ let amount = if (if ((minOutAmount > 0))
870+ then (minOutAmount > amountEstimated)
871+ else false)
872+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
873+ else amountEstimated
874+ let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
875+ if ((burnInv == burnInv))
876+ then {
877+ let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
878+ let sendFee = if ((feeAmount > 0))
879+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
880+ else nil
881+ $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
882+ }
883+ else throw("Strict value is not equal to itself.")
884+ }
885+ else throw("Strict value is not equal to itself.")
886+ }
887+ else throw("Strict value is not equal to itself.")
888+ }
889+
890+
891+
892+@Callable(i)
893+func getOneTknREADONLY (outAssetId,paymentAmount) = {
894+ let $t03532335461 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
895+ let amountEstimated = $t03532335461._1
896+ let commonState = $t03532335461._2
897+ let feeAmount = $t03532335461._3
898+ let bonus = $t03532335461._4
899+ $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
900+ }
901+
902+
903+
904+@Callable(i)
905+func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
906+ let isPoolOneTokenOperationsDisabled = {
907+ let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
908+ if ($isInstanceOf(@, "Boolean"))
909+ then @
910+ else throw(($getType(@) + " couldn't be cast to Boolean"))
911+ }
912+ let isGetDisabled = if (if (isGlobalShutdown())
913+ then true
914+ else (cfgPoolStatus == PoolShutdown))
915+ then true
916+ else isPoolOneTokenOperationsDisabled
917+ let checks = [if (if (!(isGetDisabled))
918+ then true
919+ else isManager(i))
920+ then true
921+ else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
922+ then true
923+ else throwErr("no payments are expected")]
924+ if ((checks == checks))
925+ then {
926+ let outAssetId = parseAssetId(outAssetIdStr)
927+ let userAddress = i.caller
928+ let txId = i.transactionId
929+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
930+ if ((unstakeInv == unstakeInv))
931+ then {
932+ let $t03628636419 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
933+ if (($t03628636419 == $t03628636419))
934+ then {
935+ let bonus = $t03628636419._4
936+ let feeAmount = $t03628636419._3
937+ let commonState = $t03628636419._2
938+ let amountEstimated = $t03628636419._1
939+ let amount = if (if ((minOutAmount > 0))
940+ then (minOutAmount > amountEstimated)
941+ else false)
942+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
943+ else amountEstimated
944+ let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
945+ if ((burnInv == burnInv))
946+ then {
947+ let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
948+ let sendFee = if ((feeAmount > 0))
949+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
950+ else nil
951+ $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
952+ }
953+ else throw("Strict value is not equal to itself.")
954+ }
955+ else throw("Strict value is not equal to itself.")
956+ }
957+ else throw("Strict value is not equal to itself.")
958+ }
959+ else throw("Strict value is not equal to itself.")
960+ }
961+
962+
963+
964+@Callable(i)
965+func get () = {
966+ let res = commonGet(i)
967+ let outAmtAmt = res._1
968+ let outPrAmt = res._2
969+ let pmtAmt = res._3
970+ let pmtAssetId = res._4
971+ let state = res._5
972+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
973+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
974+ then state
975+ else throw("Strict value is not equal to itself.")
976+ }
977+
978+
979+
980+@Callable(i)
981+func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
982+ let res = commonGet(i)
983+ let outAmAmt = res._1
984+ let outPrAmt = res._2
985+ let pmtAmt = res._3
986+ let pmtAssetId = res._4
987+ let state = res._5
988+ if ((noLessThenAmtAsset > outAmAmt))
989+ then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
990+ else if ((noLessThenPriceAsset > outPrAmt))
991+ then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
992+ else {
993+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
994+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
995+ then state
996+ else throw("Strict value is not equal to itself.")
997+ }
998+ }
999+
1000+
1001+
1002+@Callable(i)
1003+func unstakeAndGet (amount) = {
1004+ let checkPayments = if ((size(i.payments) != 0))
1005+ then throw("No payments are expected")
1006+ else true
1007+ if ((checkPayments == checkPayments))
1008+ then {
1009+ let cfg = getPoolConfig()
1010+ let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
1011+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1012+ if ((unstakeInv == unstakeInv))
1013+ then {
1014+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1015+ let poolStatus = parseIntValue(res._9)
1016+ let state = res._10
1017+ let checkPoolStatus = if (if (isGlobalShutdown())
1018+ then true
1019+ else (poolStatus == PoolShutdown))
1020+ then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1021+ else true
1022+ if ((checkPoolStatus == checkPoolStatus))
1023+ then {
1024+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1025+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1026+ then state
1027+ else throw("Strict value is not equal to itself.")
1028+ }
1029+ else throw("Strict value is not equal to itself.")
1030+ }
1031+ else throw("Strict value is not equal to itself.")
1032+ }
1033+ else throw("Strict value is not equal to itself.")
1034+ }
1035+
1036+
1037+
1038+@Callable(i)
1039+func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
1040+ let isGetDisabled = if (isGlobalShutdown())
1041+ then true
1042+ else (cfgPoolStatus == PoolShutdown)
1043+ let checks = [if (!(isGetDisabled))
1044+ then true
1045+ else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
1046+ then true
1047+ else throw("no payments are expected")]
1048+ if ((checks == checks))
1049+ then {
1050+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1051+ if ((unstakeInv == unstakeInv))
1052+ then {
1053+ let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1054+ let outAmAmt = res._1
1055+ let outPrAmt = res._2
1056+ let state = res._10
1057+ let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
1058+ then true
1059+ else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
1060+ then true
1061+ else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
1062+ if ((checkAmounts == checkAmounts))
1063+ then {
1064+ let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1065+ if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1066+ then state
1067+ else throw("Strict value is not equal to itself.")
1068+ }
1069+ else throw("Strict value is not equal to itself.")
1070+ }
1071+ else throw("Strict value is not equal to itself.")
1072+ }
1073+ else throw("Strict value is not equal to itself.")
1074+ }
1075+
1076+
1077+
1078+@Callable(i)
1079+func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
1080+ then throw("permissions denied")
1081+ else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
1082+
1083+
1084+
1085+@Callable(i)
1086+func refreshKLp () = {
1087+ let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
1088+ let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
1089+ then unit
1090+ else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
1091+ if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
1092+ then {
1093+ let $t04140241450 = refreshKLpInternal()
1094+ let actions = $t04140241450._1
1095+ let updatedKLp = $t04140241450._2
1096+ $Tuple2(actions, updatedKLp)
1097+ }
1098+ else throw("Strict value is not equal to itself.")
1099+ }
1100+
1101+
1102+
1103+@Callable(i)
1104+func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
1105+
1106+
1107+
1108+@Callable(i)
1109+func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
1110+
1111+
1112+
1113+@Callable(i)
1114+func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
1115+ let prices = calcPrices(amAmt, prAmt, lpAmt)
1116+ $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
1117+ }
1118+
1119+
1120+
1121+@Callable(i)
1122+func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
1123+
1124+
1125+
1126+@Callable(i)
1127+func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
1128+
1129+
1130+
1131+@Callable(i)
1132+func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
1133+
1134+
1135+
1136+@Callable(i)
1137+func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
1138+
1139+
1140+
1141+@Callable(i)
1142+func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
1143+ let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
1144+ $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
1145+ }
1146+
1147+
1148+
1149+@Callable(i)
1150+func statsREADONLY () = {
1151+ let cfg = getPoolConfig()
1152+ let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
1153+ let amtAssetId = cfg[idxAmtAssetId]
1154+ let priceAssetId = cfg[idxPriceAssetId]
1155+ let iAmtAssetId = cfg[idxIAmtAssetId]
1156+ let iPriceAssetId = cfg[idxIPriceAssetId]
1157+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
1158+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
1159+ let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
1160+ let accAmtAssetBalance = getAccBalance(amtAssetId)
1161+ let accPriceAssetBalance = getAccBalance(priceAssetId)
1162+ let pricesList = if ((poolLPBalance == 0))
1163+ then [zeroBigInt, zeroBigInt, zeroBigInt]
1164+ else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
1165+ let curPrice = 0
1166+ let lpAmtAssetShare = fromX18(pricesList[1], scale8)
1167+ let lpPriceAssetShare = fromX18(pricesList[2], scale8)
1168+ let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
1169+ $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))
1170+ }
1171+
1172+
1173+
1174+@Callable(i)
1175+func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
1176+ let cfg = getPoolConfig()
1177+ let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
1178+ let amAssetIdStr = cfg[idxAmtAssetId]
1179+ let amAssetId = fromBase58String(amAssetIdStr)
1180+ let prAssetIdStr = cfg[idxPriceAssetId]
1181+ let prAssetId = fromBase58String(prAssetIdStr)
1182+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
1183+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
1184+ let poolStatus = cfg[idxPoolStatus]
1185+ let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
1186+ let accAmtAssetBalance = getAccBalance(amAssetIdStr)
1187+ let accPriceAssetBalance = getAccBalance(prAssetIdStr)
1188+ let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
1189+ let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
1190+ let curPriceX18 = if ((poolLPBalance == 0))
1191+ then zeroBigInt
1192+ else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
1193+ let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
1194+ let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
1195+ let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
1196+ let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
1197+ let calcLpAmt = estPut._1
1198+ let curPriceCalc = estPut._3
1199+ let amBalance = estPut._4
1200+ let prBalance = estPut._5
1201+ let lpEmission = estPut._6
1202+ $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))
1203+ }
1204+
1205+
1206+
1207+@Callable(i)
1208+func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
1209+ let cfg = getPoolConfig()
1210+ let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
1211+ let amAssetIdStr = cfg[idxAmtAssetId]
1212+ let amAssetId = fromBase58String(amAssetIdStr)
1213+ let prAssetIdStr = cfg[idxPriceAssetId]
1214+ let prAssetId = fromBase58String(prAssetIdStr)
1215+ let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
1216+ let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
1217+ let poolStatus = cfg[idxPoolStatus]
1218+ let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
1219+ let amBalanceRaw = getAccBalance(amAssetIdStr)
1220+ let prBalanceRaw = getAccBalance(prAssetIdStr)
1221+ let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
1222+ let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
1223+ let curPriceX18 = if ((poolLPBalance == 0))
1224+ then zeroBigInt
1225+ else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
1226+ let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
1227+ let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
1228+ let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
1229+ let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
1230+ let calcLpAmt = estPut._1
1231+ let curPriceCalc = estPut._3
1232+ let amBalance = estPut._4
1233+ let prBalance = estPut._5
1234+ let lpEmission = estPut._6
1235+ $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))
1236+ }
1237+
1238+
1239+
1240+@Callable(i)
1241+func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
1242+ let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
1243+ let outAmAmt = res._1
1244+ let outPrAmt = res._2
1245+ let amBalance = res._5
1246+ let prBalance = res._6
1247+ let lpEmission = res._7
1248+ let curPrice = res._8
1249+ let poolStatus = parseIntValue(res._9)
1250+ $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))
1251+ }
1252+
1253+
1254+@Verifier(tx)
1255+func verify () = {
1256+ let targetPublicKey = match managerPublicKeyOrUnit() {
1257+ case pk: ByteVector =>
1258+ pk
1259+ case _: Unit =>
1260+ tx.senderPublicKey
1261+ case _ =>
1262+ throw("Match error")
1263+ }
1264+ match tx {
1265+ case order: Order =>
1266+ let matcherPub = getMatcherPubOrFail()
1267+ let orderValid = validateMatcherOrderAllowed(order)
1268+ let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
1269+ let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
1270+ if (if (if (orderValid)
1271+ then senderValid
1272+ else false)
1273+ then matcherValid
1274+ else false)
1275+ then true
1276+ else throwOrderError(orderValid, senderValid, matcherValid)
1277+ case s: SetScriptTransaction =>
1278+ let newHash = blake2b256(value(s.script))
1279+ let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
1280+ let currentHash = scriptHash(this)
1281+ if (if ((allowedHash == newHash))
1282+ then (currentHash != newHash)
1283+ else false)
1284+ then true
1285+ else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
1286+ case _ =>
1287+ sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
1288+ }
1289+ }
1290+

github/deemru/w8io/169f3d6 
57.46 ms