tx · BHie8N5AfNPCmTNuZ9zB8yujpz2Eqh4DUL2c715TVgEH 3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu: -0.01400000 Waves 2020.11.03 13:01 [1248973] smart account 3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu > SELF 0.00000000 Waves
{ "type": 13, "id": "BHie8N5AfNPCmTNuZ9zB8yujpz2Eqh4DUL2c715TVgEH", "fee": 1400000, "feeAssetId": null, "timestamp": 1604397765678, "version": 1, "sender": "3N6BjePshL5deiUtAU9nXgEC2vGcK2anSsu", "senderPublicKey": "FBUTJS3qNBzn5vEveZKU8RYGzQXuXJ7HeRuXJQdkaE8f", "proofs": [ "2yTtdGHmn64WmNySqbjZM3Y7ybLXoLGsiQbVHUYn4RG137SnCnNNDnPt69bnJtQS1fcobvbrVP9dvzEF1ajLeZEb" ], "script": "base64:AAIEAAAAAAAAABMIAhIAEgASBAoCCAgSABIDCgEIAAAAYgEAAAARa2V5QWNjdW11bGF0ZWRGZWUAAAAAAgAAABIlc19fYWNjdW11bGF0ZWRGZWUBAAAADmtleVVjb2xsYXRlcmFsAAAAAAIAAAAPJXNfX3Vjb2xsYXRlcmFsAQAAABlrZXlUb3RhbExlbmRlZEF0T3RoZXJBY2NzAAAAAAIAAAAaJXNfX3RvdGFsTGVuZGVkQXRPdGhlckFjY3MBAAAAE2tleUFzc2V0TG9ja2VkVG90YWwAAAABAAAAB2Fzc2V0SWQJAAEsAAAAAgIAAAAYJXMlc19fYXNzZXRMb2NrZWRUb3RhbF9fBQAAAAdhc3NldElkAQAAABNrZXlBY2NvdW50T3BlcmF0aW9uAAAAAwAAAAx1bmxvY2tIZWlnaHQAAAAHYWRkcmVzcwAAAAZzdGF0dXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAB4lcyVzJWQlc19fZGVmb0Fzc2V0T3BlcmF0aW9uX18FAAAAB2FkZHJlc3MCAAAAAl9fCQABpAAAAAEFAAAADHVubG9ja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NrTmV1dHJpbm9TUAYJAAAAAAAAAggFAAAAA2ludgAAAAhmdW5jdGlvbgIAAAAOdW5sb2NrTmV1dHJpbm8DCQEAAAACIT0AAAACCQAEJQAAAAEFAAAAEm5ldXRyaW5vU3Rha2luZ0FjYwkABCUAAAABCQAEJAAAAAEIBQAAAANpbnYAAAAEZEFwcAkAAAIAAAABAgAAACVpbnZhbGlkIG5ldXRyaW5vIHN0YWtpbmcgZGFwcCBhZGRyZXNzCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkBAAAAImZhY3RvcnlSZWFkRGVmb1N0YWtpbmdQYWNlbWFrZXJQdWIAAAAACQAAAgAAAAECAAAAI05vdCBhbGxvd2VkIGludm9jYXRpb24gbWV0aG9kIGNhbGxzCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQG6mDs=", "chainId": 84, "height": 1248973, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 27HcWtP4XVTQLyDJjzUvUeosZUhqtR6B16bW3E8oY7V9 Next: CynvUJufzsSJRXGvws5crN7vnAWwSiiqXUpUBXjNUK6j Diff:
Old | New | Differences | |
---|---|---|---|
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyFactoryDefoStakingPacemakerPub () = "%s%s__commonConfig__defoStakingPacemakerPub" | |
78 | + | ||
79 | + | ||
80 | + | func keyFactoryPoolMakerLiquidityRequest (assetAddress,poolMakerAddress,h) = makeString(["%s%s%s%d%s__pool", assetAddress, poolMakerAddress, toString(h), "liquidityRequest"], "__") | |
81 | + | ||
82 | + | ||
83 | + | func keyFactoryPoolMakerUnlockHeight (assetAddress,poolMakerAddress) = makeString(["%s%s%s%s__pool", assetAddress, poolMakerAddress, "unlockHeight"], "__") | |
78 | 84 | ||
79 | 85 | ||
80 | 86 | func factoryReadDebtAssetId () = valueOrErrorMessage(getString(factoryAcc, keyFactoryDebtAssetId()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDebtAssetId())) | |
322 | 328 | let isSellBlockedByLastHeight = ((sellPriceLastHeight - sellPriceLastHeight) > 5) | |
323 | 329 | if (isBlocked) | |
324 | 330 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
325 | - | else if ((sellAssetCfg[IdxDefoAssetCode] == "NGN")) | |
326 | - | then throw("crossExchange for NGN is temporary disabled") | |
327 | - | else if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm)) | |
328 | - | then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm)) | |
329 | - | else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr)) | |
330 | - | then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr)) | |
331 | - | else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED")) | |
332 | - | then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus])) | |
333 | - | else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED")) | |
334 | - | then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus])) | |
335 | - | else if (isBlockedByLastHeight) | |
336 | - | then throw(((((("buy last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " buyCode=") + buyAssetCodeConfirm)) | |
337 | - | else if (isSellBlockedByLastHeight) | |
338 | - | then throw(((((("sell last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " sellCode=") + sellAssetCodeConfirm)) | |
339 | - | else { | |
340 | - | let buyAssetUsdPrice = getBuyPrice((weekendsPriceChangeCoefficient / 2)) | |
341 | - | let sellAssetUsdPrice = getSellPriceFrom(controlAccReadPrice(sellAssetCodeConfirm), (weekendsPriceChangeCoefficient / 2)) | |
342 | - | let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice) | |
343 | - | let usdnDebt = fraction(pmtAmount, priceDecimals, sellAssetUsdPrice) | |
344 | - | let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0) | |
345 | - | let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm) | |
346 | - | let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0) | |
347 | - | let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent]) | |
348 | - | let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100)) | |
349 | - | ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt))) | |
350 | - | } | |
331 | + | else if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm)) | |
332 | + | then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm)) | |
333 | + | else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr)) | |
334 | + | then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr)) | |
335 | + | else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED")) | |
336 | + | then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus])) | |
337 | + | else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED")) | |
338 | + | then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus])) | |
339 | + | else if (isBlockedByLastHeight) | |
340 | + | then throw(((((("buy last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " buyCode=") + buyAssetCodeConfirm)) | |
341 | + | else if (isSellBlockedByLastHeight) | |
342 | + | then throw(((((("sell last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " sellCode=") + sellAssetCodeConfirm)) | |
343 | + | else { | |
344 | + | let buyAssetUsdPrice = getBuyPrice((weekendsPriceChangeCoefficient / 2)) | |
345 | + | let sellAssetUsdPrice = getSellPriceFrom(controlAccReadPrice(sellAssetCodeConfirm), (weekendsPriceChangeCoefficient / 2)) | |
346 | + | let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice) | |
347 | + | let usdnDebt = fraction(pmtAmount, priceDecimals, sellAssetUsdPrice) | |
348 | + | let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0) | |
349 | + | let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm) | |
350 | + | let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0) | |
351 | + | let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent]) | |
352 | + | let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100)) | |
353 | + | ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt))) | |
354 | + | } | |
351 | 355 | } | |
352 | 356 | ||
353 | 357 | ||
385 | 389 | } | |
386 | 390 | ||
387 | 391 | ||
392 | + | ||
393 | + | @Callable(i) | |
394 | + | func fulfillRedeemRequest (poolMakerAddress) = { | |
395 | + | let thisAddressStr = toString(this) | |
396 | + | let poolMakerUnlockHeightKey = keyFactoryPoolMakerUnlockHeight(thisAddressStr, poolMakerAddress) | |
397 | + | let poolMakerUnlockHeight = valueOrElse(getInteger(factoryAcc, poolMakerUnlockHeightKey), 0) | |
398 | + | if ((0 >= poolMakerUnlockHeight)) | |
399 | + | then throw("All liquidity request fulfilled") | |
400 | + | else { | |
401 | + | let poolMakerLiquidityRequestKey = keyFactoryPoolMakerLiquidityRequest(thisAddressStr, poolMakerAddress, poolMakerUnlockHeight) | |
402 | + | let poolMakerLiquidityRequestAmount = valueOrErrorMessage(getInteger(factoryAcc, poolMakerLiquidityRequestKey), "Empty poolMakerLiquidityRequestKey at factory acc") | |
403 | + | if (isDefined(getInteger(this, poolMakerLiquidityRequestKey))) | |
404 | + | then throw("Liquidity request has been already fulfilled") | |
405 | + | else [IntegerEntry(poolMakerLiquidityRequestKey, poolMakerLiquidityRequestAmount), ScriptTransfer(factoryAcc, poolMakerLiquidityRequestAmount, baseAssetId)] | |
406 | + | } | |
407 | + | } | |
408 | + | ||
409 | + | ||
388 | 410 | @Verifier(tx) | |
389 | 411 | func verify () = match tx { | |
390 | 412 | case inv: InvokeScriptTransaction => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func keyAccumulatedFee () = "%s__accumulatedFee" | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func keyUcollateral () = "%s__ucollateral" | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func keyTotalLendedAtOtherAccs () = "%s__totalLendedAtOtherAccs" | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func keyAssetLockedTotal (assetId) = ("%s%s__assetLockedTotal__" + assetId) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func keyAccountOperation (unlockHeight,address,status) = ((((("%s%s%d%s__defoAssetOperation__" + address) + "__") + toString(unlockHeight)) + "__") + status) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func keyFactory () = "%s__factory" | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func keyLendedAmountByAssetCode (assetCode) = ("%s%s__lendedBaseAssetAmount__" + assetCode) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func keyPrice (assetCode) = ("%s%s__price__" + assetCode) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func keyControlLastHeight (assetCode) = ("%s%s__lastHeight__" + assetCode) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | let IdxOperationAmountIn = 1 | |
32 | 32 | ||
33 | 33 | let IdxOperationAssetIn = 2 | |
34 | 34 | ||
35 | 35 | let IdxOperationPrice = 3 | |
36 | 36 | ||
37 | 37 | let IdxOperationAmountOut = 4 | |
38 | 38 | ||
39 | 39 | let IdxOperationAssetOut = 5 | |
40 | 40 | ||
41 | 41 | 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)], "__") | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | 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)], "__") | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func assetReadSwapDataArrayOrFail (accOperationKey) = { | |
48 | 48 | let accOperationDataStr = valueOrErrorMessage(getString(this, accOperationKey), ("There is no request for passed arguments: " + accOperationKey)) | |
49 | 49 | split(accOperationDataStr, "__") | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | let nullInt = -1 | |
54 | 54 | ||
55 | 55 | let nullStr = "NULL" | |
56 | 56 | ||
57 | 57 | let factoryAcc = addressFromStringValue(valueOrErrorMessage(getString(this, keyFactory()), ((("No config at this=" + toString(this)) + " for key=") + keyFactory()))) | |
58 | 58 | ||
59 | 59 | func keyFactoryDebtAssetId () = "%s%s__commonConfig__debtAssetId" | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyFactoryDebtAssetEtalonBalance () = "%s%s__commonConfig__debtAssetEtalonBalance" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyFactoryAssetCfg (assetAddressStr) = (("%s%s%s__defoAsset__" + assetAddressStr) + "__config") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyFactoryAssetCurrentPool (assetAccAddress) = (("%s%s%s__defoAsset__" + toString(assetAccAddress)) + "__currentPool") | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyFactoryDefoAddressByAssetCode (assetCode) = (("%s%s%s__defoAsset__" + assetCode) + "__addressByAssetCode") | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func keyFactoryAssetPoolMakers (assetAddress) = (("%s%s%s__defoAsset__" + assetAddress) + "__poolMakers") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func keyFactoryDefoStakingPacemakerPub () = "%s%s__commonConfig__defoStakingPacemakerPub" | |
78 | + | ||
79 | + | ||
80 | + | func keyFactoryPoolMakerLiquidityRequest (assetAddress,poolMakerAddress,h) = makeString(["%s%s%s%d%s__pool", assetAddress, poolMakerAddress, toString(h), "liquidityRequest"], "__") | |
81 | + | ||
82 | + | ||
83 | + | func keyFactoryPoolMakerUnlockHeight (assetAddress,poolMakerAddress) = makeString(["%s%s%s%s__pool", assetAddress, poolMakerAddress, "unlockHeight"], "__") | |
78 | 84 | ||
79 | 85 | ||
80 | 86 | func factoryReadDebtAssetId () = valueOrErrorMessage(getString(factoryAcc, keyFactoryDebtAssetId()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDebtAssetId())) | |
81 | 87 | ||
82 | 88 | ||
83 | 89 | func factoryReadAssetCfgByAddress (assetAddressStr) = split(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetCfg(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetCfg(assetAddressStr))), "__") | |
84 | 90 | ||
85 | 91 | ||
86 | 92 | func factoryReadAssetCfgByCode (assetCode) = { | |
87 | 93 | let assetAddressStr = valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoAddressByAssetCode(assetCode)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoAddressByAssetCode(assetCode))) | |
88 | 94 | $Tuple2(assetAddressStr, factoryReadAssetCfgByAddress(assetAddressStr)) | |
89 | 95 | } | |
90 | 96 | ||
91 | 97 | ||
92 | 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))) | |
93 | 99 | ||
94 | 100 | ||
95 | 101 | func factoryReadDefoStakingPacemakerPub () = fromBase58String(valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoStakingPacemakerPub()), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoStakingPacemakerPub()))) | |
96 | 102 | ||
97 | 103 | ||
98 | 104 | let IdxDefoAssetCode = 1 | |
99 | 105 | ||
100 | 106 | let IdxDefoAssetId = 2 | |
101 | 107 | ||
102 | 108 | let IdxDefoAssetStatus = 3 | |
103 | 109 | ||
104 | 110 | let IdxPriceDecimals = 4 | |
105 | 111 | ||
106 | 112 | let IdxBaseAssetId = 5 | |
107 | 113 | ||
108 | 114 | let IdxOverCollateralPercent = 6 | |
109 | 115 | ||
110 | 116 | let IdxMinInitPool = 7 | |
111 | 117 | ||
112 | 118 | let IdxPriceOracleAddress = 8 | |
113 | 119 | ||
114 | 120 | let IdxMinBuyPayment = 9 | |
115 | 121 | ||
116 | 122 | let IdxMinSellPayment = 10 | |
117 | 123 | ||
118 | 124 | let IdxBuyLockInterval = 11 | |
119 | 125 | ||
120 | 126 | let IdxSellLockInterval = 12 | |
121 | 127 | ||
122 | 128 | let IdxBuyFeePercent = 13 | |
123 | 129 | ||
124 | 130 | let IdxSellFeePercent = 14 | |
125 | 131 | ||
126 | 132 | let IdxPoolRedemptionTimeout = 15 | |
127 | 133 | ||
128 | 134 | let IdxWeekendsPriceChangeCoefficient = 16 | |
129 | 135 | ||
130 | 136 | let thisCfgArray = factoryReadAssetCfgByAddress(toString(this)) | |
131 | 137 | ||
132 | 138 | let defoAssetCode = thisCfgArray[IdxDefoAssetCode] | |
133 | 139 | ||
134 | 140 | let defoAssetIdStr = thisCfgArray[IdxDefoAssetId] | |
135 | 141 | ||
136 | 142 | let defoAssetId = fromBase58String(defoAssetIdStr) | |
137 | 143 | ||
138 | 144 | let priceOracleAcc = addressFromStringValue(thisCfgArray[IdxPriceOracleAddress]) | |
139 | 145 | ||
140 | 146 | let overCollateralPercent = parseIntValue(thisCfgArray[IdxOverCollateralPercent]) | |
141 | 147 | ||
142 | 148 | let baseAssetIdStr = thisCfgArray[IdxBaseAssetId] | |
143 | 149 | ||
144 | 150 | let baseAssetId = fromBase58String(baseAssetIdStr) | |
145 | 151 | ||
146 | 152 | let priceDecimals = parseIntValue(thisCfgArray[IdxPriceDecimals]) | |
147 | 153 | ||
148 | 154 | let minBasicBuyAmount = parseIntValue(thisCfgArray[IdxMinBuyPayment]) | |
149 | 155 | ||
150 | 156 | let minSynthSellAmount = parseIntValue(thisCfgArray[IdxMinSellPayment]) | |
151 | 157 | ||
152 | 158 | let buyLockInterval = parseIntValue(thisCfgArray[IdxBuyLockInterval]) | |
153 | 159 | ||
154 | 160 | let sellLockInterval = parseIntValue(thisCfgArray[IdxSellLockInterval]) | |
155 | 161 | ||
156 | 162 | let buyFeePercent = parseIntValue(thisCfgArray[IdxBuyFeePercent]) | |
157 | 163 | ||
158 | 164 | let sellFeePercent = parseIntValue(thisCfgArray[IdxSellFeePercent]) | |
159 | 165 | ||
160 | 166 | let weekendsPriceChangeCoefficient = parseIntValue(thisCfgArray[IdxWeekendsPriceChangeCoefficient]) | |
161 | 167 | ||
162 | 168 | func keyIsBlocked () = "%s__isBlocked" | |
163 | 169 | ||
164 | 170 | ||
165 | 171 | func keyIsMarketOpened (assetCode) = ("%s%s__isMarketOpened__" + assetCode) | |
166 | 172 | ||
167 | 173 | ||
168 | 174 | let isBlocked = valueOrElse(getBoolean(priceOracleAcc, keyIsBlocked()), false) | |
169 | 175 | ||
170 | 176 | let isMarketOpened = valueOrElse(getBoolean(priceOracleAcc, keyIsMarketOpened(defoAssetCode)), false) | |
171 | 177 | ||
172 | 178 | func controlAccReadPrice (assetCode) = valueOrErrorMessage(getInteger(priceOracleAcc, keyPrice(assetCode)), ((("No price at priceOracle=" + toString(priceOracleAcc)) + " for key=") + keyPrice(assetCode))) | |
173 | 179 | ||
174 | 180 | ||
175 | 181 | func controlAccReadLastHeight (assetCode) = valueOrErrorMessage(getInteger(priceOracleAcc, keyControlLastHeight(assetCode)), ((("No lastHeight at priceOracle=" + toString(priceOracleAcc)) + " for key=") + keyControlLastHeight(assetCode))) | |
176 | 182 | ||
177 | 183 | ||
178 | 184 | func controlAccReadCurrIdxOrFail () = valueOrErrorMessage(getInteger(priceOracleAcc, "currIdx"), ("No currIdx at controlAcc=" + toString(priceOracleAcc))) | |
179 | 185 | ||
180 | 186 | ||
181 | 187 | func controlAccReadIdxHeight (idx) = { | |
182 | 188 | let idxHeightKey = ("idxHeight_" + toString(idx)) | |
183 | 189 | valueOrElse(getInteger(priceOracleAcc, idxHeightKey), 0) | |
184 | 190 | } | |
185 | 191 | ||
186 | 192 | ||
187 | 193 | func controlAccReadPriceByHeight (priceHeight) = { | |
188 | 194 | let priceByHeightKey = ("price_" + toString(priceHeight)) | |
189 | 195 | valueOrErrorMessage(getInteger(priceOracleAcc, priceByHeightKey), ((("No " + priceByHeightKey) + " at controlAcc=") + toString(priceOracleAcc))) | |
190 | 196 | } | |
191 | 197 | ||
192 | 198 | ||
193 | 199 | let priceLastHeight = controlAccReadLastHeight(defoAssetCode) | |
194 | 200 | ||
195 | 201 | let isBlockedByLastHeight = ((priceLastHeight - priceLastHeight) > 5) | |
196 | 202 | ||
197 | 203 | let keyDefoStakingAddress = "%s%s__commonConfig__defoStakingAddress" | |
198 | 204 | ||
199 | 205 | let keyNeutrinoStakingAddress = "%s%s__commonConfig__neutrinoStakingAddress" | |
200 | 206 | ||
201 | 207 | func keyDefoStakingAssetBalance (assetId) = ("%s%s__stakingBalance__" + assetId) | |
202 | 208 | ||
203 | 209 | ||
204 | 210 | func keyNeutrinoStakingBalance () = ((("rpd_balance_" + baseAssetIdStr) + "_") + toString(this)) | |
205 | 211 | ||
206 | 212 | ||
207 | 213 | let defoStakingAcc = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyDefoStakingAddress), ((("No config at factoryAcc" + toString(factoryAcc)) + " for key=") + keyDefoStakingAddress))), ("address extraction error for key=" + keyDefoStakingAddress)) | |
208 | 214 | ||
209 | 215 | let neutrinoStakingAcc = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(factoryAcc, keyNeutrinoStakingAddress), ((("No config at factoryAcc" + toString(factoryAcc)) + " for key=") + keyNeutrinoStakingAddress))), ("address extraction error for key=" + keyNeutrinoStakingAddress)) | |
210 | 216 | ||
211 | 217 | func getThisDefoStakingBalance () = valueOrElse(getInteger(defoStakingAcc, keyDefoStakingAssetBalance(defoAssetIdStr)), 0) | |
212 | 218 | ||
213 | 219 | ||
214 | 220 | func getThisNeutrinoStakingBalance () = valueOrElse(getInteger(neutrinoStakingAcc, keyNeutrinoStakingBalance()), 0) | |
215 | 221 | ||
216 | 222 | ||
217 | 223 | let ucollateral = valueOrElse(getInteger(this, keyUcollateral()), 0) | |
218 | 224 | ||
219 | 225 | let accumulatedFee = valueOrElse(getInteger(this, keyAccumulatedFee()), 0) | |
220 | 226 | ||
221 | 227 | let currPoolAmount = getIntegerValue(factoryAcc, keyFactoryAssetCurrentPool(this)) | |
222 | 228 | ||
223 | 229 | let debtAssetId = fromBase58String(factoryReadDebtAssetId()) | |
224 | 230 | ||
225 | 231 | let debtAssetEtalonBalance = getIntegerValue(factoryAcc, keyFactoryDebtAssetEtalonBalance()) | |
226 | 232 | ||
227 | 233 | let lendedOrDebtAmount = (debtAssetEtalonBalance - assetBalance(this, debtAssetId)) | |
228 | 234 | ||
229 | 235 | let currentBaseAssetBalance = ((assetBalance(this, baseAssetId) + getThisNeutrinoStakingBalance()) + lendedOrDebtAmount) | |
230 | 236 | ||
231 | 237 | let controlPrice = controlAccReadPrice(thisCfgArray[IdxDefoAssetCode]) | |
232 | 238 | ||
233 | 239 | let emission = (value(assetInfo(defoAssetId)).quantity - assetBalance(this, defoAssetId)) | |
234 | 240 | ||
235 | 241 | func getBuyPrice (changeCoeff) = if (isMarketOpened) | |
236 | 242 | then controlPrice | |
237 | 243 | else fraction((priceDecimals - changeCoeff), controlPrice, priceDecimals) | |
238 | 244 | ||
239 | 245 | ||
240 | 246 | func getSellPrice (changeCoeff) = if (isMarketOpened) | |
241 | 247 | then controlPrice | |
242 | 248 | else fraction((priceDecimals + changeCoeff), controlPrice, priceDecimals) | |
243 | 249 | ||
244 | 250 | ||
245 | 251 | func getSellPriceFrom (fromPrice,changeCoeff) = if (isMarketOpened) | |
246 | 252 | then fromPrice | |
247 | 253 | else fraction((priceDecimals + changeCoeff), fromPrice, priceDecimals) | |
248 | 254 | ||
249 | 255 | ||
250 | 256 | func internalBuyAsset (sellerAddr,sellAmt,sellAssetId,minSellAmt,buy2sellPrice,feePercent) = { | |
251 | 257 | let defoAssetAmountGross = fraction(sellAmt, buy2sellPrice, priceDecimals) | |
252 | 258 | let defoAssetAmount = fraction((priceDecimals - feePercent), defoAssetAmountGross, priceDecimals) | |
253 | 259 | let feeAmount = (defoAssetAmountGross - defoAssetAmount) | |
254 | 260 | let requiredBasicAssetAmount = fraction(defoAssetAmountGross, priceDecimals, buy2sellPrice) | |
255 | 261 | let change = (sellAmt - requiredBasicAssetAmount) | |
256 | 262 | if (if ((minSellAmt > sellAmt)) | |
257 | 263 | then (toString(sellerAddr) != toString(defoStakingAcc)) | |
258 | 264 | else false) | |
259 | 265 | then throw(((((("impossible to issue new " + defoAssetCode) + ": payment=") + toString(sellAmt)) + "is less then min amount=") + toString(minSellAmt))) | |
260 | 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) | |
261 | 267 | } | |
262 | 268 | ||
263 | 269 | ||
264 | 270 | @Callable(i) | |
265 | 271 | func buyAsset () = { | |
266 | 272 | let pmt = value(i.payments[0]) | |
267 | 273 | let pmtAssetId = value(pmt.assetId) | |
268 | 274 | if (isBlocked) | |
269 | 275 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
270 | 276 | else if (isBlockedByLastHeight) | |
271 | 277 | then throw(((("last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height))) | |
272 | 278 | else if ((pmtAssetId != baseAssetId)) | |
273 | 279 | then throw(((("Payment asset id doesn't match basic asset: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(pmtAssetId))) | |
274 | 280 | else internalBuyAsset(i.caller, pmt.amount, pmtAssetId, minBasicBuyAmount, getBuyPrice(weekendsPriceChangeCoefficient), buyFeePercent)._1 | |
275 | 281 | } | |
276 | 282 | ||
277 | 283 | ||
278 | 284 | ||
279 | 285 | @Callable(i) | |
280 | 286 | func sellAsset () = { | |
281 | 287 | let pmt = value(i.payments[0]) | |
282 | 288 | let pmtAsset = value(pmt.assetId) | |
283 | 289 | let callerAddress = toString(i.caller) | |
284 | 290 | let sellPrice = getSellPrice(weekendsPriceChangeCoefficient) | |
285 | 291 | if (isBlocked) | |
286 | 292 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
287 | 293 | else if (isBlockedByLastHeight) | |
288 | 294 | then throw(((("last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height))) | |
289 | 295 | else if ((pmtAsset != defoAssetId)) | |
290 | 296 | then throw(((("Invalid payment asset id: expected=" + toBase58String(defoAssetId)) + " actual=") + toBase58String(pmtAsset))) | |
291 | 297 | else if ((minSynthSellAmount > pmt.amount)) | |
292 | 298 | then throw(((("Payment amount less then mininimal allowed: paymentAmount=" + toString(pmt.amount)) + " minAmount=") + toString(minSynthSellAmount))) | |
293 | 299 | else { | |
294 | 300 | let baseAssetAmountNoBalanceLimit = fraction(pmt.amount, priceDecimals, sellPrice) | |
295 | 301 | let baseAssetAmountAvailable = if ((baseAssetAmountNoBalanceLimit > currentBaseAssetBalance)) | |
296 | 302 | then currentBaseAssetBalance | |
297 | 303 | else baseAssetAmountNoBalanceLimit | |
298 | 304 | let soldDefoAssetAmountGross = fraction(baseAssetAmountAvailable, sellPrice, priceDecimals) | |
299 | 305 | let change = (pmt.amount - soldDefoAssetAmountGross) | |
300 | 306 | let defoAmountFee = fraction(sellFeePercent, soldDefoAssetAmountGross, priceDecimals) | |
301 | 307 | let soldDefoAssetAmount = (soldDefoAssetAmountGross - defoAmountFee) | |
302 | 308 | let baseAssetAmountToSend = fraction(soldDefoAssetAmount, priceDecimals, sellPrice) | |
303 | 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))] | |
304 | 310 | } | |
305 | 311 | } | |
306 | 312 | ||
307 | 313 | ||
308 | 314 | ||
309 | 315 | @Callable(i) | |
310 | 316 | func crossExchange (buyAssetCodeConfirm,sellAssetCodeConfirm) = { | |
311 | 317 | let pmt = value(i.payments[0]) | |
312 | 318 | let pmtAsset = value(pmt.assetId) | |
313 | 319 | let pmtAssetStr = toBase58String(pmtAsset) | |
314 | 320 | let pmtAmount = pmt.amount | |
315 | 321 | let callerAddress = toString(i.caller) | |
316 | 322 | let buyAssetCfg = thisCfgArray | |
317 | 323 | let sellAssetTuple = factoryReadAssetCfgByCode(sellAssetCodeConfirm) | |
318 | 324 | let sellAssetCfg = sellAssetTuple._2 | |
319 | 325 | let sellAssetAccAddress = valueOrErrorMessage(addressFromString(sellAssetTuple._1), ("couldn't parse address from string for assetCode=" + sellAssetCodeConfirm)) | |
320 | 326 | let minSellPmt = valueOrErrorMessage(parseInt(sellAssetCfg[IdxMinSellPayment]), ("minSellPmt parsing error: rawVal=" + sellAssetCfg[IdxMinSellPayment])) | |
321 | 327 | let sellPriceLastHeight = controlAccReadLastHeight(sellAssetCodeConfirm) | |
322 | 328 | let isSellBlockedByLastHeight = ((sellPriceLastHeight - sellPriceLastHeight) > 5) | |
323 | 329 | if (isBlocked) | |
324 | 330 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
325 | - | else if ((sellAssetCfg[IdxDefoAssetCode] == "NGN")) | |
326 | - | then throw("crossExchange for NGN is temporary disabled") | |
327 | - | else if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm)) | |
328 | - | then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm)) | |
329 | - | else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr)) | |
330 | - | then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr)) | |
331 | - | else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED")) | |
332 | - | then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus])) | |
333 | - | else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED")) | |
334 | - | then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus])) | |
335 | - | else if (isBlockedByLastHeight) | |
336 | - | then throw(((((("buy last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " buyCode=") + buyAssetCodeConfirm)) | |
337 | - | else if (isSellBlockedByLastHeight) | |
338 | - | then throw(((((("sell last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " sellCode=") + sellAssetCodeConfirm)) | |
339 | - | else { | |
340 | - | let buyAssetUsdPrice = getBuyPrice((weekendsPriceChangeCoefficient / 2)) | |
341 | - | let sellAssetUsdPrice = getSellPriceFrom(controlAccReadPrice(sellAssetCodeConfirm), (weekendsPriceChangeCoefficient / 2)) | |
342 | - | let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice) | |
343 | - | let usdnDebt = fraction(pmtAmount, priceDecimals, sellAssetUsdPrice) | |
344 | - | let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0) | |
345 | - | let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm) | |
346 | - | let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0) | |
347 | - | let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent]) | |
348 | - | let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100)) | |
349 | - | ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt))) | |
350 | - | } | |
331 | + | else if ((thisCfgArray[IdxDefoAssetCode] != buyAssetCodeConfirm)) | |
332 | + | then throw(((("buyAsset confirmation failed: buyAssetIdConfirm=" + thisCfgArray[IdxDefoAssetCode]) + " BUT buyAssetId=") + buyAssetCodeConfirm)) | |
333 | + | else if ((sellAssetCfg[IdxDefoAssetId] != pmtAssetStr)) | |
334 | + | then throw(((("sellAsset confirmation failed: sellAssetIdConfirm=" + sellAssetCfg[IdxDefoAssetId]) + "BUT pmtAsset=") + pmtAssetStr)) | |
335 | + | else if ((thisCfgArray[IdxDefoAssetStatus] != "ISSUED")) | |
336 | + | then throw(((("toAsset has not been issued yet: buyAssetId=" + buyAssetCodeConfirm) + " BUT status=") + thisCfgArray[IdxDefoAssetStatus])) | |
337 | + | else if ((sellAssetCfg[IdxDefoAssetStatus] != "ISSUED")) | |
338 | + | then throw(((("fromAssetCfg has not been issued yet: sellAssetId=" + pmtAssetStr) + " BUT status=") + sellAssetCfg[IdxDefoAssetStatus])) | |
339 | + | else if (isBlockedByLastHeight) | |
340 | + | then throw(((((("buy last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " buyCode=") + buyAssetCodeConfirm)) | |
341 | + | else if (isSellBlockedByLastHeight) | |
342 | + | then throw(((((("sell last price finalization has been more then 5 blocks ago: priceLastHeight=" + toString(priceLastHeight)) + " currHeight=") + toString(height)) + " sellCode=") + sellAssetCodeConfirm)) | |
343 | + | else { | |
344 | + | let buyAssetUsdPrice = getBuyPrice((weekendsPriceChangeCoefficient / 2)) | |
345 | + | let sellAssetUsdPrice = getSellPriceFrom(controlAccReadPrice(sellAssetCodeConfirm), (weekendsPriceChangeCoefficient / 2)) | |
346 | + | let buy2sellPrice = fraction(buyAssetUsdPrice, priceDecimals, sellAssetUsdPrice) | |
347 | + | let usdnDebt = fraction(pmtAmount, priceDecimals, sellAssetUsdPrice) | |
348 | + | let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0) | |
349 | + | let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(sellAssetCodeConfirm) | |
350 | + | let lendedAmtByAssetCode = valueOrElse(getInteger(this, lendedAmountByAssetCodeKey), 0) | |
351 | + | let sellAssetSellFeePercent = parseIntValue(sellAssetCfg[IdxSellFeePercent]) | |
352 | + | let buyAssetResult = internalBuyAsset(i.caller, pmtAmount, pmtAsset, minSellPmt, buy2sellPrice, fraction((buyFeePercent + sellAssetSellFeePercent), 50, 100)) | |
353 | + | ((((buyAssetResult._1 :+ ScriptTransfer(sellAssetAccAddress, usdnDebt, debtAssetId)) :+ ScriptTransfer(sellAssetAccAddress, (pmtAmount - buyAssetResult._2), pmtAsset)) :+ IntegerEntry(lendedAmountByAssetCodeKey, (lendedAmtByAssetCode + usdnDebt))) :+ IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs + usdnDebt))) | |
354 | + | } | |
351 | 355 | } | |
352 | 356 | ||
353 | 357 | ||
354 | 358 | ||
355 | 359 | @Callable(i) | |
356 | 360 | func rebalanceDebts () = { | |
357 | 361 | let debtPmt0 = value(i.payments[0]) | |
358 | 362 | let debtPmtAsset0 = value(debtPmt0.assetId) | |
359 | 363 | let basePmt1 = value(i.payments[1]) | |
360 | 364 | let basePmtAsset1 = value(basePmt1.assetId) | |
361 | 365 | let debtorAddress = toString(i.caller) | |
362 | 366 | let debtorAssetCfg = factoryReadAssetCfgByAddress(debtorAddress) | |
363 | 367 | let debtorAssetCode = debtorAssetCfg[IdxDefoAssetCode] | |
364 | 368 | let lendedAmountByAssetCodeKey = keyLendedAmountByAssetCode(debtorAssetCode) | |
365 | 369 | let lendedAmt = valueOrErrorMessage(getInteger(this, lendedAmountByAssetCodeKey), ("No debts for " + debtorAssetCode)) | |
366 | 370 | if (isBlocked) | |
367 | 371 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
368 | 372 | else if ((debtAssetId != debtPmtAsset0)) | |
369 | 373 | then throw(((("invalid debt asset id in the first paymet: expected=" + toBase58String(debtAssetId)) + " actual=") + toBase58String(debtPmtAsset0))) | |
370 | 374 | else if ((baseAssetId != basePmtAsset1)) | |
371 | 375 | then throw(((("invalid base asset id in the second payment: expected=" + toBase58String(baseAssetId)) + " actual=") + toBase58String(basePmtAsset1))) | |
372 | 376 | else if ((debtPmt0.amount != basePmt1.amount)) | |
373 | 377 | then throw("first payment amount doesn't match to the second payment amount") | |
374 | 378 | else if ((0 >= lendedAmt)) | |
375 | 379 | then throw(("lendedAmt is less then zero: lendedAmt=" + toString(lendedAmt))) | |
376 | 380 | else if (((100 * priceDecimals) >= debtPmt0.amount)) | |
377 | 381 | then throw(("attached payment must be greater then 100: pmt0.amount=" + toString(debtPmt0.amount))) | |
378 | 382 | else if ((debtPmt0.amount > lendedAmt)) | |
379 | 383 | then throw(((("attached payment is grater than required: pmtAmount=" + toString(debtPmt0.amount)) + " lendedAmt=") + toString(lendedAmt))) | |
380 | 384 | else { | |
381 | 385 | let totalLendedAtOtherAccs = valueOrElse(getInteger(this, keyTotalLendedAtOtherAccs()), 0) | |
382 | 386 | let lendedAmtAfter = (lendedAmt - debtPmt0.amount) | |
383 | 387 | [IntegerEntry(lendedAmountByAssetCodeKey, lendedAmtAfter), IntegerEntry(keyTotalLendedAtOtherAccs(), (totalLendedAtOtherAccs - debtPmt0.amount)), StringEntry(("%s%s__rebalanceTrace__" + toBase58String(i.transactionId)), assetDataRebalanceTrace(debtorAssetCode, debtPmt0, basePmt1, lendedAmt, lendedAmtAfter))] | |
384 | 388 | } | |
385 | 389 | } | |
386 | 390 | ||
387 | 391 | ||
392 | + | ||
393 | + | @Callable(i) | |
394 | + | func fulfillRedeemRequest (poolMakerAddress) = { | |
395 | + | let thisAddressStr = toString(this) | |
396 | + | let poolMakerUnlockHeightKey = keyFactoryPoolMakerUnlockHeight(thisAddressStr, poolMakerAddress) | |
397 | + | let poolMakerUnlockHeight = valueOrElse(getInteger(factoryAcc, poolMakerUnlockHeightKey), 0) | |
398 | + | if ((0 >= poolMakerUnlockHeight)) | |
399 | + | then throw("All liquidity request fulfilled") | |
400 | + | else { | |
401 | + | let poolMakerLiquidityRequestKey = keyFactoryPoolMakerLiquidityRequest(thisAddressStr, poolMakerAddress, poolMakerUnlockHeight) | |
402 | + | let poolMakerLiquidityRequestAmount = valueOrErrorMessage(getInteger(factoryAcc, poolMakerLiquidityRequestKey), "Empty poolMakerLiquidityRequestKey at factory acc") | |
403 | + | if (isDefined(getInteger(this, poolMakerLiquidityRequestKey))) | |
404 | + | then throw("Liquidity request has been already fulfilled") | |
405 | + | else [IntegerEntry(poolMakerLiquidityRequestKey, poolMakerLiquidityRequestAmount), ScriptTransfer(factoryAcc, poolMakerLiquidityRequestAmount, baseAssetId)] | |
406 | + | } | |
407 | + | } | |
408 | + | ||
409 | + | ||
388 | 410 | @Verifier(tx) | |
389 | 411 | func verify () = match tx { | |
390 | 412 | case inv: InvokeScriptTransaction => | |
391 | 413 | if ((inv.fee > (900 * 1000))) | |
392 | 414 | then throw(("fee amount is greater than max allowed: " + toString(inv.fee))) | |
393 | 415 | else if (isDefined(inv.feeAssetId)) | |
394 | 416 | then throw("only Waves is allowed as feeAssetId") | |
395 | 417 | else if ((inv.function == "rebalanceDebts")) | |
396 | 418 | then { | |
397 | 419 | let invDappAddress = toString(addressFromRecipient(inv.dApp)) | |
398 | 420 | if ((factoryReadAssetCfgByAddress(invDappAddress)[IdxDefoAssetStatus] != "ISSUED")) | |
399 | 421 | then throw("only defo dapp is allowed") | |
400 | 422 | else if ((invDappAddress == toString(this))) | |
401 | 423 | then throw("impossible to call self rebealnceDebt") | |
402 | 424 | else true | |
403 | 425 | } | |
404 | 426 | else if (if (if ((inv.function == "lockNeutrino")) | |
405 | 427 | then true | |
406 | 428 | else (inv.function == "lockNeutrinoSP")) | |
407 | 429 | then true | |
408 | 430 | else (inv.function == "unlockNeutrino")) | |
409 | 431 | then if ((toString(neutrinoStakingAcc) != toString(addressFromRecipient(inv.dApp)))) | |
410 | 432 | then throw("invalid neutrino staking dapp address") | |
411 | 433 | else sigVerify(tx.bodyBytes, tx.proofs[0], factoryReadDefoStakingPacemakerPub()) | |
412 | 434 | else throw("Not allowed invocation method calls") | |
413 | 435 | case _ => | |
414 | 436 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
415 | 437 | } | |
416 | 438 |
github/deemru/w8io/026f985 51.74 ms ◑