tx · 75njJKdrbT4DCX85Hpeq5eNRJU9j9eMEJ9Ny91mpvPix

3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H:  -0.03000000 Waves

2022.11.09 10:36 [2309307] smart account 3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H > SELF 0.00000000 Waves

{ "type": 13, "id": "75njJKdrbT4DCX85Hpeq5eNRJU9j9eMEJ9Ny91mpvPix", "fee": 3000000, "feeAssetId": null, "timestamp": 1667979389997, "version": 1, "sender": "3N4JvGpYF8iwSPzqwqWcubTfWWaKxdgmE4H", "senderPublicKey": "p2hzghiY7UemNr13x5jVMEC1aSdo6Tkv76kjMxRU9cZ", "proofs": [ "3LSr8v6azX2d3sa7GR9C6QyQNLK5jADSdcySQgrgWiEvQ2SpYVGhbqwVf47H96eyajtnSTsjTHMzywHhKvVhGNoP" ], "script": "base64:BgKxJwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VBc3Nld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wIAgkApAMBBQJiVQUDbmlsBQFqAQJmSAECZkkABAJmSgQCZHEJAQJldQADCQABAgUCZHECCkJ5dGVWZWN0b3IEAmV6BQJkcQUCZXoDCQABAgUCZHECBFVuaXQIBQJmSA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCZHEFAmZIAwkAAQIFAmRxAgVPcmRlcgQCY1IFAmRxBAJmSwkBAmFHAAQCYXUJAQJjUQEFAmNSBAJhdgkA9AMDCAUCY1IJYm9keUJ5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAAgFAmNSD3NlbmRlclB1YmxpY0tleQQCYXcJAPQDAwgFAmNSCWJvZHlCeXRlcwkAkQMCCAUCY1IGcHJvb2ZzAAEFAmZLAwMDBQJhdQUCYXYHBQJhdwcGCQECYXQDBQJhdQUCYXYFAmF3AwkAAQIFAmRxAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXYFAmRxBAJmTAkA9gMBCQEFdmFsdWUBCAUCZXYGc2NyaXB0BAJmTQkA2wQBCQEFdmFsdWUBCQCdCAIFAmFECQECYXIABAJmTgkA8QcBBQR0aGlzAwMJAAACBQJmTQUCZkwJAQIhPQIFAmZOBQJmTAcGCQD0AwMIBQJmSAlib2R5Qnl0ZXMJAJEDAggFAmZIBnByb29mcwAABQJmSgkA9AMDCAUCZkgJYm9keUJ5dGVzCQCRAwIIBQJmSAZwcm9vZnMAAAUCZkrGvHs8", "chainId": 84, "height": 2309307, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7Xg19PNmmfvoSqBJT9S6MmsHL1My8u9gNhGeYeQuvdnE Next: Dg96FS6GNjfxJv2JwyoX8Mv1VLfoi4B52bBwRKtzYhrP Diff:
OldNewDifferences
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
61-
62-let testingggggg = 1
63-
64-let ssssssssssss = 1
6561
6662 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6763
187183
188184 let poolConfigParsed = parsePoolConfig(getPoolConfig())
189185
190-let $t075877753 = poolConfigParsed
186+let $t075447710 = poolConfigParsed
191187
192-let cfgPoolAddress = $t075877753._1
188+let cfgPoolAddress = $t075447710._1
193189
194-let cfgPoolStatus = $t075877753._2
190+let cfgPoolStatus = $t075447710._2
195191
196-let cfgLpAssetId = $t075877753._3
192+let cfgLpAssetId = $t075447710._3
197193
198-let cfgAmountAssetId = $t075877753._4
194+let cfgAmountAssetId = $t075447710._4
199195
200-let cfgPriceAssetId = $t075877753._5
196+let cfgPriceAssetId = $t075447710._5
201197
202-let cfgAmountAssetDecimals = $t075877753._6
198+let cfgAmountAssetDecimals = $t075447710._6
203199
204-let cfgPriceAssetDecimals = $t075877753._7
200+let cfgPriceAssetDecimals = $t075447710._7
205201
206202 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
207203
478474 else if ((paymentAssetId == cfgPriceAssetId))
479475 then false
480476 else throwErr("invalid asset")
481- let $t02261422907 = if (isEval)
477+ let $t02257122864 = if (isEval)
482478 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
483479 else if (paymentInAmountAsset)
484480 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
485481 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
486- let amountBalanceOld = $t02261422907._1
487- let priceBalanceOld = $t02261422907._2
488- let $t02291123060 = if (paymentInAmountAsset)
482+ let amountBalanceOld = $t02257122864._1
483+ let priceBalanceOld = $t02257122864._2
484+ let $t02286823017 = if (paymentInAmountAsset)
489485 then $Tuple2(paymentAmountRaw, 0)
490486 else $Tuple2(0, paymentAmountRaw)
491- let amountAssetAmountRaw = $t02291123060._1
492- let priceAssetAmountRaw = $t02291123060._2
487+ let amountAssetAmountRaw = $t02286823017._1
488+ let priceAssetAmountRaw = $t02286823017._2
493489 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
494490 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
495- let $t02318223241 = takeFee(paymentAmountRaw)
496- let paymentAmount = $t02318223241._1
497- let feeAmount = $t02318223241._2
491+ let $t02313923198 = takeFee(paymentAmountRaw)
492+ let paymentAmount = $t02313923198._1
493+ let feeAmount = $t02313923198._2
498494 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
499495 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
500496 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
517513 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
518514 let priceOld = fromX18(priceOldX18, scale8)
519515 let loss = {
520- let $t02471824885 = if (paymentInAmountAsset)
516+ let $t02467524842 = if (paymentInAmountAsset)
521517 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
522518 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
523- let amount = $t02471824885._1
524- let balance = $t02471824885._2
519+ let amount = $t02467524842._1
520+ let balance = $t02467524842._2
525521 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
526522 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
527523 }
555551 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
556552 let redeemedBigInt = toBigInt(paymentAmount)
557553 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
558- let $t02646526515 = takeFee(amountRaw)
559- let totalAmount = $t02646526515._1
560- let feeAmount = $t02646526515._2
561- let $t02651926745 = if (outInAmountAsset)
554+ let $t02642226472 = takeFee(amountRaw)
555+ let totalAmount = $t02642226472._1
556+ let feeAmount = $t02642226472._2
557+ let $t02647626702 = if (outInAmountAsset)
562558 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
563559 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
564- let outAmAmount = $t02651926745._1
565- let outPrAmount = $t02651926745._2
566- let amBalanceNew = $t02651926745._3
567- let prBalanceNew = $t02651926745._4
560+ let outAmAmount = $t02647626702._1
561+ let outPrAmount = $t02647626702._2
562+ let amBalanceNew = $t02647626702._3
563+ let prBalanceNew = $t02647626702._4
568564 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
569565 let priceNew = fromX18(priceNewX18, scale8)
570566 let commonState = if (isEval)
745741 let paymentAmountRaw = payment.amount
746742 let userAddress = i.caller
747743 let txId = i.transactionId
748- let $t03145531582 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
749- let emitAmountEstimated = $t03145531582._1
750- let commonState = $t03145531582._2
751- let feeAmount = $t03145531582._3
752- let bonus = $t03145531582._4
744+ let $t03141231539 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745+ let emitAmountEstimated = $t03141231539._1
746+ let commonState = $t03141231539._2
747+ let feeAmount = $t03141231539._3
748+ let bonus = $t03141231539._4
753749 let emitAmount = if (if ((minOutAmount > 0))
754750 then (minOutAmount > emitAmountEstimated)
755751 else false)
780776
781777 @Callable(i)
782778 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
783- let $t03231132446 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
784- let emitAmountEstimated = $t03231132446._1
785- let commonState = $t03231132446._2
786- let feeAmount = $t03231132446._3
787- let bonus = $t03231132446._4
779+ let $t03226832403 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780+ let emitAmountEstimated = $t03226832403._1
781+ let commonState = $t03226832403._2
782+ let feeAmount = $t03226832403._3
783+ let bonus = $t03226832403._4
788784 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
789785 }
790786
816812 let paymentAmount = payment.amount
817813 let userAddress = i.caller
818814 let txId = i.transactionId
819- let $t03321833350 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
820- let amountEstimated = $t03321833350._1
821- let commonState = $t03321833350._2
822- let feeAmount = $t03321833350._3
823- let bonus = $t03321833350._4
815+ let $t03317533307 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816+ let amountEstimated = $t03317533307._1
817+ let commonState = $t03317533307._2
818+ let feeAmount = $t03317533307._3
819+ let bonus = $t03317533307._4
824820 let amount = if (if ((minOutAmount > 0))
825821 then (minOutAmount > amountEstimated)
826822 else false)
844840
845841 @Callable(i)
846842 func getOneTknREADONLY (outAssetId,paymentAmount) = {
847- let $t03398534123 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
848- let amountEstimated = $t03398534123._1
849- let commonState = $t03398534123._2
850- let feeAmount = $t03398534123._3
851- let bonus = $t03398534123._4
843+ let $t03394234080 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844+ let amountEstimated = $t03394234080._1
845+ let commonState = $t03394234080._2
846+ let feeAmount = $t03394234080._3
847+ let bonus = $t03394234080._4
852848 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
853849 }
854850
880876 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
881877 if ((unstakeInv == unstakeInv))
882878 then {
883- let $t03491535045 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
884- let amountEstimated = $t03491535045._1
885- let commonState = $t03491535045._2
886- let feeAmount = $t03491535045._3
887- let bonus = $t03491535045._4
879+ let $t03487235002 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880+ let amountEstimated = $t03487235002._1
881+ let commonState = $t03487235002._2
882+ let feeAmount = $t03487235002._3
883+ let bonus = $t03487235002._4
888884 let amount = if (if ((minOutAmount > 0))
889885 then (minOutAmount > amountEstimated)
890886 else false)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lPdecimals = 8
55
66 let scale8 = 100000000
77
88 let scale8BigInt = toBigInt(100000000)
99
1010 let scale18 = toBigInt(1000000000000000000)
1111
1212 let zeroBigInt = toBigInt(0)
1313
1414 let big0 = toBigInt(0)
1515
1616 let big1 = toBigInt(1)
1717
1818 let big2 = toBigInt(2)
1919
2020 let wavesString = "WAVES"
2121
2222 let SEP = "__"
2323
2424 let PoolActive = 1
2525
2626 let PoolPutDisabled = 2
2727
2828 let PoolMatcherDisabled = 3
2929
3030 let PoolShutdown = 4
3131
3232 let idxPoolAddress = 1
3333
3434 let idxPoolStatus = 2
3535
3636 let idxPoolLPAssetId = 3
3737
3838 let idxAmtAssetId = 4
3939
4040 let idxPriceAssetId = 5
4141
4242 let idxAmtAssetDcm = 6
4343
4444 let idxPriceAssetDcm = 7
4545
4646 let idxIAmtAssetId = 8
4747
4848 let idxIPriceAssetId = 9
4949
5050 let idxLPAssetDcm = 10
5151
5252 let idxPoolAmtAssetAmt = 1
5353
5454 let idxPoolPriceAssetAmt = 2
5555
5656 let idxPoolLPAssetAmt = 3
5757
5858 let idxFactoryStakingContract = 1
5959
6060 let idxFactorySlippageContract = 7
61-
62-let testingggggg = 1
63-
64-let ssssssssssss = 1
6561
6662 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult))
6763
6864
6965 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18))
7066
7167
7268 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7369
7470
7571 func abs (val) = if ((0 > val))
7672 then -(val)
7773 else val
7874
7975
8076 func absBigInt (val) = if ((zeroBigInt > val))
8177 then -(val)
8278 else val
8379
8480
8581 func fc () = "%s__factoryContract"
8682
8783
8884 func mpk () = "%s__managerPublicKey"
8985
9086
9187 func pmpk () = "%s__pendingManagerPublicKey"
9288
9389
9490 func pl () = "%s%s__price__last"
9591
9692
9793 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9894
9995
10096 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
10197
10298
10399 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
104100
105101
106102 func aa () = "%s__amountAsset"
107103
108104
109105 func pa () = "%s__priceAsset"
110106
111107
112108 let keyFee = "%s__fee"
113109
114110 let feeDefault = fraction(10, scale8, 10000)
115111
116112 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
117113
118114 func keyFactoryConfig () = "%s__factoryConfig"
119115
120116
121117 func keyMatcherPub () = "%s%s__matcher__publicKey"
122118
123119
124120 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
125121
126122
127123 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
128124
129125
130126 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
131127
132128
133129 func keyAllPoolsShutdown () = "%s__shutdown"
134130
135131
136132 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
137133
138134
139135 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
140136
141137
142138 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
143139
144140 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
145141
146142
147143 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
148144
149145
150146 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
151147
152148
153149 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
154150
155151
156152 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
157153
158154 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
159155
160156 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
161157
162158
163159 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
164160
165161
166162 func getPoolConfig () = {
167163 let amtAsset = getStringOrFail(this, aa())
168164 let priceAsset = getStringOrFail(this, pa())
169165 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
170166 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
171167 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
172168 }
173169
174170
175171 func parseAssetId (input) = if ((input == wavesString))
176172 then unit
177173 else fromBase58String(input)
178174
179175
180176 func assetIdToString (input) = if ((input == unit))
181177 then wavesString
182178 else toBase58String(value(input))
183179
184180
185181 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]))
186182
187183
188184 let poolConfigParsed = parsePoolConfig(getPoolConfig())
189185
190-let $t075877753 = poolConfigParsed
186+let $t075447710 = poolConfigParsed
191187
192-let cfgPoolAddress = $t075877753._1
188+let cfgPoolAddress = $t075447710._1
193189
194-let cfgPoolStatus = $t075877753._2
190+let cfgPoolStatus = $t075447710._2
195191
196-let cfgLpAssetId = $t075877753._3
192+let cfgLpAssetId = $t075447710._3
197193
198-let cfgAmountAssetId = $t075877753._4
194+let cfgAmountAssetId = $t075447710._4
199195
200-let cfgPriceAssetId = $t075877753._5
196+let cfgPriceAssetId = $t075447710._5
201197
202-let cfgAmountAssetDecimals = $t075877753._6
198+let cfgAmountAssetDecimals = $t075447710._6
203199
204-let cfgPriceAssetDecimals = $t075877753._7
200+let cfgPriceAssetDecimals = $t075447710._7
205201
206202 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
207203
208204
209205 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
210206
211207 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
212208
213209 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)
214210
215211
216212 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)
217213
218214
219215 func getAccBalance (assetId) = if ((assetId == "WAVES"))
220216 then wavesBalance(this).available
221217 else assetBalance(this, fromBase58String(assetId))
222218
223219
224220 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
225221
226222
227223 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
228224 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
229225 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
230226 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
231227 }
232228
233229
234230 func calcPrices (amAmt,prAmt,lpAmt) = {
235231 let cfg = getPoolConfig()
236232 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
237233 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
238234 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
239235 let amAmtX18 = toX18(amAmt, amtAssetDcm)
240236 let prAmtX18 = toX18(prAmt, priceAssetDcm)
241237 let lpAmtX18 = toX18(lpAmt, scale8)
242238 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
243239 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
244240 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
245241 }
246242
247243
248244 func calculatePrices (amAmt,prAmt,lpAmt) = {
249245 let prices = calcPrices(amAmt, prAmt, lpAmt)
250246 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
251247 }
252248
253249
254250 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
255251 let cfg = getPoolConfig()
256252 let lpAssetId = cfg[idxPoolLPAssetId]
257253 let amAssetId = cfg[idxAmtAssetId]
258254 let prAssetId = cfg[idxPriceAssetId]
259255 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
260256 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
261257 let poolStatus = cfg[idxPoolStatus]
262258 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
263259 if ((lpAssetId != pmtAssetId))
264260 then throw("Invalid asset passed.")
265261 else {
266262 let amBalance = getAccBalance(amAssetId)
267263 let amBalanceX18 = toX18(amBalance, amAssetDcm)
268264 let prBalance = getAccBalance(prAssetId)
269265 let prBalanceX18 = toX18(prBalance, prAssetDcm)
270266 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
271267 let curPrice = fromX18(curPriceX18, scale8)
272268 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
273269 let lpEmissionX18 = toX18(lpEmission, scale8)
274270 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
275271 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
276272 let outAmAmt = fromX18(outAmAmtX18, amAssetDcm)
277273 let outPrAmt = fromX18(outPrAmtX18, prAssetDcm)
278274 let state = if ((txId58 == ""))
279275 then nil
280276 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
281277 then unit
282278 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
283279 then unit
284280 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)]
285281 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
286282 }
287283 }
288284
289285
290286 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
291287 let cfg = getPoolConfig()
292288 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
293289 let amAssetIdStr = cfg[idxAmtAssetId]
294290 let prAssetIdStr = cfg[idxPriceAssetId]
295291 let iAmtAssetId = cfg[idxIAmtAssetId]
296292 let iPriceAssetId = cfg[idxIPriceAssetId]
297293 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
298294 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
299295 let poolStatus = cfg[idxPoolStatus]
300296 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
301297 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
302298 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
303299 if (if ((amAssetIdStr != inAmAssetIdStr))
304300 then true
305301 else (prAssetIdStr != inPrAssetIdStr))
306302 then throw("Invalid amt or price asset passed.")
307303 else {
308304 let amBalance = if (isEvaluate)
309305 then getAccBalance(amAssetIdStr)
310306 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
311307 let prBalance = if (isEvaluate)
312308 then getAccBalance(prAssetIdStr)
313309 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
314310 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
315311 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
316312 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
317313 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
318314 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
319315 let res = if ((lpEmission == 0))
320316 then {
321317 let curPriceX18 = zeroBigInt
322318 let slippageX18 = zeroBigInt
323319 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
324320 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
325321 }
326322 else {
327323 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
328324 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
329325 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
330326 if (if ((curPriceX18 != zeroBigInt))
331327 then (slippageX18 > slippageToleranceX18)
332328 else false)
333329 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
334330 else {
335331 let lpEmissionX18 = toX18(lpEmission, scale8)
336332 let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
337333 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
338334 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
339335 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
340336 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
341337 let expAmtAssetAmtX18 = expectedAmts._1
342338 let expPriceAssetAmtX18 = expectedAmts._2
343339 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18)
344340 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(expAmtAssetAmtX18, amtAssetDcm), fromX18(expPriceAssetAmtX18, priceAssetDcm), curPriceX18, slippageX18)
345341 }
346342 }
347343 let calcLpAmt = res._1
348344 let calcAmAssetPmt = res._2
349345 let calcPrAssetPmt = res._3
350346 let curPrice = fromX18(res._4, scale8)
351347 let slippageCalc = fromX18(res._5, scale8)
352348 if ((0 >= calcLpAmt))
353349 then throw("Invalid calculations. LP calculated is less than zero.")
354350 else {
355351 let emitLpAmt = if (!(emitLp))
356352 then 0
357353 else calcLpAmt
358354 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
359355 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
360356 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))]
361357 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
362358 }
363359 }
364360 }
365361
366362
367363 func validateMatcherOrderAllowed (order) = {
368364 let cfg = getPoolConfig()
369365 let amtAssetId = cfg[idxAmtAssetId]
370366 let priceAssetId = cfg[idxPriceAssetId]
371367 let poolStatus = parseIntValue(cfg[idxPoolStatus])
372368 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
373369 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
374370 let accAmtAssetBalance = getAccBalance(amtAssetId)
375371 let accPriceAssetBalance = getAccBalance(priceAssetId)
376372 let curPriceX18 = if ((order.orderType == Buy))
377373 then privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance + order.amount), accPriceAssetBalance)
378374 else privateCalcPrice(amtAssetDcm, priceAssetDcm, (accAmtAssetBalance - order.amount), accPriceAssetBalance)
379375 let curPrice = fromX18(curPriceX18, scale8)
380376 if (if (if (isGlobalShutdown())
381377 then true
382378 else (poolStatus == PoolMatcherDisabled))
383379 then true
384380 else (poolStatus == PoolShutdown))
385381 then throw("Exchange operations disabled")
386382 else {
387383 let orderAmtAsset = order.assetPair.amountAsset
388384 let orderAmtAssetStr = if ((orderAmtAsset == unit))
389385 then "WAVES"
390386 else toBase58String(value(orderAmtAsset))
391387 let orderPriceAsset = order.assetPair.priceAsset
392388 let orderPriceAssetStr = if ((orderPriceAsset == unit))
393389 then "WAVES"
394390 else toBase58String(value(orderPriceAsset))
395391 if (if ((orderAmtAssetStr != amtAssetId))
396392 then true
397393 else (orderPriceAssetStr != priceAssetId))
398394 then throw("Wrong order assets.")
399395 else {
400396 let orderPrice = order.price
401397 let priceDcm = fraction(scale8, priceAssetDcm, amtAssetDcm)
402398 let castedOrderPrice = toScale(orderPrice, scale8, priceDcm)
403399 let isOrderPriceValid = if ((order.orderType == Buy))
404400 then (curPrice >= castedOrderPrice)
405401 else (castedOrderPrice >= curPrice)
406402 true
407403 }
408404 }
409405 }
410406
411407
412408 func commonGet (i) = if ((size(i.payments) != 1))
413409 then throw("exactly 1 payment is expected")
414410 else {
415411 let pmt = value(i.payments[0])
416412 let pmtAssetId = value(pmt.assetId)
417413 let pmtAmt = pmt.amount
418414 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
419415 let outAmAmt = res._1
420416 let outPrAmt = res._2
421417 let poolStatus = parseIntValue(res._9)
422418 let state = res._10
423419 if (if (isGlobalShutdown())
424420 then true
425421 else (poolStatus == PoolShutdown))
426422 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
427423 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
428424 }
429425
430426
431427 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
432428 then throw("exactly 2 payments are expected")
433429 else {
434430 let amAssetPmt = value(i.payments[0])
435431 let prAssetPmt = value(i.payments[1])
436432 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
437433 let poolStatus = parseIntValue(estPut._8)
438434 if (if (if (isGlobalShutdown())
439435 then true
440436 else (poolStatus == PoolPutDisabled))
441437 then true
442438 else (poolStatus == PoolShutdown))
443439 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
444440 else estPut
445441 }
446442
447443
448444 func emit (amount) = {
449445 let emitInv = invoke(factoryContract, "emit", [amount], nil)
450446 if ((emitInv == emitInv))
451447 then {
452448 let emitInvLegacy = match emitInv {
453449 case legacyFactoryContract: Address =>
454450 invoke(legacyFactoryContract, "emit", [amount], nil)
455451 case _ =>
456452 unit
457453 }
458454 if ((emitInvLegacy == emitInvLegacy))
459455 then amount
460456 else throw("Strict value is not equal to itself.")
461457 }
462458 else throw("Strict value is not equal to itself.")
463459 }
464460
465461
466462 func takeFee (amount) = {
467463 let feeAmount = fraction(amount, fee, scale8)
468464 $Tuple2((amount - feeAmount), feeAmount)
469465 }
470466
471467
472468 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
473469 let isEval = (txId == unit)
474470 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
475471 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
476472 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
477473 then true
478474 else if ((paymentAssetId == cfgPriceAssetId))
479475 then false
480476 else throwErr("invalid asset")
481- let $t02261422907 = if (isEval)
477+ let $t02257122864 = if (isEval)
482478 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
483479 else if (paymentInAmountAsset)
484480 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
485481 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
486- let amountBalanceOld = $t02261422907._1
487- let priceBalanceOld = $t02261422907._2
488- let $t02291123060 = if (paymentInAmountAsset)
482+ let amountBalanceOld = $t02257122864._1
483+ let priceBalanceOld = $t02257122864._2
484+ let $t02286823017 = if (paymentInAmountAsset)
489485 then $Tuple2(paymentAmountRaw, 0)
490486 else $Tuple2(0, paymentAmountRaw)
491- let amountAssetAmountRaw = $t02291123060._1
492- let priceAssetAmountRaw = $t02291123060._2
487+ let amountAssetAmountRaw = $t02286823017._1
488+ let priceAssetAmountRaw = $t02286823017._2
493489 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
494490 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
495- let $t02318223241 = takeFee(paymentAmountRaw)
496- let paymentAmount = $t02318223241._1
497- let feeAmount = $t02318223241._2
491+ let $t02313923198 = takeFee(paymentAmountRaw)
492+ let paymentAmount = $t02313923198._1
493+ let feeAmount = $t02313923198._2
498494 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
499495 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
500496 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
501497 let priceNew = fromX18(priceNewX18, scale8)
502498 let paymentBalance = if (paymentInAmountAsset)
503499 then amountBalanceOld
504500 else priceBalanceOld
505501 let paymentBalanceBigInt = toBigInt(paymentBalance)
506502 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
507503 let chechSupply = if ((supplyBigInt > big0))
508504 then true
509505 else throwErr("initial deposit requires all coins")
510506 if ((chechSupply == chechSupply))
511507 then {
512508 let depositBigInt = toBigInt(paymentAmount)
513509 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
514510 let commonState = if (isEval)
515511 then nil
516512 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))]
517513 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
518514 let priceOld = fromX18(priceOldX18, scale8)
519515 let loss = {
520- let $t02471824885 = if (paymentInAmountAsset)
516+ let $t02467524842 = if (paymentInAmountAsset)
521517 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
522518 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
523- let amount = $t02471824885._1
524- let balance = $t02471824885._2
519+ let amount = $t02467524842._1
520+ let balance = $t02467524842._2
525521 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
526522 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
527523 }
528524 $Tuple4(issueAmount, commonState, feeAmount, loss)
529525 }
530526 else throw("Strict value is not equal to itself.")
531527 }
532528
533529
534530 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
535531 let isEval = (txId == unit)
536532 let checks = [if ((paymentAssetId == cfgLpAssetId))
537533 then true
538534 else throwErr("invalid lp asset")]
539535 if ((checks == checks))
540536 then {
541537 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
542538 then true
543539 else if ((outAssetId == cfgPriceAssetId))
544540 then false
545541 else throwErr("invalid asset")
546542 let balanceBigInt = if (outInAmountAsset)
547543 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
548544 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
549545 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
550546 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
551547 let outBalance = if (outInAmountAsset)
552548 then amBalanceOld
553549 else prBalanceOld
554550 let outBalanceBigInt = toBigInt(outBalance)
555551 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
556552 let redeemedBigInt = toBigInt(paymentAmount)
557553 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
558- let $t02646526515 = takeFee(amountRaw)
559- let totalAmount = $t02646526515._1
560- let feeAmount = $t02646526515._2
561- let $t02651926745 = if (outInAmountAsset)
554+ let $t02642226472 = takeFee(amountRaw)
555+ let totalAmount = $t02642226472._1
556+ let feeAmount = $t02642226472._2
557+ let $t02647626702 = if (outInAmountAsset)
562558 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
563559 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
564- let outAmAmount = $t02651926745._1
565- let outPrAmount = $t02651926745._2
566- let amBalanceNew = $t02651926745._3
567- let prBalanceNew = $t02651926745._4
560+ let outAmAmount = $t02647626702._1
561+ let outPrAmount = $t02647626702._2
562+ let amBalanceNew = $t02647626702._3
563+ let prBalanceNew = $t02647626702._4
568564 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
569565 let priceNew = fromX18(priceNewX18, scale8)
570566 let commonState = if (isEval)
571567 then nil
572568 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)]
573569 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
574570 let priceOld = fromX18(priceOldX18, scale8)
575571 let loss = {
576572 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
577573 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
578574 }
579575 $Tuple4(totalAmount, commonState, feeAmount, loss)
580576 }
581577 else throw("Strict value is not equal to itself.")
582578 }
583579
584580
585581 func managerPublicKeyOrUnit () = match getString(mpk()) {
586582 case s: String =>
587583 fromBase58String(s)
588584 case _: Unit =>
589585 unit
590586 case _ =>
591587 throw("Match error")
592588 }
593589
594590
595591 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
596592 case s: String =>
597593 fromBase58String(s)
598594 case _: Unit =>
599595 unit
600596 case _ =>
601597 throw("Match error")
602598 }
603599
604600
605601 func mustManager (i) = {
606602 let pd = throw("Permission denied")
607603 match managerPublicKeyOrUnit() {
608604 case pk: ByteVector =>
609605 if ((i.callerPublicKey == pk))
610606 then true
611607 else pd
612608 case _: Unit =>
613609 if ((i.caller == this))
614610 then true
615611 else pd
616612 case _ =>
617613 throw("Match error")
618614 }
619615 }
620616
621617
622618 @Callable(i)
623619 func setManager (pendingManagerPublicKey) = {
624620 let checkCaller = mustManager(i)
625621 if ((checkCaller == checkCaller))
626622 then {
627623 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
628624 if ((checkManagerPublicKey == checkManagerPublicKey))
629625 then [StringEntry(pmpk(), pendingManagerPublicKey)]
630626 else throw("Strict value is not equal to itself.")
631627 }
632628 else throw("Strict value is not equal to itself.")
633629 }
634630
635631
636632
637633 @Callable(i)
638634 func confirmManager () = {
639635 let pm = pendingManagerPublicKeyOrUnit()
640636 let hasPM = if (isDefined(pm))
641637 then true
642638 else throw("No pending manager")
643639 if ((hasPM == hasPM))
644640 then {
645641 let checkPM = if ((i.callerPublicKey == value(pm)))
646642 then true
647643 else throw("You are not pending manager")
648644 if ((checkPM == checkPM))
649645 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
650646 else throw("Strict value is not equal to itself.")
651647 }
652648 else throw("Strict value is not equal to itself.")
653649 }
654650
655651
656652
657653 @Callable(i)
658654 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
659655 then throw("Invalid slippageTolerance passed")
660656 else {
661657 let estPut = commonPut(i, slippageTolerance, true)
662658 let emitLpAmt = estPut._2
663659 let lpAssetId = estPut._7
664660 let state = estPut._9
665661 let amDiff = estPut._10
666662 let prDiff = estPut._11
667663 let amId = estPut._12
668664 let prId = estPut._13
669665 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
670666 if ((emitInv == emitInv))
671667 then {
672668 let emitInvLegacy = match emitInv {
673669 case legacyFactoryContract: Address =>
674670 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
675671 case _ =>
676672 unit
677673 }
678674 if ((emitInvLegacy == emitInvLegacy))
679675 then {
680676 let slippageAInv = if ((amDiff > 0))
681677 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
682678 else nil
683679 if ((slippageAInv == slippageAInv))
684680 then {
685681 let slippagePInv = if ((prDiff > 0))
686682 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
687683 else nil
688684 if ((slippagePInv == slippagePInv))
689685 then {
690686 let lpTransfer = if (shouldAutoStake)
691687 then {
692688 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
693689 if ((slpStakeInv == slpStakeInv))
694690 then nil
695691 else throw("Strict value is not equal to itself.")
696692 }
697693 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
698694 (state ++ lpTransfer)
699695 }
700696 else throw("Strict value is not equal to itself.")
701697 }
702698 else throw("Strict value is not equal to itself.")
703699 }
704700 else throw("Strict value is not equal to itself.")
705701 }
706702 else throw("Strict value is not equal to itself.")
707703 }
708704
709705
710706
711707 @Callable(i)
712708 func putForFree (maxSlippage) = if ((0 > maxSlippage))
713709 then throw("Invalid value passed")
714710 else {
715711 let estPut = commonPut(i, maxSlippage, false)
716712 estPut._9
717713 }
718714
719715
720716
721717 @Callable(i)
722718 func putOneTkn (minOutAmount,autoStake) = {
723719 let isPoolOneTokenOperationsDisabled = {
724720 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
725721 if ($isInstanceOf(@, "Boolean"))
726722 then @
727723 else throw(($getType(@) + " couldn't be cast to Boolean"))
728724 }
729725 let isPutDisabled = if (if (if (isGlobalShutdown())
730726 then true
731727 else (cfgPoolStatus == PoolPutDisabled))
732728 then true
733729 else (cfgPoolStatus == PoolShutdown))
734730 then true
735731 else isPoolOneTokenOperationsDisabled
736732 let checks = [if (!(isPutDisabled))
737733 then true
738734 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
739735 then true
740736 else throwErr("exactly 1 payment are expected")]
741737 if ((checks == checks))
742738 then {
743739 let payment = i.payments[0]
744740 let paymentAssetId = payment.assetId
745741 let paymentAmountRaw = payment.amount
746742 let userAddress = i.caller
747743 let txId = i.transactionId
748- let $t03145531582 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
749- let emitAmountEstimated = $t03145531582._1
750- let commonState = $t03145531582._2
751- let feeAmount = $t03145531582._3
752- let bonus = $t03145531582._4
744+ let $t03141231539 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
745+ let emitAmountEstimated = $t03141231539._1
746+ let commonState = $t03141231539._2
747+ let feeAmount = $t03141231539._3
748+ let bonus = $t03141231539._4
753749 let emitAmount = if (if ((minOutAmount > 0))
754750 then (minOutAmount > emitAmountEstimated)
755751 else false)
756752 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
757753 else emitAmountEstimated
758754 let emitInv = emit(emitAmount)
759755 if ((emitInv == emitInv))
760756 then {
761757 let lpTransfer = if (autoStake)
762758 then {
763759 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
764760 if ((stakeInv == stakeInv))
765761 then nil
766762 else throw("Strict value is not equal to itself.")
767763 }
768764 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
769765 let sendFee = if ((feeAmount > 0))
770766 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
771767 else nil
772768 $Tuple2(((commonState ++ lpTransfer) ++ sendFee), emitAmount)
773769 }
774770 else throw("Strict value is not equal to itself.")
775771 }
776772 else throw("Strict value is not equal to itself.")
777773 }
778774
779775
780776
781777 @Callable(i)
782778 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
783- let $t03231132446 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
784- let emitAmountEstimated = $t03231132446._1
785- let commonState = $t03231132446._2
786- let feeAmount = $t03231132446._3
787- let bonus = $t03231132446._4
779+ let $t03226832403 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
780+ let emitAmountEstimated = $t03226832403._1
781+ let commonState = $t03226832403._2
782+ let feeAmount = $t03226832403._3
783+ let bonus = $t03226832403._4
788784 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
789785 }
790786
791787
792788
793789 @Callable(i)
794790 func getOneTkn (outAssetIdStr,minOutAmount) = {
795791 let isPoolOneTokenOperationsDisabled = {
796792 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
797793 if ($isInstanceOf(@, "Boolean"))
798794 then @
799795 else throw(($getType(@) + " couldn't be cast to Boolean"))
800796 }
801797 let isGetDisabled = if (if (isGlobalShutdown())
802798 then true
803799 else (cfgPoolStatus == PoolShutdown))
804800 then true
805801 else isPoolOneTokenOperationsDisabled
806802 let checks = [if (!(isGetDisabled))
807803 then true
808804 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
809805 then true
810806 else throwErr("exactly 1 payment are expected")]
811807 if ((checks == checks))
812808 then {
813809 let outAssetId = parseAssetId(outAssetIdStr)
814810 let payment = i.payments[0]
815811 let paymentAssetId = payment.assetId
816812 let paymentAmount = payment.amount
817813 let userAddress = i.caller
818814 let txId = i.transactionId
819- let $t03321833350 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
820- let amountEstimated = $t03321833350._1
821- let commonState = $t03321833350._2
822- let feeAmount = $t03321833350._3
823- let bonus = $t03321833350._4
815+ let $t03317533307 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
816+ let amountEstimated = $t03317533307._1
817+ let commonState = $t03317533307._2
818+ let feeAmount = $t03317533307._3
819+ let bonus = $t03317533307._4
824820 let amount = if (if ((minOutAmount > 0))
825821 then (minOutAmount > amountEstimated)
826822 else false)
827823 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
828824 else amountEstimated
829825 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
830826 if ((burnInv == burnInv))
831827 then {
832828 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
833829 let sendFee = if ((feeAmount > 0))
834830 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
835831 else nil
836832 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
837833 }
838834 else throw("Strict value is not equal to itself.")
839835 }
840836 else throw("Strict value is not equal to itself.")
841837 }
842838
843839
844840
845841 @Callable(i)
846842 func getOneTknREADONLY (outAssetId,paymentAmount) = {
847- let $t03398534123 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
848- let amountEstimated = $t03398534123._1
849- let commonState = $t03398534123._2
850- let feeAmount = $t03398534123._3
851- let bonus = $t03398534123._4
843+ let $t03394234080 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
844+ let amountEstimated = $t03394234080._1
845+ let commonState = $t03394234080._2
846+ let feeAmount = $t03394234080._3
847+ let bonus = $t03394234080._4
852848 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
853849 }
854850
855851
856852
857853 @Callable(i)
858854 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
859855 let isPoolOneTokenOperationsDisabled = {
860856 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
861857 if ($isInstanceOf(@, "Boolean"))
862858 then @
863859 else throw(($getType(@) + " couldn't be cast to Boolean"))
864860 }
865861 let isGetDisabled = if (if (isGlobalShutdown())
866862 then true
867863 else (cfgPoolStatus == PoolShutdown))
868864 then true
869865 else isPoolOneTokenOperationsDisabled
870866 let checks = [if (!(isGetDisabled))
871867 then true
872868 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
873869 then true
874870 else throwErr("no payments are expected")]
875871 if ((checks == checks))
876872 then {
877873 let outAssetId = parseAssetId(outAssetIdStr)
878874 let userAddress = i.caller
879875 let txId = i.transactionId
880876 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
881877 if ((unstakeInv == unstakeInv))
882878 then {
883- let $t03491535045 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
884- let amountEstimated = $t03491535045._1
885- let commonState = $t03491535045._2
886- let feeAmount = $t03491535045._3
887- let bonus = $t03491535045._4
879+ let $t03487235002 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
880+ let amountEstimated = $t03487235002._1
881+ let commonState = $t03487235002._2
882+ let feeAmount = $t03487235002._3
883+ let bonus = $t03487235002._4
888884 let amount = if (if ((minOutAmount > 0))
889885 then (minOutAmount > amountEstimated)
890886 else false)
891887 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
892888 else amountEstimated
893889 let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
894890 if ((burnInv == burnInv))
895891 then {
896892 let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
897893 let sendFee = if ((feeAmount > 0))
898894 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
899895 else nil
900896 $Tuple2(((commonState ++ assetTransfer) ++ sendFee), amount)
901897 }
902898 else throw("Strict value is not equal to itself.")
903899 }
904900 else throw("Strict value is not equal to itself.")
905901 }
906902 else throw("Strict value is not equal to itself.")
907903 }
908904
909905
910906
911907 @Callable(i)
912908 func get () = {
913909 let res = commonGet(i)
914910 let outAmtAmt = res._1
915911 let outPrAmt = res._2
916912 let pmtAmt = res._3
917913 let pmtAssetId = res._4
918914 let state = res._5
919915 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
920916 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
921917 then state
922918 else throw("Strict value is not equal to itself.")
923919 }
924920
925921
926922
927923 @Callable(i)
928924 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
929925 let res = commonGet(i)
930926 let outAmAmt = res._1
931927 let outPrAmt = res._2
932928 let pmtAmt = res._3
933929 let pmtAssetId = res._4
934930 let state = res._5
935931 if ((noLessThenAmtAsset > outAmAmt))
936932 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
937933 else if ((noLessThenPriceAsset > outPrAmt))
938934 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
939935 else {
940936 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
941937 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
942938 then state
943939 else throw("Strict value is not equal to itself.")
944940 }
945941 }
946942
947943
948944
949945 @Callable(i)
950946 func unstakeAndGet (amount) = {
951947 let checkPayments = if ((size(i.payments) != 0))
952948 then throw("No payments are expected")
953949 else true
954950 if ((checkPayments == checkPayments))
955951 then {
956952 let cfg = getPoolConfig()
957953 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
958954 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
959955 if ((unstakeInv == unstakeInv))
960956 then {
961957 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
962958 let poolStatus = parseIntValue(res._9)
963959 let state = res._10
964960 let checkPoolStatus = if (if (isGlobalShutdown())
965961 then true
966962 else (poolStatus == PoolShutdown))
967963 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
968964 else true
969965 if ((checkPoolStatus == checkPoolStatus))
970966 then {
971967 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
972968 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
973969 then state
974970 else throw("Strict value is not equal to itself.")
975971 }
976972 else throw("Strict value is not equal to itself.")
977973 }
978974 else throw("Strict value is not equal to itself.")
979975 }
980976 else throw("Strict value is not equal to itself.")
981977 }
982978
983979
984980
985981 @Callable(i)
986982 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
987983 let isGetDisabled = if (isGlobalShutdown())
988984 then true
989985 else (cfgPoolStatus == PoolShutdown)
990986 let checks = [if (!(isGetDisabled))
991987 then true
992988 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
993989 then true
994990 else throw("no payments are expected")]
995991 if ((checks == checks))
996992 then {
997993 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
998994 if ((unstakeInv == unstakeInv))
999995 then {
1000996 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
1001997 let outAmAmt = res._1
1002998 let outPrAmt = res._2
1003999 let state = res._10
10041000 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
10051001 then true
10061002 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
10071003 then true
10081004 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
10091005 if ((checkAmounts == checkAmounts))
10101006 then {
10111007 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
10121008 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10131009 then state
10141010 else throw("Strict value is not equal to itself.")
10151011 }
10161012 else throw("Strict value is not equal to itself.")
10171013 }
10181014 else throw("Strict value is not equal to itself.")
10191015 }
10201016 else throw("Strict value is not equal to itself.")
10211017 }
10221018
10231019
10241020
10251021 @Callable(i)
10261022 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
10271023 then throw("permissions denied")
10281024 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
10291025
10301026
10311027
10321028 @Callable(i)
10331029 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
10341030
10351031
10361032
10371033 @Callable(i)
10381034 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
10391035
10401036
10411037
10421038 @Callable(i)
10431039 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
10441040 let prices = calcPrices(amAmt, prAmt, lpAmt)
10451041 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
10461042 }
10471043
10481044
10491045
10501046 @Callable(i)
10511047 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
10521048
10531049
10541050
10551051 @Callable(i)
10561052 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
10571053
10581054
10591055
10601056 @Callable(i)
10611057 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
10621058
10631059
10641060
10651061 @Callable(i)
10661062 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
10671063
10681064
10691065
10701066 @Callable(i)
10711067 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
10721068 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
10731069 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
10741070 }
10751071
10761072
10771073
10781074 @Callable(i)
10791075 func statsREADONLY () = {
10801076 let cfg = getPoolConfig()
10811077 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
10821078 let amtAssetId = cfg[idxAmtAssetId]
10831079 let priceAssetId = cfg[idxPriceAssetId]
10841080 let iAmtAssetId = cfg[idxIAmtAssetId]
10851081 let iPriceAssetId = cfg[idxIPriceAssetId]
10861082 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
10871083 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
10881084 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
10891085 let accAmtAssetBalance = getAccBalance(amtAssetId)
10901086 let accPriceAssetBalance = getAccBalance(priceAssetId)
10911087 let pricesList = if ((poolLPBalance == 0))
10921088 then [zeroBigInt, zeroBigInt, zeroBigInt]
10931089 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
10941090 let curPrice = 0
10951091 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
10961092 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
10971093 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
10981094 $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))
10991095 }
11001096
11011097
11021098
11031099 @Callable(i)
11041100 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
11051101 let cfg = getPoolConfig()
11061102 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11071103 let amAssetIdStr = cfg[idxAmtAssetId]
11081104 let amAssetId = fromBase58String(amAssetIdStr)
11091105 let prAssetIdStr = cfg[idxPriceAssetId]
11101106 let prAssetId = fromBase58String(prAssetIdStr)
11111107 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11121108 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11131109 let poolStatus = cfg[idxPoolStatus]
11141110 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11151111 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
11161112 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
11171113 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
11181114 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
11191115 let curPriceX18 = if ((poolLPBalance == 0))
11201116 then zeroBigInt
11211117 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
11221118 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
11231119 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
11241120 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
11251121 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11261122 let calcLpAmt = estPut._1
11271123 let curPriceCalc = estPut._3
11281124 let amBalance = estPut._4
11291125 let prBalance = estPut._5
11301126 let lpEmission = estPut._6
11311127 $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))
11321128 }
11331129
11341130
11351131
11361132 @Callable(i)
11371133 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
11381134 let cfg = getPoolConfig()
11391135 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11401136 let amAssetIdStr = cfg[idxAmtAssetId]
11411137 let amAssetId = fromBase58String(amAssetIdStr)
11421138 let prAssetIdStr = cfg[idxPriceAssetId]
11431139 let prAssetId = fromBase58String(prAssetIdStr)
11441140 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
11451141 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
11461142 let poolStatus = cfg[idxPoolStatus]
11471143 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
11481144 let amBalanceRaw = getAccBalance(amAssetIdStr)
11491145 let prBalanceRaw = getAccBalance(prAssetIdStr)
11501146 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
11511147 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
11521148 let curPriceX18 = if ((poolLPBalance == 0))
11531149 then zeroBigInt
11541150 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
11551151 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
11561152 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
11571153 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
11581154 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
11591155 let calcLpAmt = estPut._1
11601156 let curPriceCalc = estPut._3
11611157 let amBalance = estPut._4
11621158 let prBalance = estPut._5
11631159 let lpEmission = estPut._6
11641160 $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))
11651161 }
11661162
11671163
11681164
11691165 @Callable(i)
11701166 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
11711167 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
11721168 let outAmAmt = res._1
11731169 let outPrAmt = res._2
11741170 let amBalance = res._5
11751171 let prBalance = res._6
11761172 let lpEmission = res._7
11771173 let curPrice = res._8
11781174 let poolStatus = parseIntValue(res._9)
11791175 $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))
11801176 }
11811177
11821178
11831179 @Verifier(tx)
11841180 func verify () = {
11851181 let targetPublicKey = match managerPublicKeyOrUnit() {
11861182 case pk: ByteVector =>
11871183 pk
11881184 case _: Unit =>
11891185 tx.senderPublicKey
11901186 case _ =>
11911187 throw("Match error")
11921188 }
11931189 match tx {
11941190 case order: Order =>
11951191 let matcherPub = getMatcherPubOrFail()
11961192 let orderValid = validateMatcherOrderAllowed(order)
11971193 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
11981194 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
11991195 if (if (if (orderValid)
12001196 then senderValid
12011197 else false)
12021198 then matcherValid
12031199 else false)
12041200 then true
12051201 else throwOrderError(orderValid, senderValid, matcherValid)
12061202 case s: SetScriptTransaction =>
12071203 let newHash = blake2b256(value(s.script))
12081204 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
12091205 let currentHash = scriptHash(this)
12101206 if (if ((allowedHash == newHash))
12111207 then (currentHash != newHash)
12121208 else false)
12131209 then true
12141210 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12151211 case _ =>
12161212 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
12171213 }
12181214 }
12191215

github/deemru/w8io/026f985 
122.98 ms