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