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