tx · 3p7b7rUofr95XZTRSFdhg2rUSrwRYWWvT9YMC8pkbphJ 3N8acke1zAnovSvhh47EaNR9X5cuH8GRubE: -0.01000000 Waves 2020.03.20 06:11 [917090] smart account 3N8acke1zAnovSvhh47EaNR9X5cuH8GRubE > SELF 0.00000000 Waves
{ "type": 13, "id": "3p7b7rUofr95XZTRSFdhg2rUSrwRYWWvT9YMC8pkbphJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1584673863948, "version": 1, "sender": "3N8acke1zAnovSvhh47EaNR9X5cuH8GRubE", "senderPublicKey": "wgvqgKuiuvnVgUQTXiX14D4AgvSgnVCaz87tU46tTqu", "proofs": [ "39wFQ1QvKpaRXtK2htoRH8ERWWGzwegsTKBXstLfyZJsy6inTYfRhJ6Kf3S7RUUjskgK6DgvBJHNborSizhQUxsA" ], "script": "base64:AAIDAAAAAAAAAAkIARIDCgEIEgAAAAAmAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAADGdldEJvb2xCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQcBAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRj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XRhRW50cnkAAAACCQEAAAAYZ2V0SGVpZ2h0UHJpY2VCeUluZGV4S2V5AAAAAQUAAAANbmV3UHJpY2VJbmRleAUAAAAGaGVpZ2h0BQAAAANuaWwAAAAASUDRuA==", "chainId": 84, "height": 917090, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | + | case a: Int => | |
6 | + | a | |
7 | + | case _ => | |
8 | + | 0 | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func getStringByKey (key) = match getString(this, key) { | |
13 | + | case a: String => | |
14 | + | a | |
15 | + | case _ => | |
16 | + | "" | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func getBoolByKey (key) = match getBoolean(this, key) { | |
21 | + | case a: Boolean => | |
22 | + | a | |
23 | + | case _ => | |
24 | + | false | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
29 | + | case a: Int => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | 0 | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
37 | + | case a: String => | |
38 | + | a | |
39 | + | case _ => | |
40 | + | "" | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | func dropElementInJsonArray (array,element) = { | |
45 | + | let splitedArray = split(array, element) | |
46 | + | if ((take(splitedArray[1], 1) == ",")) | |
47 | + | then (splitedArray[0] + drop(splitedArray[1], 1)) | |
48 | + | else (dropRight(splitedArray[0], 1) + splitedArray[1]) | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
53 | + | ||
54 | + | ||
55 | + | let BLOCK = "block" | |
56 | + | ||
57 | + | let UNBLOCK = "unblock" | |
58 | + | ||
59 | + | let UPDATE = "update" | |
60 | + | ||
61 | + | let OraclesKey = "oracles" | |
62 | + | ||
63 | + | let PriceOffsetKey = "price_offset" | |
64 | + | ||
65 | + | let AutoEmergencyOracleAddress = "3P7ihFVxBNbHK237TNdPxT1xHEu8pHexXTr" | |
66 | + | ||
67 | + | let PriceKey = "price" | |
68 | + | ||
69 | + | let IsBlockedKey = "is_blocked" | |
70 | + | ||
71 | + | let IsBlockedCallerKey = "is_blocked_caller" | |
72 | + | ||
73 | + | let IsBlockedReasonKey = "is_blocked_reason" | |
74 | + | ||
75 | + | let PriceIndexKey = "price_index" | |
76 | + | ||
77 | + | func getBlackSwarmPriceKey (block) = (("black_swarm_price" + "_") + toString(block)) | |
78 | + | ||
79 | + | ||
80 | + | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
81 | + | ||
82 | + | ||
83 | + | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
84 | + | ||
85 | + | ||
86 | + | func getOracleProvidePriceKey (height) = ("price_" + toString(height)) | |
87 | + | ||
88 | + | ||
89 | + | let price = getNumberByKey(PriceKey) | |
90 | + | ||
91 | + | let priceIndex = getNumberByKey(PriceIndexKey) | |
92 | + | ||
93 | + | let isBlocked = getBoolByKey(IsBlockedKey) | |
94 | + | ||
95 | + | let isBlockedCaller = getBoolByKey(IsBlockedCallerKey) | |
96 | + | ||
97 | + | let bftCoefficientOracle = 3 | |
98 | + | ||
99 | + | let percentPriceOffset = getNumberByKey(PriceOffsetKey) | |
100 | + | ||
101 | + | let oracles = getStringByKey(OraclesKey) | |
102 | + | ||
103 | + | let oraclesList = convertJsonArrayToList(oracles) | |
104 | + | ||
105 | + | func getOracleProvideHeight (owner,height) = getNumberByAddressAndKey(addressFromStringValue(owner), getOracleProvidePriceKey(height)) | |
106 | + | ||
107 | + | ||
108 | + | func getPriceHistory (height) = getNumberByKey(getPriceHistoryKey(height)) | |
109 | + | ||
110 | + | ||
111 | + | func isOracle (address) = isDefined(indexOf(oracles, address)) | |
112 | + | ||
113 | + | ||
114 | + | func filterAdminsVoteByAction (result,address,action) = address :: result | |
115 | + | ||
116 | + | ||
117 | + | func filterAdminsVoteByBlockAction (result,address) = filterAdminsVoteByAction(result, address, BLOCK) | |
118 | + | ||
119 | + | ||
120 | + | func filterAdminsVoteByUnblockAction (result,address) = filterAdminsVoteByAction(result, address, UNBLOCK) | |
121 | + | ||
122 | + | ||
123 | + | func filterAdminsVoteByUpdateAction (result,address) = filterAdminsVoteByAction(result, address, UPDATE) | |
124 | + | ||
125 | + | ||
126 | + | func findPricesInRange (prices) = { | |
127 | + | let minPercentBound = 90 | |
128 | + | let maxPercentBound = 110 | |
129 | + | let p0 = prices[0] | |
130 | + | let check0 = if ((0 >= prices[0])) | |
131 | + | then [0] | |
132 | + | else { | |
133 | + | let p01 = ((prices[1] * 100) / p0) | |
134 | + | let p02 = ((prices[2] * 100) / p0) | |
135 | + | let p03 = ((prices[3] * 100) / p0) | |
136 | + | let p04 = ((prices[4] * 100) / p0) | |
137 | + | let array1 = if (if ((maxPercentBound > p01)) | |
138 | + | then (p01 > minPercentBound) | |
139 | + | else false) | |
140 | + | then [1, 0] | |
141 | + | else [0] | |
142 | + | let array2 = if (if ((maxPercentBound > p02)) | |
143 | + | then (p02 > minPercentBound) | |
144 | + | else false) | |
145 | + | then 2 :: array1 | |
146 | + | else array1 | |
147 | + | let array3 = if (if ((maxPercentBound > p03)) | |
148 | + | then (p03 > minPercentBound) | |
149 | + | else false) | |
150 | + | then 3 :: array2 | |
151 | + | else array2 | |
152 | + | if (if ((maxPercentBound > p04)) | |
153 | + | then (p04 > minPercentBound) | |
154 | + | else false) | |
155 | + | then 4 :: array3 | |
156 | + | else array3 | |
157 | + | } | |
158 | + | let check1 = if ((size(check0) >= 3)) | |
159 | + | then check0 | |
160 | + | else { | |
161 | + | let p1 = prices[1] | |
162 | + | if ((0 >= p1)) | |
163 | + | then [1] | |
164 | + | else { | |
165 | + | let p10 = ((prices[0] * 100) / p1) | |
166 | + | let p12 = ((prices[2] * 100) / p1) | |
167 | + | let p13 = ((prices[3] * 100) / p1) | |
168 | + | let p14 = ((prices[4] * 100) / p1) | |
169 | + | let array1 = if (if ((maxPercentBound > p10)) | |
170 | + | then (p10 > minPercentBound) | |
171 | + | else false) | |
172 | + | then [0, 1] | |
173 | + | else [1] | |
174 | + | let array2 = if (if ((maxPercentBound > p12)) | |
175 | + | then (p12 > minPercentBound) | |
176 | + | else false) | |
177 | + | then 2 :: array1 | |
178 | + | else array1 | |
179 | + | let array3 = if (if ((maxPercentBound > p13)) | |
180 | + | then (p13 > minPercentBound) | |
181 | + | else false) | |
182 | + | then 3 :: array2 | |
183 | + | else array2 | |
184 | + | if (if ((maxPercentBound > p14)) | |
185 | + | then (p14 > minPercentBound) | |
186 | + | else false) | |
187 | + | then 4 :: array3 | |
188 | + | else array3 | |
189 | + | } | |
190 | + | } | |
191 | + | let check2 = if ((size(check1) >= 3)) | |
192 | + | then check1 | |
193 | + | else { | |
194 | + | let p2 = prices[2] | |
195 | + | if ((0 >= p2)) | |
196 | + | then [2] | |
197 | + | else { | |
198 | + | let p20 = ((prices[0] * 100) / p2) | |
199 | + | let p21 = ((prices[1] * 100) / p2) | |
200 | + | let p23 = ((prices[3] * 100) / p2) | |
201 | + | let p24 = ((prices[4] * 100) / p2) | |
202 | + | let array1 = if (if ((maxPercentBound > p20)) | |
203 | + | then (p20 > minPercentBound) | |
204 | + | else false) | |
205 | + | then [0, 2] | |
206 | + | else [2] | |
207 | + | let array2 = if (if ((maxPercentBound > p21)) | |
208 | + | then (p21 > minPercentBound) | |
209 | + | else false) | |
210 | + | then 1 :: array1 | |
211 | + | else array1 | |
212 | + | let array3 = if (if ((maxPercentBound > p23)) | |
213 | + | then (p23 > minPercentBound) | |
214 | + | else false) | |
215 | + | then 3 :: array2 | |
216 | + | else array2 | |
217 | + | if (if ((maxPercentBound > p24)) | |
218 | + | then (p24 > minPercentBound) | |
219 | + | else false) | |
220 | + | then 4 :: array3 | |
221 | + | else array3 | |
222 | + | } | |
223 | + | } | |
224 | + | let check3 = if ((size(check2) >= 3)) | |
225 | + | then check2 | |
226 | + | else { | |
227 | + | let p3 = prices[3] | |
228 | + | if ((0 >= p3)) | |
229 | + | then [3] | |
230 | + | else { | |
231 | + | let p30 = ((prices[0] * 100) / p3) | |
232 | + | let p31 = ((prices[1] * 100) / p3) | |
233 | + | let p32 = ((prices[2] * 100) / p3) | |
234 | + | let p34 = ((prices[4] * 100) / p3) | |
235 | + | let array1 = if (if ((maxPercentBound > p30)) | |
236 | + | then (p30 > minPercentBound) | |
237 | + | else false) | |
238 | + | then [0, 3] | |
239 | + | else [3] | |
240 | + | let array2 = if (if ((maxPercentBound > p31)) | |
241 | + | then (p31 > minPercentBound) | |
242 | + | else false) | |
243 | + | then 1 :: array1 | |
244 | + | else array1 | |
245 | + | let array3 = if (if ((maxPercentBound > p32)) | |
246 | + | then (p32 > minPercentBound) | |
247 | + | else false) | |
248 | + | then 2 :: array2 | |
249 | + | else array2 | |
250 | + | if (if ((maxPercentBound > p34)) | |
251 | + | then (p34 > minPercentBound) | |
252 | + | else false) | |
253 | + | then 4 :: array3 | |
254 | + | else array3 | |
255 | + | } | |
256 | + | } | |
257 | + | if ((size(check3) >= 3)) | |
258 | + | then check3 | |
259 | + | else { | |
260 | + | let p4 = prices[4] | |
261 | + | if ((0 >= p4)) | |
262 | + | then [4] | |
263 | + | else { | |
264 | + | let p40 = ((prices[0] * 100) / p4) | |
265 | + | let p41 = ((prices[1] * 100) / p4) | |
266 | + | let p42 = ((prices[2] * 100) / p4) | |
267 | + | let p43 = ((prices[3] * 100) / p4) | |
268 | + | let array1 = if (if ((maxPercentBound > p40)) | |
269 | + | then (p40 > minPercentBound) | |
270 | + | else false) | |
271 | + | then [0, 4] | |
272 | + | else [4] | |
273 | + | let array2 = if (if ((maxPercentBound > p41)) | |
274 | + | then (p41 > minPercentBound) | |
275 | + | else false) | |
276 | + | then 1 :: array1 | |
277 | + | else array1 | |
278 | + | let array3 = if (if ((maxPercentBound > p42)) | |
279 | + | then (p42 > minPercentBound) | |
280 | + | else false) | |
281 | + | then 2 :: array2 | |
282 | + | else array2 | |
283 | + | if (if ((maxPercentBound > p43)) | |
284 | + | then (p43 > minPercentBound) | |
285 | + | else false) | |
286 | + | then 3 :: array3 | |
287 | + | else array3 | |
288 | + | } | |
289 | + | } | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | @Callable(i) | |
294 | + | func callEmergencyShutdown (reason) = { | |
295 | + | let callerAddress = toString(i.caller) | |
296 | + | if ((AutoEmergencyOracleAddress != callerAddress)) | |
297 | + | then throw("caller must be one an emergency oracle") | |
298 | + | else WriteSet([DataEntry(IsBlockedKey, true), DataEntry(IsBlockedCallerKey, callerAddress), DataEntry(IsBlockedReasonKey, reason)]) | |
299 | + | } | |
300 | + | ||
301 | + | ||
302 | + | ||
303 | + | @Callable(i) | |
304 | + | func finalizeCurrentPrice () = if (isBlocked) | |
305 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
306 | + | else if ((getPriceHistory(height) != 0)) | |
307 | + | then throw("wait next block") | |
308 | + | else { | |
309 | + | let prices = [getOracleProvideHeight(oraclesList[0], height), getOracleProvideHeight(oraclesList[1], height), getOracleProvideHeight(oraclesList[2], height), getOracleProvideHeight(oraclesList[3], height), getOracleProvideHeight(oraclesList[4], height)] | |
310 | + | let pricesInRange = findPricesInRange(prices) | |
311 | + | let priceProvidingCount = size(pricesInRange) | |
312 | + | if ((3 > priceProvidingCount)) | |
313 | + | then throw(((((((((((((((((((((("Could not finalize price because of big variation: height=" + toString(height)) + " | |
314 | + | ") + oraclesList[0]) + "=") + toString(prices[0])) + " | |
315 | + | ") + oraclesList[1]) + "=") + toString(prices[1])) + " | |
316 | + | ") + oraclesList[2]) + "=") + toString(prices[2])) + " | |
317 | + | ") + oraclesList[3]) + "=") + toString(prices[3])) + " | |
318 | + | ") + oraclesList[4]) + "=") + toString(prices[4]))) | |
319 | + | else { | |
320 | + | let sum1 = ((prices[pricesInRange[0]] + prices[pricesInRange[1]]) + prices[pricesInRange[2]]) | |
321 | + | let sum2 = if ((priceProvidingCount >= 4)) | |
322 | + | then (sum1 + prices[pricesInRange[3]]) | |
323 | + | else sum1 | |
324 | + | let priceSum = if ((priceProvidingCount >= 5)) | |
325 | + | then (sum2 + prices[pricesInRange[4]]) | |
326 | + | else sum2 | |
327 | + | if ((priceProvidingCount >= 6)) | |
328 | + | then throw("Invalid pricesInRange creation") | |
329 | + | else { | |
330 | + | let newPrice = (priceSum / priceProvidingCount) | |
331 | + | if (if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
332 | + | then true | |
333 | + | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice)) | |
334 | + | then WriteSet([DataEntry(IsBlockedKey, true), DataEntry(getBlackSwarmPriceKey(height), newPrice)]) | |
335 | + | else { | |
336 | + | let newPriceIndex = (priceIndex + 1) | |
337 | + | WriteSet([DataEntry(PriceKey, newPrice), DataEntry(getPriceHistoryKey(height), newPrice), DataEntry(PriceIndexKey, newPriceIndex), DataEntry(getHeightPriceByIndexKey(newPriceIndex), height)]) | |
338 | + | } | |
339 | + | } | |
340 | + | } | |
341 | + | } | |
342 | + | ||
343 | + |
github/deemru/w8io/169f3d6 25.66 ms ◑