tx · Grh8toPwnL8jtb3sCijt2mHpx9aQBrPBWpNkUsu2swh2 3MqY3tM5bgwds1ugNQGJziL8VJVvjTiNccH: -0.10000000 Waves 2020.03.31 10:07 [933299] smart account 3MqY3tM5bgwds1ugNQGJziL8VJVvjTiNccH > SELF 0.00000000 Waves
{ "type": 13, "id": "Grh8toPwnL8jtb3sCijt2mHpx9aQBrPBWpNkUsu2swh2", "fee": 10000000, "feeAssetId": null, "timestamp": 1585638502456, "version": 1, "sender": "3MqY3tM5bgwds1ugNQGJziL8VJVvjTiNccH", "senderPublicKey": "HRyg4YHsVLeXBvMTqFpWfyRMg57CCKwpad33v1c9dt31", "proofs": [ "4THd9pYcvhyFpwKiwh5SfP8UhKz8W9yvp4FH7HKXwt6FvTsVLRQjjNyrWqcJZB5FMfSEx1cS8nP4TWBZ1N6Wa4dZ" ], "script": "base64:AAIDAAAAAAAAABUIARIDCgEIEgwKCgECAQIBAgECAQIAAAAYAQAAABZjb252ZXJ0V2F2ZXNUb05ldXRyaW5vAAAAAgAAAAZhbW91bnQAAAAFcHJpY2UJAABrAAAAAwkAAGsAAAADBQAAAAZhbW91bnQFAAAABXByaWNlAAAAAAAAAABkAAAAAAAAD0JAAAAAAAAF9eEAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldE51bWJlckJ5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQ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ABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAA9uZXV0cmlub1N1cHBseV8JAAGkAAAAAQUAAAAGaGVpZ2h0BQAAAA5uZXV0cmlub1N1cHBseQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAABBkZWZpY2l0X3BlcmNlbnRfCQABpAAAAAEFAAAABmhlaWdodAMJAQAAAAIhPQAAAAIFAAAADm5ldXRyaW5vU3VwcGx5AAAAAAAAAAAACQAAaQAAAAIJAABoAAAAAgUAAAAHZGVmaWNpdAAAAAAAAAAAZAUAAAAObmV1dHJpbm9TdXBwbHkAAAAAAAAAAAAFAAAAA25pbAAAAABTpEbv", "chainId": 84, "height": 933299, "spentComplexity": 0 } View: original | compacted Prev: none Next: 7W7SgA2t4UhsL5qnP8yG6XPDS8zbNf4rBqdc5ajuBwSv Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), 1000000, 100000000) | |
5 | + | ||
6 | + | ||
7 | + | func getStringByKey (key) = match getString(this, key) { | |
8 | + | case a: String => | |
9 | + | a | |
10 | + | case _ => | |
11 | + | "" | |
12 | + | } | |
13 | + | ||
14 | + | ||
15 | + | func getNumberByAddressAndKey (address,key) = match getInteger(addressFromStringValue(address), key) { | |
16 | + | case a: Int => | |
17 | + | a | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | ||
22 | + | ||
23 | + | func getOracleProvideHeight (ownerPub,height) = match getInteger(addressFromPublicKey(ownerPub), ("price_" + toString(height))) { | |
24 | + | case a: Int => | |
25 | + | a | |
26 | + | case _ => | |
27 | + | 0 | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
32 | + | case a: String => | |
33 | + | a | |
34 | + | case _ => | |
35 | + | "" | |
36 | + | } | |
37 | + | ||
38 | + | ||
39 | + | func dropElementInJsonArray (array,element) = { | |
40 | + | let splitedArray = split(array, element) | |
41 | + | if ((take(splitedArray[1], 1) == ",")) | |
42 | + | then (splitedArray[0] + drop(splitedArray[1], 1)) | |
43 | + | else (dropRight(splitedArray[0], 1) + splitedArray[1]) | |
44 | + | } | |
45 | + | ||
46 | + | ||
47 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
48 | + | ||
49 | + | ||
50 | + | let price = match getInteger(this, "price") { | |
51 | + | case a: Int => | |
52 | + | a | |
53 | + | case _ => | |
54 | + | 0 | |
55 | + | } | |
56 | + | ||
57 | + | let priceIndex = match getInteger(this, "price_index") { | |
58 | + | case a: Int => | |
59 | + | a | |
60 | + | case _ => | |
61 | + | 0 | |
62 | + | } | |
63 | + | ||
64 | + | let isBlocked = match getBoolean(this, "is_blocked") { | |
65 | + | case a: Boolean => | |
66 | + | a | |
67 | + | case _ => | |
68 | + | false | |
69 | + | } | |
70 | + | ||
71 | + | let percentPriceOffset = 7 | |
72 | + | ||
73 | + | let pubKeyOracles = getStringByKey("oracles") | |
74 | + | ||
75 | + | let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles) | |
76 | + | ||
77 | + | let bftCoefficientOracle = 4 | |
78 | + | ||
79 | + | let neutrinoAddress = addressFromPublicKey(fromBase58String("J4hU7VqLs2JAJXwFnjicQ97XShyZEqt8REC8fJHkTdKd")) | |
80 | + | ||
81 | + | let liquidationAddress = addressFromPublicKey(fromBase58String("HDqeggkNi96GMzyGv4AQMQms43nwSrvgMjTDznyivt8R")) | |
82 | + | ||
83 | + | let neutrinoAsset = fromBase58String("EyizrdEpB9yuh45Zv3f2UfxKLjcecrmvcq5DSP9fEwum") | |
84 | + | ||
85 | + | let neutrinoLockedBalance = match getInteger(neutrinoAddress, "balance_lock_neutrino") { | |
86 | + | case a: Int => | |
87 | + | a | |
88 | + | case _ => | |
89 | + | 0 | |
90 | + | } | |
91 | + | ||
92 | + | let wavesLockedBalance = match getInteger(neutrinoAddress, "balance_lock_waves") { | |
93 | + | case a: Int => | |
94 | + | a | |
95 | + | case _ => | |
96 | + | 0 | |
97 | + | } | |
98 | + | ||
99 | + | let reserve = (wavesBalance(neutrinoAddress) - wavesLockedBalance) | |
100 | + | ||
101 | + | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset)) | |
102 | + | ||
103 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price)) | |
104 | + | ||
105 | + | func findPricesInRange (prices) = { | |
106 | + | let minPercentBound = 90 | |
107 | + | let maxPercentBound = 110 | |
108 | + | let p0 = prices[0] | |
109 | + | let check0 = if ((0 >= prices[0])) | |
110 | + | then [0] | |
111 | + | else { | |
112 | + | let p01 = ((prices[1] * 100) / p0) | |
113 | + | let p02 = ((prices[2] * 100) / p0) | |
114 | + | let p03 = ((prices[3] * 100) / p0) | |
115 | + | let p04 = ((prices[4] * 100) / p0) | |
116 | + | let array1 = if (if ((maxPercentBound > p01)) | |
117 | + | then (p01 > minPercentBound) | |
118 | + | else false) | |
119 | + | then [1, 0] | |
120 | + | else [0] | |
121 | + | let array2 = if (if ((maxPercentBound > p02)) | |
122 | + | then (p02 > minPercentBound) | |
123 | + | else false) | |
124 | + | then 2 :: array1 | |
125 | + | else array1 | |
126 | + | let array3 = if (if ((maxPercentBound > p03)) | |
127 | + | then (p03 > minPercentBound) | |
128 | + | else false) | |
129 | + | then 3 :: array2 | |
130 | + | else array2 | |
131 | + | if (if ((maxPercentBound > p04)) | |
132 | + | then (p04 > minPercentBound) | |
133 | + | else false) | |
134 | + | then 4 :: array3 | |
135 | + | else array3 | |
136 | + | } | |
137 | + | let check1 = if ((size(check0) >= 3)) | |
138 | + | then check0 | |
139 | + | else { | |
140 | + | let p1 = prices[1] | |
141 | + | if ((0 >= p1)) | |
142 | + | then [1] | |
143 | + | else { | |
144 | + | let p10 = ((prices[0] * 100) / p1) | |
145 | + | let p12 = ((prices[2] * 100) / p1) | |
146 | + | let p13 = ((prices[3] * 100) / p1) | |
147 | + | let p14 = ((prices[4] * 100) / p1) | |
148 | + | let array1 = if (if ((maxPercentBound > p10)) | |
149 | + | then (p10 > minPercentBound) | |
150 | + | else false) | |
151 | + | then [0, 1] | |
152 | + | else [1] | |
153 | + | let array2 = if (if ((maxPercentBound > p12)) | |
154 | + | then (p12 > minPercentBound) | |
155 | + | else false) | |
156 | + | then 2 :: array1 | |
157 | + | else array1 | |
158 | + | let array3 = if (if ((maxPercentBound > p13)) | |
159 | + | then (p13 > minPercentBound) | |
160 | + | else false) | |
161 | + | then 3 :: array2 | |
162 | + | else array2 | |
163 | + | if (if ((maxPercentBound > p14)) | |
164 | + | then (p14 > minPercentBound) | |
165 | + | else false) | |
166 | + | then 4 :: array3 | |
167 | + | else array3 | |
168 | + | } | |
169 | + | } | |
170 | + | let check2 = if ((size(check1) >= 3)) | |
171 | + | then check1 | |
172 | + | else { | |
173 | + | let p2 = prices[2] | |
174 | + | if ((0 >= p2)) | |
175 | + | then [2] | |
176 | + | else { | |
177 | + | let p20 = ((prices[0] * 100) / p2) | |
178 | + | let p21 = ((prices[1] * 100) / p2) | |
179 | + | let p23 = ((prices[3] * 100) / p2) | |
180 | + | let p24 = ((prices[4] * 100) / p2) | |
181 | + | let array1 = if (if ((maxPercentBound > p20)) | |
182 | + | then (p20 > minPercentBound) | |
183 | + | else false) | |
184 | + | then [0, 2] | |
185 | + | else [2] | |
186 | + | let array2 = if (if ((maxPercentBound > p21)) | |
187 | + | then (p21 > minPercentBound) | |
188 | + | else false) | |
189 | + | then 1 :: array1 | |
190 | + | else array1 | |
191 | + | let array3 = if (if ((maxPercentBound > p23)) | |
192 | + | then (p23 > minPercentBound) | |
193 | + | else false) | |
194 | + | then 3 :: array2 | |
195 | + | else array2 | |
196 | + | if (if ((maxPercentBound > p24)) | |
197 | + | then (p24 > minPercentBound) | |
198 | + | else false) | |
199 | + | then 4 :: array3 | |
200 | + | else array3 | |
201 | + | } | |
202 | + | } | |
203 | + | let check3 = if ((size(check2) >= 3)) | |
204 | + | then check2 | |
205 | + | else { | |
206 | + | let p3 = prices[3] | |
207 | + | if ((0 >= p3)) | |
208 | + | then [3] | |
209 | + | else { | |
210 | + | let p30 = ((prices[0] * 100) / p3) | |
211 | + | let p31 = ((prices[1] * 100) / p3) | |
212 | + | let p32 = ((prices[2] * 100) / p3) | |
213 | + | let p34 = ((prices[4] * 100) / p3) | |
214 | + | let array1 = if (if ((maxPercentBound > p30)) | |
215 | + | then (p30 > minPercentBound) | |
216 | + | else false) | |
217 | + | then [0, 3] | |
218 | + | else [3] | |
219 | + | let array2 = if (if ((maxPercentBound > p31)) | |
220 | + | then (p31 > minPercentBound) | |
221 | + | else false) | |
222 | + | then 1 :: array1 | |
223 | + | else array1 | |
224 | + | let array3 = if (if ((maxPercentBound > p32)) | |
225 | + | then (p32 > minPercentBound) | |
226 | + | else false) | |
227 | + | then 2 :: array2 | |
228 | + | else array2 | |
229 | + | if (if ((maxPercentBound > p34)) | |
230 | + | then (p34 > minPercentBound) | |
231 | + | else false) | |
232 | + | then 4 :: array3 | |
233 | + | else array3 | |
234 | + | } | |
235 | + | } | |
236 | + | if ((size(check3) >= 3)) | |
237 | + | then check3 | |
238 | + | else { | |
239 | + | let p4 = prices[4] | |
240 | + | if ((0 >= p4)) | |
241 | + | then [4] | |
242 | + | else { | |
243 | + | let p40 = ((prices[0] * 100) / p4) | |
244 | + | let p41 = ((prices[1] * 100) / p4) | |
245 | + | let p42 = ((prices[2] * 100) / p4) | |
246 | + | let p43 = ((prices[3] * 100) / p4) | |
247 | + | let array1 = if (if ((maxPercentBound > p40)) | |
248 | + | then (p40 > minPercentBound) | |
249 | + | else false) | |
250 | + | then [0, 4] | |
251 | + | else [4] | |
252 | + | let array2 = if (if ((maxPercentBound > p41)) | |
253 | + | then (p41 > minPercentBound) | |
254 | + | else false) | |
255 | + | then 1 :: array1 | |
256 | + | else array1 | |
257 | + | let array3 = if (if ((maxPercentBound > p42)) | |
258 | + | then (p42 > minPercentBound) | |
259 | + | else false) | |
260 | + | then 2 :: array2 | |
261 | + | else array2 | |
262 | + | if (if ((maxPercentBound > p43)) | |
263 | + | then (p43 > minPercentBound) | |
264 | + | else false) | |
265 | + | then 3 :: array3 | |
266 | + | else array3 | |
267 | + | } | |
268 | + | } | |
269 | + | } | |
270 | + | ||
271 | + | ||
272 | + | func formattingPriceMsg (price,height) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price))) | |
273 | + | ||
274 | + | ||
275 | + | @Callable(i) | |
276 | + | func callEmergencyShutdown (reason) = { | |
277 | + | let AutoEmergencyOracleAddress = "3Mwho43kPZa9w1y91NJsAoYxgQpsg3JjGby" | |
278 | + | let callerAddress = toString(i.caller) | |
279 | + | if ((AutoEmergencyOracleAddress != callerAddress)) | |
280 | + | then throw("caller must be one an emergency oracle") | |
281 | + | else WriteSet([DataEntry("is_blocked", true), DataEntry("is_blocked_caller", callerAddress), DataEntry("is_blocked_reason", reason)]) | |
282 | + | } | |
283 | + | ||
284 | + | ||
285 | + | ||
286 | + | @Callable(i) | |
287 | + | func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked) | |
288 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
289 | + | else if (( match getInteger(this, ("price_" + toString(height))) { | |
290 | + | case a: Int => | |
291 | + | a | |
292 | + | case _ => | |
293 | + | 0 | |
294 | + | } != 0)) | |
295 | + | then throw("wait next block") | |
296 | + | else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey))) | |
297 | + | then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)])) | |
298 | + | else { | |
299 | + | let prices = [if (sigVerify(formattingPriceMsg(price1, height), sign1, fromBase58String(pubKeyOraclesList[0]))) | |
300 | + | then price1 | |
301 | + | else 0, if (sigVerify(formattingPriceMsg(price2, height), sign2, fromBase58String(pubKeyOraclesList[1]))) | |
302 | + | then price2 | |
303 | + | else 0, if (sigVerify(formattingPriceMsg(price3, height), sign3, fromBase58String(pubKeyOraclesList[2]))) | |
304 | + | then price3 | |
305 | + | else 0, if (sigVerify(formattingPriceMsg(price4, height), sign4, fromBase58String(pubKeyOraclesList[3]))) | |
306 | + | then price4 | |
307 | + | else 0, if (sigVerify(formattingPriceMsg(price5, height), sign5, fromBase58String(pubKeyOraclesList[4]))) | |
308 | + | then price5 | |
309 | + | else 0] | |
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 | + | ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + " | |
315 | + | ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + " | |
316 | + | ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + " | |
317 | + | ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + " | |
318 | + | ") + pubKeyOraclesList[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("is_blocked", true), DataEntry((("black_swarm_price" + "_") + toString(height)), newPrice)]) | |
335 | + | else { | |
336 | + | let newPriceIndex = (priceIndex + 1) | |
337 | + | WriteSet([DataEntry("price", newPrice), DataEntry(("price_" + toString(height)), newPrice), DataEntry("price_index", newPriceIndex), DataEntry(("price_index_" + toString(newPriceIndex)), height), DataEntry(("deficit_" + toString(height)), deficit), DataEntry(("neutrinoSupply_" + toString(height)), neutrinoSupply), DataEntry(("deficit_percent_" + toString(height)), if ((neutrinoSupply != 0)) | |
338 | + | then ((deficit * 100) / neutrinoSupply) | |
339 | + | else 0)]) | |
340 | + | } | |
341 | + | } | |
342 | + | } | |
343 | + | } | |
344 | + | ||
345 | + |
github/deemru/w8io/169f3d6 26.94 ms ◑