tx · 2YG32vXKqsqm5bGr318anrWctr9Uz2BQZiLuui7yxava 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj: -0.04000000 Waves 2022.08.23 15:02 [2197103] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves
{ "type": 13, "id": "2YG32vXKqsqm5bGr318anrWctr9Uz2BQZiLuui7yxava", "fee": 4000000, "feeAssetId": null, "timestamp": 1661256134478, "version": 1, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "4SotD7V912zkrhzX1SEPyh9JdEXCT4u8ofEiBLs7ENbnDzsnuyday9jGQupZnn1j3Dw1JHh6hVVzevGNVdhr2FHv", "2dVCiGFL1xtLWMzWPFU8N8r2DqrqNqf5sfqLF2K8qYCLYtAcA5HXiVZFUG95J86ACEnXkSub3DHffFdF3GMcHrUG", "KwW6sVYzY2AbLutypET98j5ivkQLSWcpBLP2ywmPY7YQQz6mUAvcTKjdZ2YkXM5hATNUihcHBpbmQ7NgT7Eyu9V" ], "script": "base64:BgJOCAISDgoMCAgICAgIAQEBAQEBEgUKAwgIARIAEgASBQoDCAEIEgMKAQESBAoCAQgSABIECgIIARIECgIBARIECgIIARIFCgMIAQESABIApQEBD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQVsY2FsYwEBbAkAuQgBBQFsAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ5nZXRTdHJpbmdCeUtleQEDa2V5CQELdmFs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WJLZXlBZG1pbnNMaXN0AAMAAgAABAckbWF0Y2gwBQJ0eAMJAAECBQckbWF0Y2gwAhVTcG9uc29yRmVlVHJhbnNhY3Rpb24ECXNwb25zb3JUeAUHJG1hdGNoMAMJARtjaGVja0lzVmFsaWRNaW5TcG9uc29yZWRGZWUBBQlzcG9uc29yVHgJAGcCBQVjb3VudAADBwkAZwIFBWNvdW50AAMlKItO", "chainId": 84, "height": 2197103, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2YTUDVy5c9WEf2XUhRfABTXnpMgw11i9VWM6xBZivQZx Next: 6q9jKmWEtf4idm22x5gtq7n6L7fSH7RW7HtZjWQmmbbC Full:
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 WAVELET = 100000000 | |
79 | 79 | ||
80 | 80 | let PAULI = 1000000 | |
81 | 81 | ||
82 | 82 | let PRICELET = 1000000 | |
83 | 83 | ||
84 | 84 | let DEFAULTSWAPFEE = 20000 | |
85 | 85 | ||
86 | 86 | let BRPROTECTED = 100000 | |
87 | 87 | ||
88 | 88 | let IdxNetAmount = 0 | |
89 | 89 | ||
90 | 90 | let IdxFeeAmount = 1 | |
91 | 91 | ||
92 | 92 | let IdxGrossAmount = 2 | |
93 | 93 | ||
94 | 94 | let IdxControlCfgNeutrinoDapp = 1 | |
95 | 95 | ||
96 | 96 | let IdxControlCfgAuctionDapp = 2 | |
97 | 97 | ||
98 | 98 | let IdxControlCfgRpdDapp = 3 | |
99 | 99 | ||
100 | 100 | let IdxControlCfgMathDapp = 4 | |
101 | 101 | ||
102 | 102 | let IdxControlCfgLiquidationDapp = 5 | |
103 | 103 | ||
104 | 104 | let IdxControlCfgRestDapp = 6 | |
105 | 105 | ||
106 | 106 | let IdxControlCfgNodeRegistryDapp = 7 | |
107 | 107 | ||
108 | 108 | let IdxControlCfgNsbtStakingDapp = 8 | |
109 | 109 | ||
110 | 110 | let IdxControlCfgMediatorDapp = 9 | |
111 | 111 | ||
112 | 112 | let IdxControlCfgSurfStakingDapp = 10 | |
113 | 113 | ||
114 | 114 | let IdxControlCfgGnsbtControllerDapp = 11 | |
115 | 115 | ||
116 | 116 | func keyControlAddress () = "%s%s__config__controlAddress" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyControlCfg () = "%s__controlConfig" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
129 | 129 | ||
130 | 130 | let controlCfg = readControlCfgOrFail(controlContract) | |
131 | 131 | ||
132 | 132 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
133 | 133 | ||
134 | 134 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
135 | 135 | ||
136 | 136 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
137 | 137 | ||
138 | 138 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
139 | 139 | ||
140 | 140 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
141 | 141 | ||
142 | 142 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
143 | 143 | ||
144 | 144 | let BondAssetIdKey = "bond_asset_id" | |
145 | 145 | ||
146 | 146 | let AuctionContractKey = "auction_contract" | |
147 | 147 | ||
148 | 148 | let NsbtStakingContractKey = "nsbtStakingContract" | |
149 | 149 | ||
150 | 150 | let LiquidationContractKey = "liquidation_contract" | |
151 | 151 | ||
152 | 152 | let RPDContractKey = "rpd_contract" | |
153 | 153 | ||
154 | 154 | let ContolContractKey = "control_contract" | |
155 | 155 | ||
156 | 156 | let MathContractKey = "math_contract" | |
157 | 157 | ||
158 | 158 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
159 | 159 | ||
160 | 160 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
161 | 161 | ||
162 | 162 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
163 | 163 | ||
164 | 164 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
165 | 165 | ||
166 | 166 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
167 | 167 | ||
168 | 168 | let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart" | |
169 | 169 | ||
170 | 170 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
171 | 171 | ||
172 | 172 | func keyNodeRegistry (address) = ("%s__" + address) | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | let PriceKey = "price" | |
176 | 176 | ||
177 | 177 | let PriceIndexKey = "price_index" | |
178 | 178 | ||
179 | 179 | let IsBlockedKey = "is_blocked" | |
180 | 180 | ||
181 | 181 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP)) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx)) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * WAVELET)) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP) | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func totalLockedKEY (swapType) = ("balance_lock_" + swapType) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func totalLockedByUserKEY (swapType,owner) = makeString(["balance_lock", swapType, owner], "_") | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func balanceLockIntervalKEY (swapType) = (("balance_" + swapType) + "_lock_interval") | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval" | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func outFeePartKEY (swapType) = (swapType + "Out_swap_feePart") | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func swapsTimeframeKEY () = "swaps_timeframe" | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func brProtectedKEY () = "min_BR_protection_level" | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func minSwapAmountREAD (swapType) = valueOrElse(getInteger(this, minSwapAmountKEY(swapType)), 0) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440) | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func totalLockedREAD (swapType) = valueOrElse(getInteger(this, totalLockedKEY(swapType)), 0) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func totalLockedByUserREAD (swapType,owner) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner)), 0) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount))) | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | 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))) | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
284 | 284 | ||
285 | 285 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
286 | 286 | ||
287 | 287 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
288 | 288 | ||
289 | 289 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
290 | 290 | ||
291 | 291 | let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z") | |
292 | 292 | ||
293 | 293 | let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF") | |
294 | 294 | ||
295 | 295 | let neutrinoContract = this | |
296 | 296 | ||
297 | 297 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
298 | 298 | ||
299 | 299 | func checkIsValidMinSponsoredFee (tx) = { | |
300 | 300 | let MINTRANSFERFEE = 100000 | |
301 | 301 | let SponsoredFeeUpperBound = 1000 | |
302 | 302 | let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice) | |
303 | 303 | let minNeutrinoFee = (realNeutrinoFee * 2) | |
304 | 304 | let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100) | |
305 | 305 | let inputFee = value(tx.minSponsoredAssetFee) | |
306 | 306 | if (if ((inputFee >= minNeutrinoFee)) | |
307 | 307 | then (maxNeutrinoFee >= inputFee) | |
308 | 308 | else false) | |
309 | 309 | then (tx.assetId == neutrinoAssetId) | |
310 | 310 | else false | |
311 | 311 | } | |
312 | 312 | ||
313 | 313 | ||
314 | 314 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
315 | 315 | ||
316 | 316 | ||
317 | 317 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
321 | 321 | ||
322 | 322 | ||
323 | 323 | let sIdxSwapType = 1 | |
324 | 324 | ||
325 | 325 | let sIdxStatus = 2 | |
326 | 326 | ||
327 | 327 | let sIdxInAmount = 3 | |
328 | 328 | ||
329 | 329 | let sIdxPrice = 4 | |
330 | 330 | ||
331 | 331 | let sIdxOutNetAmount = 5 | |
332 | 332 | ||
333 | 333 | let sIdxOutFeeAmount = 6 | |
334 | 334 | ||
335 | 335 | let sIdxStartHeight = 7 | |
336 | 336 | ||
337 | 337 | let sIdxStartTimestamp = 8 | |
338 | 338 | ||
339 | 339 | let sIdxEndHeight = 9 | |
340 | 340 | ||
341 | 341 | let sIdxEndTimestamp = 10 | |
342 | 342 | ||
343 | 343 | let sIdxSelfUnlockHeight = 11 | |
344 | 344 | ||
345 | 345 | let sIdxRandUnlockHeight = 12 | |
346 | 346 | ||
347 | 347 | let sIdxIndex = 13 | |
348 | 348 | ||
349 | 349 | let sIdxWithdrawTxId = 14 | |
350 | 350 | ||
351 | 351 | let sIdxMinRand = 15 | |
352 | 352 | ||
353 | 353 | let sIdxMaxRand = 16 | |
354 | 354 | ||
355 | 355 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
356 | 356 | ||
357 | 357 | ||
358 | 358 | func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax], SEP) | |
359 | 359 | ||
360 | 360 | ||
361 | 361 | func pendingSwapDATA (swapType,inAssetAmount,selfUnlockHeight) = strSwapDATA(swapType, "PENDING", toString(inAssetAmount), "0", "0", "0", toString(height), toString(lastBlock.timestamp), "0", "0", toString(selfUnlockHeight), "0", "0", "NULL", "0", "0") | |
362 | 362 | ||
363 | 363 | ||
364 | 364 | func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId) = 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]) | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
368 | 368 | let swapKey = swapKEY(userAddress, swapTxId) | |
369 | 369 | split(valueOrErrorMessage(getString(this, swapKey), ("no swap data for " + swapKey)), SEP) | |
370 | 370 | } | |
371 | 371 | ||
372 | 372 | ||
373 | 373 | func applyFees (amountOutGross,inAmtToSURF,feePart) = { | |
374 | 374 | let feeAmount = fraction(amountOutGross, feePart, PAULI) | |
375 | 375 | [(amountOutGross - feeAmount), feeAmount] | |
376 | 376 | } | |
377 | 377 | ||
378 | 378 | ||
379 | 379 | func abs (x) = if ((0 > x)) | |
380 | 380 | then -(x) | |
381 | 381 | else x | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | func selectNode (unleaseAmount) = { | |
385 | 385 | let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship()) | |
386 | 386 | let oldLeased0 = getNumberByKey(getLeaseAmountKey(0)) | |
387 | 387 | let oldLeased1 = getNumberByKey(getLeaseAmountKey(1)) | |
388 | 388 | let newLeased0 = (amountToLease + oldLeased0) | |
389 | 389 | let newLeased1 = (amountToLease + oldLeased1) | |
390 | 390 | if (if ((newLeased0 > 0)) | |
391 | 391 | then true | |
392 | 392 | else (newLeased1 > 0)) | |
393 | 393 | then { | |
394 | 394 | let delta0 = abs((newLeased0 - oldLeased1)) | |
395 | 395 | let delta1 = abs((newLeased1 - oldLeased0)) | |
396 | 396 | if ((delta1 >= delta0)) | |
397 | 397 | then $Tuple2(0, newLeased0) | |
398 | 398 | else $Tuple2(1, newLeased1) | |
399 | 399 | } | |
400 | 400 | else $Tuple2(-1, 0) | |
401 | 401 | } | |
402 | 402 | ||
403 | 403 | ||
404 | 404 | func thisOnly (i) = if ((i.caller != this)) | |
405 | 405 | then throw("Permission denied: this contract only allowed") | |
406 | 406 | else true | |
407 | 407 | ||
408 | 408 | ||
409 | 409 | func prepareUnleaseAndLease (unleaseAmount) = { | |
410 | 410 | let nodeTuple = selectNode(unleaseAmount) | |
411 | 411 | let nodeIndex = nodeTuple._1 | |
412 | 412 | let newLeaseAmount = nodeTuple._2 | |
413 | 413 | if ((newLeaseAmount > 0)) | |
414 | 414 | then { | |
415 | 415 | let leaseIdKey = getLeaseIdKey(nodeIndex) | |
416 | 416 | let oldLease = getBinary(this, leaseIdKey) | |
417 | 417 | let unleaseOrEmpty = if (isDefined(oldLease)) | |
418 | 418 | then [LeaseCancel(value(oldLease))] | |
419 | 419 | else nil | |
420 | 420 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
421 | 421 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
422 | 422 | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
423 | 423 | } | |
424 | 424 | else nil | |
425 | 425 | } | |
426 | 426 | ||
427 | 427 | ||
428 | 428 | func readNodeInfo (nodeIdx) = { | |
429 | 429 | let nodeAddress = getStakingNodeAddressByIndex(nodeIdx) | |
430 | 430 | let leasedAmtKEY = getLeaseAmountKey(nodeIdx) | |
431 | 431 | let leasedAmt = getNumberByKey(leasedAmtKEY) | |
432 | 432 | let leaseIdKEY = getLeaseIdKey(nodeIdx) | |
433 | 433 | let leaseId = value(getBinary(this, leaseIdKEY)) | |
434 | 434 | $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId) | |
435 | 435 | } | |
436 | 436 | ||
437 | 437 | ||
438 | 438 | func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapParamsByUserSYSREADONLY) = { | |
439 | 439 | let swapLimitSpent = swapParamsByUserSYSREADONLY._2 | |
440 | 440 | let blcks2LmtReset = swapParamsByUserSYSREADONLY._3 | |
441 | 441 | let wavesSwapLimitMax = swapParamsByUserSYSREADONLY._6 | |
442 | 442 | let usdnSwapLimitMax = swapParamsByUserSYSREADONLY._7 | |
443 | 443 | let minSwapAmount = minSwapAmountREAD(swapType) | |
444 | 444 | let totalLocked = totalLockedREAD(swapType) | |
445 | 445 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr) | |
446 | 446 | let nodeAddress = getStakingNodeByIndex(0) | |
447 | 447 | let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex)) | |
448 | 448 | let isSwapByNode = (nodeAddress == userAddressStr) | |
449 | 449 | let balanceLockMaxInterval = if (isSwapByNode) | |
450 | 450 | then nodeBalanceLockIntervalREAD() | |
451 | 451 | else balanceLockIntervalREAD(swapType) | |
452 | 452 | let selfUnlockHeight = (height + balanceLockMaxInterval) | |
453 | 453 | let swapUsdnVolume = if ((swapType == "neutrino")) | |
454 | 454 | then pmtAmount | |
455 | 455 | else convertWavesToNeutrino(pmtAmount, priceByIndex) | |
456 | 456 | let swapLimitMax = if ((swapType == "neutrino")) | |
457 | 457 | then usdnSwapLimitMax | |
458 | 458 | else convertWavesToNeutrino(wavesSwapLimitMax, priceByIndex) | |
459 | 459 | if ((minSwapAmount > pmtAmount)) | |
460 | 460 | then minSwapAmountFAIL(swapType, minSwapAmount) | |
461 | 461 | else if (if (!(isSwapByNode)) | |
462 | 462 | then (swapLimitSpent > 0) | |
463 | 463 | else false) | |
464 | 464 | then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset)))) | |
465 | 465 | else if (if (!(isSwapByNode)) | |
466 | 466 | then (swapUsdnVolume > swapLimitMax) | |
467 | 467 | else false) | |
468 | 468 | then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax))) | |
469 | 469 | else if (isBlocked) | |
470 | 470 | then emergencyShutdownFAIL() | |
471 | 471 | else { | |
472 | 472 | let leasePart = if ((swapType == "waves")) | |
473 | 473 | then prepareUnleaseAndLease(0) | |
474 | 474 | else nil | |
475 | 475 | $Tuple2(([IntegerEntry(keySwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastSwapHeight(userAddressStr), height), IntegerEntry(totalLockedByUserKEY(swapType, userAddressStr), (totalLockedByUser + pmtAmount)), IntegerEntry(getBalanceUnlockBlockKey(userAddressStr), selfUnlockHeight), IntegerEntry(totalLockedKEY(swapType), (totalLocked + pmtAmount)), StringEntry(swapKEY(userAddressStr, txId58), pendingSwapDATA(swapType, pmtAmount, selfUnlockHeight))] ++ leasePart), unit) | |
476 | 476 | } | |
477 | 477 | } | |
478 | 478 | ||
479 | 479 | ||
480 | 480 | let nMetricIdxPrice = 0 | |
481 | 481 | ||
482 | 482 | let nMetricIdxUsdnLockedBalance = 1 | |
483 | 483 | ||
484 | 484 | let nMetricIdxWavesLockedBalance = 2 | |
485 | 485 | ||
486 | 486 | let nMetricIdxReserve = 3 | |
487 | 487 | ||
488 | 488 | let nMetricIdxReserveInUsdn = 4 | |
489 | 489 | ||
490 | 490 | let nMetricIdxUsdnSupply = 5 | |
491 | 491 | ||
492 | 492 | let nMetricIdxSurplus = 6 | |
493 | 493 | ||
494 | 494 | let nMetricIdxSurplusPercent = 7 | |
495 | 495 | ||
496 | 496 | let nMetricIdxBR = 8 | |
497 | 497 | ||
498 | 498 | let nMetricIdxNsbtSupply = 9 | |
499 | 499 | ||
500 | 500 | let nMetricIdxMaxNsbtSupply = 10 | |
501 | 501 | ||
502 | 502 | let nMetricIdxSurfSupply = 11 | |
503 | 503 | ||
504 | 504 | let bFuncIdxSurf = 0 | |
505 | 505 | ||
506 | 506 | let bFuncIdxWaves = 1 | |
507 | 507 | ||
508 | 508 | let bFuncIdxUsdn = 2 | |
509 | 509 | ||
510 | 510 | let bFuncIdxReserveStart = 3 | |
511 | 511 | ||
512 | 512 | let bFuncIdxSupplyStart = 4 | |
513 | 513 | ||
514 | 514 | let bFuncIdxBRStart = 5 | |
515 | 515 | ||
516 | 516 | let bFuncIdxReserveEnd = 6 | |
517 | 517 | ||
518 | 518 | let bFuncIdxSupplyEnd = 7 | |
519 | 519 | ||
520 | 520 | let bFuncIdxBREnd = 8 | |
521 | 521 | ||
522 | 522 | let bFuncIdxRest = 9 | |
523 | 523 | ||
524 | 524 | let bFuncIdxWavesPrice = 10 | |
525 | 525 | ||
526 | 526 | func calcWithdrawW2U (wavesIn,price) = { | |
527 | 527 | let outAmtGross = convertWavesToNeutrino(wavesIn, price) | |
528 | 528 | $Tuple9(outAmtGross, neutrinoAssetId, 0, unit, 0, wavesIn, 0, 0, 0) | |
529 | 529 | } | |
530 | 530 | ||
531 | 531 | ||
532 | 532 | func calcWithdrawU2W (usdnIn,price,br,reservesInUsdn,usdnSupply) = { | |
533 | 533 | let brProtected = valueOrElse(getInteger(this, brProtectedKEY()), BRPROTECTED) | |
534 | 534 | let maxAllowedUsdnBeforeMinBr = if ((brProtected >= br)) | |
535 | 535 | then 0 | |
536 | 536 | else fraction((reservesInUsdn - fraction(brProtected, usdnSupply, PAULI)), PAULI, (PAULI - brProtected)) | |
537 | 537 | let allowedUsdnBeforeMinBr = if ((usdnIn > maxAllowedUsdnBeforeMinBr)) | |
538 | 538 | then maxAllowedUsdnBeforeMinBr | |
539 | 539 | else usdnIn | |
540 | 540 | let allowedUsdnAfterMinBr = if ((usdnIn > maxAllowedUsdnBeforeMinBr)) | |
541 | 541 | then fraction((usdnIn - maxAllowedUsdnBeforeMinBr), br, PAULI) | |
542 | 542 | else 0 | |
543 | 543 | let allowedUsdn = (allowedUsdnBeforeMinBr + allowedUsdnAfterMinBr) | |
544 | 544 | let usdn2SURF = (usdnIn - allowedUsdn) | |
545 | 545 | let outAmtGross = convertNeutrinoToWaves(allowedUsdn, price) | |
546 | 546 | $Tuple9(outAmtGross, unit, usdn2SURF, neutrinoAssetId, outAmtGross, allowedUsdn, maxAllowedUsdnBeforeMinBr, allowedUsdnBeforeMinBr, allowedUsdnAfterMinBr) | |
547 | 547 | } | |
548 | 548 | ||
549 | 549 | ||
550 | 550 | func calcWithdraw (swapType,inAmount,price) = { | |
551 | 551 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
552 | 552 | if (if ((0 > outFeePart)) | |
553 | 553 | then true | |
554 | 554 | else (outFeePart >= PAULI)) | |
555 | 555 | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
556 | 556 | else { | |
557 | 557 | let brProtected = valueOrElse(getInteger(this, brProtectedKEY()), BRPROTECTED) | |
558 | 558 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
559 | 559 | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
560 | 560 | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
561 | 561 | let usdnSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
562 | 562 | let outDataTuple = if ((swapType == "waves")) | |
563 | 563 | then calcWithdrawW2U(inAmount, price) | |
564 | 564 | else if ((swapType == "neutrino")) | |
565 | 565 | then calcWithdrawU2W(inAmount, price, BR, reservesInUsdn, usdnSupply) | |
566 | 566 | else throw(("Unsupported swap type " + swapType)) | |
567 | 567 | let outAmtGross = outDataTuple._1 | |
568 | 568 | let outAssetId = outDataTuple._2 | |
569 | 569 | let inAmtToSurfPart = outDataTuple._3 | |
570 | 570 | let inAssetId = outDataTuple._4 | |
571 | 571 | let unleaseAmt = outDataTuple._5 | |
572 | 572 | let payoutsArray = applyFees(outAmtGross, inAmtToSurfPart, outFeePart) | |
573 | 573 | let outNetAmt = payoutsArray[IdxNetAmount] | |
574 | 574 | let outFeeAmt = payoutsArray[IdxFeeAmount] | |
575 | 575 | let outSurfAmt = if ((0 >= inAmtToSurfPart)) | |
576 | 576 | then 0 | |
577 | 577 | else { | |
578 | 578 | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [inAmtToSurfPart, inAssetId], nil)) | |
579 | 579 | asInt(surfResult[bFuncIdxSurf]) | |
580 | 580 | } | |
581 | 581 | $Tuple7(outNetAmt, outAssetId, outSurfAmt, inAmtToSurfPart, unleaseAmt, outFeeAmt, outAmtGross) | |
582 | 582 | } | |
583 | 583 | } | |
584 | 584 | ||
585 | 585 | ||
586 | 586 | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
587 | 587 | let userAddress = addressFromStringValue(account) | |
588 | 588 | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
589 | 589 | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
590 | 590 | let swapType = dataArray[sIdxSwapType] | |
591 | 591 | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
592 | 592 | let swapStatus = dataArray[sIdxStatus] | |
593 | 593 | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
594 | 594 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
595 | 595 | let totalLocked = totalLockedREAD(swapType) | |
596 | 596 | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
597 | 597 | let unlockHeight = selfUnlockHeight | |
598 | 598 | let indexHeight = getHeightPriceByIndex(index) | |
599 | 599 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
600 | 600 | let priceByIndex = getPriceHistory(indexHeight) | |
601 | 601 | if (isBlocked) | |
602 | 602 | then emergencyShutdownFAIL() | |
603 | 603 | else if ((swapStatus != "PENDING")) | |
604 | 604 | then throw("swap has been already processed") | |
605 | 605 | else if ((unlockHeight > height)) | |
606 | 606 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
607 | 607 | else if (if (if ((index > priceIndex)) | |
608 | 608 | then true | |
609 | 609 | else (unlockHeight > indexHeight)) | |
610 | 610 | then true | |
611 | 611 | else if ((prevIndexHeight != 0)) | |
612 | 612 | then (prevIndexHeight >= unlockHeight) | |
613 | 613 | else false) | |
614 | 614 | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
615 | 615 | else { | |
616 | 616 | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex) | |
617 | 617 | let outNetAmount = withdrawTuple._1 | |
618 | 618 | let outAssetId = withdrawTuple._2 | |
619 | 619 | let outSurfAmt = withdrawTuple._3 | |
620 | 620 | let inAmtToSurfPart = withdrawTuple._4 | |
621 | 621 | let unleaseAmt = withdrawTuple._5 | |
622 | 622 | let outFeeAmount = withdrawTuple._6 | |
623 | 623 | let outAmtGross = withdrawTuple._7 | |
624 | 624 | if ((0 >= outAmtGross)) | |
625 | 625 | then throw("balance equals zero") | |
626 | 626 | else { | |
627 | 627 | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAssetId), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))] | |
628 | 628 | let surfCondition = if ((outSurfAmt > 0)) | |
629 | 629 | then { | |
630 | 630 | let issueResult = invoke(auctionContract, "issueSurf", [outSurfAmt, account], nil) | |
631 | 631 | if ((issueResult == issueResult)) | |
632 | 632 | then 0 | |
633 | 633 | else throw("Strict value is not equal to itself.") | |
634 | 634 | } | |
635 | 635 | else 0 | |
636 | 636 | if ((surfCondition == surfCondition)) | |
637 | 637 | then $Tuple3(state, AttachedPayment(outAssetId, outFeeAmount), unleaseAmt) | |
638 | 638 | else throw("Strict value is not equal to itself.") | |
639 | 639 | } | |
640 | 640 | } | |
641 | 641 | } | |
642 | 642 | ||
643 | 643 | ||
644 | 644 | @Callable(i) | |
645 | 645 | func constructor (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = { | |
646 | 646 | let checkCaller = thisOnly(i) | |
647 | 647 | if ((checkCaller == checkCaller)) | |
648 | 648 | then if ((size(i.payments) != 0)) | |
649 | 649 | then throw("no payments allowed") | |
650 | 650 | 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(MinWavesSwapAmountKey, minWavesSwapAmountPrm), IntegerEntry(MinNeutrinoSwapAmountKey, minNeutrinoSwapAmountPrm), IntegerEntry(NeutrinoOutFeePartKey, neutrinoOutFeePartPrm), IntegerEntry(WavesOutFeePartKey, wavesOutFeePartPrm)] | |
651 | 651 | else throw("Strict value is not equal to itself.") | |
652 | 652 | } | |
653 | 653 | ||
654 | 654 | ||
655 | 655 | ||
656 | 656 | @Callable(i) | |
657 | 657 | func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = { | |
658 | 658 | let checkCaller = thisOnly(i) | |
659 | 659 | if ((checkCaller == checkCaller)) | |
660 | 660 | then if ((size(i.payments) != 0)) | |
661 | 661 | then throw("no payments allowed") | |
662 | 662 | else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)] | |
663 | 663 | else throw("Strict value is not equal to itself.") | |
664 | 664 | } | |
665 | 665 | ||
666 | 666 | ||
667 | 667 | ||
668 | 668 | @Callable(i) | |
669 | 669 | func swapWavesToNeutrino () = if ((size(i.payments) != 1)) | |
670 | 670 | then throw("swapWavesToNeutrino require only one payment") | |
671 | 671 | else { | |
672 | 672 | let pmt = value(i.payments[0]) | |
673 | 673 | if (isDefined(pmt.assetId)) | |
674 | 674 | then throw("Only Waves token is allowed for swapping.") | |
675 | 675 | else { | |
676 | 676 | let userAddress = toString(i.caller) | |
677 | 677 | let txId58 = toBase58String(i.transactionId) | |
678 | 678 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
679 | 679 | let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
680 | 680 | commonSwapResult | |
681 | 681 | } | |
682 | 682 | } | |
683 | 683 | ||
684 | 684 | ||
685 | 685 | ||
686 | 686 | @Callable(i) | |
687 | 687 | func swapNeutrinoToWaves () = if ((size(i.payments) != 1)) | |
688 | 688 | then throw("swapNeutrinoToWaves require only one payment") | |
689 | 689 | else { | |
690 | 690 | let pmt = value(i.payments[0]) | |
691 | 691 | if ((pmt.assetId != neutrinoAssetId)) | |
692 | 692 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
693 | 693 | else { | |
694 | 694 | let userAddress = toString(i.caller) | |
695 | 695 | let txId58 = toBase58String(i.transactionId) | |
696 | 696 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
697 | 697 | let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
698 | 698 | commonSwapResult | |
699 | 699 | } | |
700 | 700 | } | |
701 | 701 | ||
702 | 702 | ||
703 | 703 | ||
704 | 704 | @Callable(i) | |
705 | 705 | func withdraw (account,index,swapTxId) = { | |
706 | 706 | let txId = toBase58String(i.transactionId) | |
707 | 707 | if ((size(i.payments) != 0)) | |
708 | 708 | then throw("no payments allowed") | |
709 | 709 | else { | |
710 | 710 | let commonTuple = commonWithdraw(account, index, swapTxId, txId) | |
711 | 711 | let state = commonTuple._1 | |
712 | 712 | let fee = commonTuple._2 | |
713 | 713 | let unleaseAmt = commonTuple._3 | |
714 | 714 | let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil) | |
715 | 715 | if ((unleaseInvOrEmpty == unleaseInvOrEmpty)) | |
716 | 716 | then { | |
717 | 717 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", ["", 0, 0], nil)) | |
718 | 718 | let gnsbtAmtTotal = asInt(gnsbtData[1]) | |
719 | 719 | let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3]) | |
720 | 720 | let surfFeeAmt = if ((gnsbtAmtTotal != 0)) | |
721 | 721 | then fraction(fee.amount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal) | |
722 | 722 | else 0 | |
723 | 723 | let nsbtFeeAmt = (fee.amount - surfFeeAmt) | |
724 | 724 | let surfDeposit = if ((surfFeeAmt > 0)) | |
725 | 725 | then { | |
726 | 726 | let surfInv = invoke(surfStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, surfFeeAmt)]) | |
727 | 727 | if ((surfInv == surfInv)) | |
728 | 728 | then nil | |
729 | 729 | else throw("Strict value is not equal to itself.") | |
730 | 730 | } | |
731 | 731 | else nil | |
732 | 732 | if ((surfDeposit == surfDeposit)) | |
733 | 733 | then { | |
734 | 734 | let nsbtDeposit = if ((nsbtFeeAmt > 0)) | |
735 | 735 | then { | |
736 | 736 | let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, nsbtFeeAmt)]) | |
737 | 737 | if ((nsbtInv == nsbtInv)) | |
738 | 738 | then nil | |
739 | 739 | else throw("Strict value is not equal to itself.") | |
740 | 740 | } | |
741 | 741 | else nil | |
742 | 742 | if ((nsbtDeposit == nsbtDeposit)) | |
743 | 743 | then state | |
744 | 744 | else throw("Strict value is not equal to itself.") | |
745 | 745 | } | |
746 | 746 | else throw("Strict value is not equal to itself.") | |
747 | 747 | } | |
748 | 748 | else throw("Strict value is not equal to itself.") | |
749 | 749 | } | |
750 | 750 | } | |
751 | 751 | ||
752 | 752 | ||
753 | 753 | ||
754 | 754 | @Callable(i) | |
755 | 755 | func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this)) | |
756 | 756 | then throw("internalUnleaseAndLease is not public method") | |
757 | 757 | else prepareUnleaseAndLease(unleaseAmount) | |
758 | 758 | ||
759 | 759 | ||
760 | 760 | ||
761 | 761 | @Callable(i) | |
762 | 762 | func transferUsdnToUser (amount,addr) = if ((i.caller != auctionContract)) | |
763 | 763 | then throw("Only auction contract is authorized") | |
764 | 764 | else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)] | |
765 | 765 | ||
766 | 766 | ||
767 | 767 | ||
768 | 768 | @Callable(i) | |
769 | 769 | func acceptWaves () = if ((i.caller != auctionContract)) | |
770 | 770 | then throw("Currently only auction contract is allowed to call") | |
771 | 771 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
772 | 772 | ||
773 | 773 | ||
774 | 774 | ||
775 | 775 | @Callable(i) | |
776 | 776 | func approveLeasings (nListS,groupNum) = { | |
777 | 777 | let lAmt = (50 * WAVELET) | |
778 | 778 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
779 | 779 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
780 | 780 | let mngPub = fromBase58String(mngPubS) | |
781 | 781 | let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE") | |
782 | 782 | let nodeRegAddr = addressFromStringValue(nodeRegAddrStr) | |
783 | 783 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
784 | 784 | let lGrNodeOpt = getString(this, lGroupNodeListKEY) | |
785 | 785 | if (isDefined(lGrNodeOpt)) | |
786 | 786 | then throw((("group " + toString(groupNum)) + " already initialized")) | |
787 | 787 | else { | |
788 | 788 | let nList = split(nListS, SEP) | |
789 | 789 | let expCount = size(nIdxs) | |
790 | 790 | if ((i.callerPublicKey != mngPub)) | |
791 | 791 | then throw("approveLeasings not authorized") | |
792 | 792 | else { | |
793 | 793 | let $t03363933701 = readNodeInfo(0) | |
794 | 794 | let nAddr0 = $t03363933701._1 | |
795 | 795 | let lAmtKEY0 = $t03363933701._2 | |
796 | 796 | let lAmt0 = $t03363933701._3 | |
797 | 797 | let lIdKEY0 = $t03363933701._4 | |
798 | 798 | let lId0 = $t03363933701._5 | |
799 | 799 | let $t03370433766 = readNodeInfo(1) | |
800 | 800 | let nAddr1 = $t03370433766._1 | |
801 | 801 | let lAmtKEY1 = $t03370433766._2 | |
802 | 802 | let lAmt1 = $t03370433766._3 | |
803 | 803 | let lIdKEY1 = $t03370433766._4 | |
804 | 804 | let lId1 = $t03370433766._5 | |
805 | 805 | let newL0 = Lease(nAddr0, (lAmt0 - ((lAmt * expCount) / 2))) | |
806 | 806 | let newL1 = Lease(nAddr1, (lAmt1 - ((lAmt * expCount) / 2))) | |
807 | 807 | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
808 | 808 | if ((validation == validation)) | |
809 | 809 | then { | |
810 | 810 | func forEachNodeValidateAndGenerateLease (a,i) = { | |
811 | 811 | let node = nList[i] | |
812 | 812 | let la = Lease(addressFromStringValue(node), lAmt) | |
813 | 813 | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
814 | 814 | } | |
815 | 815 | ||
816 | 816 | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), BinaryEntry(lIdKEY1, lcalc(newL1)), IntegerEntry(lAmtKEY0, newL0.amount), IntegerEntry(lAmtKEY1, newL1.amount), LeaseCancel(lId0), LeaseCancel(lId1), newL0, newL1] ++ { | |
817 | 817 | let $l = nIdxs | |
818 | 818 | let $s = size($l) | |
819 | 819 | let $acc0 = nil | |
820 | 820 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
821 | 821 | then $a | |
822 | 822 | else forEachNodeValidateAndGenerateLease($a, $l[$i]) | |
823 | 823 | ||
824 | 824 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
825 | 825 | then $a | |
826 | 826 | else throw("List size exceeds 8") | |
827 | 827 | ||
828 | 828 | $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) | |
829 | 829 | }) | |
830 | 830 | } | |
831 | 831 | else throw("Strict value is not equal to itself.") | |
832 | 832 | } | |
833 | 833 | } | |
834 | 834 | } | |
835 | 835 | ||
836 | 836 | ||
837 | 837 | ||
838 | 838 | @Callable(i) | |
839 | 839 | func rebalanceLeasings (amount,groupNum) = { | |
840 | 840 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
841 | 841 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
842 | 842 | let mngPub = fromBase58String(mngPubS) | |
843 | 843 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
844 | 844 | let nListS = getStringOrFail(this, lGroupNodeListKEY) | |
845 | 845 | let nList = split(nListS, SEP) | |
846 | 846 | if ((i.callerPublicKey != mngPub)) | |
847 | 847 | then throw("rebalanceLeasings not authorized") | |
848 | 848 | else { | |
849 | 849 | let unleaseAmt = ((amount / size(nList)) + 1) | |
850 | 850 | let $t03518335245 = readNodeInfo(0) | |
851 | 851 | let nAddr0 = $t03518335245._1 | |
852 | 852 | let lAmtKEY0 = $t03518335245._2 | |
853 | 853 | let lAmt0 = $t03518335245._3 | |
854 | 854 | let lIdKEY0 = $t03518335245._4 | |
855 | 855 | let lId0 = $t03518335245._5 | |
856 | 856 | let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList)))) | |
857 | 857 | func forEachNodeDoUnlease (a,i) = { | |
858 | 858 | let node = nList[i] | |
859 | 859 | let lIdKEY = getLeaseIdByAddressKey(node) | |
860 | 860 | let lId = getBinaryValue(this, lIdKEY) | |
861 | 861 | let lAmtKEY = getLeaseAmountByAddressKey(node) | |
862 | 862 | let lAmt = getIntegerValue(this, lAmtKEY) | |
863 | 863 | let ula = LeaseCancel(value(lId)) | |
864 | 864 | let la = Lease(addressFromStringValue(node), (lAmt - unleaseAmt)) | |
865 | 865 | (a ++ [LeaseCancel(value(lId)), la, BinaryEntry(lIdKEY, lcalc(la)), IntegerEntry(lAmtKEY, la.amount)]) | |
866 | 866 | } | |
867 | 867 | ||
868 | 868 | ({ | |
869 | 869 | let $l = nIdxs | |
870 | 870 | let $s = size($l) | |
871 | 871 | let $acc0 = nil | |
872 | 872 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
873 | 873 | then $a | |
874 | 874 | else forEachNodeDoUnlease($a, $l[$i]) | |
875 | 875 | ||
876 | 876 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
877 | 877 | then $a | |
878 | 878 | else throw("List size exceeds 8") | |
879 | 879 | ||
880 | 880 | $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) | |
881 | 881 | } ++ [BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0]) | |
882 | 882 | } | |
883 | 883 | } | |
884 | 884 | ||
885 | 885 | ||
886 | 886 | ||
887 | 887 | @Callable(i) | |
888 | 888 | func swapParamsByUserSYSREADONLY (userAddressStr,gnsbtDiff) = { | |
889 | 889 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStr, 0, 0], nil)) | |
890 | 890 | let gnsbtAmt = (asInt(gnsbtData[0]) + gnsbtDiff) | |
891 | 891 | let gnsbtAmtTotal = (asInt(gnsbtData[1]) + gnsbtDiff) | |
892 | 892 | let swapLimitData = asAnyList(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil)) | |
893 | 893 | let wavesSwapLimitInUsdnMax = asInt(swapLimitData[0]) | |
894 | 894 | let wavesSwapLimitMax = asInt(swapLimitData[1]) | |
895 | 895 | let usdnSwapLimitMax = asInt(swapLimitData[2]) | |
896 | 896 | let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0) | |
897 | 897 | let swapLimitTimelifeBlocks = swapsTimeframeREAD() | |
898 | 898 | let passedBlocksAfterLastSwap = (height - lastSwapHeight) | |
899 | 899 | let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks) | |
900 | 900 | let swapLimitSpentInUsdn = if (isSwapTimelifeNew) | |
901 | 901 | then 0 | |
902 | 902 | else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0) | |
903 | 903 | let blcks2LmtReset = if (isSwapTimelifeNew) | |
904 | 904 | then 0 | |
905 | 905 | else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap) | |
906 | 906 | $Tuple2(nil, $Tuple7(wavesSwapLimitInUsdnMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, wavesSwapLimitMax, usdnSwapLimitMax)) | |
907 | 907 | } | |
908 | 908 | ||
909 | 909 | ||
910 | 910 | ||
911 | 911 | @Callable(i) | |
912 | 912 | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price) = $Tuple2(nil, calcWithdraw(swapType, inAmount, price)) | |
913 | 913 | ||
914 | 914 | ||
915 | 915 | ||
916 | 916 | @Callable(i) | |
917 | 917 | func updateReservesAndNeutrinoSupply () = { | |
918 | 918 | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
919 | 919 | case a: Int => | |
920 | 920 | a | |
921 | 921 | case _ => | |
922 | 922 | 0 | |
923 | 923 | } | |
924 | 924 | ||
925 | 925 | let nMetrix = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
926 | 926 | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
927 | 927 | let newIdx = (idx + 1) | |
928 | 928 | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), IntegerEntry("reserve", asInt(nMetrix[3])), IntegerEntry("neutrinoSupply", asInt(nMetrix[5])), IntegerEntry("reservesInUsdn", convertWavesToNeutrino(asInt(nMetrix[3]), asInt(nMetrix[0]))), IntegerEntry("surplus", asInt(nMetrix[6])), IntegerEntry("deficit", -(asInt(nMetrix[6])))] | |
929 | 929 | } | |
930 | 930 | ||
931 | 931 | ||
932 | 932 | ||
933 | 933 | @Callable(i) | |
934 | 934 | func wavesBalancesVsPayment () = { | |
935 | 935 | let b = wavesBalance(this) | |
936 | 936 | [IntegerEntry("wavesBalance_available", b.available), IntegerEntry("wavesBalance_regular", b.regular), IntegerEntry("wavesBalance_generating", b.generating), IntegerEntry("wavesBalance_effective", b.effective), IntegerEntry("waves_payment", value(i.payments[0]).amount)] | |
937 | 937 | } | |
938 | 938 | ||
939 | 939 | ||
940 | 940 | @Verifier(tx) | |
941 | 941 | func verify () = { | |
942 | 942 | let id = toBase58String(tx.id) | |
943 | 943 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
944 | 944 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
945 | 945 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
946 | 946 | then 1 | |
947 | 947 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
948 | 948 | then 1 | |
949 | 949 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
950 | 950 | then 1 | |
951 | 951 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
952 | 952 | then 2 | |
953 | 953 | else 0)) | |
954 | 954 | match tx { | |
955 | 955 | case sponsorTx: SponsorFeeTransaction => | |
956 | 956 | if (checkIsValidMinSponsoredFee(sponsorTx)) | |
957 | 957 | then (count >= 3) | |
958 | 958 | else false | |
959 | 959 | case _ => | |
960 | 960 | (count >= 3) | |
961 | 961 | } | |
962 | 962 | } | |
963 | 963 |
github/deemru/w8io/026f985 83.01 ms ◑