tx · HrYmWNzyHft45jNm2oSb2azkTdfvvAQAeqHWKtjwUW8k 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj: -0.01400000 Waves 2022.03.24 09:26 [1977639] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves
{ "type": 13, "id": "HrYmWNzyHft45jNm2oSb2azkTdfvvAQAeqHWKtjwUW8k", "fee": 1400000, "feeAssetId": null, "timestamp": 1648103221142, "version": 1, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "4c1qoFtPJDqoCZ49ZVPfg945fmydBLDTVrqhYnwb2PuEjiUDZZwRfAuo6LrdGMKYBoWjiYYkd3fk98yxn2NJKRNn", "5tvonumqXTvB1uMMdM3EeCjLrCe45tSDa58nt5TzRX9WPfJ74MBRSTcAjV9pdKZ9upimd77SNxrNcBfqkCHD4CJm", "4n5saztkTZKo3DSwDN4eBXWHkhchL9RarH8k4m7oWRLBFauQLywYCH2dJTeoQc3XXALXS8kUkHe9tGBuyDGfYai5" ], "script": "base64:AAIFAAAAAAAAADQIAhIOCgwICAgICAgBAQEBAQESBQoDCAgBEgASABIFCgMIAQgSABIECgIBCBIAEgQKAggBAAAAdQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkAAAAAAAAAAAABAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQcBAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAA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AAAAAA8kz8tE=", "chainId": 84, "height": 1977639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GYffL1ZfVL6Lwz5DfunscQ3hkzUvnyFiBCKMMKSYkZD5 Next: FtDNSChYhtAPm16gApha11hdpHjD7oyD4GUyieiUry2c Diff:
Old | New | Differences | |
---|---|---|---|
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | - | @Callable(i) | |
404 | 403 | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
405 | - | let checkCaller = thisOnly(i) | |
406 | - | if ((checkCaller == checkCaller)) | |
407 | - | then if ((size(i.payments) != 0)) | |
408 | - | then throw("no payments allowed") | |
409 | - | else { | |
410 | - | let userAddress = addressFromStringValue(account) | |
411 | - | let feeManagerAddress = feeManagerAddressREAD() | |
412 | - | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
413 | - | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
414 | - | let swapType = dataArray[sIdxSwapType] | |
415 | - | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
416 | - | let swapStatus = dataArray[sIdxStatus] | |
417 | - | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
418 | - | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
419 | - | let totalLocked = totalLockedREAD(swapType) | |
420 | - | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
421 | - | let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType))) | |
422 | - | let indexHeight = getHeightPriceByIndex(index) | |
423 | - | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
424 | - | let priceByIndex = getPriceHistory(indexHeight) | |
425 | - | let outAmountGrossTuple = if ((swapType == "waves")) | |
426 | - | then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId) | |
427 | - | else if ((swapType == "neutrino")) | |
428 | - | then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit) | |
429 | - | else throw(("Unsupported swap type " + swapType)) | |
430 | - | let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart) | |
431 | - | let outNetAmount = payoutsArray[IdxNetAmount] | |
432 | - | let outFeeAmount = payoutsArray[IdxFeeAmount] | |
433 | - | if (isBlocked) | |
434 | - | then emergencyShutdownFAIL() | |
435 | - | else if ((swapStatus != "PENDING")) | |
436 | - | then throw("swap has been already processed") | |
437 | - | else if ((unlockHeight > height)) | |
438 | - | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
439 | - | else if (if (if ((index > priceIndex)) | |
440 | - | then true | |
441 | - | else (unlockHeight > indexHeight)) | |
442 | - | then true | |
443 | - | else if ((prevIndexHeight != 0)) | |
444 | - | then (prevIndexHeight >= unlockHeight) | |
404 | + | let userAddress = addressFromStringValue(account) | |
405 | + | let feeManagerAddress = feeManagerAddressREAD() | |
406 | + | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
407 | + | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
408 | + | let swapType = dataArray[sIdxSwapType] | |
409 | + | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
410 | + | let swapStatus = dataArray[sIdxStatus] | |
411 | + | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
412 | + | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
413 | + | let totalLocked = totalLockedREAD(swapType) | |
414 | + | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
415 | + | let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType))) | |
416 | + | let indexHeight = getHeightPriceByIndex(index) | |
417 | + | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
418 | + | let priceByIndex = getPriceHistory(indexHeight) | |
419 | + | let outAmountGrossTuple = if ((swapType == "waves")) | |
420 | + | then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId) | |
421 | + | else if ((swapType == "neutrino")) | |
422 | + | then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit) | |
423 | + | else throw(("Unsupported swap type " + swapType)) | |
424 | + | let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart) | |
425 | + | let outNetAmount = payoutsArray[IdxNetAmount] | |
426 | + | let outFeeAmount = payoutsArray[IdxFeeAmount] | |
427 | + | if (isBlocked) | |
428 | + | then emergencyShutdownFAIL() | |
429 | + | else if ((swapStatus != "PENDING")) | |
430 | + | then throw("swap has been already processed") | |
431 | + | else if ((unlockHeight > height)) | |
432 | + | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
433 | + | else if (if (if ((index > priceIndex)) | |
434 | + | then true | |
435 | + | else (unlockHeight > indexHeight)) | |
436 | + | then true | |
437 | + | else if ((prevIndexHeight != 0)) | |
438 | + | then (prevIndexHeight >= unlockHeight) | |
439 | + | else false) | |
440 | + | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
441 | + | else if ((0 >= payoutsArray[IdxGrossAmount])) | |
442 | + | then throw("balance equals zero") | |
443 | + | else if (if ((0 > outFeePart)) | |
444 | + | then true | |
445 | + | else (outFeePart >= PAULI)) | |
446 | + | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
447 | + | else { | |
448 | + | let leasePart = if (if ((swapType == "neutrino")) | |
449 | + | then (outAmountGrossTuple._1 > 0) | |
445 | 450 | else false) | |
446 | - | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
447 | - | else if ((0 >= payoutsArray[IdxGrossAmount])) | |
448 | - | then throw("balance equals zero") | |
449 | - | else if (if ((0 > outFeePart)) | |
450 | - | then true | |
451 | - | else (outFeePart >= PAULI)) | |
452 | - | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
453 | - | else { | |
454 | - | let leasePart = if (if ((swapType == "neutrino")) | |
455 | - | then (outAmountGrossTuple._1 > 0) | |
456 | - | else false) | |
457 | - | then prepareUnleaseAndLease(outAmountGrossTuple._1) | |
458 | - | else nil | |
459 | - | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(outAmountGrossTuple._2, outFeeAmount)]) | |
460 | - | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
461 | - | then $Tuple2((leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, toBase58String(i.transactionId)))]), unit) | |
462 | - | else throw("Strict value is not equal to itself.") | |
463 | - | } | |
464 | - | } | |
465 | - | else throw("Strict value is not equal to itself.") | |
451 | + | then prepareUnleaseAndLease(outAmountGrossTuple._1) | |
452 | + | else nil | |
453 | + | let state = (leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))]) | |
454 | + | $Tuple2(state, AttachedPayment(outAmountGrossTuple._2, outFeeAmount)) | |
455 | + | } | |
466 | 456 | } | |
467 | - | ||
468 | 457 | ||
469 | 458 | ||
470 | 459 | @Callable(i) | |
492 | 481 | ||
493 | 482 | ||
494 | 483 | @Callable(i) | |
495 | - | func swapWavesToNeutrino () = | |
496 | - | | |
497 | - | | |
498 | - | | |
499 | - | | |
500 | - | then throw(" | |
484 | + | func swapWavesToNeutrino () = if ((size(i.payments) != 1)) | |
485 | + | then throw("swapWavesToNeutrino require only one payment") | |
486 | + | else { | |
487 | + | let pmt = value(i.payments[0]) | |
488 | + | if (isDefined(pmt.assetId)) | |
489 | + | then throw("Only Waves token is allowed for swapping.") | |
501 | 490 | else { | |
502 | 491 | let userAddress = toString(i.caller) | |
503 | 492 | let txId58 = toBase58String(i.transactionId) | |
505 | 494 | let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
506 | 495 | commonSwapResult | |
507 | 496 | } | |
508 | - | } | |
497 | + | } | |
509 | 498 | ||
510 | 499 | ||
511 | 500 | ||
512 | 501 | @Callable(i) | |
513 | - | func swapNeutrinoToWaves () = | |
514 | - | | |
515 | - | | |
516 | - | | |
517 | - | | |
518 | - | then throw(" | |
502 | + | func swapNeutrinoToWaves () = if ((size(i.payments) != 1)) | |
503 | + | then throw("swapNeutrinoToWaves require only one payment") | |
504 | + | else { | |
505 | + | let pmt = value(i.payments[0]) | |
506 | + | if ((pmt.assetId != neutrinoAssetId)) | |
507 | + | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
519 | 508 | else { | |
520 | 509 | let userAddress = toString(i.caller) | |
521 | 510 | let txId58 = toBase58String(i.transactionId) | |
523 | 512 | let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
524 | 513 | commonSwapResult | |
525 | 514 | } | |
526 | - | } | |
515 | + | } | |
527 | 516 | ||
528 | 517 | ||
529 | 518 | ||
531 | 520 | func withdraw (account,index,swapTxId) = if ((size(i.payments) != 0)) | |
532 | 521 | then throw("no payments allowed") | |
533 | 522 | else { | |
534 | - | let commonWithdrawInv = invoke(this, "commonWithdraw", [account, index, swapTxId, toBase58String(i.transactionId)], nil) | |
535 | - | if ((commonWithdrawInv == commonWithdrawInv)) | |
536 | - | then nil | |
523 | + | let $t02418624290 = commonWithdraw(account, index, swapTxId, toBase58String(i.transactionId)) | |
524 | + | let state = $t02418624290._1 | |
525 | + | let depositPayment = $t02418624290._2 | |
526 | + | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [depositPayment]) | |
527 | + | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
528 | + | then state | |
537 | 529 | else throw("Strict value is not equal to itself.") | |
538 | 530 | } | |
539 | 531 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(addressFromStringValue(address), key), false) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func asAnyList (val) = match val { | |
23 | 23 | case valAnyLyst: List[Any] => | |
24 | 24 | valAnyLyst | |
25 | 25 | case _ => | |
26 | 26 | throw("fail to cast into List[Any]") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func asString (val) = match val { | |
31 | 31 | case valStr: String => | |
32 | 32 | valStr | |
33 | 33 | case _ => | |
34 | 34 | throw("fail to cast into String") | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func asInt (val) = match val { | |
39 | 39 | case valInt: Int => | |
40 | 40 | valInt | |
41 | 41 | case _ => | |
42 | 42 | throw("fail to cast into Int") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func asSwapParamsSTRUCT (val) = match val { | |
47 | 47 | case struct: (Int, Int, Int, Int, Int) => | |
48 | 48 | struct | |
49 | 49 | case _ => | |
50 | 50 | throw("fail to cast into Int") | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
55 | 55 | ||
56 | 56 | let SEP = "__" | |
57 | 57 | ||
58 | 58 | let WAVELET = 100000000 | |
59 | 59 | ||
60 | 60 | let PAULI = 1000000 | |
61 | 61 | ||
62 | 62 | let PRICELET = 1000000 | |
63 | 63 | ||
64 | 64 | let DEFAULTSWAPFEE = 20000 | |
65 | 65 | ||
66 | 66 | let IdxNetAmount = 0 | |
67 | 67 | ||
68 | 68 | let IdxFeeAmount = 1 | |
69 | 69 | ||
70 | 70 | let IdxGrossAmount = 2 | |
71 | 71 | ||
72 | 72 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
73 | 73 | ||
74 | 74 | let BondAssetIdKey = "bond_asset_id" | |
75 | 75 | ||
76 | 76 | let AuctionContractKey = "auction_contract" | |
77 | 77 | ||
78 | 78 | let NsbtStakingContractKey = "nsbtStakingContract" | |
79 | 79 | ||
80 | 80 | let LiquidationContractKey = "liquidation_contract" | |
81 | 81 | ||
82 | 82 | let RPDContractKey = "rpd_contract" | |
83 | 83 | ||
84 | 84 | let ContolContractKey = "control_contract" | |
85 | 85 | ||
86 | 86 | let MathContractKey = "math_contract" | |
87 | 87 | ||
88 | 88 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
89 | 89 | ||
90 | 90 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
91 | 91 | ||
92 | 92 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
93 | 93 | ||
94 | 94 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
95 | 95 | ||
96 | 96 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
97 | 97 | ||
98 | 98 | let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart" | |
99 | 99 | ||
100 | 100 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
101 | 101 | ||
102 | 102 | let FeesManagerAddressKey = "fees_manager_address" | |
103 | 103 | ||
104 | 104 | let PriceKey = "price" | |
105 | 105 | ||
106 | 106 | let PriceIndexKey = "price_index" | |
107 | 107 | ||
108 | 108 | let IsBlockedKey = "is_blocked" | |
109 | 109 | ||
110 | 110 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP)) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * WAVELET)) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func totalLockedKEY (swapType) = ("balance_lock_" + swapType) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func totalLockedByUserKEY (swapType,owner) = makeString(["balance_lock", swapType, owner], "_") | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func balanceLockIntervalKEY (swapType) = (("balance_" + swapType) + "_lock_interval") | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval" | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func outFeePartKEY (swapType) = (swapType + "Out_swap_feePart") | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func swapsTimeframeKEY () = "swaps_timeframe" | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func minSwapAmountREAD (swapType) = valueOrElse(getInteger(this, minSwapAmountKEY(swapType)), 0) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func totalLockedREAD (swapType) = valueOrElse(getInteger(this, totalLockedKEY(swapType)), 0) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func totalLockedByUserREAD (swapType,owner) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner)), 0) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func feeManagerAddressREAD () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, FeesManagerAddressKey), (FeesManagerAddressKey + " is not specified"))), (FeesManagerAddressKey + " invalid address format")) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount))) | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | 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))) | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | let liquidationContract = getStringByKey(LiquidationContractKey) | |
204 | 204 | ||
205 | 205 | let nsbtStakingContractStr = getStringByKey(NsbtStakingContractKey) | |
206 | 206 | ||
207 | 207 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
208 | 208 | ||
209 | 209 | let auctionContract = getStringByKey(AuctionContractKey) | |
210 | 210 | ||
211 | 211 | let rpdContract = getStringByKey(RPDContractKey) | |
212 | 212 | ||
213 | 213 | let controlContract = getStringByKey(ContolContractKey) | |
214 | 214 | ||
215 | 215 | let mathContractAddress = getStringByKey(MathContractKey) | |
216 | 216 | ||
217 | 217 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
218 | 218 | ||
219 | 219 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
220 | 220 | ||
221 | 221 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
222 | 222 | ||
223 | 223 | let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z") | |
224 | 224 | ||
225 | 225 | let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF") | |
226 | 226 | ||
227 | 227 | let neutrinoContract = this | |
228 | 228 | ||
229 | 229 | let mathContract = addressFromStringValue(mathContractAddress) | |
230 | 230 | ||
231 | 231 | let nsbtStakingContract = addressFromStringValue(nsbtStakingContractStr) | |
232 | 232 | ||
233 | 233 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
234 | 234 | ||
235 | 235 | func checkIsValidMinSponsoredFee (tx) = { | |
236 | 236 | let MINTRANSFERFEE = 100000 | |
237 | 237 | let SponsoredFeeUpperBound = 1000 | |
238 | 238 | let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice) | |
239 | 239 | let minNeutrinoFee = (realNeutrinoFee * 2) | |
240 | 240 | let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100) | |
241 | 241 | let inputFee = value(tx.minSponsoredAssetFee) | |
242 | 242 | if (if ((inputFee >= minNeutrinoFee)) | |
243 | 243 | then (maxNeutrinoFee >= inputFee) | |
244 | 244 | else false) | |
245 | 245 | then (tx.assetId == neutrinoAssetId) | |
246 | 246 | else false | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | let sIdxSwapType = 1 | |
260 | 260 | ||
261 | 261 | let sIdxStatus = 2 | |
262 | 262 | ||
263 | 263 | let sIdxInAmount = 3 | |
264 | 264 | ||
265 | 265 | let sIdxPrice = 4 | |
266 | 266 | ||
267 | 267 | let sIdxOutNetAmount = 5 | |
268 | 268 | ||
269 | 269 | let sIdxOutFeeAmount = 6 | |
270 | 270 | ||
271 | 271 | let sIdxStartHeight = 7 | |
272 | 272 | ||
273 | 273 | let sIdxStartTimestamp = 8 | |
274 | 274 | ||
275 | 275 | let sIdxEndHeight = 9 | |
276 | 276 | ||
277 | 277 | let sIdxEndTimestamp = 10 | |
278 | 278 | ||
279 | 279 | let sIdxSelfUnlockHeight = 11 | |
280 | 280 | ||
281 | 281 | let sIdxRandUnlockHeight = 12 | |
282 | 282 | ||
283 | 283 | let sIdxIndex = 13 | |
284 | 284 | ||
285 | 285 | let sIdxWithdrawTxId = 14 | |
286 | 286 | ||
287 | 287 | let sIdxMinRand = 15 | |
288 | 288 | ||
289 | 289 | let sIdxMaxRand = 16 | |
290 | 290 | ||
291 | 291 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | 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) | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | 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") | |
298 | 298 | ||
299 | 299 | ||
300 | 300 | 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]) | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
304 | 304 | let swapKey = swapKEY(userAddress, swapTxId) | |
305 | 305 | split(valueOrErrorMessage(getString(this, swapKey), ("no swap data for " + swapKey)), SEP) | |
306 | 306 | } | |
307 | 307 | ||
308 | 308 | ||
309 | 309 | func applyFees (amountGross,feePart) = { | |
310 | 310 | let feeAmount = fraction(amountGross, feePart, PAULI) | |
311 | 311 | [(amountGross - feeAmount), feeAmount, amountGross] | |
312 | 312 | } | |
313 | 313 | ||
314 | 314 | ||
315 | 315 | func abs (x) = if ((0 > x)) | |
316 | 316 | then -(x) | |
317 | 317 | else x | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | func selectNode (unleaseAmount) = { | |
321 | 321 | let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship()) | |
322 | 322 | let oldLeased0 = getNumberByKey(getLeaseAmountKey(0)) | |
323 | 323 | let oldLeased1 = getNumberByKey(getLeaseAmountKey(1)) | |
324 | 324 | let newLeased0 = (amountToLease + oldLeased0) | |
325 | 325 | let newLeased1 = (amountToLease + oldLeased1) | |
326 | 326 | if (if ((newLeased0 > 0)) | |
327 | 327 | then true | |
328 | 328 | else (newLeased1 > 0)) | |
329 | 329 | then { | |
330 | 330 | let delta0 = abs((newLeased0 - oldLeased1)) | |
331 | 331 | let delta1 = abs((newLeased1 - oldLeased0)) | |
332 | 332 | if ((delta1 >= delta0)) | |
333 | 333 | then $Tuple2(0, newLeased0) | |
334 | 334 | else $Tuple2(1, newLeased1) | |
335 | 335 | } | |
336 | 336 | else $Tuple2(-1, 0) | |
337 | 337 | } | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | func thisOnly (i) = if ((i.caller != this)) | |
341 | 341 | then throw("Permission denied: this contract only allowed") | |
342 | 342 | else true | |
343 | 343 | ||
344 | 344 | ||
345 | 345 | func prepareUnleaseAndLease (unleaseAmount) = { | |
346 | 346 | let nodeTuple = selectNode(unleaseAmount) | |
347 | 347 | let nodeIndex = nodeTuple._1 | |
348 | 348 | let newLeaseAmount = nodeTuple._2 | |
349 | 349 | if ((newLeaseAmount > 0)) | |
350 | 350 | then { | |
351 | 351 | let leaseIdKey = getLeaseIdKey(nodeIndex) | |
352 | 352 | let oldLease = getBinary(this, leaseIdKey) | |
353 | 353 | let unleaseOrEmpty = if (isDefined(oldLease)) | |
354 | 354 | then [LeaseCancel(value(oldLease))] | |
355 | 355 | else nil | |
356 | 356 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
357 | 357 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
358 | 358 | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, calculateLeaseId(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
359 | 359 | } | |
360 | 360 | else nil | |
361 | 361 | } | |
362 | 362 | ||
363 | 363 | ||
364 | 364 | func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapParamsByUserSYSREADONLY) = { | |
365 | 365 | let $t01560515685 = swapParamsByUserSYSREADONLY | |
366 | 366 | let swapLimitMax = $t01560515685._1 | |
367 | 367 | let swapLimitSpent = $t01560515685._2 | |
368 | 368 | let blcks2LmtReset = $t01560515685._3 | |
369 | 369 | let minSwapAmount = minSwapAmountREAD(swapType) | |
370 | 370 | let totalLocked = totalLockedREAD(swapType) | |
371 | 371 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr) | |
372 | 372 | let nodeAddress = getStakingNodeByIndex(0) | |
373 | 373 | let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex)) | |
374 | 374 | let isSwapByNode = (nodeAddress == userAddressStr) | |
375 | 375 | let balanceLockMaxInterval = if (isSwapByNode) | |
376 | 376 | then nodeBalanceLockIntervalREAD() | |
377 | 377 | else balanceLockIntervalREAD(swapType) | |
378 | 378 | let selfUnlockHeight = (height + balanceLockMaxInterval) | |
379 | 379 | let swapUsdnVolume = if ((swapType == "neutrino")) | |
380 | 380 | then pmtAmount | |
381 | 381 | else convertWavesToNeutrino(pmtAmount, priceByIndex) | |
382 | 382 | if ((minSwapAmount > pmtAmount)) | |
383 | 383 | then minSwapAmountFAIL(swapType, minSwapAmount) | |
384 | 384 | else if (if (!(isSwapByNode)) | |
385 | 385 | then (swapLimitSpent > 0) | |
386 | 386 | else false) | |
387 | 387 | then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset)))) | |
388 | 388 | else if (if (!(isSwapByNode)) | |
389 | 389 | then (swapUsdnVolume > swapLimitMax) | |
390 | 390 | else false) | |
391 | 391 | then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax))) | |
392 | 392 | else if (isBlocked) | |
393 | 393 | then emergencyShutdownFAIL() | |
394 | 394 | else { | |
395 | 395 | let leasePart = if ((swapType == "waves")) | |
396 | 396 | then prepareUnleaseAndLease(0) | |
397 | 397 | else nil | |
398 | 398 | $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) | |
399 | 399 | } | |
400 | 400 | } | |
401 | 401 | ||
402 | 402 | ||
403 | - | @Callable(i) | |
404 | 403 | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
405 | - | let checkCaller = thisOnly(i) | |
406 | - | if ((checkCaller == checkCaller)) | |
407 | - | then if ((size(i.payments) != 0)) | |
408 | - | then throw("no payments allowed") | |
409 | - | else { | |
410 | - | let userAddress = addressFromStringValue(account) | |
411 | - | let feeManagerAddress = feeManagerAddressREAD() | |
412 | - | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
413 | - | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
414 | - | let swapType = dataArray[sIdxSwapType] | |
415 | - | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
416 | - | let swapStatus = dataArray[sIdxStatus] | |
417 | - | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
418 | - | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
419 | - | let totalLocked = totalLockedREAD(swapType) | |
420 | - | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
421 | - | let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType))) | |
422 | - | let indexHeight = getHeightPriceByIndex(index) | |
423 | - | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
424 | - | let priceByIndex = getPriceHistory(indexHeight) | |
425 | - | let outAmountGrossTuple = if ((swapType == "waves")) | |
426 | - | then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId) | |
427 | - | else if ((swapType == "neutrino")) | |
428 | - | then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit) | |
429 | - | else throw(("Unsupported swap type " + swapType)) | |
430 | - | let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart) | |
431 | - | let outNetAmount = payoutsArray[IdxNetAmount] | |
432 | - | let outFeeAmount = payoutsArray[IdxFeeAmount] | |
433 | - | if (isBlocked) | |
434 | - | then emergencyShutdownFAIL() | |
435 | - | else if ((swapStatus != "PENDING")) | |
436 | - | then throw("swap has been already processed") | |
437 | - | else if ((unlockHeight > height)) | |
438 | - | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
439 | - | else if (if (if ((index > priceIndex)) | |
440 | - | then true | |
441 | - | else (unlockHeight > indexHeight)) | |
442 | - | then true | |
443 | - | else if ((prevIndexHeight != 0)) | |
444 | - | then (prevIndexHeight >= unlockHeight) | |
404 | + | let userAddress = addressFromStringValue(account) | |
405 | + | let feeManagerAddress = feeManagerAddressREAD() | |
406 | + | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
407 | + | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
408 | + | let swapType = dataArray[sIdxSwapType] | |
409 | + | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
410 | + | let swapStatus = dataArray[sIdxStatus] | |
411 | + | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
412 | + | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
413 | + | let totalLocked = totalLockedREAD(swapType) | |
414 | + | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
415 | + | let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType))) | |
416 | + | let indexHeight = getHeightPriceByIndex(index) | |
417 | + | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
418 | + | let priceByIndex = getPriceHistory(indexHeight) | |
419 | + | let outAmountGrossTuple = if ((swapType == "waves")) | |
420 | + | then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId) | |
421 | + | else if ((swapType == "neutrino")) | |
422 | + | then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit) | |
423 | + | else throw(("Unsupported swap type " + swapType)) | |
424 | + | let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart) | |
425 | + | let outNetAmount = payoutsArray[IdxNetAmount] | |
426 | + | let outFeeAmount = payoutsArray[IdxFeeAmount] | |
427 | + | if (isBlocked) | |
428 | + | then emergencyShutdownFAIL() | |
429 | + | else if ((swapStatus != "PENDING")) | |
430 | + | then throw("swap has been already processed") | |
431 | + | else if ((unlockHeight > height)) | |
432 | + | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
433 | + | else if (if (if ((index > priceIndex)) | |
434 | + | then true | |
435 | + | else (unlockHeight > indexHeight)) | |
436 | + | then true | |
437 | + | else if ((prevIndexHeight != 0)) | |
438 | + | then (prevIndexHeight >= unlockHeight) | |
439 | + | else false) | |
440 | + | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
441 | + | else if ((0 >= payoutsArray[IdxGrossAmount])) | |
442 | + | then throw("balance equals zero") | |
443 | + | else if (if ((0 > outFeePart)) | |
444 | + | then true | |
445 | + | else (outFeePart >= PAULI)) | |
446 | + | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
447 | + | else { | |
448 | + | let leasePart = if (if ((swapType == "neutrino")) | |
449 | + | then (outAmountGrossTuple._1 > 0) | |
445 | 450 | else false) | |
446 | - | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
447 | - | else if ((0 >= payoutsArray[IdxGrossAmount])) | |
448 | - | then throw("balance equals zero") | |
449 | - | else if (if ((0 > outFeePart)) | |
450 | - | then true | |
451 | - | else (outFeePart >= PAULI)) | |
452 | - | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
453 | - | else { | |
454 | - | let leasePart = if (if ((swapType == "neutrino")) | |
455 | - | then (outAmountGrossTuple._1 > 0) | |
456 | - | else false) | |
457 | - | then prepareUnleaseAndLease(outAmountGrossTuple._1) | |
458 | - | else nil | |
459 | - | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(outAmountGrossTuple._2, outFeeAmount)]) | |
460 | - | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
461 | - | then $Tuple2((leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, toBase58String(i.transactionId)))]), unit) | |
462 | - | else throw("Strict value is not equal to itself.") | |
463 | - | } | |
464 | - | } | |
465 | - | else throw("Strict value is not equal to itself.") | |
451 | + | then prepareUnleaseAndLease(outAmountGrossTuple._1) | |
452 | + | else nil | |
453 | + | let state = (leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))]) | |
454 | + | $Tuple2(state, AttachedPayment(outAmountGrossTuple._2, outFeeAmount)) | |
455 | + | } | |
466 | 456 | } | |
467 | - | ||
468 | 457 | ||
469 | 458 | ||
470 | 459 | @Callable(i) | |
471 | 460 | func constructor (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = { | |
472 | 461 | let checkCaller = thisOnly(i) | |
473 | 462 | if ((checkCaller == checkCaller)) | |
474 | 463 | then if ((size(i.payments) != 0)) | |
475 | 464 | then throw("no payments allowed") | |
476 | 465 | 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)] | |
477 | 466 | else throw("Strict value is not equal to itself.") | |
478 | 467 | } | |
479 | 468 | ||
480 | 469 | ||
481 | 470 | ||
482 | 471 | @Callable(i) | |
483 | 472 | func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = { | |
484 | 473 | let checkCaller = thisOnly(i) | |
485 | 474 | if ((checkCaller == checkCaller)) | |
486 | 475 | then if ((size(i.payments) != 0)) | |
487 | 476 | then throw("no payments allowed") | |
488 | 477 | else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)] | |
489 | 478 | else throw("Strict value is not equal to itself.") | |
490 | 479 | } | |
491 | 480 | ||
492 | 481 | ||
493 | 482 | ||
494 | 483 | @Callable(i) | |
495 | - | func swapWavesToNeutrino () = | |
496 | - | | |
497 | - | | |
498 | - | | |
499 | - | | |
500 | - | then throw(" | |
484 | + | func swapWavesToNeutrino () = if ((size(i.payments) != 1)) | |
485 | + | then throw("swapWavesToNeutrino require only one payment") | |
486 | + | else { | |
487 | + | let pmt = value(i.payments[0]) | |
488 | + | if (isDefined(pmt.assetId)) | |
489 | + | then throw("Only Waves token is allowed for swapping.") | |
501 | 490 | else { | |
502 | 491 | let userAddress = toString(i.caller) | |
503 | 492 | let txId58 = toBase58String(i.transactionId) | |
504 | 493 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
505 | 494 | let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
506 | 495 | commonSwapResult | |
507 | 496 | } | |
508 | - | } | |
497 | + | } | |
509 | 498 | ||
510 | 499 | ||
511 | 500 | ||
512 | 501 | @Callable(i) | |
513 | - | func swapNeutrinoToWaves () = | |
514 | - | | |
515 | - | | |
516 | - | | |
517 | - | | |
518 | - | then throw(" | |
502 | + | func swapNeutrinoToWaves () = if ((size(i.payments) != 1)) | |
503 | + | then throw("swapNeutrinoToWaves require only one payment") | |
504 | + | else { | |
505 | + | let pmt = value(i.payments[0]) | |
506 | + | if ((pmt.assetId != neutrinoAssetId)) | |
507 | + | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
519 | 508 | else { | |
520 | 509 | let userAddress = toString(i.caller) | |
521 | 510 | let txId58 = toBase58String(i.transactionId) | |
522 | 511 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
523 | 512 | let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
524 | 513 | commonSwapResult | |
525 | 514 | } | |
526 | - | } | |
515 | + | } | |
527 | 516 | ||
528 | 517 | ||
529 | 518 | ||
530 | 519 | @Callable(i) | |
531 | 520 | func withdraw (account,index,swapTxId) = if ((size(i.payments) != 0)) | |
532 | 521 | then throw("no payments allowed") | |
533 | 522 | else { | |
534 | - | let commonWithdrawInv = invoke(this, "commonWithdraw", [account, index, swapTxId, toBase58String(i.transactionId)], nil) | |
535 | - | if ((commonWithdrawInv == commonWithdrawInv)) | |
536 | - | then nil | |
523 | + | let $t02418624290 = commonWithdraw(account, index, swapTxId, toBase58String(i.transactionId)) | |
524 | + | let state = $t02418624290._1 | |
525 | + | let depositPayment = $t02418624290._2 | |
526 | + | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [depositPayment]) | |
527 | + | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
528 | + | then state | |
537 | 529 | else throw("Strict value is not equal to itself.") | |
538 | 530 | } | |
539 | 531 | ||
540 | 532 | ||
541 | 533 | ||
542 | 534 | @Callable(i) | |
543 | 535 | func transferToAuction () = if ((size(i.payments) != 0)) | |
544 | 536 | then throw("no payments allowed") | |
545 | 537 | else { | |
546 | 538 | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
547 | 539 | let reserve = asInt(neutrinoMetrics[3]) | |
548 | 540 | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
549 | 541 | let surplus = asInt(neutrinoMetrics[6]) | |
550 | 542 | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
551 | 543 | let auctionNBAmount = (neutrinoSupply - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) | |
552 | 544 | let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
553 | 545 | if (isBlocked) | |
554 | 546 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
555 | 547 | else if ((auctionNBAmount > (1 * PAULI))) | |
556 | 548 | then [ScriptTransfer(addressFromStringValue(auctionContract), auctionNBAmount, bondAssetId)] | |
557 | 549 | else if ((surplusWithLiquidation >= (1 * PAULI))) | |
558 | 550 | then [ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)] | |
559 | 551 | else throw(((((((("bond were generated or do not need it. Deficit:" + toString(auctionNBAmount)) + "|") + toString(0)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus))) | |
560 | 552 | } | |
561 | 553 | ||
562 | 554 | ||
563 | 555 | ||
564 | 556 | @Callable(i) | |
565 | 557 | func transferUsdnToUser (amount,addr) = if ((i.caller != addressFromStringValue(auctionContract))) | |
566 | 558 | then throw("Only auction contract is authorized") | |
567 | 559 | else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)] | |
568 | 560 | ||
569 | 561 | ||
570 | 562 | ||
571 | 563 | @Callable(i) | |
572 | 564 | func acceptWaves () = if ((i.caller != addressFromStringValue(auctionContract))) | |
573 | 565 | then throw("Currently only auction contract is allowed to call") | |
574 | 566 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
575 | 567 | ||
576 | 568 | ||
577 | 569 | ||
578 | 570 | @Callable(i) | |
579 | 571 | func swapParamsByUserSYSREADONLY (userAddressStr,nsbtDiff) = { | |
580 | 572 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStr], nil)) | |
581 | 573 | if ((nsbtData == nsbtData)) | |
582 | 574 | then { | |
583 | 575 | let gnsbtAmt = (asInt(nsbtData[0]) + nsbtDiff) | |
584 | 576 | let gnsbtAmtTotal = (asInt(nsbtData[1]) + nsbtDiff) | |
585 | 577 | let swapLimitMax = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil)) | |
586 | 578 | let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0) | |
587 | 579 | let swapLimitTimelifeBlocks = swapsTimeframeREAD() | |
588 | 580 | let passedBlocksAfterLastSwap = (height - lastSwapHeight) | |
589 | 581 | let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks) | |
590 | 582 | let swapLimitSpent = if (isSwapTimelifeNew) | |
591 | 583 | then 0 | |
592 | 584 | else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0) | |
593 | 585 | let blcks2LmtReset = if (isSwapTimelifeNew) | |
594 | 586 | then 0 | |
595 | 587 | else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap) | |
596 | 588 | $Tuple2(nil, $Tuple5(swapLimitMax, swapLimitSpent, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal)) | |
597 | 589 | } | |
598 | 590 | else throw("Strict value is not equal to itself.") | |
599 | 591 | } | |
600 | 592 | ||
601 | 593 | ||
602 | 594 | @Verifier(tx) | |
603 | 595 | func verify () = { | |
604 | 596 | let id = toBase58String(tx.id) | |
605 | 597 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
606 | 598 | then 1 | |
607 | 599 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
608 | 600 | then 1 | |
609 | 601 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
610 | 602 | then 1 | |
611 | 603 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
612 | 604 | then 2 | |
613 | 605 | else 0)) | |
614 | 606 | match tx { | |
615 | 607 | case sponsorTx: SponsorFeeTransaction => | |
616 | 608 | if (checkIsValidMinSponsoredFee(sponsorTx)) | |
617 | 609 | then (count >= 3) | |
618 | 610 | else false | |
619 | 611 | case _ => | |
620 | 612 | (count >= 3) | |
621 | 613 | } | |
622 | 614 | } | |
623 | 615 |
github/deemru/w8io/026f985 83.83 ms ◑