tx · ChcFNPh6hSKSxYZDcLGvGusWAkTbwbz22PKutdnhDyd3

3Mw46U8UTwuNYxMZzuRx6HeDHXaMdi5vTcA:  -0.01000000 Waves

2020.09.22 21:07 [1188851] smart account 3Mw46U8UTwuNYxMZzuRx6HeDHXaMdi5vTcA > SELF 0.00000000 Waves

{ "type": 13, "id": "ChcFNPh6hSKSxYZDcLGvGusWAkTbwbz22PKutdnhDyd3", "fee": 1000000, "feeAssetId": null, "timestamp": 1600798089718, "version": 1, "sender": "3Mw46U8UTwuNYxMZzuRx6HeDHXaMdi5vTcA", "senderPublicKey": "4LF5BQ4mcDUcxxC3Lqt1UATPUDhMh4tpdidDCPzFmEvp", "proofs": [ "5cmFL6XxNk5BKZceC8c5DBqfxdLJNQYMxijcB3cu6kX9PbYnrbrKHSbQaN51nRRUZ1MSw5TKsnupCjVX1rgVeBXm" ], "script": "base64:AAIEAAAAAAAAABUIAhIAEgASBAoCCAgSABIFCgMIAQEAAABHAQAAABFrZXlBY2N1bXVsYXRlZEZlZQAAAAACAAAAEiVzX19hY2N1bXVsYXRlZEZlZQEAAAAOa2V5VWNvbGxhdGVyYWwAAAAAAgAAAA8lc19fdWNvbGxhdGVyYWwBAAAAGWtleVRvdGFsTGVuZGVkQXRPdGhlckFjY3MAAAAAAgAAABolc19fdG90YWxMZW5kZWRBdE90aGVyQWNjcwEAAAATa2V5QXNzZXRMb2NrZWRUb3RhbAAAAAEAAAAHYXNzZXRJZAkAASwAAAACAgAAABglcyVzX19hc3NldExvY2tlZFRvdGFsX18FAAAAB2Fzc2V0SWQBAAAAE2tleUFjY291bnRPcGVyYXRpb24AAAADAAAADHVubG9ja0hlaWdodAAAAAdhZGRyZXNzAAAABnN0YXR1cwkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAHiVzJXMlZCVzX19kZWZvQXNzZXRPcGVyYXRpb25fXwUAAAAHYWRkcmVzcwIAAAACX18JAAGkAAAAAQUAAAAMdW5sb2NrS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JlYmFsYW5jZURlYnRzIGNhbGwgaXMgYWxsb3dlZAMJAQAAAAIhPQAAAAIJAAGRAAAAAgkBAAAAHGZhY3RvcnlSZWFkQXNzZXRDZmdCeUFkZHJlc3MAAAABCQAEJQAAAAEJAAQkAAAAAQgFAAAAA2ludgAAAARkQXBwBQAAABJJZHhEZWZvQXNzZXRTdGF0dXMCAAAABklTU1VFRAkAAAIAAAABAgAAABlvbmx5IGRlZm8gZGFwcCBpcyBhbGxvd2VkAwkAAGYAAAACCAUAAAADaW52AAAAA2ZlZQkAAGgAAAACAAAAAAAAAAOEAAAAAAAAAAPoCQAAAgAAAAEJAAEsAAAAAgIAAAAoZmVlIGFtb3VudCBpcyBncmVhdGVyIHRoYW4gbWF4IGFsbG93ZWQ6IAkAAaQAAAABCAUAAAADaW52AAAAA2ZlZQMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADaW52AAAACmZlZUFzc2V0SWQJAAACAAAAAQIAAAAjb25seSBXYXZlcyBpcyBhbGxvd2VkIGFzIGZlZUFzc2V0SWQGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleWfLGy4=", "chainId": 84, "height": 1188851, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 9ido9k9Hf1cKWSXbFnGR5r4RkFTjb4HkrefzjygmX7Qa Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 4 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func keyAccumulatedFee () = "%s__accumulatedFee"
5+
6+
7+func keyUcollateral () = "%s__ucollateral"
8+
9+
10+func keyTotalLendedAtOtherAccs () = "%s__totalLendedAtOtherAccs"
11+
12+
13+func keyAssetLockedTotal (assetId) = ("%s%s__assetLockedTotal__" + assetId)
14+
15+
16+func keyAccountOperation (unlockHeight,address,status) = ((((("%s%s%d%s__defoAssetOperation__" + address) + "__") + toString(unlockHeight)) + "__") + status)
17+
18+
19+func keyFactory () = "%s__factory"
20+
21+
22+func keyLendedAmountByAssetCode (assetCode) = ("%s%s__lendedBaseAssetAmount__" + assetCode)
23+
24+
25+func keyPrice (assetCode) = ("%s%s__price__" + assetCode)
26+
27+
28+let IdxOperationAmountIn = 1
29+
30+let IdxOperationAssetIn = 2
31+
32+let IdxOperationPrice = 3
33+
34+let IdxOperationAmountOut = 4
35+
36+let IdxOperationAssetOut = 5
37+
38+func assetDataSwapOperation (amountIn,assetIn,price,amountOut,assetOut,bruttoAmount,feeAmount) = ((((((((((((("%d%s%d%s%d%d%d__" + toString(amountIn)) + "__") + assetIn) + "__") + toString(amountOut)) + "__") + assetOut) + "__") + toString(price)) + "__") + toString(bruttoAmount)) + "__") + toString(feeAmount))
39+
40+
41+func assetDataRebalanceTrace (debtorAssetCode,debtPmt,basePmt,lendedAmtBefore,lendedAmtAfter) = ((((((((((((("%s%s%d%s%d%d%d__" + debtorAssetCode) + "__") + toBase58String(value(debtPmt.assetId))) + "__") + toString(debtPmt.amount)) + "__") + toBase58String(value(basePmt.assetId))) + "__") + toString(basePmt.amount)) + "__") + toString(lendedAmtBefore)) + "__") + toString(lendedAmtAfter))
42+
43+
44+func assetReadSwapDataArrayOrFail (accOperationKey) = {
45+ let accOperationDataStr = valueOrErrorMessage(getString(this, accOperationKey), ("There is no request for passed arguments: " + accOperationKey))
46+ split(accOperationDataStr, "__")
47+ }
48+
49+
50+let nullInt = -1
51+
52+let nullStr = "NULL"
53+
54+let factoryAcc = addressFromStringValue(valueOrErrorMessage(getString(this, keyFactory()), ((("No config at this=" + toString(this)) + " for key=") + keyFactory())))
55+
56+func keyFactoryDebtAssetId () = "%s%s__commonConfig__debtAssetId"
57+
58+
59+func keyFactoryAssetCfg (assetAddressStr) = (("%s%s%s__defoAsset__" + assetAddressStr) + "__config")
60+
61+
62+func keyFactoryAssetCurrentPool (assetAccAddress) = (("%s%s%s__defoAsset__" + toString(assetAccAddress)) + "__currentPool")
63+
64+
65+func keyFactoryDefoAddressByAssetCode (assetCode) = (("%s%s%s__defoAsset__" + assetCode) + "__addressByAssetCode")
66+
67+
68+func factoryReadDebtAssetId () = valueOrErrorMessage(getString(factoryAcc, keyFactoryDebtAssetId()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDebtAssetId()))
69+
70+
71+func factoryReadAssetCfgByAddress (assetAddressStr) = split(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetCfg(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetCfg(assetAddressStr))), "__")
72+
73+
74+func factoryReadAssetCfgByCode (assetCode) = {
75+ let assetAddressStr = valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoAddressByAssetCode(assetCode)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoAddressByAssetCode(assetCode)))
76+ $Tuple2(assetAddressStr, factoryReadAssetCfgByAddress(assetAddressStr))
77+ }
78+
79+
80+let IdxDefoAssetCode = 1
81+
82+let IdxDefoAssetId = 2
83+
84+let IdxDefoAssetStatus = 3
85+
86+let IdxPriceDecimals = 4
87+
88+let IdxBaseAssetId = 5
89+
90+let IdxOverCollateralPercent = 6
91+
92+let IdxMinInitPool = 7
93+
94+let IdxPriceOracleAddress = 8
95+
96+let IdxMinBuyPayment = 9
97+
98+let IdxMinSellPayment = 10
99+
100+let IdxBuyLockInterval = 11
101+
102+let IdxSellLockInterval = 12
103+
104+let IdxBuyFeePercent = 13
105+
106+let IdxSellFeePercent = 14
107+
108+let thisCfgArray = factoryReadAssetCfgByAddress(toString(this))
109+
110+let defoAssetCode = thisCfgArray[IdxDefoAssetCode]
111+
112+let defoAssetId = fromBase58String(thisCfgArray[IdxDefoAssetId])
113+
114+let priceOracleAcc = addressFromStringValue(thisCfgArray[IdxPriceOracleAddress])
115+
116+let overCollateralPercent = parseIntValue(thisCfgArray[IdxOverCollateralPercent])
117+
118+let baseAssetIdStr = thisCfgArray[IdxBaseAssetId]
119+
120+let baseAssetId = fromBase58String(baseAssetIdStr)
121+
122+let priceDecimals = parseIntValue(thisCfgArray[IdxPriceDecimals])
123+
124+let minBasicBuyAmount = parseIntValue(thisCfgArray[IdxMinBuyPayment])
125+
126+let minSynthSellAmount = parseIntValue(thisCfgArray[IdxMinSellPayment])
127+
128+let buyLockInterval = parseIntValue(thisCfgArray[IdxBuyLockInterval])
129+
130+let sellLockInterval = parseIntValue(thisCfgArray[IdxSellLockInterval])
131+
132+let buyFeePercent = parseIntValue(thisCfgArray[IdxBuyFeePercent])
133+
134+let sellFeePercent = parseIntValue(thisCfgArray[IdxSellFeePercent])
135+
136+func controlAccReadPrice (assetCode) = valueOrErrorMessage(getInteger(priceOracleAcc, keyPrice(assetCode)), ((("No price at priceOracle=" + toString(priceOracleAcc)) + " for key=") + keyPrice(assetCode)))
137+
138+
139+func controlAccReadCurrIdxOrFail () = valueOrErrorMessage(getInteger(priceOracleAcc, "currIdx"), ("No currIdx at controlAcc=" + toString(priceOracleAcc)))
140+
141+
142+func controlAccReadIdxHeight (idx) = {
143+ let idxHeightKey = ("idxHeight_" + toString(idx))
144+ valueOrElse(getInteger(priceOracleAcc, idxHeightKey), 0)
145+ }
146+
147+
148+func controlAccReadPriceByHeight (priceHeight) = {
149+ let priceByHeightKey = ("price_" + toString(priceHeight))
150+ valueOrErrorMessage(getInteger(priceOracleAcc, priceByHeightKey), ((("No " + priceByHeightKey) + " at controlAcc=") + toString(priceOracleAcc)))
151+ }
152+
153+
154+func getStakingBalance () = valueOrElse(getInteger(this, ((("rpd_balance_" + baseAssetIdStr) + "_") + toString(this))), 0)
155+
156+
157+let ucollateral = valueOrElse(getInteger(this, keyUcollateral()), 0)
158+
159+let accumulatedFee = valueOrElse(getInteger(this, keyAccumulatedFee()), 0)
160+
161+let currPoolAmount = getIntegerValue(factoryAcc, keyFactoryAssetCurrentPool(this))
162+
163+let doubleCheckBasicBalance = (assetBalance(this, baseAssetId) + getStakingBalance())
164+
165+let doubleCheckUcollateral = if ((0 > ucollateral))
166+ then 0
167+ else ucollateral
168+
169+let doubleCheckCurrPoolAmount = (doubleCheckBasicBalance - ucollateral)
170+
171+let price = controlAccReadPrice(thisCfgArray[IdxDefoAssetCode])
172+
173+let overPrice = (((priceDecimals + overCollateralPercent) * price) / priceDecimals)
174+
175+let emission = value(assetInfo(defoAssetId)).quantity
176+
177+let basicAssetLockedAmt = valueOrElse(getInteger(this, keyAssetLockedTotal(baseAssetIdStr)), 0)
178+
179+let availablePoolBalance = (currPoolAmount - basicAssetLockedAmt)
180+
181+func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,feePercent) = {
182+ let availableDefoAssetInPool = (fraction(availablePoolBalance, priceDecimals, overPrice) - emission)
183+ let fullDefoAssetAmountNoPoolLimit = fraction(sellAmt, priceDecimals, buy2sellPrice)
184+ let fullDefoAssetAmountBrutto = if ((fullDefoAssetAmountNoPoolLimit > availableDefoAssetInPool))
185+ then availableDefoAssetInPool
186+ else fullDefoAssetAmountNoPoolLimit
187+ let defoAssetAmount = fraction((priceDecimals - feePercent), fullDefoAssetAmountBrutto, priceDecimals)
188+ let feeAmount = (fullDefoAssetAmountBrutto - defoAssetAmount)
189+ let requiredBasicAssetAmount = fraction(fullDefoAssetAmountBrutto, buy2sellPrice, priceDecimals)
190+ let change = (sellAmt - requiredBasicAssetAmount)
191+ if ((0 >= availableDefoAssetInPool))
192+ then throw((("impossible to issue new " + defoAssetCode) + ": not enough collateral"))
193+ else if ((minSellAmt > sellAmt))
194+ then throw(((((("impossible to issue new " + defoAssetCode) + ": payment=") + toString(sellAmt)) + "is less then min amount=") + toString(minSellAmt)))
195+ else $Tuple2([IntegerEntry(keyUcollateral(), (ucollateral + requiredBasicAssetAmount)), StringEntry(keyAccountOperation(height, toString(sellerAddr), "FINISHED"), assetDataSwapOperation(sellAmt, toBase58String(sellAssetId), price, defoAssetAmount, toBase58String(defoAssetId), fullDefoAssetAmountBrutto, feeAmount)), Reissue(defoAssetId, (defoAssetAmount + feeAmount), true), ScriptTransfer(sellerAddr, defoAssetAmount, defoAssetId), ScriptTransfer(sellerAddr, change, sellAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + feeAmount))], change)
196+ }
197+
198+
199+@Callable(i)
200+func buyAsset () = {
201+ let pmt = value(i.payments[0])
202+ let pmtAssetId = value(pmt.assetId)
203+ if ((pmtAssetId != baseAssetId))
204+ then throw(((("Payment asset id doesn't match basic asset: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(pmtAssetId)))
205+ else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, price, buyFeePercent)._1
206+ }
207+
208+
209+
210+@Callable(i)
211+func sellAsset () = {
212+ let pmt = value(i.payments[0])
213+ let pmtAsset = value(pmt.assetId)
214+ let callerAddress = toString(i.caller)
215+ if ((pmtAsset != defoAssetId))
216+ then throw(((("Invalid payment asset id: expected=" + toBase58String(defoAssetId)) + " actual=") + toBase58String(pmtAsset)))
217+ else if ((minSynthSellAmount > pmt.amount))
218+ then throw(((("Payment amount less then mininimal allowed: paymentAmount=" + toString(pmt.amount)) + " minAmount=") + toString(minSynthSellAmount)))
219+ else {
220+ let pmtDefoAmountGross = pmt.amount
221+ let defoAmountFee = fraction((priceDecimals - sellFeePercent), pmtDefoAmountGross, priceDecimals)
222+ let pmtDefoAmountNoFee = (pmtDefoAmountGross - defoAmountFee)
223+ let baseAssetAmountNoBalanceLimit = fraction(pmtDefoAmountNoFee, price, priceDecimals)
224+ let baseAssetAmountNoFee = if ((baseAssetAmountNoBalanceLimit > doubleCheckCurrPoolAmount))
225+ then doubleCheckCurrPoolAmount
226+ else baseAssetAmountNoBalanceLimit
227+ let requiredDefoAssetAmount = fraction(baseAssetAmountNoFee, priceDecimals, price)
228+ let change = (pmtDefoAmountNoFee - requiredDefoAssetAmount)
229+[IntegerEntry(keyUcollateral(), (ucollateral - baseAssetAmountNoFee)), StringEntry(keyAccountOperation(height, callerAddress, "FINISHED"), assetDataSwapOperation(pmt.amount, toBase58String(pmtAsset), price, baseAssetAmountNoFee, baseAssetIdStr, pmtDefoAmountGross, defoAmountFee)), Burn(defoAssetId, requiredDefoAssetAmount), ScriptTransfer(i.caller, baseAssetAmountNoFee, baseAssetId), ScriptTransfer(i.caller, change, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + defoAmountFee))]
230+ }
231+ }
232+
233+
234+
235+@Callable(i)
236+func crossExchange (buyAssetCodeConfirm,sellAssetCodeConfirm) = {
237+ let pmt = value(i.payments[0])
238+ let pmtAsset = value(pmt.assetId)
239+ let pmtAssetStr = toBase58String(pmtAsset)
240+ let pmtAmount = pmt.amount
241+ let callerAddress = toString(i.caller)
242+ let buyAssetCfg = thisCfgArray
243+ let sellAssetTuple = factoryReadAssetCfgByCode(sellAssetCodeConfirm)
244+ let sellAssetCfg = sellAssetTuple._2
245+ let sellAssetAccAddress = valueOrErrorMessage(addressFromString(sellAssetTuple._1), ("couldn't parse address from string for assetCode=" + sellAssetCodeConfirm))
246+ let minSellPmt = valueOrErrorMessage(parseInt(sellAssetCfg[IdxMinSellPayment]), ("minSellPmt parsing error: rawVal=" + sellAssetCfg[IdxMinSellPayment]))
247+ if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm))
248+ then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm))
249+ else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr))
250+ then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr))
251+ else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED"))
252+ then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus]))
253+ else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED"))
254+ then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus]))
255+ else {
256+ let buyAssetUsdPrice = price
257+ let sellAssetUsdPrice = controlAccReadPrice(sellAssetCodeConfirm)
258+ let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice)
259+ let debtAssetId = fromBase58String(factoryReadDebtAssetId())
260+ let usdnDebt = fraction(sellAssetUsdPrice, pmtAmount, priceDecimals)
261+ let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0)
262+ let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm)
263+ let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0)
264+ let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction(buyFeePercent, 150, 100))
265+ ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt)))
266+ }
267+ }
268+
269+
270+
271+@Callable(i)
272+func rebalanceDebts () = {
273+ let debtAssetId = fromBase58String(factoryReadDebtAssetId())
274+ let debtPmt0 = value(i.payments[0])
275+ let debtPmtAsset0 = value(debtPmt0.assetId)
276+ let basePmt1 = value(i.payments[1])
277+ let basePmtAsset1 = value(basePmt1.assetId)
278+ let debtorAddress = toString(i.caller)
279+ let debtorAssetCfg = factoryReadAssetCfgByAddress(debtorAddress)
280+ let debtorAssetCode = debtorAssetCfg[IdxDefoAssetCode]
281+ let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(debtorAssetCode)
282+ let lendedAmt = valueOrErrorMessage(getInteger(this, lendedAmountByAssetCodeKey), ("No debts for " + debtorAssetCode))
283+ if ((debtAssetId != debtPmtAsset0))
284+ then throw(((("invalid debt asset id in the first paymet: expected=" + toBase58String(debtAssetId)) + " actual=") + toBase58String(debtPmtAsset0)))
285+ else if ((baseAssetId != basePmtAsset1))
286+ then throw(((("invalid base asset id in the second payment: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(basePmtAsset1)))
287+ else if ((debtPmt0.amount != basePmt1.amount))
288+ then throw("first payment amount doesn't match to the second payment amount")
289+ else if ((0 >= lendedAmt))
290+ then throw(("lendedAmt is less then zero: lendedAmt=" + toString(lendedAmt)))
291+ else if ((0 >= debtPmt0.amount))
292+ then throw(("attached payment must be greater then 0: pmt0.amount=" + toString(debtPmt0.amount)))
293+ else if ((debtPmt0.amount > lendedAmt))
294+ then throw(((("attached payment is grater than required: pmtAmount=" + toString(debtPmt0.amount)) + " lendedAmt=") + toString(lendedAmt)))
295+ else {
296+ let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0)
297+ let lendedAmtAfter = (lendedAmt - debtPmt0.amount)
298+[IntegerEntry(lendedAmountByAssetCodeKey, lendedAmtAfter), IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs - debtPmt0.amount)), StringEntry(("%s%s__rebalanceTrace__" + toBase58String(i.transactionId)), assetDataRebalanceTrace(debtorAssetCode, debtPmt0, basePmt1, lendedAmt, lendedAmtAfter))]
299+ }
300+ }
301+
302+
303+
304+@Callable(i)
305+func withdraw (accountAddress,unlockHeight,idx) = {
306+ let accOperationKey = keyAccountOperation(unlockHeight, accountAddress, "PENDING")
307+ let accOperationDataArray = assetReadSwapDataArrayOrFail(accOperationKey)
308+ let amountIn = parseIntValue(accOperationDataArray[IdxOperationAmountIn])
309+ let assetIn = accOperationDataArray[IdxOperationAssetIn]
310+ let assetOut = accOperationDataArray[IdxOperationAssetOut]
311+ if ((unlockHeight > height))
312+ then throw((("Please wait " + toString(unlockHeight)) + " to withdraw your funds"))
313+ else {
314+ let accountLockedAmt = amountIn
315+ if ((0 >= accountLockedAmt))
316+ then throw("LockedAmount <= 0")
317+ else {
318+ let assetLockedTotalKey = keyAssetLockedTotal(accOperationDataArray[IdxOperationAssetIn])
319+ let currAssetLockedTotal = valueOrErrorMessage(getInteger(this, assetLockedTotalKey), (("State contains sellAssetRequest=" + accOperationKey) + " BUT no totalLocked"))
320+ let idxHeight = controlAccReadIdxHeight(idx)
321+ let prevIdxHeight = controlAccReadIdxHeight((idx - 1))
322+ let currIdx = controlAccReadCurrIdxOrFail()
323+ if (if (if ((idx > currIdx))
324+ then true
325+ else (unlockHeight > idxHeight))
326+ then true
327+ else if ((prevIdxHeight != 0))
328+ then (prevIdxHeight >= unlockHeight)
329+ else false)
330+ then throw(((((((((("invalid price idx: idx=" + toString(idx)) + " currIdx=") + toString(currIdx)) + " idxHeight=") + toString(idxHeight)) + " unlockHeight=") + toString(unlockHeight)) + " prevIdxHeight=") + toString(prevIdxHeight)))
331+ else {
332+ let synth2basicPrice = controlAccReadPriceByHeight(idxHeight)
333+ let assetInBytes = fromBase58String(assetIn)
334+ let $t01863219502 = if ((assetInBytes == baseAssetId))
335+ then {
336+ let synthAmt = fraction(amountIn, priceDecimals, synth2basicPrice)
337+ $Tuple4(synthAmt, Reissue(defoAssetId, synthAmt, true), ScriptTransfer(addressFromStringValue(accountAddress), synthAmt, defoAssetId), IntegerEntry(keyUcollateral(), (ucollateral + amountIn)))
338+ }
339+ else if ((assetInBytes == defoAssetId))
340+ then {
341+ let basicAmt = fraction(amountIn, synth2basicPrice, priceDecimals)
342+ let newUcollateral = (ucollateral - basicAmt)
343+ $Tuple4(basicAmt, Burn(baseAssetId, basicAmt), ScriptTransfer(addressFromStringValue(accountAddress), basicAmt, baseAssetId), IntegerEntry(keyUcollateral(), (ucollateral - basicAmt)))
344+ }
345+ else throw(("Unsupported assetIn=" + assetIn))
346+ let amountOut = $t01863219502._1
347+ let burnOrIssue = $t01863219502._2
348+ let transferSynthOrBasic = $t01863219502._3
349+ let ucollateralEntry = $t01863219502._4
350+ if ((0 > (currAssetLockedTotal - accountLockedAmt)))
351+ then throw((("Invalid data state: " + assetLockedTotalKey) + " less then 0"))
352+ else ((([IntegerEntry(assetLockedTotalKey, (currAssetLockedTotal - accountLockedAmt)), DeleteEntry(accOperationKey), StringEntry(keyAccountOperation(unlockHeight, accountAddress, "FINISHED"), assetDataSwapOperation(amountIn, assetIn, synth2basicPrice, amountOut, assetOut, 0, 0))] :+ burnOrIssue) :+ transferSynthOrBasic) :+ ucollateralEntry)
353+ }
354+ }
355+ }
356+ }
357+
358+
359+@Verifier(tx)
360+func verify () = match tx {
361+ case inv: InvokeScriptTransaction =>
362+ if ((inv.function != "rebalanceDebts"))
363+ then throw("only rebalanceDebts call is allowed")
364+ else if ((factoryReadAssetCfgByAddress(toString(addressFromRecipient(inv.dApp)))[IdxDefoAssetStatus] != "ISSUED"))
365+ then throw("only defo dapp is allowed")
366+ else if ((inv.fee > (900 * 1000)))
367+ then throw(("fee amount is greater than max allowed: " + toString(inv.fee)))
368+ else if (isDefined(inv.feeAssetId))
369+ then throw("only Waves is allowed as feeAssetId")
370+ else true
371+ case _ =>
372+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
373+}
374+

github/deemru/w8io/169f3d6 
45.03 ms