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