tx · AQJ7Zrp7GS9nYjJoXJfZVRRgRfHBTmufx9EeaeUXLaov 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj: -0.04200000 Waves 2023.03.28 07:49 [2509345] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves
{ "type": 13, "id": "AQJ7Zrp7GS9nYjJoXJfZVRRgRfHBTmufx9EeaeUXLaov", "fee": 4200000, "feeAssetId": null, "timestamp": 1679979001827, "version": 2, "chainId": 84, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "3oZ6ULgtdnLZsrRtW1ApQRgnv3YBAwLKUKqp7FWGqSkUQ9tQSxJMrTTTy5PSHFVw9sXEDu8cS464iGyyBNg1CtC5", "4kW9SEFaQi4tC3GHppiCJZxzf5zb6ZGHBhEWGNwoUy7Ks8DBjiWeaJxoonABDmSHwxS67QRBmZpxz1k8dBMcXXDr", "3DJhe1nHoGW82Z1WJ3LoGpLEcPoLCpQD9F6xTBPFH6r8jqnuJEHoSpCHXMxuABDnP6yHPNq3zyFTTMmexNvn6gxb" ], "script": "base64:BgJjCAISDgoMCAgICAgIAQEBAQEBEgUKAwgIARIHCgUYAQEBARIAEgASBAoCCAESBQoDCAEIEgMKAQESBAoCAQgSABIFCgMIAQESBAoCAQESBAoCCAESBgoECAEBCBIGCgQICAEBuAEBD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQVsY2FsYwEBbAkAuQgBBQFsAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVs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leUFkbWluc0xpc3QAAgABAAADCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwADCQDZBAEJAJEDAgUQcHViS2V5QWRtaW5zTGlzdAADAAIAAAMDBQlpc0Jsb2NrZWQJAAACCQERQGV4dHJOYXRpdmUoMTA1MykCBQ9jb250cm9sQ29udHJhY3QCEWlzX2Jsb2NrZWRfY2FsbGVyCQClCAEFC2dvdkNvbnRyYWN0BwkBDnZhbGlkYXRlVXBkYXRlAQUCdHgEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACFVNwb25zb3JGZWVUcmFuc2FjdGlvbgQJc3BvbnNvclR4BQckbWF0Y2gwAwkBG2NoZWNrSXNWYWxpZE1pblNwb25zb3JlZEZlZQEFCXNwb25zb3JUeAkAZwIFBWNvdW50AAMHCQBnAgUFY291bnQAAxDUBcM=", "height": 2509345, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5SCn7iV7KEbqt5TrKx39Kxsox49yM92aEtpL1qhmD3Ag Next: AvNrG9CVaJFj6kotychDAMghmhwuteNvXQXQompHiRyE Diff:
Old | New | Differences | |
---|---|---|---|
82 | 82 | let MULT6 = 1000000 | |
83 | 83 | ||
84 | 84 | let DEFAULTSWAPFEE = 20000 | |
85 | + | ||
86 | + | let DEFAULTBURNFEE = 5000 | |
87 | + | ||
88 | + | let DEFAULTMAXFEE = 150000 | |
85 | 89 | ||
86 | 90 | let BRPROTECTED = 100000 | |
87 | 91 | ||
210 | 214 | ||
211 | 215 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
212 | 216 | ||
217 | + | let BasketOutFeePartKey = "multiOut_swap_feePart" | |
218 | + | ||
213 | 219 | func keyNodeRegistry (address) = ("%s__" + address) | |
214 | 220 | ||
215 | 221 | ||
296 | 302 | func keyPriceByAsset (assetId) = ("%s%s%s__common__priceByAsset__" + assetId) | |
297 | 303 | ||
298 | 304 | ||
305 | + | func maxFeeKey () = "%s%s__common__maxAllowedFee" | |
306 | + | ||
307 | + | ||
308 | + | func multiOutFeeREAD () = valueOrElse(getInteger(BasketOutFeePartKey), valueOrElse(getInteger(WavesOutFeePartKey), DEFAULTBURNFEE)) | |
309 | + | ||
310 | + | ||
299 | 311 | func minSwapAmountREAD (swapType,assetId) = if ((swapType == "outMulti")) | |
300 | 312 | then valueOrElse(getInteger(MinNeutrinoSwapAmountKey), getNumberByKey(LegacyMinNeutrinoSwapAmountKey)) | |
301 | 313 | else getNumberByKey(MinTokenSwapAmountKey(assetId)) | |
370 | 382 | then MULT8 | |
371 | 383 | else (neutrinoPrice * 100)) | |
372 | 384 | let multiplier = ((MULT6 + d6) - pp6) | |
373 | - | let netAmount = fraction(outAmountGross, multiplier, MULT6) | |
374 | - | let feeAmount = if ((netAmount >= outAmountGross)) | |
375 | - | then 0 | |
376 | - | else (outAmountGross - netAmount) | |
377 | - | [outAmountGross, netAmount, feeAmount] | |
385 | + | if ((0 >= multiplier)) | |
386 | + | then throw(("Non-positive multiplier = " + toString(multiplier))) | |
387 | + | else { | |
388 | + | let discounted = fraction(outAmountGross, multiplier, MULT6) | |
389 | + | let masterFee = valueOrElse(getInteger(NeutrinoOutFeePartKey), DEFAULTSWAPFEE) | |
390 | + | let feeAmount = fraction(discounted, masterFee, MULT6) | |
391 | + | [discounted, (discounted - feeAmount), feeAmount, multiplier] | |
392 | + | } | |
378 | 393 | } | |
379 | 394 | ||
380 | 395 | ||
381 | 396 | func convertNeutrinoToBasket (amount,basketInfoStr,neutrinoSupply) = { | |
382 | 397 | let basketInfo = split_4C(basketInfoStr, "_") | |
398 | + | let k6 = value(getInteger(basketKKey())) | |
399 | + | let d6 = value(getInteger(basketDKey())) | |
400 | + | let outPart = (MULT6 - fraction(k6, d6, MULT6)) | |
383 | 401 | func conv (acc,item) = { | |
384 | 402 | let parts = split(item, LISTSEP) | |
385 | 403 | let assetId = parts[0] | |
389 | 407 | if ((neutrinoSupply == 0)) | |
390 | 408 | then throw("Attempt to burn neutrino at zero supply") | |
391 | 409 | else { | |
392 | - | let outAmount = fraction(amount, reserv, neutrinoSupply) | |
410 | + | let outAmount = fraction(fraction(amount, reserv, neutrinoSupply), outPart, MULT6) | |
393 | 411 | let wavesTuple = if ((assetId == "WAVES")) | |
394 | 412 | then $Tuple2(outAmount, price) | |
395 | 413 | else $Tuple2(acc._2, acc._3) | |
504 | 522 | ||
505 | 523 | ||
506 | 524 | func applyFeesBasket (basketOut) = { | |
507 | - | let k6 = value(getInteger(basketKKey())) | |
508 | - | let d6 = value(getInteger(basketDKey())) | |
509 | - | let feePart = fraction(k6, d6, MULT6) | |
525 | + | let feePart = multiOutFeeREAD() | |
510 | 526 | func feeApplier (acc,item) = { | |
511 | 527 | let feeAmount = fraction(item._2, feePart, MULT6) | |
512 | 528 | (acc :+ makeString([item._1, toString(item._3), toString((item._2 - feeAmount)), toString(feeAmount), toString(item._4)], LISTSEP)) | |
627 | 643 | let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo]) | |
628 | 644 | let weightedPrice = asInt(neutrinoMetrics[nMetricWeightedPrice]) | |
629 | 645 | let out = convertBasketItemToNeutrino(pmtAmount, inAsset, basketInfo, weightedPrice) | |
646 | + | let maxFee = valueOrElse(getInteger(maxFeeKey()), DEFAULTMAXFEE) | |
630 | 647 | if (if ((swapType == "outNeutrino")) | |
631 | - | then ( | |
648 | + | then ((MULT6 - maxFee) > out[3]) | |
632 | 649 | else false) | |
633 | - | then throw(( | |
650 | + | then throw(("Max allowed fee exceeded, multiplier = " + toString(out[3]))) | |
634 | 651 | else { | |
635 | 652 | let leasePart = if (if ((swapType == "outNeutrino")) | |
636 | 653 | then (inAsset == "WAVES") | |
1024 | 1041 | if ((i.callerPublicKey != mngPub)) | |
1025 | 1042 | then throw("approveLeasings not authorized") | |
1026 | 1043 | else { | |
1027 | - | let $ | |
1028 | - | let nAddr0 = $ | |
1029 | - | let lAmtKEY0 = $ | |
1030 | - | let lAmt0 = $ | |
1031 | - | let lIdKEY0 = $ | |
1032 | - | let lId0 = $ | |
1044 | + | let $t04534345405 = readNodeInfo(0) | |
1045 | + | let nAddr0 = $t04534345405._1 | |
1046 | + | let lAmtKEY0 = $t04534345405._2 | |
1047 | + | let lAmt0 = $t04534345405._3 | |
1048 | + | let lIdKEY0 = $t04534345405._4 | |
1049 | + | let lId0 = $t04534345405._5 | |
1033 | 1050 | let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount))) | |
1034 | 1051 | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
1035 | 1052 | if ((validation == validation)) | |
1074 | 1091 | then throw("rebalanceLeasings not authorized") | |
1075 | 1092 | else { | |
1076 | 1093 | let unleaseAmt = ((amount / size(nList)) + 1) | |
1077 | - | let $ | |
1078 | - | let nAddr0 = $ | |
1079 | - | let lAmtKEY0 = $ | |
1080 | - | let lAmt0 = $ | |
1081 | - | let lIdKEY0 = $ | |
1082 | - | let lId0 = $ | |
1094 | + | let $t04664546707 = readNodeInfo(0) | |
1095 | + | let nAddr0 = $t04664546707._1 | |
1096 | + | let lAmtKEY0 = $t04664546707._2 | |
1097 | + | let lAmt0 = $t04664546707._3 | |
1098 | + | let lIdKEY0 = $t04664546707._4 | |
1099 | + | let lId0 = $t04664546707._5 | |
1083 | 1100 | let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList)))) | |
1084 | 1101 | func forEachNodeDoUnlease (a,i) = { | |
1085 | 1102 | let node = nList[i] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func lcalc (l) = calculateLeaseId(l) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func asAnyList (v) = match v { | |
29 | 29 | case l: List[Any] => | |
30 | 30 | l | |
31 | 31 | case _ => | |
32 | 32 | throw("fail to cast into List[Any]") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func asString (v) = match v { | |
37 | 37 | case s: String => | |
38 | 38 | s | |
39 | 39 | case _ => | |
40 | 40 | throw("fail to cast into String") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func asInt (v) = match v { | |
45 | 45 | case i: Int => | |
46 | 46 | i | |
47 | 47 | case _ => | |
48 | 48 | throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func asBytes (val) = match val { | |
53 | 53 | case valByte: ByteVector => | |
54 | 54 | valByte | |
55 | 55 | case _ => | |
56 | 56 | throw("fail to cast into ByteVector") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func asPayment (v) = match v { | |
61 | 61 | case p: AttachedPayment => | |
62 | 62 | p | |
63 | 63 | case _ => | |
64 | 64 | throw("fail to cast into AttachedPayment") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func asSwapParamsSTRUCT (v) = match v { | |
69 | 69 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
70 | 70 | struct | |
71 | 71 | case _ => | |
72 | 72 | throw("fail to cast into Tuple5 ints") | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | let SEP = "__" | |
77 | 77 | ||
78 | 78 | let LISTSEP = ":" | |
79 | 79 | ||
80 | 80 | let MULT8 = 100000000 | |
81 | 81 | ||
82 | 82 | let MULT6 = 1000000 | |
83 | 83 | ||
84 | 84 | let DEFAULTSWAPFEE = 20000 | |
85 | + | ||
86 | + | let DEFAULTBURNFEE = 5000 | |
87 | + | ||
88 | + | let DEFAULTMAXFEE = 150000 | |
85 | 89 | ||
86 | 90 | let BRPROTECTED = 100000 | |
87 | 91 | ||
88 | 92 | let WAVESID = base58'WAVES' | |
89 | 93 | ||
90 | 94 | let nMetricIdxPrice = 0 | |
91 | 95 | ||
92 | 96 | let nMetricIdxUsdnLockedBalance = 1 | |
93 | 97 | ||
94 | 98 | let nMetricIdxWavesLockedBalance = 2 | |
95 | 99 | ||
96 | 100 | let nMetricIdxReserve = 3 | |
97 | 101 | ||
98 | 102 | let nMetricIdxReserveInUsdn = 4 | |
99 | 103 | ||
100 | 104 | let nMetricIdxUsdnSupply = 5 | |
101 | 105 | ||
102 | 106 | let nMetricIdxSurplus = 6 | |
103 | 107 | ||
104 | 108 | let nMetricIdxSurplusPercent = 7 | |
105 | 109 | ||
106 | 110 | let nMetricIdxBR = 8 | |
107 | 111 | ||
108 | 112 | let nMetricIdxNsbtSupply = 9 | |
109 | 113 | ||
110 | 114 | let nMetricIdxMaxNsbtSupply = 10 | |
111 | 115 | ||
112 | 116 | let nMetricIdxSurfSupply = 11 | |
113 | 117 | ||
114 | 118 | let nMetricUsdnUsdtPeg = 12 | |
115 | 119 | ||
116 | 120 | let nMetricCurrentPriceAdj = 13 | |
117 | 121 | ||
118 | 122 | let nMetricBasketInfo = 14 | |
119 | 123 | ||
120 | 124 | let nMetricWeightedPrice = 15 | |
121 | 125 | ||
122 | 126 | let nMetricTotalReservesUsd = 16 | |
123 | 127 | ||
124 | 128 | let IdxControlCfgNeutrinoDapp = 1 | |
125 | 129 | ||
126 | 130 | let IdxControlCfgAuctionDapp = 2 | |
127 | 131 | ||
128 | 132 | let IdxControlCfgRpdDapp = 3 | |
129 | 133 | ||
130 | 134 | let IdxControlCfgMathDapp = 4 | |
131 | 135 | ||
132 | 136 | let IdxControlCfgLiquidationDapp = 5 | |
133 | 137 | ||
134 | 138 | let IdxControlCfgRestDapp = 6 | |
135 | 139 | ||
136 | 140 | let IdxControlCfgNodeRegistryDapp = 7 | |
137 | 141 | ||
138 | 142 | let IdxControlCfgNsbtStakingDapp = 8 | |
139 | 143 | ||
140 | 144 | let IdxControlCfgMediatorDapp = 9 | |
141 | 145 | ||
142 | 146 | let IdxControlCfgSurfStakingDapp = 10 | |
143 | 147 | ||
144 | 148 | let IdxControlCfgGnsbtControllerDapp = 11 | |
145 | 149 | ||
146 | 150 | let IdxControlCfgRestV2Dapp = 12 | |
147 | 151 | ||
148 | 152 | let IdxControlCfgGovernanceDapp = 13 | |
149 | 153 | ||
150 | 154 | func keyControlAddress () = "%s%s__config__controlAddress" | |
151 | 155 | ||
152 | 156 | ||
153 | 157 | func keyControlCfg () = "%s__controlConfig" | |
154 | 158 | ||
155 | 159 | ||
156 | 160 | func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP) | |
157 | 161 | ||
158 | 162 | ||
159 | 163 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
160 | 164 | ||
161 | 165 | ||
162 | 166 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
163 | 167 | ||
164 | 168 | let controlCfg = readControlCfgOrFail(controlContract) | |
165 | 169 | ||
166 | 170 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
167 | 171 | ||
168 | 172 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
169 | 173 | ||
170 | 174 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
171 | 175 | ||
172 | 176 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
173 | 177 | ||
174 | 178 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
175 | 179 | ||
176 | 180 | let nodeRegistryContract = getContractAddressOrFail(controlCfg, IdxControlCfgNodeRegistryDapp) | |
177 | 181 | ||
178 | 182 | let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
179 | 183 | ||
180 | 184 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
181 | 185 | ||
182 | 186 | let BondAssetIdKey = "bond_asset_id" | |
183 | 187 | ||
184 | 188 | let AuctionContractKey = "auction_contract" | |
185 | 189 | ||
186 | 190 | let NsbtStakingContractKey = "nsbtStakingContract" | |
187 | 191 | ||
188 | 192 | let LiquidationContractKey = "liquidation_contract" | |
189 | 193 | ||
190 | 194 | let RPDContractKey = "rpd_contract" | |
191 | 195 | ||
192 | 196 | let ContolContractKey = "control_contract" | |
193 | 197 | ||
194 | 198 | let MathContractKey = "math_contract" | |
195 | 199 | ||
196 | 200 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
197 | 201 | ||
198 | 202 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
199 | 203 | ||
200 | 204 | func MinTokenSwapAmountKey (assetId) = ("min_outNeutrino_swap_amount_" + assetId) | |
201 | 205 | ||
202 | 206 | ||
203 | 207 | let MinNeutrinoSwapAmountKey = "min_outMulti_swap_amount" | |
204 | 208 | ||
205 | 209 | let LegacyMinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
206 | 210 | ||
207 | 211 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
208 | 212 | ||
209 | 213 | let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart" | |
210 | 214 | ||
211 | 215 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
212 | 216 | ||
217 | + | let BasketOutFeePartKey = "multiOut_swap_feePart" | |
218 | + | ||
213 | 219 | func keyNodeRegistry (address) = ("%s__" + address) | |
214 | 220 | ||
215 | 221 | ||
216 | 222 | let PriceKey = "price" | |
217 | 223 | ||
218 | 224 | let PriceIndexKey = "price_index" | |
219 | 225 | ||
220 | 226 | let IsBlockedKey = "is_blocked" | |
221 | 227 | ||
222 | 228 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
223 | 229 | ||
224 | 230 | ||
225 | 231 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
226 | 232 | ||
227 | 233 | ||
228 | 234 | func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP)) | |
229 | 235 | ||
230 | 236 | ||
231 | 237 | func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx)) | |
232 | 238 | ||
233 | 239 | ||
234 | 240 | func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * MULT8)) | |
235 | 241 | ||
236 | 242 | ||
237 | 243 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
238 | 244 | ||
239 | 245 | ||
240 | 246 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
241 | 247 | ||
242 | 248 | ||
243 | 249 | func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP) | |
244 | 250 | ||
245 | 251 | ||
246 | 252 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
247 | 253 | ||
248 | 254 | ||
249 | 255 | func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP) | |
250 | 256 | ||
251 | 257 | ||
252 | 258 | func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP) | |
253 | 259 | ||
254 | 260 | ||
255 | 261 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
256 | 262 | ||
257 | 263 | ||
258 | 264 | func totalLockedKEY (swapType,assetId) = makeString(["%s%s%s", "balanceLock", swapType, assetId], SEP) | |
259 | 265 | ||
260 | 266 | ||
261 | 267 | func totalLockedByUserKEY (swapType,owner,assetId) = makeString(["%s%s%s%s", "balanceLock", swapType, owner, assetId], "_") | |
262 | 268 | ||
263 | 269 | ||
264 | 270 | func balanceLockIntervalKEY (swapType) = if ((swapType == "outMulti")) | |
265 | 271 | then BalanceNeutrinoLockIntervalKey | |
266 | 272 | else BalanceWavesLockIntervalKey | |
267 | 273 | ||
268 | 274 | ||
269 | 275 | func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval" | |
270 | 276 | ||
271 | 277 | ||
272 | 278 | func swapsTimeframeKEY () = "swaps_timeframe" | |
273 | 279 | ||
274 | 280 | ||
275 | 281 | func brProtectedKEY () = "min_BR_protection_level" | |
276 | 282 | ||
277 | 283 | ||
278 | 284 | func basketAssetsKey () = "%s%s__common__basketAssets" | |
279 | 285 | ||
280 | 286 | ||
281 | 287 | func basketDKey () = "%s%s__common__basketD" | |
282 | 288 | ||
283 | 289 | ||
284 | 290 | func basketKKey () = "%s%s__common__basketK" | |
285 | 291 | ||
286 | 292 | ||
287 | 293 | func basketBKey () = "%s%s__common__basketB" | |
288 | 294 | ||
289 | 295 | ||
290 | 296 | func basketLogbDeltaKey () = "%s%s__common__basketLogbDelta" | |
291 | 297 | ||
292 | 298 | ||
293 | 299 | func basketWeightByAssetKey (assetId) = ("%s%s%s__common__weightByAsset__" + assetId) | |
294 | 300 | ||
295 | 301 | ||
296 | 302 | func keyPriceByAsset (assetId) = ("%s%s%s__common__priceByAsset__" + assetId) | |
297 | 303 | ||
298 | 304 | ||
305 | + | func maxFeeKey () = "%s%s__common__maxAllowedFee" | |
306 | + | ||
307 | + | ||
308 | + | func multiOutFeeREAD () = valueOrElse(getInteger(BasketOutFeePartKey), valueOrElse(getInteger(WavesOutFeePartKey), DEFAULTBURNFEE)) | |
309 | + | ||
310 | + | ||
299 | 311 | func minSwapAmountREAD (swapType,assetId) = if ((swapType == "outMulti")) | |
300 | 312 | then valueOrElse(getInteger(MinNeutrinoSwapAmountKey), getNumberByKey(LegacyMinNeutrinoSwapAmountKey)) | |
301 | 313 | else getNumberByKey(MinTokenSwapAmountKey(assetId)) | |
302 | 314 | ||
303 | 315 | ||
304 | 316 | func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440) | |
305 | 317 | ||
306 | 318 | ||
307 | 319 | func totalLockedREAD (swapType,assetId) = valueOrElse(getInteger(this, totalLockedKEY(swapType, assetId)), 0) | |
308 | 320 | ||
309 | 321 | ||
310 | 322 | func totalLockedByUserREAD (swapType,owner,assetId) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner, assetId)), 0) | |
311 | 323 | ||
312 | 324 | ||
313 | 325 | func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440) | |
314 | 326 | ||
315 | 327 | ||
316 | 328 | func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1) | |
317 | 329 | ||
318 | 330 | ||
319 | 331 | func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP) | |
320 | 332 | ||
321 | 333 | ||
322 | 334 | func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP) | |
323 | 335 | ||
324 | 336 | ||
325 | 337 | func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price) | |
326 | 338 | ||
327 | 339 | ||
328 | 340 | func convertTokenToUsd (amount,price) = fraction(amount, price, MULT8) | |
329 | 341 | ||
330 | 342 | ||
331 | 343 | func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8) | |
332 | 344 | ||
333 | 345 | ||
334 | 346 | func convertWavesToBond (amount,price) = convertTokenToUsd(amount, price) | |
335 | 347 | ||
336 | 348 | ||
337 | 349 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
338 | 350 | ||
339 | 351 | ||
340 | 352 | func convertBasketItemToNeutrino (inAmount,inAsset,basketInfoStr,neutrinoPrice) = { | |
341 | 353 | let basketInfo = split_4C(basketInfoStr, "_") | |
342 | 354 | func findItem (acc,item) = { | |
343 | 355 | let bItem = split(item, LISTSEP) | |
344 | 356 | if ((bItem[0] == inAsset)) | |
345 | 357 | then bItem | |
346 | 358 | else acc | |
347 | 359 | } | |
348 | 360 | ||
349 | 361 | let it = { | |
350 | 362 | let $l = basketInfo | |
351 | 363 | let $s = size($l) | |
352 | 364 | let $acc0 = nil | |
353 | 365 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
354 | 366 | then $a | |
355 | 367 | else findItem($a, $l[$i]) | |
356 | 368 | ||
357 | 369 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
358 | 370 | then $a | |
359 | 371 | else throw("List size exceeds 10") | |
360 | 372 | ||
361 | 373 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
362 | 374 | } | |
363 | 375 | let dlog6 = value(getInteger(basketLogbDeltaKey())) | |
364 | 376 | let d6 = value(getInteger(basketDKey())) | |
365 | 377 | let b6 = value(getInteger(basketBKey())) | |
366 | 378 | let w6 = value(getInteger(basketWeightByAssetKey(inAsset))) | |
367 | 379 | let p6 = ((dlog6 - w6) + parseIntValue(it[1])) | |
368 | 380 | let pp6 = pow(b6, 6, p6, 6, 6, HALFUP) | |
369 | 381 | let outAmountGross = fraction(inAmount, parseIntValue(it[2]), if ((neutrinoPrice == 0)) | |
370 | 382 | then MULT8 | |
371 | 383 | else (neutrinoPrice * 100)) | |
372 | 384 | let multiplier = ((MULT6 + d6) - pp6) | |
373 | - | let netAmount = fraction(outAmountGross, multiplier, MULT6) | |
374 | - | let feeAmount = if ((netAmount >= outAmountGross)) | |
375 | - | then 0 | |
376 | - | else (outAmountGross - netAmount) | |
377 | - | [outAmountGross, netAmount, feeAmount] | |
385 | + | if ((0 >= multiplier)) | |
386 | + | then throw(("Non-positive multiplier = " + toString(multiplier))) | |
387 | + | else { | |
388 | + | let discounted = fraction(outAmountGross, multiplier, MULT6) | |
389 | + | let masterFee = valueOrElse(getInteger(NeutrinoOutFeePartKey), DEFAULTSWAPFEE) | |
390 | + | let feeAmount = fraction(discounted, masterFee, MULT6) | |
391 | + | [discounted, (discounted - feeAmount), feeAmount, multiplier] | |
392 | + | } | |
378 | 393 | } | |
379 | 394 | ||
380 | 395 | ||
381 | 396 | func convertNeutrinoToBasket (amount,basketInfoStr,neutrinoSupply) = { | |
382 | 397 | let basketInfo = split_4C(basketInfoStr, "_") | |
398 | + | let k6 = value(getInteger(basketKKey())) | |
399 | + | let d6 = value(getInteger(basketDKey())) | |
400 | + | let outPart = (MULT6 - fraction(k6, d6, MULT6)) | |
383 | 401 | func conv (acc,item) = { | |
384 | 402 | let parts = split(item, LISTSEP) | |
385 | 403 | let assetId = parts[0] | |
386 | 404 | let share = parseIntValue(parts[1]) | |
387 | 405 | let price = parseIntValue(parts[2]) | |
388 | 406 | let reserv = parseIntValue(parts[3]) | |
389 | 407 | if ((neutrinoSupply == 0)) | |
390 | 408 | then throw("Attempt to burn neutrino at zero supply") | |
391 | 409 | else { | |
392 | - | let outAmount = fraction(amount, reserv, neutrinoSupply) | |
410 | + | let outAmount = fraction(fraction(amount, reserv, neutrinoSupply), outPart, MULT6) | |
393 | 411 | let wavesTuple = if ((assetId == "WAVES")) | |
394 | 412 | then $Tuple2(outAmount, price) | |
395 | 413 | else $Tuple2(acc._2, acc._3) | |
396 | 414 | $Tuple3((acc._1 :+ $Tuple4(assetId, outAmount, price, share)), wavesTuple._1, wavesTuple._2) | |
397 | 415 | } | |
398 | 416 | } | |
399 | 417 | ||
400 | 418 | let $l = basketInfo | |
401 | 419 | let $s = size($l) | |
402 | 420 | let $acc0 = $Tuple3(nil, 0, 0) | |
403 | 421 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
404 | 422 | then $a | |
405 | 423 | else conv($a, $l[$i]) | |
406 | 424 | ||
407 | 425 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
408 | 426 | then $a | |
409 | 427 | else throw("List size exceeds 10") | |
410 | 428 | ||
411 | 429 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
412 | 430 | } | |
413 | 431 | ||
414 | 432 | ||
415 | 433 | func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount))) | |
416 | 434 | ||
417 | 435 | ||
418 | 436 | func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
419 | 437 | ||
420 | 438 | ||
421 | 439 | func priceIndexFAIL (index,priceIndex,indexHeight,unlockHeight,prevIndexHeight) = throw(((((((((("invalid price history index: index=" + toString(index)) + " priceIndex=") + toString(priceIndex)) + " indexHeight=") + toString(indexHeight)) + " unlockHeight=") + toString(unlockHeight)) + " prevIndexHeight=") + toString(prevIndexHeight))) | |
422 | 440 | ||
423 | 441 | ||
424 | 442 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
425 | 443 | ||
426 | 444 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
427 | 445 | ||
428 | 446 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
429 | 447 | ||
430 | 448 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
431 | 449 | ||
432 | 450 | let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z") | |
433 | 451 | ||
434 | 452 | let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF") | |
435 | 453 | ||
436 | 454 | let neutrinoContract = this | |
437 | 455 | ||
438 | 456 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
439 | 457 | ||
440 | 458 | func checkIsValidMinSponsoredFee (tx) = { | |
441 | 459 | let MINTRANSFERFEE = 100000 | |
442 | 460 | let SponsoredFeeUpperBound = 1000 | |
443 | 461 | let realNeutrinoFee = convertTokenToUsd(MINTRANSFERFEE, currentPrice) | |
444 | 462 | let minNeutrinoFee = (realNeutrinoFee * 2) | |
445 | 463 | let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100) | |
446 | 464 | let inputFee = value(tx.minSponsoredAssetFee) | |
447 | 465 | if (if ((inputFee >= minNeutrinoFee)) | |
448 | 466 | then (maxNeutrinoFee >= inputFee) | |
449 | 467 | else false) | |
450 | 468 | then (tx.assetId == neutrinoAssetId) | |
451 | 469 | else false | |
452 | 470 | } | |
453 | 471 | ||
454 | 472 | ||
455 | 473 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
456 | 474 | ||
457 | 475 | ||
458 | 476 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
459 | 477 | ||
460 | 478 | ||
461 | 479 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
462 | 480 | ||
463 | 481 | ||
464 | 482 | let sIdxSwapType = 1 | |
465 | 483 | ||
466 | 484 | let sIdxStatus = 2 | |
467 | 485 | ||
468 | 486 | let sIdxInAmount = 3 | |
469 | 487 | ||
470 | 488 | let sIdxStartHeight = 7 | |
471 | 489 | ||
472 | 490 | let sIdxStartTimestamp = 8 | |
473 | 491 | ||
474 | 492 | let sIdxSelfUnlockHeight = 11 | |
475 | 493 | ||
476 | 494 | let sIdxMinRand = 15 | |
477 | 495 | ||
478 | 496 | let sIdxMaxRand = 16 | |
479 | 497 | ||
480 | 498 | let sIdxInAsset = 20 | |
481 | 499 | ||
482 | 500 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
483 | 501 | ||
484 | 502 | ||
485 | 503 | func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br,basketData,inAsset) = makeString_2C(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d%s%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br, basketData, inAsset], SEP) | |
486 | 504 | ||
487 | 505 | ||
488 | 506 | func pendingSwapDATA (swapType,inAssetAmount,selfUnlockHeight,inAsset) = strSwapDATA(swapType, "PENDING", toString(inAssetAmount), "0", "0", "0", toString(height), toString(lastBlock.timestamp), "0", "0", toString(selfUnlockHeight), "0", "0", "NULL", "0", "0", "0", "0", "", inAsset) | |
489 | 507 | ||
490 | 508 | ||
491 | 509 | func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId,outSurfAmt,br,basketData,inAsset) = strSwapDATA(dataArray[sIdxSwapType], "FINISHED", dataArray[sIdxInAmount], toString(price), toString(outNetAmount), toString(outFeeAmount), dataArray[sIdxStartHeight], dataArray[sIdxStartTimestamp], toString(height), toString(lastBlock.timestamp), dataArray[sIdxSelfUnlockHeight], toString(randUnlockHeight), toString(index), withdrawTxId, dataArray[sIdxMinRand], dataArray[sIdxMaxRand], toString(outSurfAmt), toString(br), basketData, inAsset) | |
492 | 510 | ||
493 | 511 | ||
494 | 512 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
495 | 513 | let swapKey = swapKEY(userAddress, swapTxId) | |
496 | 514 | split_4C(valueOrErrorMessage(getString(swapKey), ("no swap data for " + swapKey)), SEP) | |
497 | 515 | } | |
498 | 516 | ||
499 | 517 | ||
500 | 518 | func applyFees (amountOutGross,inAmtToSURF,feePart) = { | |
501 | 519 | let feeAmount = fraction(amountOutGross, feePart, MULT6) | |
502 | 520 | [(amountOutGross - feeAmount), feeAmount] | |
503 | 521 | } | |
504 | 522 | ||
505 | 523 | ||
506 | 524 | func applyFeesBasket (basketOut) = { | |
507 | - | let k6 = value(getInteger(basketKKey())) | |
508 | - | let d6 = value(getInteger(basketDKey())) | |
509 | - | let feePart = fraction(k6, d6, MULT6) | |
525 | + | let feePart = multiOutFeeREAD() | |
510 | 526 | func feeApplier (acc,item) = { | |
511 | 527 | let feeAmount = fraction(item._2, feePart, MULT6) | |
512 | 528 | (acc :+ makeString([item._1, toString(item._3), toString((item._2 - feeAmount)), toString(feeAmount), toString(item._4)], LISTSEP)) | |
513 | 529 | } | |
514 | 530 | ||
515 | 531 | let a = { | |
516 | 532 | let $l = basketOut | |
517 | 533 | let $s = size($l) | |
518 | 534 | let $acc0 = nil | |
519 | 535 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
520 | 536 | then $a | |
521 | 537 | else feeApplier($a, $l[$i]) | |
522 | 538 | ||
523 | 539 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
524 | 540 | then $a | |
525 | 541 | else throw("List size exceeds 10") | |
526 | 542 | ||
527 | 543 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
528 | 544 | } | |
529 | 545 | makeString_2C(a, "_") | |
530 | 546 | } | |
531 | 547 | ||
532 | 548 | ||
533 | 549 | func abs (x) = if ((0 > x)) | |
534 | 550 | then -(x) | |
535 | 551 | else x | |
536 | 552 | ||
537 | 553 | ||
538 | 554 | func selectNode (unleaseAmount) = { | |
539 | 555 | let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship()) | |
540 | 556 | let oldLeased0 = getNumberByKey(getLeaseAmountKey(0)) | |
541 | 557 | let oldLeased1 = getNumberByKey(getLeaseAmountKey(1)) | |
542 | 558 | let newLeased0 = (amountToLease + oldLeased0) | |
543 | 559 | let newLeased1 = (amountToLease + oldLeased1) | |
544 | 560 | if (if ((newLeased0 > 0)) | |
545 | 561 | then true | |
546 | 562 | else (newLeased1 > 0)) | |
547 | 563 | then { | |
548 | 564 | let delta0 = abs((newLeased0 - oldLeased1)) | |
549 | 565 | let delta1 = abs((newLeased1 - oldLeased0)) | |
550 | 566 | if ((delta1 >= delta0)) | |
551 | 567 | then $Tuple2(0, newLeased0) | |
552 | 568 | else $Tuple2(1, newLeased1) | |
553 | 569 | } | |
554 | 570 | else $Tuple2(-1, 0) | |
555 | 571 | } | |
556 | 572 | ||
557 | 573 | ||
558 | 574 | func thisOnly (i) = if ((i.caller != this)) | |
559 | 575 | then throw("Permission denied: this contract only allowed") | |
560 | 576 | else true | |
561 | 577 | ||
562 | 578 | ||
563 | 579 | func prepareUnleaseAndLease (unleaseAmount) = { | |
564 | 580 | let nodeTuple = selectNode(unleaseAmount) | |
565 | 581 | let nodeIndex = nodeTuple._1 | |
566 | 582 | let newLeaseAmount = nodeTuple._2 | |
567 | 583 | if ((newLeaseAmount > 0)) | |
568 | 584 | then { | |
569 | 585 | let leaseIdKey = getLeaseIdKey(nodeIndex) | |
570 | 586 | let oldLease = getBinary(this, leaseIdKey) | |
571 | 587 | let unleaseOrEmpty = if (isDefined(oldLease)) | |
572 | 588 | then [LeaseCancel(value(oldLease))] | |
573 | 589 | else nil | |
574 | 590 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
575 | 591 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
576 | 592 | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
577 | 593 | } | |
578 | 594 | else nil | |
579 | 595 | } | |
580 | 596 | ||
581 | 597 | ||
582 | 598 | func readNodeInfo (nodeIdx) = { | |
583 | 599 | let nodeAddress = getStakingNodeAddressByIndex(nodeIdx) | |
584 | 600 | let leasedAmtKEY = getLeaseAmountKey(nodeIdx) | |
585 | 601 | let leasedAmt = getNumberByKey(leasedAmtKEY) | |
586 | 602 | let leaseIdKEY = getLeaseIdKey(nodeIdx) | |
587 | 603 | let leaseId = value(getBinary(this, leaseIdKEY)) | |
588 | 604 | $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId) | |
589 | 605 | } | |
590 | 606 | ||
591 | 607 | ||
592 | 608 | func commonSwap (swapType,pmtAmount,inAsset,userAddressStr,txId58) = { | |
593 | 609 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil)) | |
594 | 610 | let tokenSwapLimitUsd = swapParamsSTRUCT._1 | |
595 | 611 | let swapLimitSpent = swapParamsSTRUCT._2 | |
596 | 612 | let blcks2LmtReset = swapParamsSTRUCT._3 | |
597 | 613 | let usdnSwapLimitMax = swapParamsSTRUCT._7 | |
598 | 614 | let minSwapAmount = minSwapAmountREAD(swapType, inAsset) | |
599 | 615 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr, inAsset) | |
600 | 616 | let nodeAddress = getStakingNodeByIndex(0) | |
601 | 617 | let isSwapByNode = (nodeAddress == userAddressStr) | |
602 | 618 | let balanceLockMaxInterval = if (isSwapByNode) | |
603 | 619 | then nodeBalanceLockIntervalREAD() | |
604 | 620 | else balanceLockIntervalREAD(swapType) | |
605 | 621 | let selfUnlockHeight = (height + balanceLockMaxInterval) | |
606 | 622 | let pr = value(getInteger(controlContract, keyPriceByAsset(inAsset))) | |
607 | 623 | let swapUsdnVolume = if ((swapType == "outNeutrino")) | |
608 | 624 | then convertTokenToUsd(pmtAmount, pr) | |
609 | 625 | else pmtAmount | |
610 | 626 | let swapLimitMax = if ((swapType == "outNeutrino")) | |
611 | 627 | then tokenSwapLimitUsd | |
612 | 628 | else usdnSwapLimitMax | |
613 | 629 | if ((minSwapAmount > pmtAmount)) | |
614 | 630 | then minSwapAmountFAIL(swapType, minSwapAmount) | |
615 | 631 | else if (if (!(isSwapByNode)) | |
616 | 632 | then (swapLimitSpent > 0) | |
617 | 633 | else false) | |
618 | 634 | then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset)))) | |
619 | 635 | else if (if (!(isSwapByNode)) | |
620 | 636 | then (swapUsdnVolume > swapLimitMax) | |
621 | 637 | else false) | |
622 | 638 | then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax))) | |
623 | 639 | else if (isBlocked) | |
624 | 640 | then emergencyShutdownFAIL() | |
625 | 641 | else { | |
626 | 642 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
627 | 643 | let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo]) | |
628 | 644 | let weightedPrice = asInt(neutrinoMetrics[nMetricWeightedPrice]) | |
629 | 645 | let out = convertBasketItemToNeutrino(pmtAmount, inAsset, basketInfo, weightedPrice) | |
646 | + | let maxFee = valueOrElse(getInteger(maxFeeKey()), DEFAULTMAXFEE) | |
630 | 647 | if (if ((swapType == "outNeutrino")) | |
631 | - | then ( | |
648 | + | then ((MULT6 - maxFee) > out[3]) | |
632 | 649 | else false) | |
633 | - | then throw(( | |
650 | + | then throw(("Max allowed fee exceeded, multiplier = " + toString(out[3]))) | |
634 | 651 | else { | |
635 | 652 | let leasePart = if (if ((swapType == "outNeutrino")) | |
636 | 653 | then (inAsset == "WAVES") | |
637 | 654 | else false) | |
638 | 655 | then prepareUnleaseAndLease(0) | |
639 | 656 | else nil | |
640 | 657 | $Tuple2(([IntegerEntry(keySwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastSwapHeight(userAddressStr), height), IntegerEntry(totalLockedByUserKEY(swapType, userAddressStr, inAsset), (totalLockedByUser + pmtAmount)), IntegerEntry(getBalanceUnlockBlockKey(userAddressStr), selfUnlockHeight), StringEntry(swapKEY(userAddressStr, txId58), pendingSwapDATA(swapType, pmtAmount, selfUnlockHeight, inAsset))] ++ leasePart), unit) | |
641 | 658 | } | |
642 | 659 | } | |
643 | 660 | } | |
644 | 661 | ||
645 | 662 | ||
646 | 663 | let bFuncIdxSurf = 0 | |
647 | 664 | ||
648 | 665 | let bFuncIdxWaves = 1 | |
649 | 666 | ||
650 | 667 | let bFuncIdxUsdn = 2 | |
651 | 668 | ||
652 | 669 | let bFuncIdxReserveStart = 3 | |
653 | 670 | ||
654 | 671 | let bFuncIdxSupplyStart = 4 | |
655 | 672 | ||
656 | 673 | let bFuncIdxBRStart = 5 | |
657 | 674 | ||
658 | 675 | let bFuncIdxReserveEnd = 6 | |
659 | 676 | ||
660 | 677 | let bFuncIdxSupplyEnd = 7 | |
661 | 678 | ||
662 | 679 | let bFuncIdxBREnd = 8 | |
663 | 680 | ||
664 | 681 | let bFuncIdxRest = 9 | |
665 | 682 | ||
666 | 683 | let bFuncIdxWavesPrice = 10 | |
667 | 684 | ||
668 | 685 | func calcWithdrawT2U (inAmount,inAsset,basketInfo,weightedPrice) = { | |
669 | 686 | let outAmt = convertBasketItemToNeutrino(inAmount, inAsset, basketInfo, weightedPrice) | |
670 | 687 | $Tuple12(outAmt[0], neutrinoAssetId, 0, inAsset, 0, weightedPrice, inAmount, 0, 0, 0, nil, [outAmt[1], outAmt[2]]) | |
671 | 688 | } | |
672 | 689 | ||
673 | 690 | ||
674 | 691 | func calcWithdrawU2Basket (usdnIn,basketInfo,neutrinoSupply) = { | |
675 | 692 | let outAmtGross = convertNeutrinoToBasket(usdnIn, basketInfo, neutrinoSupply) | |
676 | 693 | $Tuple12(outAmtGross._2, unit, 0, neutrinoAssetId, outAmtGross._2, outAmtGross._3, usdnIn, neutrinoSupply, usdnIn, 0, outAmtGross._1, nil) | |
677 | 694 | } | |
678 | 695 | ||
679 | 696 | ||
680 | 697 | func calcWithdraw (swapType,inAmount,price,neutrinoMetrics,inAsset) = { | |
681 | 698 | let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
682 | 699 | let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo]) | |
683 | 700 | let weightedPrice = asInt(neutrinoMetrics[nMetricWeightedPrice]) | |
684 | 701 | let outDataTuple = if ((swapType == "outNeutrino")) | |
685 | 702 | then calcWithdrawT2U(inAmount, inAsset, basketInfo, weightedPrice) | |
686 | 703 | else if ((swapType == "outMulti")) | |
687 | 704 | then calcWithdrawU2Basket(inAmount, basketInfo, neutrinoSupply) | |
688 | 705 | else throw(("Unsupported swap type " + swapType)) | |
689 | 706 | let outAmtGross = outDataTuple._1 | |
690 | 707 | let outAssetId = outDataTuple._2 | |
691 | 708 | let inAmtToSurfPart = outDataTuple._3 | |
692 | 709 | let inAssetId = outDataTuple._4 | |
693 | 710 | let unleaseAmt = outDataTuple._5 | |
694 | 711 | let withdrawPrice = outDataTuple._6 | |
695 | 712 | let basketData = outDataTuple._11 | |
696 | 713 | let netFeeData = outDataTuple._12 | |
697 | 714 | let outNetAmt = if ((swapType == "outNeutrino")) | |
698 | 715 | then netFeeData[0] | |
699 | 716 | else 0 | |
700 | 717 | let outFeeAmt = if ((swapType == "outNeutrino")) | |
701 | 718 | then netFeeData[1] | |
702 | 719 | else 0 | |
703 | 720 | let outSurfAmt = if ((0 >= inAmtToSurfPart)) | |
704 | 721 | then 0 | |
705 | 722 | else asInt(asAnyList(invoke(mathContract, "surfFunctionREADONLY", [inAmtToSurfPart, inAssetId], nil))[bFuncIdxSurf]) | |
706 | 723 | let withdrawBasket = if ((swapType == "outMulti")) | |
707 | 724 | then applyFeesBasket(basketData) | |
708 | 725 | else "" | |
709 | 726 | $Tuple9(outNetAmt, outAssetId, outSurfAmt, inAmtToSurfPart, unleaseAmt, outFeeAmt, outAmtGross, withdrawPrice, withdrawBasket) | |
710 | 727 | } | |
711 | 728 | ||
712 | 729 | ||
713 | 730 | func keyApplyInProgress () = "%s__applyInProgress" | |
714 | 731 | ||
715 | 732 | ||
716 | 733 | func keyProposalDataById (proposalId) = ("%s%d__proposalData__" + toString(proposalId)) | |
717 | 734 | ||
718 | 735 | ||
719 | 736 | let govIdxTxIds = 9 | |
720 | 737 | ||
721 | 738 | func validateUpdate (tx) = match tx { | |
722 | 739 | case o: Order => | |
723 | 740 | throw("Orders aren't allowed") | |
724 | 741 | case t: DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|InvokeExpressionTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction => | |
725 | 742 | let txId = toBase58String(t.id) | |
726 | 743 | let proposalId = valueOrErrorMessage(getInteger(govContract, keyApplyInProgress()), "Apply is not happening") | |
727 | 744 | let txList = split(split(getStringOrFail(govContract, keyProposalDataById(proposalId)), SEP)[govIdxTxIds], LISTSEP) | |
728 | 745 | if (!(isDefined(indexOf(txList, txId)))) | |
729 | 746 | then throw(((("Unknown txId: " + txId) + " for proposalId=") + toString(proposalId))) | |
730 | 747 | else true | |
731 | 748 | case _ => | |
732 | 749 | throw("Match error") | |
733 | 750 | } | |
734 | 751 | ||
735 | 752 | ||
736 | 753 | @Callable(i) | |
737 | 754 | func constructorV1 (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = { | |
738 | 755 | let checkCaller = thisOnly(i) | |
739 | 756 | if ((checkCaller == checkCaller)) | |
740 | 757 | then if ((size(i.payments) != 0)) | |
741 | 758 | then throw("no payments allowed") | |
742 | 759 | else [StringEntry(NeutrinoAssetIdKey, neutrinoAssetIdPrm), StringEntry(BondAssetIdKey, bondAssetIdPrm), StringEntry(AuctionContractKey, auctionContractPrm), StringEntry(LiquidationContractKey, liquidationContractPrm), StringEntry(RPDContractKey, rpdContractPrm), StringEntry(NodeOracleProviderPubKeyKey, nodeOracleProviderPubKeyPrm), IntegerEntry(BalanceWavesLockIntervalKey, balanceWavesLockIntervalPrm), IntegerEntry(BalanceNeutrinoLockIntervalKey, balanceNeutrinoLockIntervalPrm), IntegerEntry(MinTokenSwapAmountKey("WAVES"), minWavesSwapAmountPrm), IntegerEntry(MinNeutrinoSwapAmountKey, minNeutrinoSwapAmountPrm), IntegerEntry(NeutrinoOutFeePartKey, neutrinoOutFeePartPrm), IntegerEntry(WavesOutFeePartKey, wavesOutFeePartPrm)] | |
743 | 760 | else throw("Strict value is not equal to itself.") | |
744 | 761 | } | |
745 | 762 | ||
746 | 763 | ||
747 | 764 | ||
748 | 765 | @Callable(i) | |
749 | 766 | func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = { | |
750 | 767 | let checkCaller = thisOnly(i) | |
751 | 768 | if ((checkCaller == checkCaller)) | |
752 | 769 | then if ((size(i.payments) != 0)) | |
753 | 770 | then throw("no payments allowed") | |
754 | 771 | else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)] | |
755 | 772 | else throw("Strict value is not equal to itself.") | |
756 | 773 | } | |
757 | 774 | ||
758 | 775 | ||
759 | 776 | ||
760 | 777 | @Callable(i) | |
761 | 778 | func constructorV3 (assetsWeightsMins,dParam,kParam,bParam,deltaParam) = { | |
762 | 779 | let checkCaller = thisOnly(i) | |
763 | 780 | if ((checkCaller == checkCaller)) | |
764 | 781 | then if ((size(i.payments) != 0)) | |
765 | 782 | then throw("no payments allowed") | |
766 | 783 | else { | |
767 | 784 | func prepare (acc,item) = { | |
768 | 785 | let parts = split(item, "_") | |
769 | 786 | let assetId = parts[0] | |
770 | 787 | let weight = parseIntValue(parts[1]) | |
771 | 788 | let minVal = parseIntValue(parts[2]) | |
772 | 789 | $Tuple2((acc._1 :+ assetId), ((acc._2 :+ IntegerEntry(basketWeightByAssetKey(assetId), weight)) :+ IntegerEntry(MinTokenSwapAmountKey(assetId), minVal))) | |
773 | 790 | } | |
774 | 791 | ||
775 | 792 | let r = { | |
776 | 793 | let $l = assetsWeightsMins | |
777 | 794 | let $s = size($l) | |
778 | 795 | let $acc0 = $Tuple2(nil, nil) | |
779 | 796 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
780 | 797 | then $a | |
781 | 798 | else prepare($a, $l[$i]) | |
782 | 799 | ||
783 | 800 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
784 | 801 | then $a | |
785 | 802 | else throw("List size exceeds 10") | |
786 | 803 | ||
787 | 804 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
788 | 805 | } | |
789 | 806 | (((((r._2 :+ IntegerEntry(basketDKey(), dParam)) :+ IntegerEntry(basketKKey(), kParam)) :+ IntegerEntry(basketBKey(), bParam)) :+ IntegerEntry(basketLogbDeltaKey(), log(deltaParam, 6, bParam, 6, 6, HALFUP))) :+ StringEntry(basketAssetsKey(), makeString(r._1, SEP))) | |
790 | 807 | } | |
791 | 808 | else throw("Strict value is not equal to itself.") | |
792 | 809 | } | |
793 | 810 | ||
794 | 811 | ||
795 | 812 | ||
796 | 813 | @Callable(i) | |
797 | 814 | func swapTokenToNeutrino () = if ((size(i.payments) != 1)) | |
798 | 815 | then throw("swapTokenToNeutrino require only one payment") | |
799 | 816 | else { | |
800 | 817 | let pmt = value(i.payments[0]) | |
801 | 818 | let basketAssets = value(getString(basketAssetsKey())) | |
802 | 819 | let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID)) | |
803 | 820 | if (!(contains(basketAssets, pmtAssetIdStr))) | |
804 | 821 | then throw(((pmtAssetIdStr + " is not one of basket tokens:") + basketAssets)) | |
805 | 822 | else { | |
806 | 823 | let userAddress = toString(i.caller) | |
807 | 824 | let txId58 = toBase58String(i.transactionId) | |
808 | 825 | let totalLocked = totalLockedREAD("outNeutrino", pmtAssetIdStr) | |
809 | 826 | let pmtAmount = pmt.amount | |
810 | 827 | let saveTotalLocked = invoke(this, "internalSaveInteger", [totalLockedKEY("outNeutrino", pmtAssetIdStr), (totalLocked + pmtAmount)], nil) | |
811 | 828 | if ((saveTotalLocked == saveTotalLocked)) | |
812 | 829 | then commonSwap("outNeutrino", pmtAmount, pmtAssetIdStr, userAddress, txId58) | |
813 | 830 | else throw("Strict value is not equal to itself.") | |
814 | 831 | } | |
815 | 832 | } | |
816 | 833 | ||
817 | 834 | ||
818 | 835 | ||
819 | 836 | @Callable(i) | |
820 | 837 | func swapNeutrinoToBasket () = if ((size(i.payments) != 1)) | |
821 | 838 | then throw("swapNeutrinoToBasket require only one payment") | |
822 | 839 | else { | |
823 | 840 | let pmt = value(i.payments[0]) | |
824 | 841 | if ((pmt.assetId != neutrinoAssetId)) | |
825 | 842 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
826 | 843 | else { | |
827 | 844 | let userAddress = toString(i.caller) | |
828 | 845 | let txId58 = toBase58String(i.transactionId) | |
829 | 846 | let neutrinoAssetIdStr = toBase58String(neutrinoAssetId) | |
830 | 847 | let totalLocked = totalLockedREAD("outMulti", neutrinoAssetIdStr) | |
831 | 848 | let pmtAmount = pmt.amount | |
832 | 849 | let saveTotalLocked = invoke(this, "internalSaveInteger", [totalLockedKEY("outMulti", neutrinoAssetIdStr), (totalLocked + pmtAmount)], nil) | |
833 | 850 | if ((saveTotalLocked == saveTotalLocked)) | |
834 | 851 | then commonSwap("outMulti", pmt.amount, neutrinoAssetIdStr, userAddress, txId58) | |
835 | 852 | else throw("Strict value is not equal to itself.") | |
836 | 853 | } | |
837 | 854 | } | |
838 | 855 | ||
839 | 856 | ||
840 | 857 | ||
841 | 858 | @Callable(i) | |
842 | 859 | func internalSaveInteger (key,amount) = if ((i.caller != this)) | |
843 | 860 | then throw("internalSaveInteger is not public method") | |
844 | 861 | else [IntegerEntry(key, amount)] | |
845 | 862 | ||
846 | 863 | ||
847 | 864 | ||
848 | 865 | @Callable(i) | |
849 | 866 | func withdraw (account,index,swapTxId) = { | |
850 | 867 | let txId = toBase58String(i.transactionId) | |
851 | 868 | if ((size(i.payments) != 0)) | |
852 | 869 | then throw("no payments allowed") | |
853 | 870 | else { | |
854 | 871 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
855 | 872 | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
856 | 873 | let userAddress = addressFromStringValue(account) | |
857 | 874 | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
858 | 875 | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
859 | 876 | let swapType = dataArray[sIdxSwapType] | |
860 | 877 | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
861 | 878 | let swapStatus = dataArray[sIdxStatus] | |
862 | 879 | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
863 | 880 | let inAsset = dataArray[sIdxInAsset] | |
864 | 881 | let totalLocked = totalLockedREAD(swapType, inAsset) | |
865 | 882 | let totalLockedByUser = totalLockedByUserREAD(swapType, account, inAsset) | |
866 | 883 | let unlockHeight = selfUnlockHeight | |
867 | 884 | let indexHeight = getHeightPriceByIndex(index) | |
868 | 885 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
869 | 886 | let priceByIndex = getPriceHistory(indexHeight) | |
870 | 887 | if (isBlocked) | |
871 | 888 | then emergencyShutdownFAIL() | |
872 | 889 | else if ((swapStatus != "PENDING")) | |
873 | 890 | then throw("swap has been already processed") | |
874 | 891 | else if ((unlockHeight > height)) | |
875 | 892 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
876 | 893 | else if (if (if ((index > priceIndex)) | |
877 | 894 | then true | |
878 | 895 | else (unlockHeight > indexHeight)) | |
879 | 896 | then true | |
880 | 897 | else if ((prevIndexHeight != 0)) | |
881 | 898 | then (prevIndexHeight >= unlockHeight) | |
882 | 899 | else false) | |
883 | 900 | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
884 | 901 | else { | |
885 | 902 | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex, neutrinoMetrics, inAsset) | |
886 | 903 | let outNetAmount = withdrawTuple._1 | |
887 | 904 | let outAssetId = withdrawTuple._2 | |
888 | 905 | let outSurfAmt = withdrawTuple._3 | |
889 | 906 | let unleaseAmt = withdrawTuple._5 | |
890 | 907 | let outFeeAmount = withdrawTuple._6 | |
891 | 908 | let outAmtGross = withdrawTuple._7 | |
892 | 909 | let withdrawPrice = withdrawTuple._8 | |
893 | 910 | let withdrawBasket = withdrawTuple._9 | |
894 | 911 | if (if ((swapType == "outNeutrino")) | |
895 | 912 | then (0 >= outAmtGross) | |
896 | 913 | else false) | |
897 | 914 | then throw("balance equals zero") | |
898 | 915 | else { | |
899 | 916 | let surfCondition = if ((outSurfAmt > 0)) | |
900 | 917 | then { | |
901 | 918 | let issueResult = invoke(auctionContract, "issueSurf", [outSurfAmt, account], nil) | |
902 | 919 | if ((issueResult == issueResult)) | |
903 | 920 | then 0 | |
904 | 921 | else throw("Strict value is not equal to itself.") | |
905 | 922 | } | |
906 | 923 | else 0 | |
907 | 924 | if ((surfCondition == surfCondition)) | |
908 | 925 | then { | |
909 | 926 | let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil) | |
910 | 927 | if ((unleaseInvOrEmpty == unleaseInvOrEmpty)) | |
911 | 928 | then { | |
912 | 929 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", ["", 0, 0], nil)) | |
913 | 930 | let gnsbtAmtTotal = asInt(gnsbtData[1]) | |
914 | 931 | let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3]) | |
915 | 932 | let commonActions = [IntegerEntry(totalLockedByUserKEY(swapType, account, inAsset), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType, inAsset), (totalLocked - inAmount)), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, withdrawPrice, outNetAmount, outFeeAmount, unlockHeight, index, txId, outSurfAmt, BR, withdrawBasket, inAsset))] | |
916 | 933 | func deposits (surfFees,nsbtFees,surfPayments,nsbtPayments) = { | |
917 | 934 | let surfDeposit = if ((surfFees > 0)) | |
918 | 935 | then asInt(invoke(surfStakingContract, "deposit", nil, surfPayments)) | |
919 | 936 | else 0 | |
920 | 937 | let nsbtDeposit = if ((nsbtFees > 0)) | |
921 | 938 | then asInt(invoke(nsbtStakingContract, "deposit", nil, nsbtPayments)) | |
922 | 939 | else 0 | |
923 | 940 | (surfDeposit + nsbtDeposit) | |
924 | 941 | } | |
925 | 942 | ||
926 | 943 | func divideFees (feeAmount) = { | |
927 | 944 | let surfAmt1 = if ((gnsbtAmtTotal != 0)) | |
928 | 945 | then fraction(feeAmount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal) | |
929 | 946 | else 0 | |
930 | 947 | let surfAmt2 = if ((gnsbtAmtTotal != 0)) | |
931 | 948 | then fraction(feeAmount, (MULT6 - BR), MULT6) | |
932 | 949 | else 0 | |
933 | 950 | let surfAmt = max([surfAmt1, surfAmt2]) | |
934 | 951 | let nsbtAmt = (feeAmount - surfAmt) | |
935 | 952 | [surfAmt, nsbtAmt] | |
936 | 953 | } | |
937 | 954 | ||
938 | 955 | let transfers = if ((swapType == "outMulti")) | |
939 | 956 | then { | |
940 | 957 | let basket = split_4C(withdrawBasket, "_") | |
941 | 958 | func looper (acc,item) = { | |
942 | 959 | let it = split(item, LISTSEP) | |
943 | 960 | let tempAssetId = fromBase58String(it[0]) | |
944 | 961 | let assetId = if ((tempAssetId == WAVESID)) | |
945 | 962 | then unit | |
946 | 963 | else tempAssetId | |
947 | 964 | let netAmount = parseIntValue(it[2]) | |
948 | 965 | let feeAmount = parseIntValue(it[3]) | |
949 | 966 | let fees = divideFees(feeAmount) | |
950 | 967 | $Tuple5((acc._1 :+ ScriptTransfer(userAddress, netAmount, assetId)), (acc._2 :+ AttachedPayment(assetId, fees[0])), (acc._3 :+ AttachedPayment(assetId, fees[1])), (acc._4 + fees[0]), (acc._5 + fees[1])) | |
951 | 968 | } | |
952 | 969 | ||
953 | 970 | let r = { | |
954 | 971 | let $l = basket | |
955 | 972 | let $s = size($l) | |
956 | 973 | let $acc0 = $Tuple5(nil, nil, nil, 0, 0) | |
957 | 974 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
958 | 975 | then $a | |
959 | 976 | else looper($a, $l[$i]) | |
960 | 977 | ||
961 | 978 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
962 | 979 | then $a | |
963 | 980 | else throw("List size exceeds 10") | |
964 | 981 | ||
965 | 982 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
966 | 983 | } | |
967 | 984 | let depoResult = deposits(r._4, r._5, r._2, r._3) | |
968 | 985 | $Tuple2(r._1, depoResult) | |
969 | 986 | } | |
970 | 987 | else { | |
971 | 988 | let fees = divideFees(outFeeAmount) | |
972 | 989 | let depoResult = deposits(fees[0], fees[1], [AttachedPayment(outAssetId, fees[0])], [AttachedPayment(outAssetId, fees[1])]) | |
973 | 990 | $Tuple2([ScriptTransfer(userAddress, outNetAmount, outAssetId)], depoResult) | |
974 | 991 | } | |
975 | 992 | $Tuple2((commonActions ++ transfers._1), transfers._2) | |
976 | 993 | } | |
977 | 994 | else throw("Strict value is not equal to itself.") | |
978 | 995 | } | |
979 | 996 | else throw("Strict value is not equal to itself.") | |
980 | 997 | } | |
981 | 998 | } | |
982 | 999 | } | |
983 | 1000 | } | |
984 | 1001 | ||
985 | 1002 | ||
986 | 1003 | ||
987 | 1004 | @Callable(i) | |
988 | 1005 | func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this)) | |
989 | 1006 | then throw("internalUnleaseAndLease is not public method") | |
990 | 1007 | else prepareUnleaseAndLease(unleaseAmount) | |
991 | 1008 | ||
992 | 1009 | ||
993 | 1010 | ||
994 | 1011 | @Callable(i) | |
995 | 1012 | func transferUsdnToUser (amount,addr) = if ((i.caller != auctionContract)) | |
996 | 1013 | then throw("Only auction contract is authorized") | |
997 | 1014 | else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)] | |
998 | 1015 | ||
999 | 1016 | ||
1000 | 1017 | ||
1001 | 1018 | @Callable(i) | |
1002 | 1019 | func acceptWaves () = if (if ((i.caller != auctionContract)) | |
1003 | 1020 | then (i.caller != govContract) | |
1004 | 1021 | else false) | |
1005 | 1022 | then throw("Currently only auction and governance contracts are allowed to call") | |
1006 | 1023 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
1007 | 1024 | ||
1008 | 1025 | ||
1009 | 1026 | ||
1010 | 1027 | @Callable(i) | |
1011 | 1028 | func approveLeasings (nListS,groupNum,lAmt) = { | |
1012 | 1029 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
1013 | 1030 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
1014 | 1031 | let mngPub = fromBase58String(mngPubS) | |
1015 | 1032 | let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE") | |
1016 | 1033 | let nodeRegAddr = addressFromStringValue(nodeRegAddrStr) | |
1017 | 1034 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
1018 | 1035 | let lGrNodeOpt = getString(this, lGroupNodeListKEY) | |
1019 | 1036 | if (isDefined(lGrNodeOpt)) | |
1020 | 1037 | then throw((("group " + toString(groupNum)) + " already initialized")) | |
1021 | 1038 | else { | |
1022 | 1039 | let nList = split(nListS, SEP) | |
1023 | 1040 | let expCount = size(nIdxs) | |
1024 | 1041 | if ((i.callerPublicKey != mngPub)) | |
1025 | 1042 | then throw("approveLeasings not authorized") | |
1026 | 1043 | else { | |
1027 | - | let $ | |
1028 | - | let nAddr0 = $ | |
1029 | - | let lAmtKEY0 = $ | |
1030 | - | let lAmt0 = $ | |
1031 | - | let lIdKEY0 = $ | |
1032 | - | let lId0 = $ | |
1044 | + | let $t04534345405 = readNodeInfo(0) | |
1045 | + | let nAddr0 = $t04534345405._1 | |
1046 | + | let lAmtKEY0 = $t04534345405._2 | |
1047 | + | let lAmt0 = $t04534345405._3 | |
1048 | + | let lIdKEY0 = $t04534345405._4 | |
1049 | + | let lId0 = $t04534345405._5 | |
1033 | 1050 | let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount))) | |
1034 | 1051 | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
1035 | 1052 | if ((validation == validation)) | |
1036 | 1053 | then { | |
1037 | 1054 | func forEachNodeValidateAndGenerateLease (a,i) = { | |
1038 | 1055 | let node = nList[i] | |
1039 | 1056 | let la = Lease(addressFromStringValue(node), lAmt) | |
1040 | 1057 | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
1041 | 1058 | } | |
1042 | 1059 | ||
1043 | 1060 | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0] ++ { | |
1044 | 1061 | let $l = nIdxs | |
1045 | 1062 | let $s = size($l) | |
1046 | 1063 | let $acc0 = nil | |
1047 | 1064 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1048 | 1065 | then $a | |
1049 | 1066 | else forEachNodeValidateAndGenerateLease($a, $l[$i]) | |
1050 | 1067 | ||
1051 | 1068 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1052 | 1069 | then $a | |
1053 | 1070 | else throw("List size exceeds 8") | |
1054 | 1071 | ||
1055 | 1072 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
1056 | 1073 | }) | |
1057 | 1074 | } | |
1058 | 1075 | else throw("Strict value is not equal to itself.") | |
1059 | 1076 | } | |
1060 | 1077 | } | |
1061 | 1078 | } | |
1062 | 1079 | ||
1063 | 1080 | ||
1064 | 1081 | ||
1065 | 1082 | @Callable(i) | |
1066 | 1083 | func rebalanceLeasings (amount,groupNum) = { | |
1067 | 1084 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
1068 | 1085 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
1069 | 1086 | let mngPub = fromBase58String(mngPubS) | |
1070 | 1087 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
1071 | 1088 | let nListS = getStringOrFail(this, lGroupNodeListKEY) | |
1072 | 1089 | let nList = split(nListS, SEP) | |
1073 | 1090 | if ((i.callerPublicKey != mngPub)) | |
1074 | 1091 | then throw("rebalanceLeasings not authorized") | |
1075 | 1092 | else { | |
1076 | 1093 | let unleaseAmt = ((amount / size(nList)) + 1) | |
1077 | - | let $ | |
1078 | - | let nAddr0 = $ | |
1079 | - | let lAmtKEY0 = $ | |
1080 | - | let lAmt0 = $ | |
1081 | - | let lIdKEY0 = $ | |
1082 | - | let lId0 = $ | |
1094 | + | let $t04664546707 = readNodeInfo(0) | |
1095 | + | let nAddr0 = $t04664546707._1 | |
1096 | + | let lAmtKEY0 = $t04664546707._2 | |
1097 | + | let lAmt0 = $t04664546707._3 | |
1098 | + | let lIdKEY0 = $t04664546707._4 | |
1099 | + | let lId0 = $t04664546707._5 | |
1083 | 1100 | let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList)))) | |
1084 | 1101 | func forEachNodeDoUnlease (a,i) = { | |
1085 | 1102 | let node = nList[i] | |
1086 | 1103 | let lIdKEY = getLeaseIdByAddressKey(node) | |
1087 | 1104 | let lId = getBinaryValue(this, lIdKEY) | |
1088 | 1105 | let lAmtKEY = getLeaseAmountByAddressKey(node) | |
1089 | 1106 | let lAmt = getIntegerValue(this, lAmtKEY) | |
1090 | 1107 | let ula = LeaseCancel(value(lId)) | |
1091 | 1108 | let la = Lease(addressFromStringValue(node), (lAmt - unleaseAmt)) | |
1092 | 1109 | (a ++ [LeaseCancel(value(lId)), la, BinaryEntry(lIdKEY, lcalc(la)), IntegerEntry(lAmtKEY, la.amount)]) | |
1093 | 1110 | } | |
1094 | 1111 | ||
1095 | 1112 | ({ | |
1096 | 1113 | let $l = nIdxs | |
1097 | 1114 | let $s = size($l) | |
1098 | 1115 | let $acc0 = nil | |
1099 | 1116 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1100 | 1117 | then $a | |
1101 | 1118 | else forEachNodeDoUnlease($a, $l[$i]) | |
1102 | 1119 | ||
1103 | 1120 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1104 | 1121 | then $a | |
1105 | 1122 | else throw("List size exceeds 8") | |
1106 | 1123 | ||
1107 | 1124 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
1108 | 1125 | } ++ [BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0]) | |
1109 | 1126 | } | |
1110 | 1127 | } | |
1111 | 1128 | ||
1112 | 1129 | ||
1113 | 1130 | ||
1114 | 1131 | @Callable(i) | |
1115 | 1132 | func swapParamsByUserSYSREADONLY (userAddressStr,gnsbtDiff) = { | |
1116 | 1133 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStr, 0, 0], nil)) | |
1117 | 1134 | let gnsbtAmt = (asInt(gnsbtData[0]) + gnsbtDiff) | |
1118 | 1135 | let gnsbtAmtTotal = (asInt(gnsbtData[1]) + gnsbtDiff) | |
1119 | 1136 | let swapLimitData = asAnyList(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil)) | |
1120 | 1137 | let tokenSwapLimitInUsdMax = asInt(swapLimitData[0]) | |
1121 | 1138 | let usdnSwapLimitMax = asInt(swapLimitData[2]) | |
1122 | 1139 | let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0) | |
1123 | 1140 | let swapLimitTimelifeBlocks = swapsTimeframeREAD() | |
1124 | 1141 | let passedBlocksAfterLastSwap = (height - lastSwapHeight) | |
1125 | 1142 | let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks) | |
1126 | 1143 | let swapLimitSpentInUsdn = if (isSwapTimelifeNew) | |
1127 | 1144 | then 0 | |
1128 | 1145 | else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0) | |
1129 | 1146 | let blcks2LmtReset = if (isSwapTimelifeNew) | |
1130 | 1147 | then 0 | |
1131 | 1148 | else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap) | |
1132 | 1149 | $Tuple2(nil, $Tuple7(tokenSwapLimitInUsdMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, 0, usdnSwapLimitMax)) | |
1133 | 1150 | } | |
1134 | 1151 | ||
1135 | 1152 | ||
1136 | 1153 | ||
1137 | 1154 | @Callable(i) | |
1138 | 1155 | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price,inAsset) = { | |
1139 | 1156 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
1140 | 1157 | $Tuple2(nil, calcWithdraw(swapType, inAmount, price, neutrinoMetrics, inAsset)) | |
1141 | 1158 | } | |
1142 | 1159 | ||
1143 | 1160 | ||
1144 | 1161 | ||
1145 | 1162 | @Callable(i) | |
1146 | 1163 | func replaceCommunityNode (oldAddrStr,newAddrStr,groupNum,penaltyAmount) = { | |
1147 | 1164 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
1148 | 1165 | let mngPub = fromBase58String(mngPubS) | |
1149 | 1166 | if ((i.callerPublicKey != mngPub)) | |
1150 | 1167 | then throw("replaceCommunityNode not authorized") | |
1151 | 1168 | else { | |
1152 | 1169 | let groupKey = getLeaseGroupNodeListKey(groupNum) | |
1153 | 1170 | let groupNodeListS = getStringOrFail(this, groupKey) | |
1154 | 1171 | if (!(contains(groupNodeListS, oldAddrStr))) | |
1155 | 1172 | then throw(((("Group " + toString(groupNum)) + " does not contain address ") + oldAddrStr)) | |
1156 | 1173 | else { | |
1157 | 1174 | let doReplace = invoke(nodeRegistryContract, "replaceApprovedNode", [oldAddrStr, newAddrStr, groupNum, penaltyAmount], nil) | |
1158 | 1175 | if ((doReplace == doReplace)) | |
1159 | 1176 | then { | |
1160 | 1177 | let oldLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr) | |
1161 | 1178 | let oldLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr) | |
1162 | 1179 | let leaseAmt = getIntegerValue(oldLeaseAmtKey) | |
1163 | 1180 | let newLeaseIdKey = getLeaseIdByAddressKey(newAddrStr) | |
1164 | 1181 | let newLeaseAmtKey = getLeaseAmountByAddressKey(newAddrStr) | |
1165 | 1182 | let newLease = Lease(addressFromStringValue(newAddrStr), leaseAmt) | |
1166 | 1183 | let updatedGroupNodeListS = makeString(split(groupNodeListS, oldAddrStr), newAddrStr) | |
1167 | 1184 | $Tuple2([LeaseCancel(getBinaryValue(oldLeaseIdKey)), DeleteEntry(oldLeaseIdKey), DeleteEntry(oldLeaseAmtKey), StringEntry(groupKey, updatedGroupNodeListS), newLease, BinaryEntry(newLeaseIdKey, lcalc(newLease)), IntegerEntry(newLeaseAmtKey, leaseAmt)], unit) | |
1168 | 1185 | } | |
1169 | 1186 | else throw("Strict value is not equal to itself.") | |
1170 | 1187 | } | |
1171 | 1188 | } | |
1172 | 1189 | } | |
1173 | 1190 | ||
1174 | 1191 | ||
1175 | 1192 | @Verifier(tx) | |
1176 | 1193 | func verify () = { | |
1177 | 1194 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
1178 | 1195 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
1179 | 1196 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
1180 | 1197 | then 1 | |
1181 | 1198 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
1182 | 1199 | then 1 | |
1183 | 1200 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
1184 | 1201 | then 1 | |
1185 | 1202 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
1186 | 1203 | then 2 | |
1187 | 1204 | else 0)) | |
1188 | 1205 | if (if (isBlocked) | |
1189 | 1206 | then (getStringValue(controlContract, "is_blocked_caller") == toString(govContract)) | |
1190 | 1207 | else false) | |
1191 | 1208 | then validateUpdate(tx) | |
1192 | 1209 | else match tx { | |
1193 | 1210 | case sponsorTx: SponsorFeeTransaction => | |
1194 | 1211 | if (checkIsValidMinSponsoredFee(sponsorTx)) | |
1195 | 1212 | then (count >= 3) | |
1196 | 1213 | else false | |
1197 | 1214 | case _ => | |
1198 | 1215 | (count >= 3) | |
1199 | 1216 | } | |
1200 | 1217 | } | |
1201 | 1218 |
github/deemru/w8io/026f985 162.36 ms ◑