tx · E2HCraJeQ7QSCGoAFb9wgagXMxaA9C77DPkWKDSb1Bxb 3MtgeKSTN6b63HXjVjzbJMPdrnjh5ntRruR: -0.01000000 Waves 2021.07.27 20:25 [1632349] smart account 3MtgeKSTN6b63HXjVjzbJMPdrnjh5ntRruR > SELF 0.00000000 Waves
{ "type": 13, "id": "E2HCraJeQ7QSCGoAFb9wgagXMxaA9C77DPkWKDSb1Bxb", "fee": 1000000, "feeAssetId": null, "timestamp": 1627406736642, "version": 1, "sender": "3MtgeKSTN6b63HXjVjzbJMPdrnjh5ntRruR", "senderPublicKey": "9x75DzVBGmFgwi6xSGiP6bSvqFJ7c7TSCQH14JdQM7ww", "proofs": [ "5YupYRa7t7SG7y4ypKtp2PNaELbg6cXQLFb48CdDPaV3B7RmadFq6U5UkGSAKubkYbPwaHjjtKHVW62P2CzGxn6n" ], "script": "base64:AAIEAAAAAAAAABkIAhIDCgEIEgwKCgECAQIBAgECAQISABIAAAAAFAEAAAAWY29udmVydFdhdmVzVG9OZXV0cmlubwAAAAIAAAAGYW1vdW50AAAABXByaWNlCQAAawAAAAMJAABrAAAAAwUAAAAGYW1vdW50BQAAAAVwcmljZQAAAAAAAA9CQAAAAAAAAA9CQAAAAAAABfXhAAEAAAAYZ2V0TnVtYmVyQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkAAAAAAAAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AgAAAAABAAAAFmNvbnZlcnRKc29uQXJyYXlUb0xpc3QAAAABAAAACWpzb25BcnJheQkABLUAAAACBQAAAAlqc29uQXJy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Byb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAPHZnXy", "chainId": 84, "height": 1632349, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 1000000), 1000000, 100000000) | |
5 | + | ||
6 | + | ||
7 | + | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
8 | + | ||
9 | + | ||
10 | + | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
11 | + | ||
12 | + | ||
13 | + | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
14 | + | ||
15 | + | ||
16 | + | let price = valueOrElse(getInteger(this, "price"), 0) | |
17 | + | ||
18 | + | let priceIndex = valueOrElse(getInteger(this, "price_index"), 0) | |
19 | + | ||
20 | + | let isBlocked = valueOrElse(getBoolean(this, "is_blocked"), false) | |
21 | + | ||
22 | + | let percentPriceOffset = 25 | |
23 | + | ||
24 | + | let pubKeyOracles = valueOrElse(getString(this, "oracles"), "") | |
25 | + | ||
26 | + | let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles) | |
27 | + | ||
28 | + | let neutrinoAddress = Address(base58'3MtHNMQEdYEvwbMrvWVBog8Szg1JsGSWsmm') | |
29 | + | ||
30 | + | let liquidationAddress = Address(base58'3Mss9v8sKwYihn5v3H6Ztg114wFZ5RSMybB') | |
31 | + | ||
32 | + | let neutrinoAsset = base58'1LBFMLWgRyEPoX8HwJcpC39LusopK1MnVeHEj9fS2Jy' | |
33 | + | ||
34 | + | let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_neutrino"), 0) | |
35 | + | ||
36 | + | let wavesLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_waves"), 0) | |
37 | + | ||
38 | + | let reserve = (wavesBalance(neutrinoAddress).regular - wavesLockedBalance) | |
39 | + | ||
40 | + | let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset)) | |
41 | + | ||
42 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price)) | |
43 | + | ||
44 | + | func findPricesInRange (prices) = { | |
45 | + | let minPercentBound = 90 | |
46 | + | let maxPercentBound = 110 | |
47 | + | let p0 = prices[0] | |
48 | + | let check0 = if ((0 >= prices[0])) | |
49 | + | then [0] | |
50 | + | else { | |
51 | + | let p01 = ((prices[1] * 100) / p0) | |
52 | + | let p02 = ((prices[2] * 100) / p0) | |
53 | + | let p03 = ((prices[3] * 100) / p0) | |
54 | + | let p04 = ((prices[4] * 100) / p0) | |
55 | + | let array1 = if (if ((maxPercentBound > p01)) | |
56 | + | then (p01 > minPercentBound) | |
57 | + | else false) | |
58 | + | then [1, 0] | |
59 | + | else [0] | |
60 | + | let array2 = if (if ((maxPercentBound > p02)) | |
61 | + | then (p02 > minPercentBound) | |
62 | + | else false) | |
63 | + | then 2 :: array1 | |
64 | + | else array1 | |
65 | + | let array3 = if (if ((maxPercentBound > p03)) | |
66 | + | then (p03 > minPercentBound) | |
67 | + | else false) | |
68 | + | then 3 :: array2 | |
69 | + | else array2 | |
70 | + | if (if ((maxPercentBound > p04)) | |
71 | + | then (p04 > minPercentBound) | |
72 | + | else false) | |
73 | + | then 4 :: array3 | |
74 | + | else array3 | |
75 | + | } | |
76 | + | let check1 = if ((size(check0) >= 3)) | |
77 | + | then check0 | |
78 | + | else { | |
79 | + | let p1 = prices[1] | |
80 | + | if ((0 >= p1)) | |
81 | + | then [1] | |
82 | + | else { | |
83 | + | let p10 = ((prices[0] * 100) / p1) | |
84 | + | let p12 = ((prices[2] * 100) / p1) | |
85 | + | let p13 = ((prices[3] * 100) / p1) | |
86 | + | let p14 = ((prices[4] * 100) / p1) | |
87 | + | let array1 = if (if ((maxPercentBound > p10)) | |
88 | + | then (p10 > minPercentBound) | |
89 | + | else false) | |
90 | + | then [0, 1] | |
91 | + | else [1] | |
92 | + | let array2 = if (if ((maxPercentBound > p12)) | |
93 | + | then (p12 > minPercentBound) | |
94 | + | else false) | |
95 | + | then 2 :: array1 | |
96 | + | else array1 | |
97 | + | let array3 = if (if ((maxPercentBound > p13)) | |
98 | + | then (p13 > minPercentBound) | |
99 | + | else false) | |
100 | + | then 3 :: array2 | |
101 | + | else array2 | |
102 | + | if (if ((maxPercentBound > p14)) | |
103 | + | then (p14 > minPercentBound) | |
104 | + | else false) | |
105 | + | then 4 :: array3 | |
106 | + | else array3 | |
107 | + | } | |
108 | + | } | |
109 | + | let check2 = if ((size(check1) >= 3)) | |
110 | + | then check1 | |
111 | + | else { | |
112 | + | let p2 = prices[2] | |
113 | + | if ((0 >= p2)) | |
114 | + | then [2] | |
115 | + | else { | |
116 | + | let p20 = ((prices[0] * 100) / p2) | |
117 | + | let p21 = ((prices[1] * 100) / p2) | |
118 | + | let p23 = ((prices[3] * 100) / p2) | |
119 | + | let p24 = ((prices[4] * 100) / p2) | |
120 | + | let array1 = if (if ((maxPercentBound > p20)) | |
121 | + | then (p20 > minPercentBound) | |
122 | + | else false) | |
123 | + | then [0, 2] | |
124 | + | else [2] | |
125 | + | let array2 = if (if ((maxPercentBound > p21)) | |
126 | + | then (p21 > minPercentBound) | |
127 | + | else false) | |
128 | + | then 1 :: array1 | |
129 | + | else array1 | |
130 | + | let array3 = if (if ((maxPercentBound > p23)) | |
131 | + | then (p23 > minPercentBound) | |
132 | + | else false) | |
133 | + | then 3 :: array2 | |
134 | + | else array2 | |
135 | + | if (if ((maxPercentBound > p24)) | |
136 | + | then (p24 > minPercentBound) | |
137 | + | else false) | |
138 | + | then 4 :: array3 | |
139 | + | else array3 | |
140 | + | } | |
141 | + | } | |
142 | + | let check3 = if ((size(check2) >= 3)) | |
143 | + | then check2 | |
144 | + | else { | |
145 | + | let p3 = prices[3] | |
146 | + | if ((0 >= p3)) | |
147 | + | then [3] | |
148 | + | else { | |
149 | + | let p30 = ((prices[0] * 100) / p3) | |
150 | + | let p31 = ((prices[1] * 100) / p3) | |
151 | + | let p32 = ((prices[2] * 100) / p3) | |
152 | + | let p34 = ((prices[4] * 100) / p3) | |
153 | + | let array1 = if (if ((maxPercentBound > p30)) | |
154 | + | then (p30 > minPercentBound) | |
155 | + | else false) | |
156 | + | then [0, 3] | |
157 | + | else [3] | |
158 | + | let array2 = if (if ((maxPercentBound > p31)) | |
159 | + | then (p31 > minPercentBound) | |
160 | + | else false) | |
161 | + | then 1 :: array1 | |
162 | + | else array1 | |
163 | + | let array3 = if (if ((maxPercentBound > p32)) | |
164 | + | then (p32 > minPercentBound) | |
165 | + | else false) | |
166 | + | then 2 :: array2 | |
167 | + | else array2 | |
168 | + | if (if ((maxPercentBound > p34)) | |
169 | + | then (p34 > minPercentBound) | |
170 | + | else false) | |
171 | + | then 4 :: array3 | |
172 | + | else array3 | |
173 | + | } | |
174 | + | } | |
175 | + | if ((size(check3) >= 3)) | |
176 | + | then check3 | |
177 | + | else { | |
178 | + | let p4 = prices[4] | |
179 | + | if ((0 >= p4)) | |
180 | + | then [4] | |
181 | + | else { | |
182 | + | let p40 = ((prices[0] * 100) / p4) | |
183 | + | let p41 = ((prices[1] * 100) / p4) | |
184 | + | let p42 = ((prices[2] * 100) / p4) | |
185 | + | let p43 = ((prices[3] * 100) / p4) | |
186 | + | let array1 = if (if ((maxPercentBound > p40)) | |
187 | + | then (p40 > minPercentBound) | |
188 | + | else false) | |
189 | + | then [0, 4] | |
190 | + | else [4] | |
191 | + | let array2 = if (if ((maxPercentBound > p41)) | |
192 | + | then (p41 > minPercentBound) | |
193 | + | else false) | |
194 | + | then 1 :: array1 | |
195 | + | else array1 | |
196 | + | let array3 = if (if ((maxPercentBound > p42)) | |
197 | + | then (p42 > minPercentBound) | |
198 | + | else false) | |
199 | + | then 2 :: array2 | |
200 | + | else array2 | |
201 | + | if (if ((maxPercentBound > p43)) | |
202 | + | then (p43 > minPercentBound) | |
203 | + | else false) | |
204 | + | then 3 :: array3 | |
205 | + | else array3 | |
206 | + | } | |
207 | + | } | |
208 | + | } | |
209 | + | ||
210 | + | ||
211 | + | func formattingPriceMsg (price) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price))) | |
212 | + | ||
213 | + | ||
214 | + | @Callable(i) | |
215 | + | func callEmergencyShutdown (reason) = { | |
216 | + | let AutoEmergencyOracleAddress = "3ND1cZkkHzw3tvKXjb6H4ZocpKEBScXyMi6" | |
217 | + | let callerAddress = toString(i.caller) | |
218 | + | if ((AutoEmergencyOracleAddress != callerAddress)) | |
219 | + | then throw("caller must be one an emergency oracle") | |
220 | + | else [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", callerAddress), StringEntry("is_blocked_reason", reason)] | |
221 | + | } | |
222 | + | ||
223 | + | ||
224 | + | ||
225 | + | @Callable(i) | |
226 | + | func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked) | |
227 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
228 | + | else if ((valueOrElse(getInteger(this, ("price_" + toString(height))), 0) != 0)) | |
229 | + | then throw("wait next block") | |
230 | + | else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey))) | |
231 | + | then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)])) | |
232 | + | else { | |
233 | + | let prices = [if (sigVerify_8Kb(formattingPriceMsg(price1), sign1, fromBase58String(pubKeyOraclesList[0]))) | |
234 | + | then price1 | |
235 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(price2), sign2, fromBase58String(pubKeyOraclesList[1]))) | |
236 | + | then price2 | |
237 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(price3), sign3, fromBase58String(pubKeyOraclesList[2]))) | |
238 | + | then price3 | |
239 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(price4), sign4, fromBase58String(pubKeyOraclesList[3]))) | |
240 | + | then price4 | |
241 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(price5), sign5, fromBase58String(pubKeyOraclesList[4]))) | |
242 | + | then price5 | |
243 | + | else 0] | |
244 | + | let zeroPriceCount = if ((prices[0] == 0)) | |
245 | + | then 1 | |
246 | + | else (0 + (if ((prices[1] == 0)) | |
247 | + | then 1 | |
248 | + | else (0 + (if ((prices[2] == 0)) | |
249 | + | then 1 | |
250 | + | else (0 + (if ((prices[3] == 0)) | |
251 | + | then 1 | |
252 | + | else (0 + (if ((prices[4] == 0)) | |
253 | + | then 1 | |
254 | + | else 0)))))))) | |
255 | + | if ((zeroPriceCount >= 3)) | |
256 | + | then throw("3 prices or more are equals to 0") | |
257 | + | else { | |
258 | + | let pricesInRange = findPricesInRange(prices) | |
259 | + | let priceProvidingCount = size(pricesInRange) | |
260 | + | if ((3 > priceProvidingCount)) | |
261 | + | then throw(((((((((((((((((((((("Could not finalize price because of big variation: height=" + toString(height)) + " | |
262 | + | ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + " | |
263 | + | ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + " | |
264 | + | ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + " | |
265 | + | ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + " | |
266 | + | ") + pubKeyOraclesList[4]) + "=") + toString(prices[4]))) | |
267 | + | else { | |
268 | + | let sum1 = ((prices[pricesInRange[0]] + prices[pricesInRange[1]]) + prices[pricesInRange[2]]) | |
269 | + | let sum2 = if ((priceProvidingCount >= 4)) | |
270 | + | then (sum1 + prices[pricesInRange[3]]) | |
271 | + | else sum1 | |
272 | + | let priceSum = if ((priceProvidingCount >= 5)) | |
273 | + | then (sum2 + prices[pricesInRange[4]]) | |
274 | + | else sum2 | |
275 | + | if ((priceProvidingCount >= 6)) | |
276 | + | then throw("Invalid pricesInRange creation") | |
277 | + | else { | |
278 | + | let newPrice = (priceSum / priceProvidingCount) | |
279 | + | if (if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
280 | + | then true | |
281 | + | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice)) | |
282 | + | then { | |
283 | + | let reason = "automatic emergency shutdown because of large price variability" | |
284 | + | [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", toString(this)), StringEntry("is_blocked_reason", reason), IntegerEntry((("black_swarm_price" + "_") + toString(height)), newPrice)] | |
285 | + | } | |
286 | + | else { | |
287 | + | let newPriceIndex = (priceIndex + 1) | |
288 | + | [IntegerEntry("price", newPrice), IntegerEntry(("price_" + toString(height)), newPrice), IntegerEntry("price_index", newPriceIndex), IntegerEntry(("price_index_" + toString(newPriceIndex)), height), IntegerEntry(("deficit_" + toString(height)), deficit), IntegerEntry(("neutrinoSupply_" + toString(height)), neutrinoSupply), IntegerEntry(("deficit_percent_" + toString(height)), if ((neutrinoSupply != 0)) | |
289 | + | then ((deficit * 100) / neutrinoSupply) | |
290 | + | else 0)] | |
291 | + | } | |
292 | + | } | |
293 | + | } | |
294 | + | } | |
295 | + | } | |
296 | + | ||
297 | + | ||
298 | + | ||
299 | + | @Callable(i) | |
300 | + | func updateReservesAndNeutrinoSupply () = { | |
301 | + | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
302 | + | case a: Int => | |
303 | + | a | |
304 | + | case _ => | |
305 | + | 0 | |
306 | + | } | |
307 | + | ||
308 | + | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
309 | + | let newIdx = (idx + 1) | |
310 | + | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), IntegerEntry("reserve", reserve), IntegerEntry("neutrinoSupply", neutrinoSupply), IntegerEntry("reservesInUsdn", convertWavesToNeutrino(reserve, price)), IntegerEntry("deficit", deficit)] | |
311 | + | } | |
312 | + | ||
313 | + | ||
314 | + | ||
315 | + | @Callable(i) | |
316 | + | func wavesBalancesVsPayment () = { | |
317 | + | let balance = wavesBalance(this) | |
318 | + | [IntegerEntry("wavesBalance_available", balance.available), IntegerEntry("wavesBalance_regular", balance.regular), IntegerEntry("wavesBalance_generating", balance.generating), IntegerEntry("wavesBalance_effective", balance.effective), IntegerEntry("waves_payment", value(i.payments[0]).amount)] | |
319 | + | } | |
320 | + | ||
321 | + | ||
322 | + | @Verifier(tx) | |
323 | + | func verify () = { | |
324 | + | let pubKeyAdminsList = ["JAQ8TykMcbDYjjoXNjGbwC5L8XxyAe97xWgW2i7evdQE", "Amhh7ZofMC69icTQ6N2yZSYsMPqJRU1CRg5gJZEj54cF", "EktkBzwXupKcp5aeHfkFYct2FmybpkRk21SAWyetwBbE", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
325 | + | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
326 | + | then 1 | |
327 | + | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
328 | + | then 1 | |
329 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
330 | + | then 1 | |
331 | + | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
332 | + | then 2 | |
333 | + | else 0)) | |
334 | + | (count >= 3) | |
335 | + | } | |
336 | + |
github/deemru/w8io/026f985 24.68 ms ◑