tx · En6mwKcgZw9QXF8CTEvUiegvgzqs6cAVS6b3bWSzFcJm 3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx: -0.01600000 Waves 2023.03.01 18:19 [2471170] smart account 3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx > SELF 0.00000000 Waves
{ "type": 13, "id": "En6mwKcgZw9QXF8CTEvUiegvgzqs6cAVS6b3bWSzFcJm", "fee": 1600000, "feeAssetId": null, "timestamp": 1677683943889, "version": 2, "chainId": 84, "sender": "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx", "senderPublicKey": "NaY7sqttWGpnVrcb6uE8xPp2VnMjT7fhv3q1TKGL9ar", "proofs": [ "3Bgw3GymTaKqpdUeLGxgxZtCDuSjTJpq687tzkt6uxvdDcGSkh7xfddcMPtBUswoUcfajb3NfVepCbKq1GXgnFYE", "2pji4LFCfUqgAgoRHwPiJ7gLpRKPYmikfRzzpMzNi8AhuAhkTgi2td4NSxeE4CrPySz7o1E78Wed1WHKQFSi4QhQ", "2KavUXTjJP7tU1B9GyLVKAwWne69MxhwJGv6cRY28cbLBCg59x7dBH6sxP31DiDeuvE1XM2TmW9GmA6vVAB65cPo" ], "script": "base64:BgInCAISEAoOCAgICAgICAgICAgICAgSAwoBCBIMCgoBAgECAQIBAgECKwADU0VQAgJfXwAZSWR4Q29udHJvbENmZ05ldXRyaW5vRGFwcAABABhJZHhDb250cm9sQ2ZnQXVjdGlvbkRhcHAAAgAUSWR4Q29udHJvbENmZ1JwZERhcHAAAwAVSWR4Q29udHJvbENmZ01hdGhEYXBwAAQAHElkeENvbnRyb2xDZmdMaXF1aWRhdGlvbkRhcHAABQAVSWR4Q29udHJvbENmZ1Jlc3REYXBwAAYAHUlkeENvbnRyb2xDZmdOb2RlUmVnaXN0cnlEYXBwAAcAHElkeENvbnRyb2xDZmdOc2J0U3Rha2luZ0RhcHAACAAZSWR4Q29udHJvbENmZ01lZGlhdG9yRGFwcAAJABxJZHhDb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nZlcmlmeQAEE3B1YktleUFkbWluc0xpc3RTdHIJALkJAgkAzAgCAixFeHRFRUsxOW5tS2o5bUNwbld5dkVFSkZZQVRMTWNWRU12b2hoVUhreUhObQkAzAgCAixFdjVweTVGZkJRWDljWnBZS25mUXJUQjQ5QnlmOFFtcFpXZURWUmltNHlWNwkAzAgCAixEVXV1TGpYdTk4bkJ3WmM3ZnF3Q1RqdEEzbm5Sd2dUYmtNU3I1U1UyTm1EUgkAzAgCAixEVXV1TGpYdTk4bkJ3WmM3ZnF3Q1RqdEEzbm5Sd2dUYmtNU3I1U1UyTm1EUgUDbmlsBQNTRVAEEHB1YktleUFkbWluc0xpc3QJALUJAgkBC3ZhbHVlT3JFbHNlAgkAnQgCBQ9jb250cm9sQ29udHJhY3QCDCVzX19tdWx0aXNpZwUTcHViS2V5QWRtaW5zTGlzdFN0cgUDU0VQBAVjb3VudAkAZAIJAGQCCQBkAgMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkAkQMCBRBwdWJLZXlBZG1pbnNMaXN0AAAAAQAAAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQkA2QQBCQCRAwIFEHB1YktleUFkbWluc0xpc3QAAQABAAADCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACCQDZBAEJAJEDAgUQcHViS2V5QWRtaW5zTGlzdAACAAEAAAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAMJANkEAQkAkQMCBRBwdWJLZXlBZG1pbnNMaXN0AAMAAgAACQBnAgUFY291bnQAA+NNEj4=", "height": 2471170, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2VvRna4mwHwtRV87Vi9KHqoV51EsYPgN5kfC6m5CQXKY Next: 5zs5QcWYfE97kW2vbJyKtsiec4TpSBWeMfW5ba8MqX2c Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let IdxControlCfgNeutrinoDapp = 1 | |
7 | 7 | ||
8 | 8 | let IdxControlCfgAuctionDapp = 2 | |
9 | 9 | ||
10 | 10 | let IdxControlCfgRpdDapp = 3 | |
11 | 11 | ||
12 | 12 | let IdxControlCfgMathDapp = 4 | |
13 | 13 | ||
14 | 14 | let IdxControlCfgLiquidationDapp = 5 | |
15 | 15 | ||
16 | 16 | let IdxControlCfgRestDapp = 6 | |
17 | 17 | ||
18 | 18 | let IdxControlCfgNodeRegistryDapp = 7 | |
19 | 19 | ||
20 | 20 | let IdxControlCfgNsbtStakingDapp = 8 | |
21 | 21 | ||
22 | 22 | let IdxControlCfgMediatorDapp = 9 | |
23 | 23 | ||
24 | 24 | let IdxControlCfgSurfStakingDapp = 10 | |
25 | 25 | ||
26 | 26 | let IdxControlCfgGnsbtControllerDapp = 11 | |
27 | 27 | ||
28 | 28 | let IdxControlCfgRestV2Dapp = 12 | |
29 | 29 | ||
30 | 30 | let IdxControlCfgGovernanceDapp = 13 | |
31 | 31 | ||
32 | 32 | let IdxControlCfgPegProviderDapp = 14 | |
33 | 33 | ||
34 | 34 | func keyControlConfig () = "%s__controlConfig" | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func dataControlCfg (neutrinoContract,auctionContract,rpdContract,mathContract,liquidationContract,restContract,nodeRegistryContract,nsbtStakingContract,mediatorContract,surfStakingContract,gnsbtControllerContract,restV2Contract,governanceContract,doraContract) = makeString(["%s%s%s%s%s%s%s%s%s%s%s%s%s%s", neutrinoContract, auctionContract, rpdContract, mathContract, liquidationContract, restContract, nodeRegistryContract, nsbtStakingContract, mediatorContract, surfStakingContract, gnsbtControllerContract, restV2Contract, governanceContract, doraContract], SEP) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 1000000), 1000000, 100000000) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | let price = valueOrElse(getInteger(this, "price"), 0) | |
53 | 53 | ||
54 | 54 | let priceIndex = valueOrElse(getInteger(this, "price_index"), 0) | |
55 | 55 | ||
56 | 56 | let isBlocked = valueOrElse(getBoolean(this, "is_blocked"), false) | |
57 | 57 | ||
58 | 58 | let percentPriceOffset = 1000 | |
59 | 59 | ||
60 | 60 | let pubKeyOracles = valueOrElse(getString(this, "oracles"), "") | |
61 | 61 | ||
62 | 62 | let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles) | |
63 | 63 | ||
64 | 64 | let neutrinoAddress = Address(base58'3N9be2mwrA52WJho6DiesZkk4351GvpnWuj') | |
65 | 65 | ||
66 | 66 | let liquidationAddress = Address(base58'3N24ZPUAMhFm76N3vbNiiDtFqfUnmBHTc5N') | |
67 | 67 | ||
68 | 68 | let neutrinoAsset = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
69 | 69 | ||
70 | 70 | let controlContract = this | |
71 | 71 | ||
72 | 72 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | let controlCfg = split_4C(getStringOrFail(this, keyControlConfig()), SEP) | |
79 | 79 | ||
80 | 80 | let governanceContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp) | |
81 | 81 | ||
82 | 82 | let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_neutrino"), 0) | |
83 | 83 | ||
84 | 84 | let wavesLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_waves"), 0) | |
85 | 85 | ||
86 | 86 | let reserve = (wavesBalance(neutrinoAddress).regular - wavesLockedBalance) | |
87 | 87 | ||
88 | 88 | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset)) | |
89 | 89 | ||
90 | 90 | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price)) | |
91 | 91 | ||
92 | 92 | func findPricesInRange (prices) = { | |
93 | 93 | let minPercentBound = 90 | |
94 | 94 | let maxPercentBound = 110 | |
95 | 95 | let p0 = prices[0] | |
96 | 96 | let check0 = if ((0 >= prices[0])) | |
97 | 97 | then [0] | |
98 | 98 | else { | |
99 | 99 | let p01 = ((prices[1] * 100) / p0) | |
100 | 100 | let p02 = ((prices[2] * 100) / p0) | |
101 | 101 | let p03 = ((prices[3] * 100) / p0) | |
102 | 102 | let p04 = ((prices[4] * 100) / p0) | |
103 | 103 | let array1 = if (if ((maxPercentBound > p01)) | |
104 | 104 | then (p01 > minPercentBound) | |
105 | 105 | else false) | |
106 | 106 | then [1, 0] | |
107 | 107 | else [0] | |
108 | 108 | let array2 = if (if ((maxPercentBound > p02)) | |
109 | 109 | then (p02 > minPercentBound) | |
110 | 110 | else false) | |
111 | 111 | then 2 :: array1 | |
112 | 112 | else array1 | |
113 | 113 | let array3 = if (if ((maxPercentBound > p03)) | |
114 | 114 | then (p03 > minPercentBound) | |
115 | 115 | else false) | |
116 | 116 | then 3 :: array2 | |
117 | 117 | else array2 | |
118 | 118 | if (if ((maxPercentBound > p04)) | |
119 | 119 | then (p04 > minPercentBound) | |
120 | 120 | else false) | |
121 | 121 | then 4 :: array3 | |
122 | 122 | else array3 | |
123 | 123 | } | |
124 | 124 | let check1 = if ((size(check0) >= 3)) | |
125 | 125 | then check0 | |
126 | 126 | else { | |
127 | 127 | let p1 = prices[1] | |
128 | 128 | if ((0 >= p1)) | |
129 | 129 | then [1] | |
130 | 130 | else { | |
131 | 131 | let p10 = ((prices[0] * 100) / p1) | |
132 | 132 | let p12 = ((prices[2] * 100) / p1) | |
133 | 133 | let p13 = ((prices[3] * 100) / p1) | |
134 | 134 | let p14 = ((prices[4] * 100) / p1) | |
135 | 135 | let array1 = if (if ((maxPercentBound > p10)) | |
136 | 136 | then (p10 > minPercentBound) | |
137 | 137 | else false) | |
138 | 138 | then [0, 1] | |
139 | 139 | else [1] | |
140 | 140 | let array2 = if (if ((maxPercentBound > p12)) | |
141 | 141 | then (p12 > minPercentBound) | |
142 | 142 | else false) | |
143 | 143 | then 2 :: array1 | |
144 | 144 | else array1 | |
145 | 145 | let array3 = if (if ((maxPercentBound > p13)) | |
146 | 146 | then (p13 > minPercentBound) | |
147 | 147 | else false) | |
148 | 148 | then 3 :: array2 | |
149 | 149 | else array2 | |
150 | 150 | if (if ((maxPercentBound > p14)) | |
151 | 151 | then (p14 > minPercentBound) | |
152 | 152 | else false) | |
153 | 153 | then 4 :: array3 | |
154 | 154 | else array3 | |
155 | 155 | } | |
156 | 156 | } | |
157 | 157 | let check2 = if ((size(check1) >= 3)) | |
158 | 158 | then check1 | |
159 | 159 | else { | |
160 | 160 | let p2 = prices[2] | |
161 | 161 | if ((0 >= p2)) | |
162 | 162 | then [2] | |
163 | 163 | else { | |
164 | 164 | let p20 = ((prices[0] * 100) / p2) | |
165 | 165 | let p21 = ((prices[1] * 100) / p2) | |
166 | 166 | let p23 = ((prices[3] * 100) / p2) | |
167 | 167 | let p24 = ((prices[4] * 100) / p2) | |
168 | 168 | let array1 = if (if ((maxPercentBound > p20)) | |
169 | 169 | then (p20 > minPercentBound) | |
170 | 170 | else false) | |
171 | 171 | then [0, 2] | |
172 | 172 | else [2] | |
173 | 173 | let array2 = if (if ((maxPercentBound > p21)) | |
174 | 174 | then (p21 > minPercentBound) | |
175 | 175 | else false) | |
176 | 176 | then 1 :: array1 | |
177 | 177 | else array1 | |
178 | 178 | let array3 = if (if ((maxPercentBound > p23)) | |
179 | 179 | then (p23 > minPercentBound) | |
180 | 180 | else false) | |
181 | 181 | then 3 :: array2 | |
182 | 182 | else array2 | |
183 | 183 | if (if ((maxPercentBound > p24)) | |
184 | 184 | then (p24 > minPercentBound) | |
185 | 185 | else false) | |
186 | 186 | then 4 :: array3 | |
187 | 187 | else array3 | |
188 | 188 | } | |
189 | 189 | } | |
190 | 190 | let check3 = if ((size(check2) >= 3)) | |
191 | 191 | then check2 | |
192 | 192 | else { | |
193 | 193 | let p3 = prices[3] | |
194 | 194 | if ((0 >= p3)) | |
195 | 195 | then [3] | |
196 | 196 | else { | |
197 | 197 | let p30 = ((prices[0] * 100) / p3) | |
198 | 198 | let p31 = ((prices[1] * 100) / p3) | |
199 | 199 | let p32 = ((prices[2] * 100) / p3) | |
200 | 200 | let p34 = ((prices[4] * 100) / p3) | |
201 | 201 | let array1 = if (if ((maxPercentBound > p30)) | |
202 | 202 | then (p30 > minPercentBound) | |
203 | 203 | else false) | |
204 | 204 | then [0, 3] | |
205 | 205 | else [3] | |
206 | 206 | let array2 = if (if ((maxPercentBound > p31)) | |
207 | 207 | then (p31 > minPercentBound) | |
208 | 208 | else false) | |
209 | 209 | then 1 :: array1 | |
210 | 210 | else array1 | |
211 | 211 | let array3 = if (if ((maxPercentBound > p32)) | |
212 | 212 | then (p32 > minPercentBound) | |
213 | 213 | else false) | |
214 | 214 | then 2 :: array2 | |
215 | 215 | else array2 | |
216 | 216 | if (if ((maxPercentBound > p34)) | |
217 | 217 | then (p34 > minPercentBound) | |
218 | 218 | else false) | |
219 | 219 | then 4 :: array3 | |
220 | 220 | else array3 | |
221 | 221 | } | |
222 | 222 | } | |
223 | 223 | if ((size(check3) >= 3)) | |
224 | 224 | then check3 | |
225 | 225 | else { | |
226 | 226 | let p4 = prices[4] | |
227 | 227 | if ((0 >= p4)) | |
228 | 228 | then [4] | |
229 | 229 | else { | |
230 | 230 | let p40 = ((prices[0] * 100) / p4) | |
231 | 231 | let p41 = ((prices[1] * 100) / p4) | |
232 | 232 | let p42 = ((prices[2] * 100) / p4) | |
233 | 233 | let p43 = ((prices[3] * 100) / p4) | |
234 | 234 | let array1 = if (if ((maxPercentBound > p40)) | |
235 | 235 | then (p40 > minPercentBound) | |
236 | 236 | else false) | |
237 | 237 | then [0, 4] | |
238 | 238 | else [4] | |
239 | 239 | let array2 = if (if ((maxPercentBound > p41)) | |
240 | 240 | then (p41 > minPercentBound) | |
241 | 241 | else false) | |
242 | 242 | then 1 :: array1 | |
243 | 243 | else array1 | |
244 | 244 | let array3 = if (if ((maxPercentBound > p42)) | |
245 | 245 | then (p42 > minPercentBound) | |
246 | 246 | else false) | |
247 | 247 | then 2 :: array2 | |
248 | 248 | else array2 | |
249 | 249 | if (if ((maxPercentBound > p43)) | |
250 | 250 | then (p43 > minPercentBound) | |
251 | 251 | else false) | |
252 | 252 | then 3 :: array3 | |
253 | 253 | else array3 | |
254 | 254 | } | |
255 | 255 | } | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func formattingPriceMsg (price) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price))) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func PriceEntry (newPrice,assetIdStr,newPriceIndex) = { | |
263 | 263 | let heightStr = toString(height) | |
264 | 264 | let newPriceIndexStr = toString(newPriceIndex) | |
265 | 265 | let priceByAssetKEY = makeString(["%s%s%s__common__priceByAsset", assetIdStr], SEP) | |
266 | 266 | let priceByHeightKEY = makeString(["%s%s%s%d__common__priceByHeight", assetIdStr, heightStr], SEP) | |
267 | 267 | let priceByIndexKEY = makeString(["%s%s%s%d__common__priceByIndex", assetIdStr, newPriceIndexStr], SEP) | |
268 | 268 | [IntegerEntry(priceByAssetKEY, newPrice), IntegerEntry(priceByIndexKEY, newPrice), IntegerEntry(priceByHeightKEY, newPrice)] | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | ||
272 | 272 | @Callable(i) | |
273 | 273 | func constructorV1 (neutrinoContract,auctionContract,rpdContract,mathContract,liquidationContract,restContract,nodeRegistryContract,nsbtStakingContract,mediatorContract,surfStakingContract,gnsbtControllerContract,restV2Contract,governanceContract,doraContract) = if ((i.caller != this)) | |
274 | 274 | then throw("permissions denied") | |
275 | 275 | else [StringEntry(keyControlConfig(), dataControlCfg(neutrinoContract, auctionContract, rpdContract, mathContract, liquidationContract, restContract, nodeRegistryContract, nsbtStakingContract, mediatorContract, surfStakingContract, gnsbtControllerContract, restV2Contract, governanceContract, doraContract))] | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | ||
279 | 279 | @Callable(i) | |
280 | 280 | func callEmergencyShutdown (reason) = { | |
281 | 281 | let AutoEmergencyOracleAddress = "3N7vEsLNz2GAnW76o5jks9KytRnSeDqSDFt" | |
282 | 282 | let callerAddress = toString(i.caller) | |
283 | 283 | if (if ((AutoEmergencyOracleAddress != callerAddress)) | |
284 | 284 | then (toString(governanceContract) != callerAddress) | |
285 | 285 | else false) | |
286 | 286 | then throw("caller must be one an emergency oracle or Governance contract") | |
287 | 287 | else [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", callerAddress), StringEntry("is_blocked_reason", reason)] | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | ||
292 | 292 | @Callable(i) | |
293 | 293 | func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked) | |
294 | 294 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
295 | 295 | else if ((valueOrElse(getInteger(this, ("price_" + toString(height))), 0) != 0)) | |
296 | 296 | then throw("wait next block") | |
297 | 297 | else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey))) | |
298 | 298 | then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)])) | |
299 | 299 | else { | |
300 | 300 | let prices = [if (sigVerify_8Kb(formattingPriceMsg(price1), sign1, fromBase58String(pubKeyOraclesList[0]))) | |
301 | 301 | then price1 | |
302 | 302 | else 0, if (sigVerify_8Kb(formattingPriceMsg(price2), sign2, fromBase58String(pubKeyOraclesList[1]))) | |
303 | 303 | then price2 | |
304 | 304 | else 0, if (sigVerify_8Kb(formattingPriceMsg(price3), sign3, fromBase58String(pubKeyOraclesList[2]))) | |
305 | 305 | then price3 | |
306 | 306 | else 0, if (sigVerify_8Kb(formattingPriceMsg(price4), sign4, fromBase58String(pubKeyOraclesList[3]))) | |
307 | 307 | then price4 | |
308 | 308 | else 0, if (sigVerify_8Kb(formattingPriceMsg(price5), sign5, fromBase58String(pubKeyOraclesList[4]))) | |
309 | 309 | then price5 | |
310 | 310 | else 0] | |
311 | 311 | let zeroPriceCount = if ((prices[0] == 0)) | |
312 | 312 | then 1 | |
313 | 313 | else (0 + (if ((prices[1] == 0)) | |
314 | 314 | then 1 | |
315 | 315 | else (0 + (if ((prices[2] == 0)) | |
316 | 316 | then 1 | |
317 | 317 | else (0 + (if ((prices[3] == 0)) | |
318 | 318 | then 1 | |
319 | 319 | else (0 + (if ((prices[4] == 0)) | |
320 | 320 | then 1 | |
321 | 321 | else 0)))))))) | |
322 | 322 | if ((zeroPriceCount >= 3)) | |
323 | 323 | then throw("3 prices or more are equals to 0") | |
324 | 324 | else { | |
325 | 325 | let pricesInRange = findPricesInRange(prices) | |
326 | 326 | let priceProvidingCount = size(pricesInRange) | |
327 | 327 | if ((3 > priceProvidingCount)) | |
328 | 328 | then throw(((((((((((((((((((((("Could not finalize price because of big variation: height=" + toString(height)) + " | |
329 | 329 | ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + " | |
330 | 330 | ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + " | |
331 | 331 | ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + " | |
332 | 332 | ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + " | |
333 | 333 | ") + pubKeyOraclesList[4]) + "=") + toString(prices[4]))) | |
334 | 334 | else { | |
335 | 335 | let sum1 = ((prices[pricesInRange[0]] + prices[pricesInRange[1]]) + prices[pricesInRange[2]]) | |
336 | 336 | let sum2 = if ((priceProvidingCount >= 4)) | |
337 | 337 | then (sum1 + prices[pricesInRange[3]]) | |
338 | 338 | else sum1 | |
339 | 339 | let priceSum = if ((priceProvidingCount >= 5)) | |
340 | 340 | then (sum2 + prices[pricesInRange[4]]) | |
341 | 341 | else sum2 | |
342 | 342 | if ((priceProvidingCount >= 6)) | |
343 | 343 | then throw("Invalid pricesInRange creation") | |
344 | 344 | else { | |
345 | 345 | let newPrice = (priceSum / priceProvidingCount) | |
346 | 346 | let newWxPrice = 71809 | |
347 | 347 | let wxAssetId = "EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc" | |
348 | 348 | if (if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
349 | 349 | then true | |
350 | 350 | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice)) | |
351 | 351 | then { | |
352 | 352 | let reason = "automatic emergency shutdown because of large price variability" | |
353 | 353 | [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", toString(this)), StringEntry("is_blocked_reason", reason), IntegerEntry((("black_swarm_price" + "_") + toString(height)), newPrice)] | |
354 | 354 | } | |
355 | 355 | else { | |
356 | 356 | let newPriceIndex = (priceIndex + 1) | |
357 | 357 | (([IntegerEntry("price", newPrice), IntegerEntry(("price_" + toString(height)), newPrice), IntegerEntry(("price_index_" + toString(newPriceIndex)), height), IntegerEntry("price_index", newPriceIndex), IntegerEntry(("indexByHeight_" + toString(height)), newPriceIndex), IntegerEntry(("priceByIndex_" + toString(newPriceIndex)), newPrice), IntegerEntry(("deficit_" + toString(height)), deficit), IntegerEntry(("neutrinoSupply_" + toString(height)), neutrinoSupply), IntegerEntry(("deficit_percent_" + toString(height)), if ((neutrinoSupply != 0)) | |
358 | 358 | then ((deficit * 100) / neutrinoSupply) | |
359 | 359 | else 0)] ++ PriceEntry(newPrice, "WAVES", newPriceIndex)) ++ PriceEntry(newWxPrice, wxAssetId, newPriceIndex)) | |
360 | 360 | } | |
361 | 361 | } | |
362 | 362 | } | |
363 | 363 | } | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | @Verifier(tx) | |
368 | 368 | func verify () = { | |
369 | 369 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
370 | 370 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
371 | 371 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
372 | 372 | then 1 | |
373 | 373 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
374 | 374 | then 1 | |
375 | 375 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
376 | 376 | then 1 | |
377 | 377 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
378 | 378 | then 2 | |
379 | 379 | else 0)) | |
380 | 380 | (count >= 3) | |
381 | 381 | } | |
382 | 382 |
github/deemru/w8io/026f985 39.36 ms ◑