tx · 5G7MyekHiM2bHHJfMbmKjFH47T9bk1n9biFjwBTohdqD

3MpHzJ37KHNWPLWooSuAFmuzL3EUXt86qQw:  -0.03500000 Waves

2022.12.22 18:25 [2371679] smart account 3MpHzJ37KHNWPLWooSuAFmuzL3EUXt86qQw > SELF 0.00000000 Waves

{ "type": 13, "id": "5G7MyekHiM2bHHJfMbmKjFH47T9bk1n9biFjwBTohdqD", "fee": 3500000, "feeAssetId": null, "timestamp": 1671722726855, "version": 1, "sender": "3MpHzJ37KHNWPLWooSuAFmuzL3EUXt86qQw", "senderPublicKey": "4gxnZwoAfBVeM48WyrZLy16TAaS7CUtppRoDqbadsKeA", "proofs": [ "2WHCkKDFnF7NjHRvhSWxNWwkbhK2rCrNFf44BwXMmHa7NDFQnXCWyoHpc3PPf5N86VR8LaeizhPF9fmEpUUV7bo3" ], "script": "base64:BgKdLQgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASABIDCgEIEgUKAwEBARIECgIBARIECgIIARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAEgMKAQESAwoBARIECgIIASIKbFBkZWNpbWFscyIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiC3dhdmVzU3RyaW5nIgNTRVAiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIg5pZHhQb29sQWRkcmVzcyINaWR4UG9vbFN0YXR1cyIQaWR4UG9vbExQQXNzZXRJZCINaWR4QW10QXNzZXRJZCIPaWR4UHJpY2VBc3NldElkIg5pZHhBbXRBc3NldERjbSIQaWR4UHJpY2VBc3NldERjbSIOaWR4SUFtdEFzc2V0SWQiEGlkeElQcmljZUFzc2V0SWQiDWlkeExQQXNzZX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kBBXZhbHVlAQkAnQgCBQJhTAkBAmF5AAQCZ0gJAPEHAQUEdGhpcwMDCQAAAgUCZ0cFAmdGCQECIT0CBQJnSAUCZ0YHBgkA9AMDCAUCZ0IJYm9keUJ5dGVzCQCRAwIIBQJnQgZwcm9vZnMAAAUCZ0QJAPQDAwgFAmdCCWJvZHlCeXRlcwkAkQMCCAUCZ0IGcHJvb2ZzAAAFAmdEOHvQgQ==", "chainId": 84, "height": 2371679, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EXYS7xffzUfkaKpEwmgTuBTihdpbiDR7UWnuk3fECZub Next: Cbj5zYyUhtbv35sybvZc7Y8GXZHF6x4KLuZRUNKtYFsR Diff:
OldNewDifferences
10181018 let userAddress = i.caller
10191019 let txId = i.transactionId
10201020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1021- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1022- if ((unstakeInv == unstakeInv))
1021+ if ((currentKLp == currentKLp))
10231022 then {
1024- let $t04062840779 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025- if (($t04062840779 == $t04062840779))
1023+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1024+ if ((unstakeInv == unstakeInv))
10261025 then {
1027- let outInAmountAsset = $t04062840779._5
1028- let bonus = $t04062840779._4
1029- let feeAmount = $t04062840779._3
1030- let commonState = $t04062840779._2
1031- let amountEstimated = $t04062840779._1
1032- let amount = if (if ((minOutAmount > 0))
1033- then (minOutAmount > amountEstimated)
1034- else false)
1035- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1036- else amountEstimated
1037- let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1038- if ((burnInv == burnInv))
1026+ let $t04063140782 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04063140782 == $t04063140782))
10391028 then {
1040- let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
1041- let sendFee = if ((feeAmount > 0))
1042- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1043- else nil
1044- let $t04127441521 = {
1045- let feeAmountForCalc = if ((this == feeCollectorAddress))
1046- then 0
1047- else feeAmount
1048- if (outInAmountAsset)
1049- then $Tuple2(-((amount + feeAmountForCalc)), 0)
1050- else $Tuple2(0, -((amount + feeAmountForCalc)))
1051- }
1052- let amountAssetBalanceDelta = $t04127441521._1
1053- let priceAssetBalanceDelta = $t04127441521._2
1054- let $t04152441632 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055- let refreshKLpActions = $t04152441632._1
1056- let updatedKLp = $t04152441632._2
1057- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1058- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1059- then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1029+ let outInAmountAsset = $t04063140782._5
1030+ let bonus = $t04063140782._4
1031+ let feeAmount = $t04063140782._3
1032+ let commonState = $t04063140782._2
1033+ let amountEstimated = $t04063140782._1
1034+ let amount = if (if ((minOutAmount > 0))
1035+ then (minOutAmount > amountEstimated)
1036+ else false)
1037+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1038+ else amountEstimated
1039+ let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1040+ if ((burnInv == burnInv))
1041+ then {
1042+ let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
1043+ let sendFee = if ((feeAmount > 0))
1044+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1045+ else nil
1046+ let $t04127741524 = {
1047+ let feeAmountForCalc = if ((this == feeCollectorAddress))
1048+ then 0
1049+ else feeAmount
1050+ if (outInAmountAsset)
1051+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
1052+ else $Tuple2(0, -((amount + feeAmountForCalc)))
1053+ }
1054+ let amountAssetBalanceDelta = $t04127741524._1
1055+ let priceAssetBalanceDelta = $t04127741524._2
1056+ let $t04152741635 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04152741635._1
1058+ let updatedKLp = $t04152741635._2
1059+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1060+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1061+ then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1062+ else throw("Strict value is not equal to itself.")
1063+ }
10601064 else throw("Strict value is not equal to itself.")
10611065 }
10621066 else throw("Strict value is not equal to itself.")
10841088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10851089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10861090 then {
1087- let $t04257842660 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088- let refreshKLpActions = $t04257842660._1
1089- let updatedKLp = $t04257842660._2
1091+ let $t04258142663 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04258142663._1
1093+ let updatedKLp = $t04258142663._2
10901094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10911095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10921096 then (state ++ refreshKLpActions)
11181122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11191123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11201124 then {
1121- let $t04360943690 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122- let refreshKLpActions = $t04360943690._1
1123- let updatedKLp = $t04360943690._2
1125+ let $t04361243693 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04361243693._1
1127+ let updatedKLp = $t04361243693._2
11241128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11251129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11261130 then (state ++ refreshKLpActions)
11641168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11651169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11661170 then {
1167- let $t04481644897 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168- let refreshKLpActions = $t04481644897._1
1169- let updatedKLp = $t04481644897._2
1171+ let $t04481944900 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04481944900._1
1173+ let updatedKLp = $t04481944900._2
11701174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11711175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11721176 then (state ++ refreshKLpActions)
12171221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12181222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12191223 then {
1220- let $t04619246273 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221- let refreshKLpActions = $t04619246273._1
1222- let updatedKLp = $t04619246273._2
1224+ let $t04619546276 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04619546276._1
1226+ let updatedKLp = $t04619546276._2
12231227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12241228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12251229 then (state ++ refreshKLpActions)
12541258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12551259 then {
12561260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1257- let $t04746047524 = refreshKLpInternal(0, 0, 0)
1258- let kLpUpdateActions = $t04746047524._1
1259- let updatedKLp = $t04746047524._2
1261+ let $t04746347527 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04746347527._1
1263+ let updatedKLp = $t04746347527._2
12601264 let actions = if ((kLp != updatedKLp))
12611265 then kLpUpdateActions
12621266 else throwErr("nothing to refresh")
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 fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round))
6969
7070
7171 func toScale (amt,resScale,curScale) = fraction(amt, resScale, curScale)
7272
7373
7474 func abs (val) = if ((0 > val))
7575 then -(val)
7676 else val
7777
7878
7979 func absBigInt (val) = if ((zeroBigInt > val))
8080 then -(val)
8181 else val
8282
8383
8484 func fc () = "%s__factoryContract"
8585
8686
8787 func mpk () = "%s__managerPublicKey"
8888
8989
9090 func pmpk () = "%s__pendingManagerPublicKey"
9191
9292
9393 func pl () = "%s%s__price__last"
9494
9595
9696 func ph (h,timestamp) = makeString(["%s%s%d%d__price__history", toString(h), toString(timestamp)], SEP)
9797
9898
9999 func pau (userAddress,txId) = ((("%s%s%s__P__" + userAddress) + "__") + txId)
100100
101101
102102 func gau (userAddress,txId) = ((("%s%s%s__G__" + userAddress) + "__") + txId)
103103
104104
105105 func aa () = "%s__amountAsset"
106106
107107
108108 func pa () = "%s__priceAsset"
109109
110110
111111 let keyFee = "%s__fee"
112112
113113 let feeDefault = fraction(10, scale8, 10000)
114114
115115 let fee = valueOrElse(getInteger(this, keyFee), feeDefault)
116116
117117 let keyKLp = makeString(["%s", "kLp"], SEP)
118118
119119 let keyKLpRefreshedHeight = makeString(["%s", "kLpRefreshedHeight"], SEP)
120120
121121 let keyKLpRefreshDelay = makeString(["%s", "refreshKLpDelay"], SEP)
122122
123123 let kLpRefreshDelayDefault = 30
124124
125125 let kLpRefreshDelay = valueOrElse(getInteger(this, keyKLpRefreshDelay), kLpRefreshDelayDefault)
126126
127127 func keyFactoryConfig () = "%s__factoryConfig"
128128
129129
130130 func keyMatcherPub () = "%s%s__matcher__publicKey"
131131
132132
133133 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
134134
135135
136136 func keyPoolConfig (iAmtAsset,iPriceAsset) = (((("%d%d%s__" + iAmtAsset) + "__") + iPriceAsset) + "__config")
137137
138138
139139 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
140140
141141
142142 func keyAllPoolsShutdown () = "%s__shutdown"
143143
144144
145145 func keyPoolWeight (contractAddress) = ("%s%s__poolWeight__" + contractAddress)
146146
147147
148148 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
149149
150150
151151 let keyFeeCollectorAddress = "%s__feeCollectorAddress"
152152
153153 func throwOrderError (orderValid,senderValid,matcherValid) = throw(((((("order validation failed: orderValid=" + toString(orderValid)) + " senderValid=") + toString(senderValid)) + " matcherValid=") + toString(matcherValid)))
154154
155155
156156 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
157157
158158
159159 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
160160
161161
162162 func throwErr (msg) = throw(makeString(["lp.ride:", msg], " "))
163163
164164
165165 func fmtErr (msg) = makeString(["lp.ride:", msg], " ")
166166
167167
168168 let factoryContract = addressFromStringValue(getStringOrFail(this, fc()))
169169
170170 let feeCollectorAddress = addressFromStringValue(getStringOrFail(factoryContract, keyFeeCollectorAddress))
171171
172172 func isGlobalShutdown () = valueOrElse(getBoolean(factoryContract, keyAllPoolsShutdown()), false)
173173
174174
175175 func getMatcherPubOrFail () = fromBase58String(getStringOrFail(factoryContract, keyMatcherPub()))
176176
177177
178178 func getPoolConfig () = {
179179 let amtAsset = getStringOrFail(this, aa())
180180 let priceAsset = getStringOrFail(this, pa())
181181 let iPriceAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAsset))
182182 let iAmtAsset = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amtAsset))
183183 split(getStringOrFail(factoryContract, keyPoolConfig(toString(iAmtAsset), toString(iPriceAsset))), SEP)
184184 }
185185
186186
187187 func parseAssetId (input) = if ((input == wavesString))
188188 then unit
189189 else fromBase58String(input)
190190
191191
192192 func assetIdToString (input) = if ((input == unit))
193193 then wavesString
194194 else toBase58String(value(input))
195195
196196
197197 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]))
198198
199199
200200 let poolConfigParsed = parsePoolConfig(getPoolConfig())
201201
202202 let $t080588224 = poolConfigParsed
203203
204204 let cfgPoolAddress = $t080588224._1
205205
206206 let cfgPoolStatus = $t080588224._2
207207
208208 let cfgLpAssetId = $t080588224._3
209209
210210 let cfgAmountAssetId = $t080588224._4
211211
212212 let cfgPriceAssetId = $t080588224._5
213213
214214 let cfgAmountAssetDecimals = $t080588224._6
215215
216216 let cfgPriceAssetDecimals = $t080588224._7
217217
218218 func getFactoryConfig () = split(getStringOrFail(factoryContract, keyFactoryConfig()), SEP)
219219
220220
221221 let stakingContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactoryStakingContract]), "incorrect staking address")
222222
223223 let slippageContract = valueOrErrorMessage(addressFromString(getFactoryConfig()[idxFactorySlippageContract]), "incorrect staking address")
224224
225225 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)
226226
227227
228228 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)
229229
230230
231231 func getAccBalance (assetId) = if ((assetId == "WAVES"))
232232 then wavesBalance(this).available
233233 else assetBalance(this, fromBase58String(assetId))
234234
235235
236236 func calcPriceBigInt (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18)
237237
238238
239239 func calcPriceBigIntRound (prAmtX18,amAmtX18,round) = fraction(prAmtX18, scale18, amAmtX18, round)
240240
241241
242242 func privateCalcPrice (amAssetDcm,prAssetDcm,amAmt,prAmt) = {
243243 let amtAssetAmtX18 = toX18(amAmt, amAssetDcm)
244244 let priceAssetAmtX18 = toX18(prAmt, prAssetDcm)
245245 calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
246246 }
247247
248248
249249 func calcPrices (amAmt,prAmt,lpAmt) = {
250250 let cfg = getPoolConfig()
251251 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
252252 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
253253 let priceX18 = privateCalcPrice(amtAssetDcm, priceAssetDcm, amAmt, prAmt)
254254 let amAmtX18 = toX18(amAmt, amtAssetDcm)
255255 let prAmtX18 = toX18(prAmt, priceAssetDcm)
256256 let lpAmtX18 = toX18(lpAmt, scale8)
257257 let lpPriceInAmAssetX18 = calcPriceBigInt(amAmtX18, lpAmtX18)
258258 let lpPriceInPrAssetX18 = calcPriceBigInt(prAmtX18, lpAmtX18)
259259 [priceX18, lpPriceInAmAssetX18, lpPriceInPrAssetX18]
260260 }
261261
262262
263263 func calculatePrices (amAmt,prAmt,lpAmt) = {
264264 let prices = calcPrices(amAmt, prAmt, lpAmt)
265265 [fromX18(prices[0], scale8), fromX18(prices[1], scale8), fromX18(prices[2], scale8)]
266266 }
267267
268268
269269 func estimateGetOperation (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
270270 let cfg = getPoolConfig()
271271 let lpAssetId = cfg[idxPoolLPAssetId]
272272 let amAssetId = cfg[idxAmtAssetId]
273273 let prAssetId = cfg[idxPriceAssetId]
274274 let amAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
275275 let prAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
276276 let poolStatus = cfg[idxPoolStatus]
277277 let lpEmission = valueOrErrorMessage(assetInfo(fromBase58String(lpAssetId)), (("Asset " + lpAssetId) + " doesn't exist")).quantity
278278 if ((lpAssetId != pmtAssetId))
279279 then throw("Invalid asset passed.")
280280 else {
281281 let amBalance = getAccBalance(amAssetId)
282282 let amBalanceX18 = toX18(amBalance, amAssetDcm)
283283 let prBalance = getAccBalance(prAssetId)
284284 let prBalanceX18 = toX18(prBalance, prAssetDcm)
285285 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
286286 let curPrice = fromX18(curPriceX18, scale8)
287287 let pmtLpAmtX18 = toX18(pmtLpAmt, scale8)
288288 let lpEmissionX18 = toX18(lpEmission, scale8)
289289 let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissionX18)
290290 let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissionX18)
291291 let outAmAmt = fromX18Round(outAmAmtX18, amAssetDcm, FLOOR)
292292 let outPrAmt = fromX18Round(outPrAmtX18, prAssetDcm, FLOOR)
293293 let state = if ((txId58 == ""))
294294 then nil
295295 else [ScriptTransfer(userAddress, outAmAmt, if ((amAssetId == "WAVES"))
296296 then unit
297297 else fromBase58String(amAssetId)), ScriptTransfer(userAddress, outPrAmt, if ((prAssetId == "WAVES"))
298298 then unit
299299 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)]
300300 $Tuple10(outAmAmt, outPrAmt, amAssetId, prAssetId, amBalance, prBalance, lpEmission, curPriceX18, poolStatus, state)
301301 }
302302 }
303303
304304
305305 func estimatePutOperation (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = {
306306 let cfg = getPoolConfig()
307307 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
308308 let amAssetIdStr = cfg[idxAmtAssetId]
309309 let prAssetIdStr = cfg[idxPriceAssetId]
310310 let iAmtAssetId = cfg[idxIAmtAssetId]
311311 let iPriceAssetId = cfg[idxIPriceAssetId]
312312 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
313313 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
314314 let poolStatus = cfg[idxPoolStatus]
315315 let lpEmission = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
316316 let inAmAssetIdStr = toBase58String(valueOrElse(inAmAssetId, fromBase58String("WAVES")))
317317 let inPrAssetIdStr = toBase58String(valueOrElse(inPrAssetId, fromBase58String("WAVES")))
318318 if (if ((amAssetIdStr != inAmAssetIdStr))
319319 then true
320320 else (prAssetIdStr != inPrAssetIdStr))
321321 then throw("Invalid amt or price asset passed.")
322322 else {
323323 let amBalance = if (isEvaluate)
324324 then getAccBalance(amAssetIdStr)
325325 else (getAccBalance(amAssetIdStr) - inAmAssetAmt)
326326 let prBalance = if (isEvaluate)
327327 then getAccBalance(prAssetIdStr)
328328 else (getAccBalance(prAssetIdStr) - inPrAssetAmt)
329329 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
330330 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
331331 let userPriceX18 = calcPriceBigInt(inPrAssetAmtX18, inAmAssetAmtX18)
332332 let amBalanceX18 = toX18(amBalance, amtAssetDcm)
333333 let prBalanceX18 = toX18(prBalance, priceAssetDcm)
334334 let res = if ((lpEmission == 0))
335335 then {
336336 let curPriceX18 = zeroBigInt
337337 let slippageX18 = zeroBigInt
338338 let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN)
339339 $Tuple5(fromX18(lpAmtX18, scale8), fromX18(inAmAssetAmtX18, amtAssetDcm), fromX18(inPrAssetAmtX18, priceAssetDcm), calcPriceBigInt((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18)
340340 }
341341 else {
342342 let curPriceX18 = calcPriceBigInt(prBalanceX18, amBalanceX18)
343343 let slippageX18 = fraction(absBigInt((curPriceX18 - userPriceX18)), scale18, curPriceX18)
344344 let slippageToleranceX18 = toX18(slippageTolerance, scale8)
345345 if (if ((curPriceX18 != zeroBigInt))
346346 then (slippageX18 > slippageToleranceX18)
347347 else false)
348348 then throw(((("Price slippage " + toString(slippageX18)) + " exceeded the passed limit of ") + toString(slippageToleranceX18)))
349349 else {
350350 let lpEmissionX18 = toX18(lpEmission, scale8)
351351 let prViaAmX18 = fraction(inAmAssetAmtX18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, CEILING), scale18, CEILING)
352352 let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, calcPriceBigIntRound(prBalanceX18, amBalanceX18, FLOOR), CEILING)
353353 let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18))
354354 then $Tuple2(amViaPrX18, inPrAssetAmtX18)
355355 else $Tuple2(inAmAssetAmtX18, prViaAmX18)
356356 let expAmtAssetAmtX18 = expectedAmts._1
357357 let expPriceAssetAmtX18 = expectedAmts._2
358358 let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18, FLOOR)
359359 $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtAssetDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceAssetDcm, CEILING), curPriceX18, slippageX18)
360360 }
361361 }
362362 let calcLpAmt = res._1
363363 let calcAmAssetPmt = res._2
364364 let calcPrAssetPmt = res._3
365365 let curPrice = fromX18(res._4, scale8)
366366 let slippageCalc = fromX18(res._5, scale8)
367367 if ((0 >= calcLpAmt))
368368 then throw("Invalid calculations. LP calculated is less than zero.")
369369 else {
370370 let emitLpAmt = if (!(emitLp))
371371 then 0
372372 else calcLpAmt
373373 let amDiff = (inAmAssetAmt - calcAmAssetPmt)
374374 let prDiff = (inPrAssetAmt - calcPrAssetPmt)
375375 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))]
376376 $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEmission, lpAssetId, poolStatus, commonState, amDiff, prDiff, inAmAssetId, inPrAssetId)
377377 }
378378 }
379379 }
380380
381381
382382 func calcKLp (amountBalance,priceBalance,lpEmission) = {
383383 let updatedKLp = fraction(pow((amountBalance * priceBalance), 0, toBigInt(5), 1, 18, DOWN), big1, lpEmission)
384384 if ((lpEmission == big0))
385385 then big0
386386 else updatedKLp
387387 }
388388
389389
390390 func calcCurrentKLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = {
391391 let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta)
392392 let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta)
393393 let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta)
394394 let currentKLp = calcKLp(amountAssetBalance, priceAssetBalance, lpAssetEmission)
395395 currentKLp
396396 }
397397
398398
399399 func refreshKLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = {
400400 let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta)
401401 let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta)
402402 let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta)
403403 let updatedKLp = calcKLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission))
404404 let actions = [IntegerEntry(keyKLpRefreshedHeight, height), StringEntry(keyKLp, toString(updatedKLp))]
405405 $Tuple2(actions, updatedKLp)
406406 }
407407
408408
409409 func validateUpdatedKLp (oldKLp,updatedKLp) = if ((updatedKLp >= oldKLp))
410410 then true
411411 else throwErr(makeString(["updated KLp lower than current KLp", toString(oldKLp), toString(updatedKLp)], " "))
412412
413413
414414 func validateMatcherOrderAllowed (order) = {
415415 let amountAssetAmount = order.amount
416416 let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR)
417417 let $t02080121013 = if ((order.orderType == Buy))
418418 then $Tuple2(amountAssetAmount, -(priceAssetAmount))
419419 else $Tuple2(-(amountAssetAmount), priceAssetAmount)
420420 let amountAssetBalanceDelta = $t02080121013._1
421421 let priceAssetBalanceDelta = $t02080121013._2
422422 if (if (if (isGlobalShutdown())
423423 then true
424424 else (cfgPoolStatus == PoolMatcherDisabled))
425425 then true
426426 else (cfgPoolStatus == PoolShutdown))
427427 then throw("Exchange operations disabled")
428428 else if (if ((order.assetPair.amountAsset != cfgAmountAssetId))
429429 then true
430430 else (order.assetPair.priceAsset != cfgPriceAssetId))
431431 then throw("Wrong order assets.")
432432 else {
433433 let kLp = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, keyKLp), fmtErr("kLp is required"))), fmtErr("invalid kLp"))
434434 let $t02148421584 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
435435 let unusedActions = $t02148421584._1
436436 let kLpNew = $t02148421584._2
437437 let isOrderValid = (kLpNew >= kLp)
438438 isOrderValid
439439 }
440440 }
441441
442442
443443 func commonGet (i) = if ((size(i.payments) != 1))
444444 then throw("exactly 1 payment is expected")
445445 else {
446446 let pmt = value(i.payments[0])
447447 let pmtAssetId = value(pmt.assetId)
448448 let pmtAmt = pmt.amount
449449 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller)
450450 let outAmAmt = res._1
451451 let outPrAmt = res._2
452452 let poolStatus = parseIntValue(res._9)
453453 let state = res._10
454454 if (if (isGlobalShutdown())
455455 then true
456456 else (poolStatus == PoolShutdown))
457457 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
458458 else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state)
459459 }
460460
461461
462462 func commonPut (i,slippageTolerance,emitLp) = if ((size(i.payments) != 2))
463463 then throw("exactly 2 payments are expected")
464464 else {
465465 let amAssetPmt = value(i.payments[0])
466466 let prAssetPmt = value(i.payments[1])
467467 let estPut = estimatePutOperation(toBase58String(i.transactionId), slippageTolerance, amAssetPmt.amount, amAssetPmt.assetId, prAssetPmt.amount, prAssetPmt.assetId, toString(i.caller), false, emitLp)
468468 let poolStatus = parseIntValue(estPut._8)
469469 if (if (if (isGlobalShutdown())
470470 then true
471471 else (poolStatus == PoolPutDisabled))
472472 then true
473473 else (poolStatus == PoolShutdown))
474474 then throw(("Put operation is blocked by admin. Status = " + toString(poolStatus)))
475475 else estPut
476476 }
477477
478478
479479 func emit (amount) = {
480480 let emitInv = invoke(factoryContract, "emit", [amount], nil)
481481 if ((emitInv == emitInv))
482482 then {
483483 let emitInvLegacy = match emitInv {
484484 case legacyFactoryContract: Address =>
485485 invoke(legacyFactoryContract, "emit", [amount], nil)
486486 case _ =>
487487 unit
488488 }
489489 if ((emitInvLegacy == emitInvLegacy))
490490 then amount
491491 else throw("Strict value is not equal to itself.")
492492 }
493493 else throw("Strict value is not equal to itself.")
494494 }
495495
496496
497497 func takeFee (amount) = {
498498 let feeAmount = fraction(amount, fee, scale8)
499499 $Tuple2((amount - feeAmount), feeAmount)
500500 }
501501
502502
503503 func calcPutOneToken (paymentAmountRaw,paymentAssetId,userAddress,txId) = {
504504 let isEval = (txId == unit)
505505 let amountBalanceRaw = getAccBalance(assetIdToString(cfgAmountAssetId))
506506 let priceBalanceRaw = getAccBalance(assetIdToString(cfgPriceAssetId))
507507 let paymentInAmountAsset = if ((paymentAssetId == cfgAmountAssetId))
508508 then true
509509 else if ((paymentAssetId == cfgPriceAssetId))
510510 then false
511511 else throwErr("invalid asset")
512512 let $t02426924562 = if (isEval)
513513 then $Tuple2(amountBalanceRaw, priceBalanceRaw)
514514 else if (paymentInAmountAsset)
515515 then $Tuple2((amountBalanceRaw - paymentAmountRaw), priceBalanceRaw)
516516 else $Tuple2(amountBalanceRaw, (priceBalanceRaw - paymentAmountRaw))
517517 let amountBalanceOld = $t02426924562._1
518518 let priceBalanceOld = $t02426924562._2
519519 let $t02456624715 = if (paymentInAmountAsset)
520520 then $Tuple2(paymentAmountRaw, 0)
521521 else $Tuple2(0, paymentAmountRaw)
522522 let amountAssetAmountRaw = $t02456624715._1
523523 let priceAssetAmountRaw = $t02456624715._2
524524 let amountAssetAmount = takeFee(amountAssetAmountRaw)._1
525525 let priceAssetAmount = takeFee(priceAssetAmountRaw)._1
526526 let $t02483724896 = takeFee(paymentAmountRaw)
527527 let paymentAmount = $t02483724896._1
528528 let feeAmount = $t02483724896._2
529529 let amountBalanceNew = (amountBalanceOld + amountAssetAmount)
530530 let priceBalanceNew = (priceBalanceOld + priceAssetAmount)
531531 let priceNewX18 = calcPriceBigInt(toX18(priceBalanceNew, cfgPriceAssetDecimals), toX18(amountBalanceNew, cfgAmountAssetDecimals))
532532 let priceNew = fromX18(priceNewX18, scale8)
533533 let paymentBalance = if (paymentInAmountAsset)
534534 then amountBalanceOld
535535 else priceBalanceOld
536536 let paymentBalanceBigInt = toBigInt(paymentBalance)
537537 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
538538 let chechSupply = if ((supplyBigInt > big0))
539539 then true
540540 else throwErr("initial deposit requires all coins")
541541 if ((chechSupply == chechSupply))
542542 then {
543543 let depositBigInt = toBigInt(paymentAmount)
544544 let issueAmount = max([0, toInt(((supplyBigInt * (sqrtBigInt((scale18 + ((depositBigInt * scale18) / paymentBalanceBigInt)), 18, 18, DOWN) - scale18)) / scale18))])
545545 let commonState = if (isEval)
546546 then nil
547547 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))]
548548 let priceOldX18 = calcPriceBigInt(toX18(priceBalanceOld, cfgPriceAssetDecimals), toX18(amountBalanceOld, cfgAmountAssetDecimals))
549549 let priceOld = fromX18(priceOldX18, scale8)
550550 let loss = {
551551 let $t02657726744 = if (paymentInAmountAsset)
552552 then $Tuple2(amountAssetAmountRaw, amountBalanceOld)
553553 else $Tuple2(priceAssetAmountRaw, priceBalanceOld)
554554 let amount = $t02657726744._1
555555 let balance = $t02657726744._2
556556 let issueAmountBoth = toInt(fraction(supplyBigInt, toBigInt((amount / 2)), toBigInt(balance)))
557557 fraction((issueAmount - issueAmountBoth), scale8, issueAmountBoth)
558558 }
559559 $Tuple5(issueAmount, commonState, feeAmount, loss, paymentInAmountAsset)
560560 }
561561 else throw("Strict value is not equal to itself.")
562562 }
563563
564564
565565 func calcGetOneToken (outAssetId,paymentAmount,paymentAssetId,userAddress,txId) = {
566566 let isEval = (txId == unit)
567567 let cfg = getPoolConfig()
568568 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
569569 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
570570 let checks = [if ((paymentAssetId == cfgLpAssetId))
571571 then true
572572 else throwErr("invalid lp asset")]
573573 if ((checks == checks))
574574 then {
575575 let outInAmountAsset = if ((outAssetId == cfgAmountAssetId))
576576 then true
577577 else if ((outAssetId == cfgPriceAssetId))
578578 then false
579579 else throwErr("invalid asset")
580580 let balanceBigInt = if (outInAmountAsset)
581581 then toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId)))
582582 else toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId)))
583583 let outInAmountAssetDecimals = if (outInAmountAsset)
584584 then amtAssetDcm
585585 else priceAssetDcm
586586 let amBalanceOld = getAccBalance(assetIdToString(cfgAmountAssetId))
587587 let prBalanceOld = getAccBalance(assetIdToString(cfgPriceAssetId))
588588 let outBalance = if (outInAmountAsset)
589589 then amBalanceOld
590590 else prBalanceOld
591591 let outBalanceBigInt = toBigInt(outBalance)
592592 let supplyBigInt = toBigInt(valueOrErrorMessage(assetInfo(cfgLpAssetId), (("asset " + toBase58String(cfgLpAssetId)) + " doesn't exist")).quantity)
593593 let redeemedBigInt = toBigInt(paymentAmount)
594594 let amountRaw = max([0, toInt(((balanceBigInt * (scale18 - pow((scale18 - ((redeemedBigInt * scale18) / supplyBigInt)), 18, big2, 0, 18, DOWN))) / scale18))])
595595 let $t02882328873 = takeFee(amountRaw)
596596 let totalAmount = $t02882328873._1
597597 let feeAmount = $t02882328873._2
598598 let $t02887729103 = if (outInAmountAsset)
599599 then $Tuple4(totalAmount, 0, (amBalanceOld - amountRaw), prBalanceOld)
600600 else $Tuple4(0, totalAmount, amBalanceOld, (prBalanceOld - amountRaw))
601601 let outAmAmount = $t02887729103._1
602602 let outPrAmount = $t02887729103._2
603603 let amBalanceNew = $t02887729103._3
604604 let prBalanceNew = $t02887729103._4
605605 let priceNewX18 = calcPriceBigInt(toX18(prBalanceNew, cfgPriceAssetDecimals), toX18(amBalanceNew, cfgAmountAssetDecimals))
606606 let priceNew = fromX18(priceNewX18, scale8)
607607 let commonState = if (isEval)
608608 then nil
609609 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)]
610610 let priceOldX18 = calcPriceBigInt(toX18(prBalanceOld, cfgPriceAssetDecimals), toX18(amBalanceOld, cfgAmountAssetDecimals))
611611 let priceOld = fromX18(priceOldX18, scale8)
612612 let loss = {
613613 let amountBothInPaymentAsset = (toInt(fraction(balanceBigInt, redeemedBigInt, supplyBigInt)) * 2)
614614 fraction((totalAmount - amountBothInPaymentAsset), scale8, amountBothInPaymentAsset)
615615 }
616616 $Tuple5(totalAmount, commonState, feeAmount, loss, outInAmountAsset)
617617 }
618618 else throw("Strict value is not equal to itself.")
619619 }
620620
621621
622622 func managerPublicKeyOrUnit () = match getString(mpk()) {
623623 case s: String =>
624624 fromBase58String(s)
625625 case _: Unit =>
626626 unit
627627 case _ =>
628628 throw("Match error")
629629 }
630630
631631
632632 func pendingManagerPublicKeyOrUnit () = match getString(pmpk()) {
633633 case s: String =>
634634 fromBase58String(s)
635635 case _: Unit =>
636636 unit
637637 case _ =>
638638 throw("Match error")
639639 }
640640
641641
642642 func isManager (i) = match managerPublicKeyOrUnit() {
643643 case pk: ByteVector =>
644644 (i.callerPublicKey == pk)
645645 case _: Unit =>
646646 (i.caller == this)
647647 case _ =>
648648 throw("Match error")
649649 }
650650
651651
652652 func mustManager (i) = {
653653 let pd = throw("Permission denied")
654654 match managerPublicKeyOrUnit() {
655655 case pk: ByteVector =>
656656 if ((i.callerPublicKey == pk))
657657 then true
658658 else pd
659659 case _: Unit =>
660660 if ((i.caller == this))
661661 then true
662662 else pd
663663 case _ =>
664664 throw("Match error")
665665 }
666666 }
667667
668668
669669 @Callable(i)
670670 func setManager (pendingManagerPublicKey) = {
671671 let checkCaller = mustManager(i)
672672 if ((checkCaller == checkCaller))
673673 then {
674674 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
675675 if ((checkManagerPublicKey == checkManagerPublicKey))
676676 then [StringEntry(pmpk(), pendingManagerPublicKey)]
677677 else throw("Strict value is not equal to itself.")
678678 }
679679 else throw("Strict value is not equal to itself.")
680680 }
681681
682682
683683
684684 @Callable(i)
685685 func confirmManager () = {
686686 let pm = pendingManagerPublicKeyOrUnit()
687687 let hasPM = if (isDefined(pm))
688688 then true
689689 else throw("No pending manager")
690690 if ((hasPM == hasPM))
691691 then {
692692 let checkPM = if ((i.callerPublicKey == value(pm)))
693693 then true
694694 else throw("You are not pending manager")
695695 if ((checkPM == checkPM))
696696 then [StringEntry(mpk(), toBase58String(value(pm))), DeleteEntry(pmpk())]
697697 else throw("Strict value is not equal to itself.")
698698 }
699699 else throw("Strict value is not equal to itself.")
700700 }
701701
702702
703703
704704 @Callable(i)
705705 func put (slippageTolerance,shouldAutoStake) = if ((0 > slippageTolerance))
706706 then throw("Invalid slippageTolerance passed")
707707 else {
708708 let estPut = commonPut(i, slippageTolerance, true)
709709 let emitLpAmt = estPut._2
710710 let lpAssetId = estPut._7
711711 let state = estPut._9
712712 let amDiff = estPut._10
713713 let prDiff = estPut._11
714714 let amId = estPut._12
715715 let prId = estPut._13
716716 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
717717 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
718718 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
719719 if ((currentKLp == currentKLp))
720720 then {
721721 let emitInv = invoke(factoryContract, "emit", [emitLpAmt], nil)
722722 if ((emitInv == emitInv))
723723 then {
724724 let emitInvLegacy = match emitInv {
725725 case legacyFactoryContract: Address =>
726726 invoke(legacyFactoryContract, "emit", [emitLpAmt], nil)
727727 case _ =>
728728 unit
729729 }
730730 if ((emitInvLegacy == emitInvLegacy))
731731 then {
732732 let slippageAInv = if ((amDiff > 0))
733733 then invoke(slippageContract, "put", nil, [AttachedPayment(amId, amDiff)])
734734 else nil
735735 if ((slippageAInv == slippageAInv))
736736 then {
737737 let slippagePInv = if ((prDiff > 0))
738738 then invoke(slippageContract, "put", nil, [AttachedPayment(prId, prDiff)])
739739 else nil
740740 if ((slippagePInv == slippagePInv))
741741 then {
742742 let lpTransfer = if (shouldAutoStake)
743743 then {
744744 let slpStakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)])
745745 if ((slpStakeInv == slpStakeInv))
746746 then nil
747747 else throw("Strict value is not equal to itself.")
748748 }
749749 else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)]
750750 let $t03363134093 = refreshKLpInternal(0, 0, 0)
751751 if (($t03363134093 == $t03363134093))
752752 then {
753753 let updatedKLp = $t03363134093._2
754754 let refreshKLpActions = $t03363134093._1
755755 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
756756 if ((isUpdatedKLpValid == isUpdatedKLpValid))
757757 then ((state ++ lpTransfer) ++ refreshKLpActions)
758758 else throw("Strict value is not equal to itself.")
759759 }
760760 else throw("Strict value is not equal to itself.")
761761 }
762762 else throw("Strict value is not equal to itself.")
763763 }
764764 else throw("Strict value is not equal to itself.")
765765 }
766766 else throw("Strict value is not equal to itself.")
767767 }
768768 else throw("Strict value is not equal to itself.")
769769 }
770770 else throw("Strict value is not equal to itself.")
771771 }
772772
773773
774774
775775 @Callable(i)
776776 func putForFree (maxSlippage) = if ((0 > maxSlippage))
777777 then throw("Invalid value passed")
778778 else {
779779 let estPut = commonPut(i, maxSlippage, false)
780780 let state = estPut._9
781781 let amAssetPmt = toBigInt(value(i.payments[0]).amount)
782782 let prAssetPmt = toBigInt(value(i.payments[1]).amount)
783783 let currentKLp = calcCurrentKLp(amAssetPmt, prAssetPmt, toBigInt(0))
784784 if ((currentKLp == currentKLp))
785785 then {
786786 let $t03465534720 = refreshKLpInternal(0, 0, 0)
787787 let refreshKLpActions = $t03465534720._1
788788 let updatedKLp = $t03465534720._2
789789 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
790790 if ((isUpdatedKLpValid == isUpdatedKLpValid))
791791 then (state ++ refreshKLpActions)
792792 else throw("Strict value is not equal to itself.")
793793 }
794794 else throw("Strict value is not equal to itself.")
795795 }
796796
797797
798798
799799 @Callable(i)
800800 func putOneTkn (minOutAmount,autoStake) = {
801801 let isPoolOneTokenOperationsDisabled = {
802802 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
803803 if ($isInstanceOf(@, "Boolean"))
804804 then @
805805 else throw(($getType(@) + " couldn't be cast to Boolean"))
806806 }
807807 let isPutDisabled = if (if (if (isGlobalShutdown())
808808 then true
809809 else (cfgPoolStatus == PoolPutDisabled))
810810 then true
811811 else (cfgPoolStatus == PoolShutdown))
812812 then true
813813 else isPoolOneTokenOperationsDisabled
814814 let checks = [if (if (!(isPutDisabled))
815815 then true
816816 else isManager(i))
817817 then true
818818 else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1))
819819 then true
820820 else throwErr("exactly 1 payment are expected")]
821821 if ((checks == checks))
822822 then {
823823 let payment = i.payments[0]
824824 let paymentAssetId = payment.assetId
825825 let paymentAmountRaw = payment.amount
826826 let currentKLp = if ((paymentAssetId == cfgAmountAssetId))
827827 then calcCurrentKLp(toBigInt(paymentAmountRaw), toBigInt(0), toBigInt(0))
828828 else if ((paymentAssetId == cfgPriceAssetId))
829829 then calcCurrentKLp(toBigInt(0), toBigInt(paymentAmountRaw), toBigInt(0))
830830 else throwErr("payment asset is not supported")
831831 if ((currentKLp == currentKLp))
832832 then {
833833 let userAddress = i.caller
834834 let txId = i.transactionId
835835 let $t03590836060 = calcPutOneToken(paymentAmountRaw, paymentAssetId, userAddress, txId)
836836 if (($t03590836060 == $t03590836060))
837837 then {
838838 let paymentInAmountAsset = $t03590836060._5
839839 let bonus = $t03590836060._4
840840 let feeAmount = $t03590836060._3
841841 let commonState = $t03590836060._2
842842 let emitAmountEstimated = $t03590836060._1
843843 let emitAmount = if (if ((minOutAmount > 0))
844844 then (minOutAmount > emitAmountEstimated)
845845 else false)
846846 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
847847 else emitAmountEstimated
848848 let emitInv = emit(emitAmount)
849849 if ((emitInv == emitInv))
850850 then {
851851 let lpTransfer = if (autoStake)
852852 then {
853853 let stakeInv = invoke(stakingContract, "stake", nil, [AttachedPayment(cfgLpAssetId, emitAmount)])
854854 if ((stakeInv == stakeInv))
855855 then nil
856856 else throw("Strict value is not equal to itself.")
857857 }
858858 else [ScriptTransfer(i.caller, emitAmount, cfgLpAssetId)]
859859 let sendFee = if ((feeAmount > 0))
860860 then [ScriptTransfer(feeCollectorAddress, feeAmount, paymentAssetId)]
861861 else nil
862862 let $t03664636843 = if ((this == feeCollectorAddress))
863863 then $Tuple2(0, 0)
864864 else if (paymentInAmountAsset)
865865 then $Tuple2(-(feeAmount), 0)
866866 else $Tuple2(0, -(feeAmount))
867867 let amountAssetBalanceDelta = $t03664636843._1
868868 let priceAssetBalanceDelta = $t03664636843._2
869869 let $t03684636954 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
870870 let refreshKLpActions = $t03684636954._1
871871 let updatedKLp = $t03684636954._2
872872 let kLp = value(getString(keyKLp))
873873 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
874874 if ((isUpdatedKLpValid == isUpdatedKLpValid))
875875 then $Tuple2((((commonState ++ lpTransfer) ++ sendFee) ++ refreshKLpActions), emitAmount)
876876 else throw("Strict value is not equal to itself.")
877877 }
878878 else throw("Strict value is not equal to itself.")
879879 }
880880 else throw("Strict value is not equal to itself.")
881881 }
882882 else throw("Strict value is not equal to itself.")
883883 }
884884 else throw("Strict value is not equal to itself.")
885885 }
886886
887887
888888
889889 @Callable(i)
890890 func putOneTknREADONLY (paymentAssetId,paymentAmountRaw) = {
891891 let $t03726037417 = calcPutOneToken(paymentAmountRaw, parseAssetId(paymentAssetId), unit, unit)
892892 let emitAmountEstimated = $t03726037417._1
893893 let commonState = $t03726037417._2
894894 let feeAmount = $t03726037417._3
895895 let bonus = $t03726037417._4
896896 let paymentInAmountAsset = $t03726037417._5
897897 $Tuple2(nil, $Tuple3(emitAmountEstimated, feeAmount, bonus))
898898 }
899899
900900
901901
902902 @Callable(i)
903903 func getOneTkn (outAssetIdStr,minOutAmount) = {
904904 let isPoolOneTokenOperationsDisabled = {
905905 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
906906 if ($isInstanceOf(@, "Boolean"))
907907 then @
908908 else throw(($getType(@) + " couldn't be cast to Boolean"))
909909 }
910910 let isGetDisabled = if (if (isGlobalShutdown())
911911 then true
912912 else (cfgPoolStatus == PoolShutdown))
913913 then true
914914 else isPoolOneTokenOperationsDisabled
915915 let checks = [if (if (!(isGetDisabled))
916916 then true
917917 else isManager(i))
918918 then true
919919 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1))
920920 then true
921921 else throwErr("exactly 1 payment are expected")]
922922 if ((checks == checks))
923923 then {
924924 let outAssetId = parseAssetId(outAssetIdStr)
925925 let payment = i.payments[0]
926926 let paymentAssetId = payment.assetId
927927 let paymentAmount = payment.amount
928928 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
929929 if ((currentKLp == currentKLp))
930930 then {
931931 let userAddress = i.caller
932932 let txId = i.transactionId
933933 let $t03830238455 = calcGetOneToken(outAssetId, paymentAmount, paymentAssetId, userAddress, txId)
934934 if (($t03830238455 == $t03830238455))
935935 then {
936936 let outInAmountAsset = $t03830238455._5
937937 let bonus = $t03830238455._4
938938 let feeAmount = $t03830238455._3
939939 let commonState = $t03830238455._2
940940 let amountEstimated = $t03830238455._1
941941 let amount = if (if ((minOutAmount > 0))
942942 then (minOutAmount > amountEstimated)
943943 else false)
944944 then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
945945 else amountEstimated
946946 let burnInv = invoke(factoryContract, "burn", [paymentAmount], [AttachedPayment(paymentAssetId, paymentAmount)])
947947 if ((burnInv == burnInv))
948948 then {
949949 let assetTransfer = [ScriptTransfer(userAddress, amount, outAssetId)]
950950 let sendFee = if ((feeAmount > 0))
951951 then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
952952 else nil
953953 let $t03895539202 = {
954954 let feeAmountForCalc = if ((this == feeCollectorAddress))
955955 then 0
956956 else feeAmount
957957 if (outInAmountAsset)
958958 then $Tuple2(-((amount + feeAmountForCalc)), 0)
959959 else $Tuple2(0, -((amount + feeAmountForCalc)))
960960 }
961961 let amountAssetBalanceDelta = $t03895539202._1
962962 let priceAssetBalanceDelta = $t03895539202._2
963963 let $t03920539313 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
964964 let refreshKLpActions = $t03920539313._1
965965 let updatedKLp = $t03920539313._2
966966 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
967967 if ((isUpdatedKLpValid == isUpdatedKLpValid))
968968 then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
969969 else throw("Strict value is not equal to itself.")
970970 }
971971 else throw("Strict value is not equal to itself.")
972972 }
973973 else throw("Strict value is not equal to itself.")
974974 }
975975 else throw("Strict value is not equal to itself.")
976976 }
977977 else throw("Strict value is not equal to itself.")
978978 }
979979
980980
981981
982982 @Callable(i)
983983 func getOneTknREADONLY (outAssetId,paymentAmount) = {
984984 let $t03957039726 = calcGetOneToken(parseAssetId(outAssetId), paymentAmount, cfgLpAssetId, unit, unit)
985985 let amountEstimated = $t03957039726._1
986986 let commonState = $t03957039726._2
987987 let feeAmount = $t03957039726._3
988988 let bonus = $t03957039726._4
989989 let outInAmountAsset = $t03957039726._5
990990 $Tuple2(nil, $Tuple3(amountEstimated, feeAmount, bonus))
991991 }
992992
993993
994994
995995 @Callable(i)
996996 func unstakeAndGetOneTkn (unstakeAmount,outAssetIdStr,minOutAmount) = {
997997 let isPoolOneTokenOperationsDisabled = {
998998 let @ = invoke(factoryContract, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
999999 if ($isInstanceOf(@, "Boolean"))
10001000 then @
10011001 else throw(($getType(@) + " couldn't be cast to Boolean"))
10021002 }
10031003 let isGetDisabled = if (if (isGlobalShutdown())
10041004 then true
10051005 else (cfgPoolStatus == PoolShutdown))
10061006 then true
10071007 else isPoolOneTokenOperationsDisabled
10081008 let checks = [if (if (!(isGetDisabled))
10091009 then true
10101010 else isManager(i))
10111011 then true
10121012 else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0))
10131013 then true
10141014 else throwErr("no payments are expected")]
10151015 if ((checks == checks))
10161016 then {
10171017 let outAssetId = parseAssetId(outAssetIdStr)
10181018 let userAddress = i.caller
10191019 let txId = i.transactionId
10201020 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
1021- let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1022- if ((unstakeInv == unstakeInv))
1021+ if ((currentKLp == currentKLp))
10231022 then {
1024- let $t04062840779 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1025- if (($t04062840779 == $t04062840779))
1023+ let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
1024+ if ((unstakeInv == unstakeInv))
10261025 then {
1027- let outInAmountAsset = $t04062840779._5
1028- let bonus = $t04062840779._4
1029- let feeAmount = $t04062840779._3
1030- let commonState = $t04062840779._2
1031- let amountEstimated = $t04062840779._1
1032- let amount = if (if ((minOutAmount > 0))
1033- then (minOutAmount > amountEstimated)
1034- else false)
1035- then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1036- else amountEstimated
1037- let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1038- if ((burnInv == burnInv))
1026+ let $t04063140782 = calcGetOneToken(outAssetId, unstakeAmount, cfgLpAssetId, userAddress, txId)
1027+ if (($t04063140782 == $t04063140782))
10391028 then {
1040- let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
1041- let sendFee = if ((feeAmount > 0))
1042- then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1043- else nil
1044- let $t04127441521 = {
1045- let feeAmountForCalc = if ((this == feeCollectorAddress))
1046- then 0
1047- else feeAmount
1048- if (outInAmountAsset)
1049- then $Tuple2(-((amount + feeAmountForCalc)), 0)
1050- else $Tuple2(0, -((amount + feeAmountForCalc)))
1051- }
1052- let amountAssetBalanceDelta = $t04127441521._1
1053- let priceAssetBalanceDelta = $t04127441521._2
1054- let $t04152441632 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1055- let refreshKLpActions = $t04152441632._1
1056- let updatedKLp = $t04152441632._2
1057- let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1058- if ((isUpdatedKLpValid == isUpdatedKLpValid))
1059- then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1029+ let outInAmountAsset = $t04063140782._5
1030+ let bonus = $t04063140782._4
1031+ let feeAmount = $t04063140782._3
1032+ let commonState = $t04063140782._2
1033+ let amountEstimated = $t04063140782._1
1034+ let amount = if (if ((minOutAmount > 0))
1035+ then (minOutAmount > amountEstimated)
1036+ else false)
1037+ then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], ""))
1038+ else amountEstimated
1039+ let burnInv = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
1040+ if ((burnInv == burnInv))
1041+ then {
1042+ let assetTransfer = [ScriptTransfer(i.caller, amount, outAssetId)]
1043+ let sendFee = if ((feeAmount > 0))
1044+ then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetId)]
1045+ else nil
1046+ let $t04127741524 = {
1047+ let feeAmountForCalc = if ((this == feeCollectorAddress))
1048+ then 0
1049+ else feeAmount
1050+ if (outInAmountAsset)
1051+ then $Tuple2(-((amount + feeAmountForCalc)), 0)
1052+ else $Tuple2(0, -((amount + feeAmountForCalc)))
1053+ }
1054+ let amountAssetBalanceDelta = $t04127741524._1
1055+ let priceAssetBalanceDelta = $t04127741524._2
1056+ let $t04152741635 = refreshKLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0)
1057+ let refreshKLpActions = $t04152741635._1
1058+ let updatedKLp = $t04152741635._2
1059+ let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
1060+ if ((isUpdatedKLpValid == isUpdatedKLpValid))
1061+ then $Tuple2((((commonState ++ assetTransfer) ++ sendFee) ++ refreshKLpActions), amount)
1062+ else throw("Strict value is not equal to itself.")
1063+ }
10601064 else throw("Strict value is not equal to itself.")
10611065 }
10621066 else throw("Strict value is not equal to itself.")
10631067 }
10641068 else throw("Strict value is not equal to itself.")
10651069 }
10661070 else throw("Strict value is not equal to itself.")
10671071 }
10681072 else throw("Strict value is not equal to itself.")
10691073 }
10701074
10711075
10721076
10731077 @Callable(i)
10741078 func get () = {
10751079 let res = commonGet(i)
10761080 let outAmtAmt = res._1
10771081 let outPrAmt = res._2
10781082 let pmtAmt = res._3
10791083 let pmtAssetId = res._4
10801084 let state = res._5
10811085 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
10821086 if ((currentKLp == currentKLp))
10831087 then {
10841088 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
10851089 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
10861090 then {
1087- let $t04257842660 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1088- let refreshKLpActions = $t04257842660._1
1089- let updatedKLp = $t04257842660._2
1091+ let $t04258142663 = refreshKLpInternal(-(outAmtAmt), -(outPrAmt), 0)
1092+ let refreshKLpActions = $t04258142663._1
1093+ let updatedKLp = $t04258142663._2
10901094 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
10911095 if ((isUpdatedKLpValid == isUpdatedKLpValid))
10921096 then (state ++ refreshKLpActions)
10931097 else throw("Strict value is not equal to itself.")
10941098 }
10951099 else throw("Strict value is not equal to itself.")
10961100 }
10971101 else throw("Strict value is not equal to itself.")
10981102 }
10991103
11001104
11011105
11021106 @Callable(i)
11031107 func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = {
11041108 let res = commonGet(i)
11051109 let outAmAmt = res._1
11061110 let outPrAmt = res._2
11071111 let pmtAmt = res._3
11081112 let pmtAssetId = res._4
11091113 let state = res._5
11101114 if ((noLessThenAmtAsset > outAmAmt))
11111115 then throw(((("noLessThenAmtAsset failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset)))
11121116 else if ((noLessThenPriceAsset > outPrAmt))
11131117 then throw(((("noLessThenPriceAsset failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset)))
11141118 else {
11151119 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11161120 if ((currentKLp == currentKLp))
11171121 then {
11181122 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)])
11191123 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11201124 then {
1121- let $t04360943690 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1122- let refreshKLpActions = $t04360943690._1
1123- let updatedKLp = $t04360943690._2
1125+ let $t04361243693 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1126+ let refreshKLpActions = $t04361243693._1
1127+ let updatedKLp = $t04361243693._2
11241128 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11251129 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11261130 then (state ++ refreshKLpActions)
11271131 else throw("Strict value is not equal to itself.")
11281132 }
11291133 else throw("Strict value is not equal to itself.")
11301134 }
11311135 else throw("Strict value is not equal to itself.")
11321136 }
11331137 }
11341138
11351139
11361140
11371141 @Callable(i)
11381142 func unstakeAndGet (amount) = {
11391143 let checkPayments = if ((size(i.payments) != 0))
11401144 then throw("No payments are expected")
11411145 else true
11421146 if ((checkPayments == checkPayments))
11431147 then {
11441148 let cfg = getPoolConfig()
11451149 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
11461150 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
11471151 if ((currentKLp == currentKLp))
11481152 then {
11491153 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(lpAssetId), amount], nil)
11501154 if ((unstakeInv == unstakeInv))
11511155 then {
11521156 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller)
11531157 let outAmAmt = res._1
11541158 let outPrAmt = res._2
11551159 let poolStatus = parseIntValue(res._9)
11561160 let state = res._10
11571161 let checkPoolStatus = if (if (isGlobalShutdown())
11581162 then true
11591163 else (poolStatus == PoolShutdown))
11601164 then throw(("Get operation is blocked by admin. Status = " + toString(poolStatus)))
11611165 else true
11621166 if ((checkPoolStatus == checkPoolStatus))
11631167 then {
11641168 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [amount], [AttachedPayment(lpAssetId, amount)])
11651169 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
11661170 then {
1167- let $t04481644897 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1168- let refreshKLpActions = $t04481644897._1
1169- let updatedKLp = $t04481644897._2
1171+ let $t04481944900 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1172+ let refreshKLpActions = $t04481944900._1
1173+ let updatedKLp = $t04481944900._2
11701174 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
11711175 if ((isUpdatedKLpValid == isUpdatedKLpValid))
11721176 then (state ++ refreshKLpActions)
11731177 else throw("Strict value is not equal to itself.")
11741178 }
11751179 else throw("Strict value is not equal to itself.")
11761180 }
11771181 else throw("Strict value is not equal to itself.")
11781182 }
11791183 else throw("Strict value is not equal to itself.")
11801184 }
11811185 else throw("Strict value is not equal to itself.")
11821186 }
11831187 else throw("Strict value is not equal to itself.")
11841188 }
11851189
11861190
11871191
11881192 @Callable(i)
11891193 func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = {
11901194 let isGetDisabled = if (isGlobalShutdown())
11911195 then true
11921196 else (cfgPoolStatus == PoolShutdown)
11931197 let checks = [if (!(isGetDisabled))
11941198 then true
11951199 else throw("get operation is blocked by admin"), if ((size(i.payments) == 0))
11961200 then true
11971201 else throw("no payments are expected")]
11981202 if ((checks == checks))
11991203 then {
12001204 let currentKLp = calcCurrentKLp(toBigInt(0), toBigInt(0), toBigInt(0))
12011205 if ((currentKLp == currentKLp))
12021206 then {
12031207 let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil)
12041208 if ((unstakeInv == unstakeInv))
12051209 then {
12061210 let res = estimateGetOperation(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller)
12071211 let outAmAmt = res._1
12081212 let outPrAmt = res._2
12091213 let state = res._10
12101214 let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset))
12111215 then true
12121216 else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset))
12131217 then true
12141218 else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))]
12151219 if ((checkAmounts == checkAmounts))
12161220 then {
12171221 let burnLPAssetOnFactory = invoke(factoryContract, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)])
12181222 if ((burnLPAssetOnFactory == burnLPAssetOnFactory))
12191223 then {
1220- let $t04619246273 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1221- let refreshKLpActions = $t04619246273._1
1222- let updatedKLp = $t04619246273._2
1224+ let $t04619546276 = refreshKLpInternal(-(outAmAmt), -(outPrAmt), 0)
1225+ let refreshKLpActions = $t04619546276._1
1226+ let updatedKLp = $t04619546276._2
12231227 let isUpdatedKLpValid = validateUpdatedKLp(currentKLp, updatedKLp)
12241228 if ((isUpdatedKLpValid == isUpdatedKLpValid))
12251229 then (state ++ refreshKLpActions)
12261230 else throw("Strict value is not equal to itself.")
12271231 }
12281232 else throw("Strict value is not equal to itself.")
12291233 }
12301234 else throw("Strict value is not equal to itself.")
12311235 }
12321236 else throw("Strict value is not equal to itself.")
12331237 }
12341238 else throw("Strict value is not equal to itself.")
12351239 }
12361240 else throw("Strict value is not equal to itself.")
12371241 }
12381242
12391243
12401244
12411245 @Callable(i)
12421246 func activate (amtAssetStr,priceAssetStr) = if ((toString(i.caller) != toString(factoryContract)))
12431247 then throw("permissions denied")
12441248 else $Tuple2([StringEntry(aa(), amtAssetStr), StringEntry(pa(), priceAssetStr)], "success")
12451249
12461250
12471251
12481252 @Callable(i)
12491253 func refreshKLp () = {
12501254 let lastRefreshedBlockHeight = valueOrElse(getInteger(keyKLpRefreshedHeight), 0)
12511255 let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= kLpRefreshDelay))
12521256 then unit
12531257 else throwErr(makeString([toString(kLpRefreshDelay), " blocks have not passed since the previous call"], ""))
12541258 if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight))
12551259 then {
12561260 let kLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyKLp), "0")), fmtErr("invalid kLp"))
1257- let $t04746047524 = refreshKLpInternal(0, 0, 0)
1258- let kLpUpdateActions = $t04746047524._1
1259- let updatedKLp = $t04746047524._2
1261+ let $t04746347527 = refreshKLpInternal(0, 0, 0)
1262+ let kLpUpdateActions = $t04746347527._1
1263+ let updatedKLp = $t04746347527._2
12601264 let actions = if ((kLp != updatedKLp))
12611265 then kLpUpdateActions
12621266 else throwErr("nothing to refresh")
12631267 $Tuple2(actions, toString(updatedKLp))
12641268 }
12651269 else throw("Strict value is not equal to itself.")
12661270 }
12671271
12681272
12691273
12701274 @Callable(i)
12711275 func getPoolConfigWrapperREADONLY () = $Tuple2(nil, getPoolConfig())
12721276
12731277
12741278
12751279 @Callable(i)
12761280 func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId))
12771281
12781282
12791283
12801284 @Callable(i)
12811285 func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = {
12821286 let prices = calcPrices(amAmt, prAmt, lpAmt)
12831287 $Tuple2(nil, [toString(prices[0]), toString(prices[1]), toString(prices[2])])
12841288 }
12851289
12861290
12871291
12881292 @Callable(i)
12891293 func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(toX18(origVal, origScaleMult)))
12901294
12911295
12921296
12931297 @Callable(i)
12941298 func fromX18WrapperREADONLY (val,resultScaleMult) = $Tuple2(nil, fromX18(parseBigIntValue(val), resultScaleMult))
12951299
12961300
12971301
12981302 @Callable(i)
12991303 func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(calcPriceBigInt(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18))))
13001304
13011305
13021306
13031307 @Callable(i)
13041308 func estimatePutOperationWrapperREADONLY (txId58,slippageTolerance,inAmAssetAmt,inAmAssetId,inPrAssetAmt,inPrAssetId,userAddress,isEvaluate,emitLp) = $Tuple2(nil, estimatePutOperation(txId58, slippageTolerance, inAmAssetAmt, inAmAssetId, inPrAssetAmt, inPrAssetId, userAddress, isEvaluate, emitLp))
13051309
13061310
13071311
13081312 @Callable(i)
13091313 func estimateGetOperationWrapperREADONLY (txId58,pmtAssetId,pmtLpAmt,userAddress) = {
13101314 let res = estimateGetOperation(txId58, pmtAssetId, pmtLpAmt, addressFromStringValue(userAddress))
13111315 $Tuple2(nil, $Tuple10(res._1, res._2, res._3, res._4, res._5, res._6, res._7, toString(res._8), res._9, res._10))
13121316 }
13131317
13141318
13151319
13161320 @Callable(i)
13171321 func statsREADONLY () = {
13181322 let cfg = getPoolConfig()
13191323 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13201324 let amtAssetId = cfg[idxAmtAssetId]
13211325 let priceAssetId = cfg[idxPriceAssetId]
13221326 let iAmtAssetId = cfg[idxIAmtAssetId]
13231327 let iPriceAssetId = cfg[idxIPriceAssetId]
13241328 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13251329 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13261330 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13271331 let accAmtAssetBalance = getAccBalance(amtAssetId)
13281332 let accPriceAssetBalance = getAccBalance(priceAssetId)
13291333 let pricesList = if ((poolLPBalance == 0))
13301334 then [zeroBigInt, zeroBigInt, zeroBigInt]
13311335 else calcPrices(accAmtAssetBalance, accPriceAssetBalance, poolLPBalance)
13321336 let curPrice = 0
13331337 let lpAmtAssetShare = fromX18(pricesList[1], scale8)
13341338 let lpPriceAssetShare = fromX18(pricesList[2], scale8)
13351339 let poolWeight = value(getInteger(factoryContract, keyPoolWeight(toString(this))))
13361340 $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))
13371341 }
13381342
13391343
13401344
13411345 @Callable(i)
13421346 func evaluatePutByAmountAssetREADONLY (inAmAssetAmt) = {
13431347 let cfg = getPoolConfig()
13441348 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13451349 let amAssetIdStr = cfg[idxAmtAssetId]
13461350 let amAssetId = fromBase58String(amAssetIdStr)
13471351 let prAssetIdStr = cfg[idxPriceAssetId]
13481352 let prAssetId = fromBase58String(prAssetIdStr)
13491353 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13501354 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13511355 let poolStatus = cfg[idxPoolStatus]
13521356 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13531357 let accAmtAssetBalance = getAccBalance(amAssetIdStr)
13541358 let accPriceAssetBalance = getAccBalance(prAssetIdStr)
13551359 let amtAssetAmtX18 = toX18(accAmtAssetBalance, amtAssetDcm)
13561360 let priceAssetAmtX18 = toX18(accPriceAssetBalance, priceAssetDcm)
13571361 let curPriceX18 = if ((poolLPBalance == 0))
13581362 then zeroBigInt
13591363 else calcPriceBigInt(priceAssetAmtX18, amtAssetAmtX18)
13601364 let inAmAssetAmtX18 = toX18(inAmAssetAmt, amtAssetDcm)
13611365 let inPrAssetAmtX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18)
13621366 let inPrAssetAmt = fromX18(inPrAssetAmtX18, priceAssetDcm)
13631367 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13641368 let calcLpAmt = estPut._1
13651369 let curPriceCalc = estPut._3
13661370 let amBalance = estPut._4
13671371 let prBalance = estPut._5
13681372 let lpEmission = estPut._6
13691373 $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))
13701374 }
13711375
13721376
13731377
13741378 @Callable(i)
13751379 func evaluatePutByPriceAssetREADONLY (inPrAssetAmt) = {
13761380 let cfg = getPoolConfig()
13771381 let lpAssetId = fromBase58String(cfg[idxPoolLPAssetId])
13781382 let amAssetIdStr = cfg[idxAmtAssetId]
13791383 let amAssetId = fromBase58String(amAssetIdStr)
13801384 let prAssetIdStr = cfg[idxPriceAssetId]
13811385 let prAssetId = fromBase58String(prAssetIdStr)
13821386 let amtAssetDcm = parseIntValue(cfg[idxAmtAssetDcm])
13831387 let priceAssetDcm = parseIntValue(cfg[idxPriceAssetDcm])
13841388 let poolStatus = cfg[idxPoolStatus]
13851389 let poolLPBalance = valueOrErrorMessage(assetInfo(lpAssetId), (("Asset " + toBase58String(lpAssetId)) + " doesn't exist")).quantity
13861390 let amBalanceRaw = getAccBalance(amAssetIdStr)
13871391 let prBalanceRaw = getAccBalance(prAssetIdStr)
13881392 let amBalanceRawX18 = toX18(amBalanceRaw, amtAssetDcm)
13891393 let prBalanceRawX18 = toX18(prBalanceRaw, priceAssetDcm)
13901394 let curPriceX18 = if ((poolLPBalance == 0))
13911395 then zeroBigInt
13921396 else calcPriceBigInt(prBalanceRawX18, amBalanceRawX18)
13931397 let inPrAssetAmtX18 = toX18(inPrAssetAmt, priceAssetDcm)
13941398 let inAmAssetAmtX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18)
13951399 let inAmAssetAmt = fromX18(inAmAssetAmtX18, amtAssetDcm)
13961400 let estPut = estimatePutOperation("", 500000, inAmAssetAmt, amAssetId, inPrAssetAmt, prAssetId, "", true, false)
13971401 let calcLpAmt = estPut._1
13981402 let curPriceCalc = estPut._3
13991403 let amBalance = estPut._4
14001404 let prBalance = estPut._5
14011405 let lpEmission = estPut._6
14021406 $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))
14031407 }
14041408
14051409
14061410
14071411 @Callable(i)
14081412 func evaluateGetREADONLY (paymentLpAssetId,paymentLpAmt) = {
14091413 let res = estimateGetOperation("", paymentLpAssetId, paymentLpAmt, this)
14101414 let outAmAmt = res._1
14111415 let outPrAmt = res._2
14121416 let amBalance = res._5
14131417 let prBalance = res._6
14141418 let lpEmission = res._7
14151419 let curPrice = res._8
14161420 let poolStatus = parseIntValue(res._9)
14171421 $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))
14181422 }
14191423
14201424
14211425 @Verifier(tx)
14221426 func verify () = {
14231427 let targetPublicKey = match managerPublicKeyOrUnit() {
14241428 case pk: ByteVector =>
14251429 pk
14261430 case _: Unit =>
14271431 tx.senderPublicKey
14281432 case _ =>
14291433 throw("Match error")
14301434 }
14311435 match tx {
14321436 case order: Order =>
14331437 let matcherPub = getMatcherPubOrFail()
14341438 let orderValid = validateMatcherOrderAllowed(order)
14351439 let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey)
14361440 let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub)
14371441 if (if (if (orderValid)
14381442 then senderValid
14391443 else false)
14401444 then matcherValid
14411445 else false)
14421446 then true
14431447 else throwOrderError(orderValid, senderValid, matcherValid)
14441448 case s: SetScriptTransaction =>
14451449 let newHash = blake2b256(value(s.script))
14461450 let allowedHash = fromBase64String(value(getString(factoryContract, keyAllowedLpScriptHash())))
14471451 let currentHash = scriptHash(this)
14481452 if (if ((allowedHash == newHash))
14491453 then (currentHash != newHash)
14501454 else false)
14511455 then true
14521456 else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14531457 case _ =>
14541458 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
14551459 }
14561460 }
14571461

github/deemru/w8io/026f985 
125.52 ms