tx · CynvUJufzsSJRXGvws5crN7vnAWwSiiqXUpUBXjNUK6j

3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu:  -0.01400000 Waves

2021.04.09 12:03 [1474710] smart account 3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu > SELF 0.00000000 Waves

{ "type": 13, "id": "CynvUJufzsSJRXGvws5crN7vnAWwSiiqXUpUBXjNUK6j", "fee": 1400000, "feeAssetId": null, "timestamp": 1617959053577, "version": 1, "sender": "3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu", "senderPublicKey": "FBUTJS3qNBzn5vEveZKU8RYGzQXuXJ7HeRuXJQdkaE8f", "proofs": [ "5HCBK3vWVfrLDiZKknD7QQKKqxWiz4vAjUCi7x7b6HwYx6bNA5gUH2Y6VKWm9ojDnU1xb1nAwUMJCw62qqiLQBKY" ], "script": "base64:AAIEAAAAAAAAABMIAhIAEgASBAoCCAgSABIDCgEIAAAAbgEAAAARa2V5QWNjdW11bGF0ZWRGZWUAAAAAAgAAABIlc19fYWNjdW11bGF0ZWRGZWUBAAAADmtleVVjb2xsYXRlcmFsAAAAAAIAAAAPJXNfX3Vjb2xsYXRlcmFsAQAAABlrZXlUb3RhbExlbmRlZEF0T3RoZXJBY2NzAAAAAAIAAAAaJXNfX3RvdGFsTGVuZGVkQXRPdGhlckFjY3MBAAAAE2tleUFzc2V0TG9ja2VkVG90YWwAAAABAAAAB2Fzc2V0SWQJAAEsAAAAAgIAAAAYJXMlc19fYXNzZXRMb2NrZWRUb3RhbF9fBQAAAAdhc3NldElkAQAAABNrZXlBY2NvdW50T3BlcmF0aW9uAAAAAwAAAAx1bmxvY2tIZWlnaHQAAAAHYWRkcmVzcwAAAAZzdGF0dXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAB4lcyVzJWQlc19fZGVmb0Fzc2V0T3BlcmF0aW9uX18FAAAAB2FkZHJlc3MCAAAAAl9fCQABpAAAAAEFAAAADHVubG9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AAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkBAAAAImZhY3RvcnlSZWFkRGVmb1N0YWtpbmdQYWNlbWFrZXJQdWIAAAAACQAAAgAAAAECAAAAI05vdCBhbGxvd2VkIGludm9jYXRpb24gbWV0aG9kIGNhbGxzCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleeH5rmM=", "chainId": 84, "height": 1474710, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BHie8N5AfNPCmTNuZ9zB8yujpz2Eqh4DUL2c715TVgEH Next: tSTyjU4pJ4dzrqxjbKe1H1LSYhbrwYdobvhfkZfbdmh Diff:
OldNewDifferences
9595 }
9696
9797
98-func factoryReadNextPoolMakerToDistributeFee (assetAddressStr) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetPoolMakers(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetPoolMakers(assetAddressStr)))), ("address extraction error for key=" + keyFactoryAssetPoolMakers(assetAddressStr)))
98+func factoryReadNextPoolMakerToDistributeFee (assetAddressStr) = addressFromStringValue("3MsbFMstwm3FHPJXmMfTgyaw7zQrpZfkwnx")
9999
100100
101101 func factoryReadDefoStakingPacemakerPub () = fromBase58String(valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoStakingPacemakerPub()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoStakingPacemakerPub())))
133133
134134 let IdxWeekendsPriceChangeCoefficient = 16
135135
136+let IdxAssetAccountPublicStr = 17
137+
138+let IdxAssetStakingReferralPublicStr = 18
139+
140+let IdxCrossExchangeCoefficient = 19
141+
142+let IdxStakingMinAmtFromSellCoefficient = 20
143+
144+let IdxPoolStabilityFeePart = 21
145+
136146 let thisCfgArray = factoryReadAssetCfgByAddress(toString(this))
137147
138148 let defoAssetCode = thisCfgArray[IdxDefoAssetCode]
164174 let sellFeePercent = parseIntValue(thisCfgArray[IdxSellFeePercent])
165175
166176 let weekendsPriceChangeCoefficient = parseIntValue(thisCfgArray[IdxWeekendsPriceChangeCoefficient])
177+
178+let assetAccountPublicStr = thisCfgArray[IdxAssetAccountPublicStr]
179+
180+let assetStakingReferralPublicStr = thisCfgArray[IdxAssetStakingReferralPublicStr]
181+
182+let crossExchangeCoefficient = parseIntValue(thisCfgArray[IdxCrossExchangeCoefficient])
183+
184+let stakingMinAmtFromSellCoefficient = parseIntValue(thisCfgArray[IdxStakingMinAmtFromSellCoefficient])
185+
186+let poolStabilityFeePart = parseIntValue(thisCfgArray[IdxPoolStabilityFeePart])
167187
168188 func keyIsBlocked () = "%s__isBlocked"
169189
243263 else fraction((priceDecimals - changeCoeff), controlPrice, priceDecimals)
244264
245265
266+func getBuyFeeConsideringStakingReferral (callerPub58Str) = if ((assetStakingReferralPublicStr == callerPub58Str))
267+ then 0
268+ else buyFeePercent
269+
270+
271+func getBuyPriceConsideringStakingReferral (changeCoeff,callerPub58Str) = if ((assetStakingReferralPublicStr == callerPub58Str))
272+ then controlPrice
273+ else getBuyPrice(changeCoeff)
274+
275+
246276 func getSellPrice (changeCoeff) = if (isMarketOpened)
247277 then controlPrice
248278 else fraction((priceDecimals + changeCoeff), controlPrice, priceDecimals)
253283 else fraction((priceDecimals + changeCoeff), fromPrice, priceDecimals)
254284
255285
256-func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,feePercent) = {
286+func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,poolMakersFeePart) = {
257287 let defoAssetAmountGross = fraction(sellAmt, buy2sellPrice, priceDecimals)
258- let defoAssetAmount = fraction((priceDecimals - feePercent), defoAssetAmountGross, priceDecimals)
259- let feeAmount = (defoAssetAmountGross - defoAssetAmount)
288+ let stabilityFeeDefoAmount = fraction(poolStabilityFeePart, defoAssetAmountGross, priceDecimals)
289+ let poolMakersFeeDefoAmount = fraction(poolMakersFeePart, defoAssetAmountGross, priceDecimals)
290+ let defoAssetAmount = ((defoAssetAmountGross - stabilityFeeDefoAmount) - poolMakersFeeDefoAmount)
260291 let requiredBasicAssetAmount = fraction(defoAssetAmountGross, priceDecimals, buy2sellPrice)
261292 let change = (sellAmt - requiredBasicAssetAmount)
262293 if (if ((minSellAmt > sellAmt))
263294 then (toString(sellerAddr) != toString(defoStakingAcc))
264295 else false)
265296 then throw(((((("impossible to issue new " + defoAssetCode) + ": payment=") + toString(sellAmt)) + "is less then min amount=") + toString(minSellAmt)))
266- else $Tuple2([IntegerEntry(keyUcollateral(), (ucollateral + requiredBasicAssetAmount)), StringEntry(keyAccountOperation(height, toString(sellerAddr), "FINISHED"), assetDataSwapOperation(sellAmt, toBase58String(sellAssetId), controlPrice, defoAssetAmount, toBase58String(defoAssetId), defoAssetAmountGross, feeAmount)), Reissue(defoAssetId, (defoAssetAmount + feeAmount), true), ScriptTransfer(sellerAddr, defoAssetAmount, defoAssetId), ScriptTransfer(sellerAddr, change, sellAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), feeAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + feeAmount))], change)
297+ else $Tuple2([IntegerEntry(keyUcollateral(), (ucollateral + requiredBasicAssetAmount)), StringEntry(keyAccountOperation(height, toString(sellerAddr), "FINISHED"), assetDataSwapOperation(sellAmt, toBase58String(sellAssetId), controlPrice, defoAssetAmount, toBase58String(defoAssetId), defoAssetAmountGross, poolMakersFeeDefoAmount)), Reissue(defoAssetId, (defoAssetAmount + poolMakersFeeDefoAmount), true), ScriptTransfer(sellerAddr, defoAssetAmount, defoAssetId), ScriptTransfer(sellerAddr, change, sellAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), poolMakersFeeDefoAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + poolMakersFeeDefoAmount))], change)
267298 }
268299
269300
271302 func buyAsset () = {
272303 let pmt = value(i.payments[0])
273304 let pmtAssetId = value(pmt.assetId)
305+ let callerPub58Str = toBase58String(i.callerPublicKey)
274306 if (isBlocked)
275307 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
276308 else if (isBlockedByLastHeight)
277309 then throw(((("last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)))
278310 else if ((pmtAssetId != baseAssetId))
279311 then throw(((("Payment asset id doesn't match basic asset: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(pmtAssetId)))
280- else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, getBuyPrice(weekendsPriceChangeCoefficient), buyFeePercent)._1
312+ else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, getBuyPriceConsideringStakingReferral(weekendsPriceChangeCoefficient, callerPub58Str), getBuyFeeConsideringStakingReferral(callerPub58Str))._1
281313 }
282314
283315
303335 else baseAssetAmountNoBalanceLimit
304336 let soldDefoAssetAmountGross = fraction(baseAssetAmountAvailable, sellPrice, priceDecimals)
305337 let change = (pmt.amount - soldDefoAssetAmountGross)
306- let defoAmountFee = fraction(sellFeePercent, soldDefoAssetAmountGross, priceDecimals)
307- let soldDefoAssetAmount = (soldDefoAssetAmountGross - defoAmountFee)
338+ let stabilityFeeDefoAmount = fraction(poolStabilityFeePart, soldDefoAssetAmountGross, priceDecimals)
339+ let poolMakersFeeDefoAmount = fraction(sellFeePercent, soldDefoAssetAmountGross, priceDecimals)
340+ let soldDefoAssetAmount = ((soldDefoAssetAmountGross - stabilityFeeDefoAmount) - poolMakersFeeDefoAmount)
308341 let baseAssetAmountToSend = fraction(soldDefoAssetAmount, priceDecimals, sellPrice)
309-[IntegerEntry(keyUcollateral(), (ucollateral - baseAssetAmountToSend)), StringEntry(keyAccountOperation(height, callerAddress, "FINISHED"), assetDataSwapOperation(pmt.amount, toBase58String(pmtAsset), sellPrice, baseAssetAmountToSend, baseAssetIdStr, soldDefoAssetAmountGross, defoAmountFee)), Burn(defoAssetId, soldDefoAssetAmount), ScriptTransfer(i.caller, baseAssetAmountToSend, baseAssetId), ScriptTransfer(i.caller, change, defoAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), defoAmountFee, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + defoAmountFee))]
342+[IntegerEntry(keyUcollateral(), (ucollateral - baseAssetAmountToSend)), StringEntry(keyAccountOperation(height, callerAddress, "FINISHED"), assetDataSwapOperation(pmt.amount, toBase58String(pmtAsset), sellPrice, baseAssetAmountToSend, baseAssetIdStr, soldDefoAssetAmountGross, poolMakersFeeDefoAmount)), Burn(defoAssetId, (soldDefoAssetAmount + stabilityFeeDefoAmount)), ScriptTransfer(i.caller, baseAssetAmountToSend, baseAssetId), ScriptTransfer(i.caller, change, defoAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), poolMakersFeeDefoAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + poolMakersFeeDefoAmount))]
310343 }
311344 }
312345
349382 let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm)
350383 let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0)
351384 let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent])
352- let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100))
385+ let crossFeePercent = fraction((buyFeePercent + sellAssetSellFeePercent), crossExchangeCoefficient, priceDecimals)
386+ let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, crossFeePercent)
353387 ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt)))
354388 }
355389 }
377411 then throw("first payment amount doesn't match to the second payment amount")
378412 else if ((0 >= lendedAmt))
379413 then throw(("lendedAmt is less then zero: lendedAmt=" + toString(lendedAmt)))
380- else if (((100 * priceDecimals) >= debtPmt0.amount))
414+ else if (((1 * priceDecimals) >= debtPmt0.amount))
381415 then throw(("attached payment must be greater then 100: pmt0.amount=" + toString(debtPmt0.amount)))
382416 else if ((debtPmt0.amount > lendedAmt))
383417 then throw(((("attached payment is grater than required: pmtAmount=" + toString(debtPmt0.amount)) + " lendedAmt=") + toString(lendedAmt)))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func keyAccumulatedFee () = "%s__accumulatedFee"
55
66
77 func keyUcollateral () = "%s__ucollateral"
88
99
1010 func keyTotalLendedAtOtherAccs () = "%s__totalLendedAtOtherAccs"
1111
1212
1313 func keyAssetLockedTotal (assetId) = ("%s%s__assetLockedTotal__" + assetId)
1414
1515
1616 func keyAccountOperation (unlockHeight,address,status) = ((((("%s%s%d%s__defoAssetOperation__" + address) + "__") + toString(unlockHeight)) + "__") + status)
1717
1818
1919 func keyFactory () = "%s__factory"
2020
2121
2222 func keyLendedAmountByAssetCode (assetCode) = ("%s%s__lendedBaseAssetAmount__" + assetCode)
2323
2424
2525 func keyPrice (assetCode) = ("%s%s__price__" + assetCode)
2626
2727
2828 func keyControlLastHeight (assetCode) = ("%s%s__lastHeight__" + assetCode)
2929
3030
3131 let IdxOperationAmountIn = 1
3232
3333 let IdxOperationAssetIn = 2
3434
3535 let IdxOperationPrice = 3
3636
3737 let IdxOperationAmountOut = 4
3838
3939 let IdxOperationAssetOut = 5
4040
4141 func assetDataSwapOperation (amountIn,assetIn,price,amountOut,assetOut,bruttoAmount,feeAmount) = makeString(["%d%s%d%s%d%d%d", toString(amountIn), assetIn, toString(amountOut), assetOut, toString(price), toString(bruttoAmount), toString(feeAmount)], "__")
4242
4343
4444 func assetDataRebalanceTrace (debtorAssetCode,debtPmt,basePmt,lendedAmtBefore,lendedAmtAfter) = makeString(["%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)], "__")
4545
4646
4747 func assetReadSwapDataArrayOrFail (accOperationKey) = {
4848 let accOperationDataStr = valueOrErrorMessage(getString(this, accOperationKey), ("There is no request for passed arguments: " + accOperationKey))
4949 split(accOperationDataStr, "__")
5050 }
5151
5252
5353 let nullInt = -1
5454
5555 let nullStr = "NULL"
5656
5757 let factoryAcc = addressFromStringValue(valueOrErrorMessage(getString(this, keyFactory()), ((("No config at this=" + toString(this)) + " for key=") + keyFactory())))
5858
5959 func keyFactoryDebtAssetId () = "%s%s__commonConfig__debtAssetId"
6060
6161
6262 func keyFactoryDebtAssetEtalonBalance () = "%s%s__commonConfig__debtAssetEtalonBalance"
6363
6464
6565 func keyFactoryAssetCfg (assetAddressStr) = (("%s%s%s__defoAsset__" + assetAddressStr) + "__config")
6666
6767
6868 func keyFactoryAssetCurrentPool (assetAccAddress) = (("%s%s%s__defoAsset__" + toString(assetAccAddress)) + "__currentPool")
6969
7070
7171 func keyFactoryDefoAddressByAssetCode (assetCode) = (("%s%s%s__defoAsset__" + assetCode) + "__addressByAssetCode")
7272
7373
7474 func keyFactoryAssetPoolMakers (assetAddress) = (("%s%s%s__defoAsset__" + assetAddress) + "__poolMakers")
7575
7676
7777 func keyFactoryDefoStakingPacemakerPub () = "%s%s__commonConfig__defoStakingPacemakerPub"
7878
7979
8080 func keyFactoryPoolMakerLiquidityRequest (assetAddress,poolMakerAddress,h) = makeString(["%s%s%s%d%s__pool", assetAddress, poolMakerAddress, toString(h), "liquidityRequest"], "__")
8181
8282
8383 func keyFactoryPoolMakerUnlockHeight (assetAddress,poolMakerAddress) = makeString(["%s%s%s%s__pool", assetAddress, poolMakerAddress, "unlockHeight"], "__")
8484
8585
8686 func factoryReadDebtAssetId () = valueOrErrorMessage(getString(factoryAcc, keyFactoryDebtAssetId()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDebtAssetId()))
8787
8888
8989 func factoryReadAssetCfgByAddress (assetAddressStr) = split(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetCfg(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetCfg(assetAddressStr))), "__")
9090
9191
9292 func factoryReadAssetCfgByCode (assetCode) = {
9393 let assetAddressStr = valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoAddressByAssetCode(assetCode)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoAddressByAssetCode(assetCode)))
9494 $Tuple2(assetAddressStr, factoryReadAssetCfgByAddress(assetAddressStr))
9595 }
9696
9797
98-func factoryReadNextPoolMakerToDistributeFee (assetAddressStr) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetPoolMakers(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetPoolMakers(assetAddressStr)))), ("address extraction error for key=" + keyFactoryAssetPoolMakers(assetAddressStr)))
98+func factoryReadNextPoolMakerToDistributeFee (assetAddressStr) = addressFromStringValue("3MsbFMstwm3FHPJXmMfTgyaw7zQrpZfkwnx")
9999
100100
101101 func factoryReadDefoStakingPacemakerPub () = fromBase58String(valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoStakingPacemakerPub()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoStakingPacemakerPub())))
102102
103103
104104 let IdxDefoAssetCode = 1
105105
106106 let IdxDefoAssetId = 2
107107
108108 let IdxDefoAssetStatus = 3
109109
110110 let IdxPriceDecimals = 4
111111
112112 let IdxBaseAssetId = 5
113113
114114 let IdxOverCollateralPercent = 6
115115
116116 let IdxMinInitPool = 7
117117
118118 let IdxPriceOracleAddress = 8
119119
120120 let IdxMinBuyPayment = 9
121121
122122 let IdxMinSellPayment = 10
123123
124124 let IdxBuyLockInterval = 11
125125
126126 let IdxSellLockInterval = 12
127127
128128 let IdxBuyFeePercent = 13
129129
130130 let IdxSellFeePercent = 14
131131
132132 let IdxPoolRedemptionTimeout = 15
133133
134134 let IdxWeekendsPriceChangeCoefficient = 16
135135
136+let IdxAssetAccountPublicStr = 17
137+
138+let IdxAssetStakingReferralPublicStr = 18
139+
140+let IdxCrossExchangeCoefficient = 19
141+
142+let IdxStakingMinAmtFromSellCoefficient = 20
143+
144+let IdxPoolStabilityFeePart = 21
145+
136146 let thisCfgArray = factoryReadAssetCfgByAddress(toString(this))
137147
138148 let defoAssetCode = thisCfgArray[IdxDefoAssetCode]
139149
140150 let defoAssetIdStr = thisCfgArray[IdxDefoAssetId]
141151
142152 let defoAssetId = fromBase58String(defoAssetIdStr)
143153
144154 let priceOracleAcc = addressFromStringValue(thisCfgArray[IdxPriceOracleAddress])
145155
146156 let overCollateralPercent = parseIntValue(thisCfgArray[IdxOverCollateralPercent])
147157
148158 let baseAssetIdStr = thisCfgArray[IdxBaseAssetId]
149159
150160 let baseAssetId = fromBase58String(baseAssetIdStr)
151161
152162 let priceDecimals = parseIntValue(thisCfgArray[IdxPriceDecimals])
153163
154164 let minBasicBuyAmount = parseIntValue(thisCfgArray[IdxMinBuyPayment])
155165
156166 let minSynthSellAmount = parseIntValue(thisCfgArray[IdxMinSellPayment])
157167
158168 let buyLockInterval = parseIntValue(thisCfgArray[IdxBuyLockInterval])
159169
160170 let sellLockInterval = parseIntValue(thisCfgArray[IdxSellLockInterval])
161171
162172 let buyFeePercent = parseIntValue(thisCfgArray[IdxBuyFeePercent])
163173
164174 let sellFeePercent = parseIntValue(thisCfgArray[IdxSellFeePercent])
165175
166176 let weekendsPriceChangeCoefficient = parseIntValue(thisCfgArray[IdxWeekendsPriceChangeCoefficient])
177+
178+let assetAccountPublicStr = thisCfgArray[IdxAssetAccountPublicStr]
179+
180+let assetStakingReferralPublicStr = thisCfgArray[IdxAssetStakingReferralPublicStr]
181+
182+let crossExchangeCoefficient = parseIntValue(thisCfgArray[IdxCrossExchangeCoefficient])
183+
184+let stakingMinAmtFromSellCoefficient = parseIntValue(thisCfgArray[IdxStakingMinAmtFromSellCoefficient])
185+
186+let poolStabilityFeePart = parseIntValue(thisCfgArray[IdxPoolStabilityFeePart])
167187
168188 func keyIsBlocked () = "%s__isBlocked"
169189
170190
171191 func keyIsMarketOpened (assetCode) = ("%s%s__isMarketOpened__" + assetCode)
172192
173193
174194 let isBlocked = valueOrElse(getBoolean(priceOracleAcc, keyIsBlocked()), false)
175195
176196 let isMarketOpened = valueOrElse(getBoolean(priceOracleAcc, keyIsMarketOpened(defoAssetCode)), false)
177197
178198 func controlAccReadPrice (assetCode) = valueOrErrorMessage(getInteger(priceOracleAcc, keyPrice(assetCode)), ((("No price at priceOracle=" + toString(priceOracleAcc)) + " for key=") + keyPrice(assetCode)))
179199
180200
181201 func controlAccReadLastHeight (assetCode) = valueOrErrorMessage(getInteger(priceOracleAcc, keyControlLastHeight(assetCode)), ((("No lastHeight at priceOracle=" + toString(priceOracleAcc)) + " for key=") + keyControlLastHeight(assetCode)))
182202
183203
184204 func controlAccReadCurrIdxOrFail () = valueOrErrorMessage(getInteger(priceOracleAcc, "currIdx"), ("No currIdx at controlAcc=" + toString(priceOracleAcc)))
185205
186206
187207 func controlAccReadIdxHeight (idx) = {
188208 let idxHeightKey = ("idxHeight_" + toString(idx))
189209 valueOrElse(getInteger(priceOracleAcc, idxHeightKey), 0)
190210 }
191211
192212
193213 func controlAccReadPriceByHeight (priceHeight) = {
194214 let priceByHeightKey = ("price_" + toString(priceHeight))
195215 valueOrErrorMessage(getInteger(priceOracleAcc, priceByHeightKey), ((("No " + priceByHeightKey) + " at controlAcc=") + toString(priceOracleAcc)))
196216 }
197217
198218
199219 let priceLastHeight = controlAccReadLastHeight(defoAssetCode)
200220
201221 let isBlockedByLastHeight = ((priceLastHeight - priceLastHeight) > 5)
202222
203223 let keyDefoStakingAddress = "%s%s__commonConfig__defoStakingAddress"
204224
205225 let keyNeutrinoStakingAddress = "%s%s__commonConfig__neutrinoStakingAddress"
206226
207227 func keyDefoStakingAssetBalance (assetId) = ("%s%s__stakingBalance__" + assetId)
208228
209229
210230 func keyNeutrinoStakingBalance () = ((("rpd_balance_" + baseAssetIdStr) + "_") + toString(this))
211231
212232
213233 let defoStakingAcc = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyDefoStakingAddress), ((("No config at factoryAcc" + toString(factoryAcc)) + " for key=") + keyDefoStakingAddress))), ("address extraction error for key=" + keyDefoStakingAddress))
214234
215235 let neutrinoStakingAcc = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyNeutrinoStakingAddress), ((("No config at factoryAcc" + toString(factoryAcc)) + " for key=") + keyNeutrinoStakingAddress))), ("address extraction error for key=" + keyNeutrinoStakingAddress))
216236
217237 func getThisDefoStakingBalance () = valueOrElse(getInteger(defoStakingAcc, keyDefoStakingAssetBalance(defoAssetIdStr)), 0)
218238
219239
220240 func getThisNeutrinoStakingBalance () = valueOrElse(getInteger(neutrinoStakingAcc, keyNeutrinoStakingBalance()), 0)
221241
222242
223243 let ucollateral = valueOrElse(getInteger(this, keyUcollateral()), 0)
224244
225245 let accumulatedFee = valueOrElse(getInteger(this, keyAccumulatedFee()), 0)
226246
227247 let currPoolAmount = getIntegerValue(factoryAcc, keyFactoryAssetCurrentPool(this))
228248
229249 let debtAssetId = fromBase58String(factoryReadDebtAssetId())
230250
231251 let debtAssetEtalonBalance = getIntegerValue(factoryAcc, keyFactoryDebtAssetEtalonBalance())
232252
233253 let lendedOrDebtAmount = (debtAssetEtalonBalance - assetBalance(this, debtAssetId))
234254
235255 let currentBaseAssetBalance = ((assetBalance(this, baseAssetId) + getThisNeutrinoStakingBalance()) + lendedOrDebtAmount)
236256
237257 let controlPrice = controlAccReadPrice(thisCfgArray[IdxDefoAssetCode])
238258
239259 let emission = (value(assetInfo(defoAssetId)).quantity - assetBalance(this, defoAssetId))
240260
241261 func getBuyPrice (changeCoeff) = if (isMarketOpened)
242262 then controlPrice
243263 else fraction((priceDecimals - changeCoeff), controlPrice, priceDecimals)
244264
245265
266+func getBuyFeeConsideringStakingReferral (callerPub58Str) = if ((assetStakingReferralPublicStr == callerPub58Str))
267+ then 0
268+ else buyFeePercent
269+
270+
271+func getBuyPriceConsideringStakingReferral (changeCoeff,callerPub58Str) = if ((assetStakingReferralPublicStr == callerPub58Str))
272+ then controlPrice
273+ else getBuyPrice(changeCoeff)
274+
275+
246276 func getSellPrice (changeCoeff) = if (isMarketOpened)
247277 then controlPrice
248278 else fraction((priceDecimals + changeCoeff), controlPrice, priceDecimals)
249279
250280
251281 func getSellPriceFrom (fromPrice,changeCoeff) = if (isMarketOpened)
252282 then fromPrice
253283 else fraction((priceDecimals + changeCoeff), fromPrice, priceDecimals)
254284
255285
256-func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,feePercent) = {
286+func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,poolMakersFeePart) = {
257287 let defoAssetAmountGross = fraction(sellAmt, buy2sellPrice, priceDecimals)
258- let defoAssetAmount = fraction((priceDecimals - feePercent), defoAssetAmountGross, priceDecimals)
259- let feeAmount = (defoAssetAmountGross - defoAssetAmount)
288+ let stabilityFeeDefoAmount = fraction(poolStabilityFeePart, defoAssetAmountGross, priceDecimals)
289+ let poolMakersFeeDefoAmount = fraction(poolMakersFeePart, defoAssetAmountGross, priceDecimals)
290+ let defoAssetAmount = ((defoAssetAmountGross - stabilityFeeDefoAmount) - poolMakersFeeDefoAmount)
260291 let requiredBasicAssetAmount = fraction(defoAssetAmountGross, priceDecimals, buy2sellPrice)
261292 let change = (sellAmt - requiredBasicAssetAmount)
262293 if (if ((minSellAmt > sellAmt))
263294 then (toString(sellerAddr) != toString(defoStakingAcc))
264295 else false)
265296 then throw(((((("impossible to issue new " + defoAssetCode) + ": payment=") + toString(sellAmt)) + "is less then min amount=") + toString(minSellAmt)))
266- else $Tuple2([IntegerEntry(keyUcollateral(), (ucollateral + requiredBasicAssetAmount)), StringEntry(keyAccountOperation(height, toString(sellerAddr), "FINISHED"), assetDataSwapOperation(sellAmt, toBase58String(sellAssetId), controlPrice, defoAssetAmount, toBase58String(defoAssetId), defoAssetAmountGross, feeAmount)), Reissue(defoAssetId, (defoAssetAmount + feeAmount), true), ScriptTransfer(sellerAddr, defoAssetAmount, defoAssetId), ScriptTransfer(sellerAddr, change, sellAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), feeAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + feeAmount))], change)
297+ else $Tuple2([IntegerEntry(keyUcollateral(), (ucollateral + requiredBasicAssetAmount)), StringEntry(keyAccountOperation(height, toString(sellerAddr), "FINISHED"), assetDataSwapOperation(sellAmt, toBase58String(sellAssetId), controlPrice, defoAssetAmount, toBase58String(defoAssetId), defoAssetAmountGross, poolMakersFeeDefoAmount)), Reissue(defoAssetId, (defoAssetAmount + poolMakersFeeDefoAmount), true), ScriptTransfer(sellerAddr, defoAssetAmount, defoAssetId), ScriptTransfer(sellerAddr, change, sellAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), poolMakersFeeDefoAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + poolMakersFeeDefoAmount))], change)
267298 }
268299
269300
270301 @Callable(i)
271302 func buyAsset () = {
272303 let pmt = value(i.payments[0])
273304 let pmtAssetId = value(pmt.assetId)
305+ let callerPub58Str = toBase58String(i.callerPublicKey)
274306 if (isBlocked)
275307 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
276308 else if (isBlockedByLastHeight)
277309 then throw(((("last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)))
278310 else if ((pmtAssetId != baseAssetId))
279311 then throw(((("Payment asset id doesn't match basic asset: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(pmtAssetId)))
280- else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, getBuyPrice(weekendsPriceChangeCoefficient), buyFeePercent)._1
312+ else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, getBuyPriceConsideringStakingReferral(weekendsPriceChangeCoefficient, callerPub58Str), getBuyFeeConsideringStakingReferral(callerPub58Str))._1
281313 }
282314
283315
284316
285317 @Callable(i)
286318 func sellAsset () = {
287319 let pmt = value(i.payments[0])
288320 let pmtAsset = value(pmt.assetId)
289321 let callerAddress = toString(i.caller)
290322 let sellPrice = getSellPrice(weekendsPriceChangeCoefficient)
291323 if (isBlocked)
292324 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
293325 else if (isBlockedByLastHeight)
294326 then throw(((("last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)))
295327 else if ((pmtAsset != defoAssetId))
296328 then throw(((("Invalid payment asset id: expected=" + toBase58String(defoAssetId)) + " actual=") + toBase58String(pmtAsset)))
297329 else if ((minSynthSellAmount > pmt.amount))
298330 then throw(((("Payment amount less then mininimal allowed: paymentAmount=" + toString(pmt.amount)) + " minAmount=") + toString(minSynthSellAmount)))
299331 else {
300332 let baseAssetAmountNoBalanceLimit = fraction(pmt.amount, priceDecimals, sellPrice)
301333 let baseAssetAmountAvailable = if ((baseAssetAmountNoBalanceLimit > currentBaseAssetBalance))
302334 then currentBaseAssetBalance
303335 else baseAssetAmountNoBalanceLimit
304336 let soldDefoAssetAmountGross = fraction(baseAssetAmountAvailable, sellPrice, priceDecimals)
305337 let change = (pmt.amount - soldDefoAssetAmountGross)
306- let defoAmountFee = fraction(sellFeePercent, soldDefoAssetAmountGross, priceDecimals)
307- let soldDefoAssetAmount = (soldDefoAssetAmountGross - defoAmountFee)
338+ let stabilityFeeDefoAmount = fraction(poolStabilityFeePart, soldDefoAssetAmountGross, priceDecimals)
339+ let poolMakersFeeDefoAmount = fraction(sellFeePercent, soldDefoAssetAmountGross, priceDecimals)
340+ let soldDefoAssetAmount = ((soldDefoAssetAmountGross - stabilityFeeDefoAmount) - poolMakersFeeDefoAmount)
308341 let baseAssetAmountToSend = fraction(soldDefoAssetAmount, priceDecimals, sellPrice)
309-[IntegerEntry(keyUcollateral(), (ucollateral - baseAssetAmountToSend)), StringEntry(keyAccountOperation(height, callerAddress, "FINISHED"), assetDataSwapOperation(pmt.amount, toBase58String(pmtAsset), sellPrice, baseAssetAmountToSend, baseAssetIdStr, soldDefoAssetAmountGross, defoAmountFee)), Burn(defoAssetId, soldDefoAssetAmount), ScriptTransfer(i.caller, baseAssetAmountToSend, baseAssetId), ScriptTransfer(i.caller, change, defoAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), defoAmountFee, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + defoAmountFee))]
342+[IntegerEntry(keyUcollateral(), (ucollateral - baseAssetAmountToSend)), StringEntry(keyAccountOperation(height, callerAddress, "FINISHED"), assetDataSwapOperation(pmt.amount, toBase58String(pmtAsset), sellPrice, baseAssetAmountToSend, baseAssetIdStr, soldDefoAssetAmountGross, poolMakersFeeDefoAmount)), Burn(defoAssetId, (soldDefoAssetAmount + stabilityFeeDefoAmount)), ScriptTransfer(i.caller, baseAssetAmountToSend, baseAssetId), ScriptTransfer(i.caller, change, defoAssetId), ScriptTransfer(factoryReadNextPoolMakerToDistributeFee(toString(this)), poolMakersFeeDefoAmount, defoAssetId), IntegerEntry(keyAccumulatedFee(), (accumulatedFee + poolMakersFeeDefoAmount))]
310343 }
311344 }
312345
313346
314347
315348 @Callable(i)
316349 func crossExchange (buyAssetCodeConfirm,sellAssetCodeConfirm) = {
317350 let pmt = value(i.payments[0])
318351 let pmtAsset = value(pmt.assetId)
319352 let pmtAssetStr = toBase58String(pmtAsset)
320353 let pmtAmount = pmt.amount
321354 let callerAddress = toString(i.caller)
322355 let buyAssetCfg = thisCfgArray
323356 let sellAssetTuple = factoryReadAssetCfgByCode(sellAssetCodeConfirm)
324357 let sellAssetCfg = sellAssetTuple._2
325358 let sellAssetAccAddress = valueOrErrorMessage(addressFromString(sellAssetTuple._1), ("couldn't parse address from string for assetCode=" + sellAssetCodeConfirm))
326359 let minSellPmt = valueOrErrorMessage(parseInt(sellAssetCfg[IdxMinSellPayment]), ("minSellPmt parsing error: rawVal=" + sellAssetCfg[IdxMinSellPayment]))
327360 let sellPriceLastHeight = controlAccReadLastHeight(sellAssetCodeConfirm)
328361 let isSellBlockedByLastHeight = ((sellPriceLastHeight - sellPriceLastHeight) > 5)
329362 if (isBlocked)
330363 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
331364 else if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm))
332365 then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm))
333366 else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr))
334367 then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr))
335368 else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED"))
336369 then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus]))
337370 else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED"))
338371 then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus]))
339372 else if (isBlockedByLastHeight)
340373 then throw(((((("buy last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " buyCode=") + buyAssetCodeConfirm))
341374 else if (isSellBlockedByLastHeight)
342375 then throw(((((("sell last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " sellCode=") + sellAssetCodeConfirm))
343376 else {
344377 let buyAssetUsdPrice = getBuyPrice((weekendsPriceChangeCoefficient / 2))
345378 let sellAssetUsdPrice = getSellPriceFrom(controlAccReadPrice(sellAssetCodeConfirm), (weekendsPriceChangeCoefficient / 2))
346379 let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice)
347380 let usdnDebt = fraction(pmtAmount, priceDecimals, sellAssetUsdPrice)
348381 let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0)
349382 let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm)
350383 let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0)
351384 let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent])
352- let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100))
385+ let crossFeePercent = fraction((buyFeePercent + sellAssetSellFeePercent), crossExchangeCoefficient, priceDecimals)
386+ let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, crossFeePercent)
353387 ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt)))
354388 }
355389 }
356390
357391
358392
359393 @Callable(i)
360394 func rebalanceDebts () = {
361395 let debtPmt0 = value(i.payments[0])
362396 let debtPmtAsset0 = value(debtPmt0.assetId)
363397 let basePmt1 = value(i.payments[1])
364398 let basePmtAsset1 = value(basePmt1.assetId)
365399 let debtorAddress = toString(i.caller)
366400 let debtorAssetCfg = factoryReadAssetCfgByAddress(debtorAddress)
367401 let debtorAssetCode = debtorAssetCfg[IdxDefoAssetCode]
368402 let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(debtorAssetCode)
369403 let lendedAmt = valueOrErrorMessage(getInteger(this, lendedAmountByAssetCodeKey), ("No debts for " + debtorAssetCode))
370404 if (isBlocked)
371405 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
372406 else if ((debtAssetId != debtPmtAsset0))
373407 then throw(((("invalid debt asset id in the first paymet: expected=" + toBase58String(debtAssetId)) + " actual=") + toBase58String(debtPmtAsset0)))
374408 else if ((baseAssetId != basePmtAsset1))
375409 then throw(((("invalid base asset id in the second payment: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(basePmtAsset1)))
376410 else if ((debtPmt0.amount != basePmt1.amount))
377411 then throw("first payment amount doesn't match to the second payment amount")
378412 else if ((0 >= lendedAmt))
379413 then throw(("lendedAmt is less then zero: lendedAmt=" + toString(lendedAmt)))
380- else if (((100 * priceDecimals) >= debtPmt0.amount))
414+ else if (((1 * priceDecimals) >= debtPmt0.amount))
381415 then throw(("attached payment must be greater then 100: pmt0.amount=" + toString(debtPmt0.amount)))
382416 else if ((debtPmt0.amount > lendedAmt))
383417 then throw(((("attached payment is grater than required: pmtAmount=" + toString(debtPmt0.amount)) + " lendedAmt=") + toString(lendedAmt)))
384418 else {
385419 let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0)
386420 let lendedAmtAfter = (lendedAmt - debtPmt0.amount)
387421 [IntegerEntry(lendedAmountByAssetCodeKey, lendedAmtAfter), IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs - debtPmt0.amount)), StringEntry(("%s%s__rebalanceTrace__" + toBase58String(i.transactionId)), assetDataRebalanceTrace(debtorAssetCode, debtPmt0, basePmt1, lendedAmt, lendedAmtAfter))]
388422 }
389423 }
390424
391425
392426
393427 @Callable(i)
394428 func fulfillRedeemRequest (poolMakerAddress) = {
395429 let thisAddressStr = toString(this)
396430 let poolMakerUnlockHeightKey = keyFactoryPoolMakerUnlockHeight(thisAddressStr, poolMakerAddress)
397431 let poolMakerUnlockHeight = valueOrElse(getInteger(factoryAcc, poolMakerUnlockHeightKey), 0)
398432 if ((0 >= poolMakerUnlockHeight))
399433 then throw("All liquidity request fulfilled")
400434 else {
401435 let poolMakerLiquidityRequestKey = keyFactoryPoolMakerLiquidityRequest(thisAddressStr, poolMakerAddress, poolMakerUnlockHeight)
402436 let poolMakerLiquidityRequestAmount = valueOrErrorMessage(getInteger(factoryAcc, poolMakerLiquidityRequestKey), "Empty poolMakerLiquidityRequestKey at factory acc")
403437 if (isDefined(getInteger(this, poolMakerLiquidityRequestKey)))
404438 then throw("Liquidity request has been already fulfilled")
405439 else [IntegerEntry(poolMakerLiquidityRequestKey, poolMakerLiquidityRequestAmount), ScriptTransfer(factoryAcc, poolMakerLiquidityRequestAmount, baseAssetId)]
406440 }
407441 }
408442
409443
410444 @Verifier(tx)
411445 func verify () = match tx {
412446 case inv: InvokeScriptTransaction =>
413447 if ((inv.fee > (900 * 1000)))
414448 then throw(("fee amount is greater than max allowed: " + toString(inv.fee)))
415449 else if (isDefined(inv.feeAssetId))
416450 then throw("only Waves is allowed as feeAssetId")
417451 else if ((inv.function == "rebalanceDebts"))
418452 then {
419453 let invDappAddress = toString(addressFromRecipient(inv.dApp))
420454 if ((factoryReadAssetCfgByAddress(invDappAddress)[IdxDefoAssetStatus] != "ISSUED"))
421455 then throw("only defo dapp is allowed")
422456 else if ((invDappAddress == toString(this)))
423457 then throw("impossible to call self rebealnceDebt")
424458 else true
425459 }
426460 else if (if (if ((inv.function == "lockNeutrino"))
427461 then true
428462 else (inv.function == "lockNeutrinoSP"))
429463 then true
430464 else (inv.function == "unlockNeutrino"))
431465 then if ((toString(neutrinoStakingAcc) != toString(addressFromRecipient(inv.dApp))))
432466 then throw("invalid neutrino staking dapp address")
433467 else sigVerify(tx.bodyBytes, tx.proofs[0], factoryReadDefoStakingPacemakerPub())
434468 else throw("Not allowed invocation method calls")
435469 case _ =>
436470 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
437471 }
438472

github/deemru/w8io/026f985 
76.06 ms