tx · TEzoRTuVch3EJgbVcXJ1wZhpwWazpMp1jnJsAABUa4d

3MrgUDrnapKVAxaLv4uB4qgcG97ytemWCnd:  -0.01000000 Waves

2020.09.22 19:47 [1188770] smart account 3MrgUDrnapKVAxaLv4uB4qgcG97ytemWCnd > SELF 0.00000000 Waves

{ "type": 13, "id": "TEzoRTuVch3EJgbVcXJ1wZhpwWazpMp1jnJsAABUa4d", "fee": 1000000, "feeAssetId": null, "timestamp": 1600793281744, "version": 1, "sender": "3MrgUDrnapKVAxaLv4uB4qgcG97ytemWCnd", "senderPublicKey": "9UngnT1anosu9sktrUUayr5HSYNyUopBKLidUnDqWDJ5", "proofs": [ "4X7ibT1GmR5MrA2JSSaHvHDSkJjL195DzdSLKz5DtgyzcVt8aqUKW44GwQBBCp6XhZJx1j17WpocmR2vqphGFAV7" ], "script": "base64:AAIEAAAAAAAAABYIAhIAEgASBQoDCAgIEgASBQoDCAEBAAAARwEAAAARa2V5QWNjdW11bGF0ZWRGZWUAAAAAAgAAABIlc19fYWNjdW11bGF0ZWRGZWUBAAAADmtleVVjb2xsYXRlcmFsAAAAAAIAAAAPJXNfX3Vjb2xsYXRlcmFsAQAAABlrZXlUb3RhbExlbmRlZEF0T3RoZXJBY2NzAAAAAAIAAAAaJXNfX3RvdGFsTGVuZGVkQXRPdGhlckFjY3MBAAAAE2tleUFzc2V0TG9ja2VkVG90YWwAAAABAAAAB2Fzc2V0SWQJAAEsAAAAAgIAAAAYJXMlc19fYXNzZXRMb2NrZWRUb3RhbF9fBQAAAAdhc3NldElkAQAAABNrZXlBY2NvdW50T3BlcmF0aW9uAAAAAwAAAAx1bmxvY2tIZWlnaHQAAAAHYWRkcmVzcwAAAAZzdGF0dXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAB4lcyVzJWQlc19fZGVmb0Fzc2V0T3BlcmF0aW9uX18FAAAAB2FkZHJlc3MCAAAAAl9fCQABpAAAAAEFAAAADHVubG9ja0h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CBhbGxvd2VkOiAJAAGkAAAAAQgFAAAAA2ludgAAAANmZWUDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA2ludgAAAApmZWVBc3NldElkCQAAAgAAAAECAAAAI29ubHkgV2F2ZXMgaXMgYWxsb3dlZCBhcyBmZWVBc3NldElkBgkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnZqYEL", "chainId": 84, "height": 1188770, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 (buyAssetId,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[IdxDefoAssetId] != buyAssetId))
248+ then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetId]) + " BUT buyAssetId=") + buyAssetId))
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=" + buyAssetId) + " 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 :+ 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 $t01862319493 = 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 = $t01862319493._1
347+ let burnOrIssue = $t01862319493._2
348+ let transferSynthOrBasic = $t01862319493._3
349+ let ucollateralEntry = $t01862319493._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/026f985 
34.19 ms