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