tx · 5wn9bGWFz7pbNjZB8rPcV9kDd3b2A6Hm51m7vhsHvH97

3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS:  -0.03100000 Waves

2022.11.28 13:00 [2336806] smart account 3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS > SELF 0.00000000 Waves

{ "type": 13, "id": "5wn9bGWFz7pbNjZB8rPcV9kDd3b2A6Hm51m7vhsHvH97", "fee": 3100000, "feeAssetId": null, "timestamp": 1669629591118, "version": 1, "sender": "3MsCuhfTF9EnyVoNh2yqo4eZ1Q24Ki3fntS", "senderPublicKey": "8rqHfvDx1Q95zF6SWwiQWVTu2vr2wNQpxUzAx84ZAedj", "proofs": [ "ULQumdsZAEJXm2Y4TXXt9ao6Mum7oN3ndusnqHhToLYefwrmu9aCGdEzeq7niDrBjvyLA62Q2vPYuksBopSfA2p" ], "script": "base64:BgKoKQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQ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2IFAmZaBwYJAPQDAwgFAmZWCWJvZHlCeXRlcwkAkQMCCAUCZlYGcHJvb2ZzAAAFAmZYCQD0AwMIBQJmVglib2R5Qnl0ZXMJAJEDAggFAmZWBnByb29mcwAABQJmWLxXcig=", "chainId": 84, "height": 2336806, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5bnYPqKyURrGQzCLanFBGp4urmaYn5FcHLVzpKyuATxK Next: 8QYT9DerMggYVKHowbw4ZtX5AsqQZENVn6dLzbhMEfdH Diff:
OldNewDifferences
591591 }
592592
593593
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-
610594 func managerPublicKeyOrUnit () = match getString(mpk()) {
611595 case s: String =>
612596 fromBase58String(s)
782766 let paymentAmountRaw = payment.amount
783767 let userAddress = i.caller
784768 let txId = i.transactionId
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
769+ let $t03198032107 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
770+ let emitAmountEstimated = $t03198032107._1
771+ let commonState = $t03198032107._2
772+ let feeAmount = $t03198032107._3
773+ let bonus = $t03198032107._4
790774 let emitAmount = if (if ((minOutAmount > 0))
791775 then (minOutAmount > emitAmountEstimated)
792776 else false)
817801
818802 @Callable(i)
819803 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
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
804+ let $t03283632971 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
805+ let emitAmountEstimated = $t03283632971._1
806+ let commonState = $t03283632971._2
807+ let feeAmount = $t03283632971._3
808+ let bonus = $t03283632971._4
825809 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
826810 }
827811
855839 let paymentAmount = payment.amount
856840 let userAddress = i.caller
857841 let txId = i.transactionId
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
842+ let $t03377633908 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
843+ let amountEstimated = $t03377633908._1
844+ let commonState = $t03377633908._2
845+ let feeAmount = $t03377633908._3
846+ let bonus = $t03377633908._4
863847 let amount = if (if ((minOutAmount > 0))
864848 then (minOutAmount > amountEstimated)
865849 else false)
883867
884868 @Callable(i)
885869 func getOneTknREADONLY (outAssetId,paymentAmount) = {
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
870+ let $t03454334681 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
871+ let amountEstimated = $t03454334681._1
872+ let commonState = $t03454334681._2
873+ let feeAmount = $t03454334681._3
874+ let bonus = $t03454334681._4
891875 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
892876 }
893877
921905 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
922906 if ((unstakeInv == unstakeInv))
923907 then {
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
908+ let $t03550635636 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
909+ let amountEstimated = $t03550635636._1
910+ let commonState = $t03550635636._2
911+ let feeAmount = $t03550635636._3
912+ let bonus = $t03550635636._4
929913 let amount = if (if ((minOutAmount > 0))
930914 then (minOutAmount > amountEstimated)
931915 else false)
10781062 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
10791063 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
10801064 then {
1081- let $t04139341441 = refreshKLpInternal()
1082- let actions = $t04139341441._1
1083- let updatedKLp = $t04139341441._2
1084- $Tuple2(actions, updatedKLp)
1065+ let amountAssetBalance = toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
1066+ let priceAssetBalance = toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
1067+ let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
1068+ let updatedKLp = fraction(pow((amountAssetBalance * priceAssetBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpAssetEmission)
1069+ let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
1070+ $Tuple2(actions, toString(updatedKLp))
10851071 }
10861072 else throw("Strict value is not equal to itself.")
10871073 }
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) = {
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-
610594 func managerPublicKeyOrUnit () = match getString(mpk()) {
611595 case s: String =>
612596 fromBase58String(s)
613597 case _: Unit =>
614598 unit
615599 case _ =>
616600 throw("Match error")
617601 }
618602
619603
620604 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
621605 case s: String =>
622606 fromBase58String(s)
623607 case _: Unit =>
624608 unit
625609 case _ =>
626610 throw("Match error")
627611 }
628612
629613
630614 func isManager (i) = match managerPublicKeyOrUnit() {
631615 case pk: ByteVector =>
632616 (i.callerPublicKey == pk)
633617 case _: Unit =>
634618 (i.caller == this)
635619 case _ =>
636620 throw("Match error")
637621 }
638622
639623
640624 func mustManager (i) = {
641625 let pd = throw("Permission denied")
642626 match managerPublicKeyOrUnit() {
643627 case pk: ByteVector =>
644628 if ((i.callerPublicKey == pk))
645629 then true
646630 else pd
647631 case _: Unit =>
648632 if ((i.caller == this))
649633 then true
650634 else pd
651635 case _ =>
652636 throw("Match error")
653637 }
654638 }
655639
656640
657641 @Callable(i)
658642 func setManager (pendingManagerPublicKey) = {
659643 let checkCaller = mustManager(i)
660644 if ((checkCaller == checkCaller))
661645 then {
662646 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
663647 if ((checkManagerPublicKey == checkManagerPublicKey))
664648 then [StringEntry(pmpk(), pendingManagerPublicKey)]
665649 else throw("Strict value is not equal to itself.")
666650 }
667651 else throw("Strict value is not equal to itself.")
668652 }
669653
670654
671655
672656 @Callable(i)
673657 func confirmManager () = {
674658 let pm = pendingManagerPublicKeyOrUnit()
675659 let hasPM = if (isDefined(pm))
676660 then true
677661 else throw("No pending manager")
678662 if ((hasPM == hasPM))
679663 then {
680664 let checkPM = if ((i.callerPublicKey == value(pm)))
681665 then true
682666 else throw("You are not pending manager")
683667 if ((checkPM == checkPM))
684668 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
685669 else throw("Strict value is not equal to itself.")
686670 }
687671 else throw("Strict value is not equal to itself.")
688672 }
689673
690674
691675
692676 @Callable(i)
693677 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
694678 then throw("Invalid slippageTolerance passed")
695679 else {
696680 let estPut = commonPut(i, slippageTolerance, true)
697681 let emitLpAmt = estPut._2
698682 let lpAssetId = estPut._7
699683 let state = estPut._9
700684 let amDiff = estPut._10
701685 let prDiff = estPut._11
702686 let amId = estPut._12
703687 let prId = estPut._13
704688 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
705689 if ((emitInv == emitInv))
706690 then {
707691 let emitInvLegacy = match emitInv {
708692 case legacyFactoryContract: Address =>
709693 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
710694 case _ =>
711695 unit
712696 }
713697 if ((emitInvLegacy == emitInvLegacy))
714698 then {
715699 let slippageAInv = if ((amDiff > 0))
716700 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
717701 else nil
718702 if ((slippageAInv == slippageAInv))
719703 then {
720704 let slippagePInv = if ((prDiff > 0))
721705 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
722706 else nil
723707 if ((slippagePInv == slippagePInv))
724708 then {
725709 let lpTransfer = if (shouldAutoStake)
726710 then {
727711 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
728712 if ((slpStakeInv == slpStakeInv))
729713 then nil
730714 else throw("Strict value is not equal to itself.")
731715 }
732716 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
733717 (state ++ lpTransfer)
734718 }
735719 else throw("Strict value is not equal to itself.")
736720 }
737721 else throw("Strict value is not equal to itself.")
738722 }
739723 else throw("Strict value is not equal to itself.")
740724 }
741725 else throw("Strict value is not equal to itself.")
742726 }
743727
744728
745729
746730 @Callable(i)
747731 func putForFree (maxSlippage) = if ((0 > maxSlippage))
748732 then throw("Invalid value passed")
749733 else {
750734 let estPut = commonPut(i, maxSlippage, false)
751735 estPut._9
752736 }
753737
754738
755739
756740 @Callable(i)
757741 func putOneTkn (minOutAmount,autoStake) = {
758742 let isPoolOneTokenOperationsDisabled = {
759743 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
760744 if ($isInstanceOf(@, "Boolean"))
761745 then @
762746 else throw(($getType(@) + " couldn't be cast to Boolean"))
763747 }
764748 let isPutDisabled = if (if (if (isGlobalShutdown())
765749 then true
766750 else (cfgPoolStatus == PoolPutDisabled))
767751 then true
768752 else (cfgPoolStatus == PoolShutdown))
769753 then true
770754 else isPoolOneTokenOperationsDisabled
771755 let checks = [if (if (!(isPutDisabled))
772756 then true
773757 else isManager(i))
774758 then true
775759 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
776760 then true
777761 else throwErr("exactly 1 payment are expected")]
778762 if ((checks == checks))
779763 then {
780764 let payment = i.payments[0]
781765 let paymentAssetId = payment.assetId
782766 let paymentAmountRaw = payment.amount
783767 let userAddress = i.caller
784768 let txId = i.transactionId
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
769+ let $t03198032107 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
770+ let emitAmountEstimated = $t03198032107._1
771+ let commonState = $t03198032107._2
772+ let feeAmount = $t03198032107._3
773+ let bonus = $t03198032107._4
790774 let emitAmount = if (if ((minOutAmount > 0))
791775 then (minOutAmount > emitAmountEstimated)
792776 else false)
793777 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
794778 else emitAmountEstimated
795779 let emitInv = emit(emitAmount)
796780 if ((emitInv == emitInv))
797781 then {
798782 let lpTransfer = if (autoStake)
799783 then {
800784 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
801785 if ((stakeInv == stakeInv))
802786 then nil
803787 else throw("Strict value is not equal to itself.")
804788 }
805789 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
806790 let sendFee = if ((feeAmount > 0))
807791 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
808792 else nil
809793 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
810794 }
811795 else throw("Strict value is not equal to itself.")
812796 }
813797 else throw("Strict value is not equal to itself.")
814798 }
815799
816800
817801
818802 @Callable(i)
819803 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
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
804+ let $t03283632971 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
805+ let emitAmountEstimated = $t03283632971._1
806+ let commonState = $t03283632971._2
807+ let feeAmount = $t03283632971._3
808+ let bonus = $t03283632971._4
825809 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
826810 }
827811
828812
829813
830814 @Callable(i)
831815 func getOneTkn (outAssetIdStr,minOutAmount) = {
832816 let isPoolOneTokenOperationsDisabled = {
833817 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
834818 if ($isInstanceOf(@, "Boolean"))
835819 then @
836820 else throw(($getType(@) + " couldn't be cast to Boolean"))
837821 }
838822 let isGetDisabled = if (if (isGlobalShutdown())
839823 then true
840824 else (cfgPoolStatus == PoolShutdown))
841825 then true
842826 else isPoolOneTokenOperationsDisabled
843827 let checks = [if (if (!(isGetDisabled))
844828 then true
845829 else isManager(i))
846830 then true
847831 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
848832 then true
849833 else throwErr("exactly 1 payment are expected")]
850834 if ((checks == checks))
851835 then {
852836 let outAssetId = parseAssetId(outAssetIdStr)
853837 let payment = i.payments[0]
854838 let paymentAssetId = payment.assetId
855839 let paymentAmount = payment.amount
856840 let userAddress = i.caller
857841 let txId = i.transactionId
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
842+ let $t03377633908 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
843+ let amountEstimated = $t03377633908._1
844+ let commonState = $t03377633908._2
845+ let feeAmount = $t03377633908._3
846+ let bonus = $t03377633908._4
863847 let amount = if (if ((minOutAmount > 0))
864848 then (minOutAmount > amountEstimated)
865849 else false)
866850 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
867851 else amountEstimated
868852 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
869853 if ((burnInv == burnInv))
870854 then {
871855 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
872856 let sendFee = if ((feeAmount > 0))
873857 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
874858 else nil
875859 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
876860 }
877861 else throw("Strict value is not equal to itself.")
878862 }
879863 else throw("Strict value is not equal to itself.")
880864 }
881865
882866
883867
884868 @Callable(i)
885869 func getOneTknREADONLY (outAssetId,paymentAmount) = {
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
870+ let $t03454334681 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
871+ let amountEstimated = $t03454334681._1
872+ let commonState = $t03454334681._2
873+ let feeAmount = $t03454334681._3
874+ let bonus = $t03454334681._4
891875 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
892876 }
893877
894878
895879
896880 @Callable(i)
897881 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
898882 let isPoolOneTokenOperationsDisabled = {
899883 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
900884 if ($isInstanceOf(@, "Boolean"))
901885 then @
902886 else throw(($getType(@) + " couldn't be cast to Boolean"))
903887 }
904888 let isGetDisabled = if (if (isGlobalShutdown())
905889 then true
906890 else (cfgPoolStatus == PoolShutdown))
907891 then true
908892 else isPoolOneTokenOperationsDisabled
909893 let checks = [if (if (!(isGetDisabled))
910894 then true
911895 else isManager(i))
912896 then true
913897 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
914898 then true
915899 else throwErr("no payments are expected")]
916900 if ((checks == checks))
917901 then {
918902 let outAssetId = parseAssetId(outAssetIdStr)
919903 let userAddress = i.caller
920904 let txId = i.transactionId
921905 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
922906 if ((unstakeInv == unstakeInv))
923907 then {
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
908+ let $t03550635636 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
909+ let amountEstimated = $t03550635636._1
910+ let commonState = $t03550635636._2
911+ let feeAmount = $t03550635636._3
912+ let bonus = $t03550635636._4
929913 let amount = if (if ((minOutAmount > 0))
930914 then (minOutAmount > amountEstimated)
931915 else false)
932916 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
933917 else amountEstimated
934918 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
935919 if ((burnInv == burnInv))
936920 then {
937921 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
938922 let sendFee = if ((feeAmount > 0))
939923 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
940924 else nil
941925 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
942926 }
943927 else throw("Strict value is not equal to itself.")
944928 }
945929 else throw("Strict value is not equal to itself.")
946930 }
947931 else throw("Strict value is not equal to itself.")
948932 }
949933
950934
951935
952936 @Callable(i)
953937 func get () = {
954938 let res = commonGet(i)
955939 let outAmtAmt = res._1
956940 let outPrAmt = res._2
957941 let pmtAmt = res._3
958942 let pmtAssetId = res._4
959943 let state = res._5
960944 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
961945 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
962946 then state
963947 else throw("Strict value is not equal to itself.")
964948 }
965949
966950
967951
968952 @Callable(i)
969953 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
970954 let res = commonGet(i)
971955 let outAmAmt = res._1
972956 let outPrAmt = res._2
973957 let pmtAmt = res._3
974958 let pmtAssetId = res._4
975959 let state = res._5
976960 if ((noLessThenAmtAsset > outAmAmt))
977961 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
978962 else if ((noLessThenPriceAsset > outPrAmt))
979963 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
980964 else {
981965 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
982966 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
983967 then state
984968 else throw("Strict value is not equal to itself.")
985969 }
986970 }
987971
988972
989973
990974 @Callable(i)
991975 func unstakeAndGet (amount) = {
992976 let checkPayments = if ((size(i.payments) != 0))
993977 then throw("No payments are expected")
994978 else true
995979 if ((checkPayments == checkPayments))
996980 then {
997981 let cfg = getPoolConfig()
998982 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
999983 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
1000984 if ((unstakeInv == unstakeInv))
1001985 then {
1002986 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
1003987 let poolStatus = parseIntValue(res._9)
1004988 let state = res._10
1005989 let checkPoolStatus = if (if (isGlobalShutdown())
1006990 then true
1007991 else (poolStatus == PoolShutdown))
1008992 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
1009993 else true
1010994 if ((checkPoolStatus == checkPoolStatus))
1011995 then {
1012996 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
1013997 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
1014998 then state
1015999 else throw("Strict value is not equal to itself.")
10161000 }
10171001 else throw("Strict value is not equal to itself.")
10181002 }
10191003 else throw("Strict value is not equal to itself.")
10201004 }
10211005 else throw("Strict value is not equal to itself.")
10221006 }
10231007
10241008
10251009
10261010 @Callable(i)
10271011 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
10281012 let isGetDisabled = if (isGlobalShutdown())
10291013 then true
10301014 else (cfgPoolStatus == PoolShutdown)
10311015 let checks = [if (!(isGetDisabled))
10321016 then true
10331017 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
10341018 then true
10351019 else throw("no payments are expected")]
10361020 if ((checks == checks))
10371021 then {
10381022 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
10391023 if ((unstakeInv == unstakeInv))
10401024 then {
10411025 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
10421026 let outAmAmt = res._1
10431027 let outPrAmt = res._2
10441028 let state = res._10
10451029 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10461030 then true
10471031 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10481032 then true
10491033 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10501034 if ((checkAmounts == checkAmounts))
10511035 then {
10521036 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10531037 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10541038 then state
10551039 else throw("Strict value is not equal to itself.")
10561040 }
10571041 else throw("Strict value is not equal to itself.")
10581042 }
10591043 else throw("Strict value is not equal to itself.")
10601044 }
10611045 else throw("Strict value is not equal to itself.")
10621046 }
10631047
10641048
10651049
10661050 @Callable(i)
10671051 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10681052 then throw("permissions denied")
10691053 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10701054
10711055
10721056
10731057 @Callable(i)
10741058 func refreshKLp () = {
10751059 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
10761060 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
10771061 then unit
10781062 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
10791063 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
10801064 then {
1081- let $t04139341441 = refreshKLpInternal()
1082- let actions = $t04139341441._1
1083- let updatedKLp = $t04139341441._2
1084- $Tuple2(actions, updatedKLp)
1065+ let amountAssetBalance = toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
1066+ let priceAssetBalance = toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
1067+ let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity)
1068+ let updatedKLp = fraction(pow((amountAssetBalance * priceAssetBalance), 0, toBigInt(5), 1, 0, DOWN), scale18, lpAssetEmission)
1069+ let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
1070+ $Tuple2(actions, toString(updatedKLp))
10851071 }
10861072 else throw("Strict value is not equal to itself.")
10871073 }
10881074
10891075
10901076
10911077 @Callable(i)
10921078 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10931079
10941080
10951081
10961082 @Callable(i)
10971083 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10981084
10991085
11001086
11011087 @Callable(i)
11021088 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
11031089 let prices = calcPrices(amAmt, prAmt, lpAmt)
11041090 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
11051091 }
11061092
11071093
11081094
11091095 @Callable(i)
11101096 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
11111097
11121098
11131099
11141100 @Callable(i)
11151101 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
11161102
11171103
11181104
11191105 @Callable(i)
11201106 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
11211107
11221108
11231109
11241110 @Callable(i)
11251111 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
11261112
11271113
11281114
11291115 @Callable(i)
11301116 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
11311117 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
11321118 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
11331119 }
11341120
11351121
11361122
11371123 @Callable(i)
11381124 func statsREADONLY () = {
11391125 let cfg = getPoolConfig()
11401126 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11411127 let amtAssetId = cfg[idxAmtAssetId]
11421128 let priceAssetId = cfg[idxPriceAssetId]
11431129 let iAmtAssetId = cfg[idxIAmtAssetId]
11441130 let iPriceAssetId = cfg[idxIPriceAssetId]
11451131 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11461132 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11471133 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11481134 let accAmtAssetBalance = getAccBalance(amtAssetId)
11491135 let accPriceAssetBalance = getAccBalance(priceAssetId)
11501136 let pricesList = if ((poolLPBalance == 0))
11511137 then [zeroBigInt, zeroBigInt, zeroBigInt]
11521138 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
11531139 let curPrice = 0
11541140 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
11551141 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
11561142 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
11571143 $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))
11581144 }
11591145
11601146
11611147
11621148 @Callable(i)
11631149 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11641150 let cfg = getPoolConfig()
11651151 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11661152 let amAssetIdStr = cfg[idxAmtAssetId]
11671153 let amAssetId = fromBase58String(amAssetIdStr)
11681154 let prAssetIdStr = cfg[idxPriceAssetId]
11691155 let prAssetId = fromBase58String(prAssetIdStr)
11701156 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11711157 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11721158 let poolStatus = cfg[idxPoolStatus]
11731159 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11741160 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11751161 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11761162 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11771163 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11781164 let curPriceX18 = if ((poolLPBalance == 0))
11791165 then zeroBigInt
11801166 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11811167 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11821168 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11831169 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11841170 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11851171 let calcLpAmt = estPut._1
11861172 let curPriceCalc = estPut._3
11871173 let amBalance = estPut._4
11881174 let prBalance = estPut._5
11891175 let lpEmission = estPut._6
11901176 $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))
11911177 }
11921178
11931179
11941180
11951181 @Callable(i)
11961182 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11971183 let cfg = getPoolConfig()
11981184 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11991185 let amAssetIdStr = cfg[idxAmtAssetId]
12001186 let amAssetId = fromBase58String(amAssetIdStr)
12011187 let prAssetIdStr = cfg[idxPriceAssetId]
12021188 let prAssetId = fromBase58String(prAssetIdStr)
12031189 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
12041190 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
12051191 let poolStatus = cfg[idxPoolStatus]
12061192 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
12071193 let amBalanceRaw = getAccBalance(amAssetIdStr)
12081194 let prBalanceRaw = getAccBalance(prAssetIdStr)
12091195 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
12101196 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
12111197 let curPriceX18 = if ((poolLPBalance == 0))
12121198 then zeroBigInt
12131199 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
12141200 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
12151201 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
12161202 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
12171203 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
12181204 let calcLpAmt = estPut._1
12191205 let curPriceCalc = estPut._3
12201206 let amBalance = estPut._4
12211207 let prBalance = estPut._5
12221208 let lpEmission = estPut._6
12231209 $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))
12241210 }
12251211
12261212
12271213
12281214 @Callable(i)
12291215 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
12301216 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
12311217 let outAmAmt = res._1
12321218 let outPrAmt = res._2
12331219 let amBalance = res._5
12341220 let prBalance = res._6
12351221 let lpEmission = res._7
12361222 let curPrice = res._8
12371223 let poolStatus = parseIntValue(res._9)
12381224 $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))
12391225 }
12401226
12411227
12421228 @Verifier(tx)
12431229 func verify () = {
12441230 let targetPublicKey = match managerPublicKeyOrUnit() {
12451231 case pk: ByteVector =>
12461232 pk
12471233 case _: Unit =>
12481234 tx.senderPublicKey
12491235 case _ =>
12501236 throw("Match error")
12511237 }
12521238 match tx {
12531239 case order: Order =>
12541240 let matcherPub = getMatcherPubOrFail()
12551241 let orderValid = validateMatcherOrderAllowed(order)
12561242 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
12571243 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
12581244 if (if (if (orderValid)
12591245 then senderValid
12601246 else false)
12611247 then matcherValid
12621248 else false)
12631249 then true
12641250 else throwOrderError(orderValid, senderValid, matcherValid)
12651251 case s: SetScriptTransaction =>
12661252 let newHash = blake2b256(value(s.script))
12671253 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12681254 let currentHash = scriptHash(this)
12691255 if (if ((allowedHash == newHash))
12701256 then (currentHash != newHash)
12711257 else false)
12721258 then true
12731259 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12741260 case _ =>
12751261 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12761262 }
12771263 }
12781264

github/deemru/w8io/026f985 
137.52 ms