tx · 9HVeLXW1z9yddBN8d2LRLLCETRgfv6iUc4iDDmYroJWe 3N1nHpe7KLcmJq27kwby5Z6tkcjBPSnLXgG: -0.01000000 Waves 2020.09.28 19:51 [1197446] smart account 3N1nHpe7KLcmJq27kwby5Z6tkcjBPSnLXgG > SELF 0.00000000 Waves
{ "type": 13, "id": "9HVeLXW1z9yddBN8d2LRLLCETRgfv6iUc4iDDmYroJWe", "fee": 1000000, "feeAssetId": null, "timestamp": 1601311902158, "version": 1, "sender": "3N1nHpe7KLcmJq27kwby5Z6tkcjBPSnLXgG", "senderPublicKey": "ATzGE6Pwwows2aQ4Xc8PS4GvQvpDaFQVrtCe7VASvFg8", "proofs": [ "36ZskEt3JUPiY7EwMpk4i6k1sXGTgfkgwxioWydutRfDBnYy5w3mgU7ePermgD7eECbb24dT6QfjEhCsTjbkpBiB" ], "script": "base64:AAIEAAAAAAAAABYIAhIDCgEIEg0KCwgBAgECAQIBAgECAAAAKAEAAAAYZ2V0TnVtYmVyQnlBZGRyZXNzQW5kS2V5AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBoAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAdhZGRyZXNzBQAAAANrZXkAAAAAAAAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AgAAAAABAAAACmtleUZhY3RvcnkAAAAAAgAAAAslc19fZmFjdG9yeQEAAAAIa2V5UHJpY2UAAAABAAAADGN1cnJlbmN5Q29kZQkAASwAAAACAgAAAA0lcyVzX19wcmljZV9fBQAAAAxjdXJyZW5jeUNvZGUBAAAADWtleUxhc3RIZWlnaHQAAAABAAAADGN1cnJlbmN5Q29kZQkAASwAAAACAgAAABIlcyVzX19sYXN0SGVpZ2h0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JlbmN5Q29kZQUAAAAGbmV3SWR4CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQEAAAANa2V5SWR4MkhlaWdodAAAAAIFAAAADGN1cnJlbmN5Q29kZQUAAAAGbmV3SWR4BQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAQAAAA1rZXlIZWlnaHQySWR4AAAAAgUAAAAMY3VycmVuY3lDb2RlBQAAAAZoZWlnaHQFAAAABm5ld0lkeAUAAAADbmlsAAAAAGmMges=", "chainId": 84, "height": 1197446, "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 getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
5 | + | ||
6 | + | ||
7 | + | func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "") | |
8 | + | ||
9 | + | ||
10 | + | func keyFactory () = "%s__factory" | |
11 | + | ||
12 | + | ||
13 | + | func keyPrice (currencyCode) = ("%s%s__price__" + currencyCode) | |
14 | + | ||
15 | + | ||
16 | + | func keyLastHeight (currencyCode) = ("%s%s__lastHeight__" + currencyCode) | |
17 | + | ||
18 | + | ||
19 | + | func keyPriceByHeight (currencyCode,h) = ((("%s%s%d__priceByHeight__" + currencyCode) + "__") + toString(h)) | |
20 | + | ||
21 | + | ||
22 | + | func keyIdx (currencyCode) = ("%s%s__idxCurrent__" + currencyCode) | |
23 | + | ||
24 | + | ||
25 | + | func keyIdx2Height (currencyCode,idx) = ((("%s%s%d__idx2Height__" + currencyCode) + "__") + toString(idx)) | |
26 | + | ||
27 | + | ||
28 | + | func keyHeight2Idx (currencyCode,h) = ((("%s%s%d__height2Idx__" + currencyCode) + "__") + toString(h)) | |
29 | + | ||
30 | + | ||
31 | + | func keyIsBlocked () = "%s__isBlocked" | |
32 | + | ||
33 | + | ||
34 | + | func keyIsBlockedSender () = "%s%s__isBlocked__sender" | |
35 | + | ||
36 | + | ||
37 | + | func keyIsBlockedReason () = "%s%s__isBlocked__reason" | |
38 | + | ||
39 | + | ||
40 | + | func keyOracles () = "%s%s__config__oracles" | |
41 | + | ||
42 | + | ||
43 | + | func keyBlackSwarmPrice (h) = ("%s%s%d__isBlocked__blackSwarmPrice__" + toString(h)) | |
44 | + | ||
45 | + | ||
46 | + | let factoryAcc = addressFromStringValue(valueOrErrorMessage(getString(this, keyFactory()), ((("No config at this=" + toString(this)) + " for key=") + keyFactory()))) | |
47 | + | ||
48 | + | func keyFactoryAssetCfg (assetAddressStr) = (("%s%s%s__defoAsset__" + assetAddressStr) + "__config") | |
49 | + | ||
50 | + | ||
51 | + | func keyFactoryDefoAddressByAssetCode (assetCode) = (("%s%s%s__defoAsset__" + assetCode) + "__addressByAssetCode") | |
52 | + | ||
53 | + | ||
54 | + | let IdxDefoAssetCode = 1 | |
55 | + | ||
56 | + | let IdxDefoAssetId = 2 | |
57 | + | ||
58 | + | let IdxDefoAssetStatus = 3 | |
59 | + | ||
60 | + | let IdxPriceDecimals = 4 | |
61 | + | ||
62 | + | let IdxBaseAssetId = 5 | |
63 | + | ||
64 | + | let IdxOverCollateralPercent = 6 | |
65 | + | ||
66 | + | let IdxMinInitPool = 7 | |
67 | + | ||
68 | + | let IdxPriceOracleAddress = 8 | |
69 | + | ||
70 | + | let IdxMinBuyPayment = 9 | |
71 | + | ||
72 | + | let IdxMinSellPayment = 10 | |
73 | + | ||
74 | + | let IdxBuyLockInterval = 11 | |
75 | + | ||
76 | + | let IdxSellLockInterval = 12 | |
77 | + | ||
78 | + | let IdxBuyFeePercent = 13 | |
79 | + | ||
80 | + | let IdxSellFeePercent = 14 | |
81 | + | ||
82 | + | func factoryReadAssetCfgByAddress (assetAddressStr) = split(valueOrErrorMessage(getString(factoryAcc, keyFactoryAssetCfg(assetAddressStr)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryAssetCfg(assetAddressStr))), "__") | |
83 | + | ||
84 | + | ||
85 | + | func factoryReadAssetCfgByCode (assetCode) = { | |
86 | + | let assetAddressStr = valueOrErrorMessage(getString(factoryAcc, keyFactoryDefoAddressByAssetCode(assetCode)), ((("No config at factory=" + toString(factoryAcc)) + " for key=") + keyFactoryDefoAddressByAssetCode(assetCode))) | |
87 | + | $Tuple2(assetAddressStr, factoryReadAssetCfgByAddress(assetAddressStr)) | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | func readPriceByHeight (currencyCode,h) = valueOrElse(getInteger(this, keyPriceByHeight(currencyCode, h)), 0) | |
92 | + | ||
93 | + | ||
94 | + | let isBlocked = valueOrElse(getBoolean(this, keyIsBlocked()), false) | |
95 | + | ||
96 | + | let minPricesCount = 3 | |
97 | + | ||
98 | + | let percentPriceOffset = 5 | |
99 | + | ||
100 | + | let pubKeyOraclesList = split(valueOrErrorMessage(getString(this, keyOracles()), ("No oracles specified by key=" + keyOracles())), ",") | |
101 | + | ||
102 | + | func findPricesInRange (prices) = { | |
103 | + | let minPercentBound = 90 | |
104 | + | let maxPercentBound = 110 | |
105 | + | let p0 = prices[0] | |
106 | + | let check0 = if ((0 >= prices[0])) | |
107 | + | then [0] | |
108 | + | else { | |
109 | + | let p01 = ((prices[1] * 100) / p0) | |
110 | + | let p02 = ((prices[2] * 100) / p0) | |
111 | + | let p03 = ((prices[3] * 100) / p0) | |
112 | + | let p04 = ((prices[4] * 100) / p0) | |
113 | + | let array1 = if (if ((maxPercentBound > p01)) | |
114 | + | then (p01 > minPercentBound) | |
115 | + | else false) | |
116 | + | then [1, 0] | |
117 | + | else [0] | |
118 | + | let array2 = if (if ((maxPercentBound > p02)) | |
119 | + | then (p02 > minPercentBound) | |
120 | + | else false) | |
121 | + | then 2 :: array1 | |
122 | + | else array1 | |
123 | + | let array3 = if (if ((maxPercentBound > p03)) | |
124 | + | then (p03 > minPercentBound) | |
125 | + | else false) | |
126 | + | then 3 :: array2 | |
127 | + | else array2 | |
128 | + | if (if ((maxPercentBound > p04)) | |
129 | + | then (p04 > minPercentBound) | |
130 | + | else false) | |
131 | + | then 4 :: array3 | |
132 | + | else array3 | |
133 | + | } | |
134 | + | let check1 = if ((size(check0) >= minPricesCount)) | |
135 | + | then check0 | |
136 | + | else { | |
137 | + | let p1 = prices[1] | |
138 | + | if ((0 >= p1)) | |
139 | + | then [1] | |
140 | + | else { | |
141 | + | let p10 = ((prices[0] * 100) / p1) | |
142 | + | let p12 = ((prices[2] * 100) / p1) | |
143 | + | let p13 = ((prices[3] * 100) / p1) | |
144 | + | let p14 = ((prices[4] * 100) / p1) | |
145 | + | let array1 = if (if ((maxPercentBound > p10)) | |
146 | + | then (p10 > minPercentBound) | |
147 | + | else false) | |
148 | + | then [0, 1] | |
149 | + | else [1] | |
150 | + | let array2 = if (if ((maxPercentBound > p12)) | |
151 | + | then (p12 > minPercentBound) | |
152 | + | else false) | |
153 | + | then 2 :: array1 | |
154 | + | else array1 | |
155 | + | let array3 = if (if ((maxPercentBound > p13)) | |
156 | + | then (p13 > minPercentBound) | |
157 | + | else false) | |
158 | + | then 3 :: array2 | |
159 | + | else array2 | |
160 | + | if (if ((maxPercentBound > p14)) | |
161 | + | then (p14 > minPercentBound) | |
162 | + | else false) | |
163 | + | then 4 :: array3 | |
164 | + | else array3 | |
165 | + | } | |
166 | + | } | |
167 | + | let check2 = if ((size(check1) >= minPricesCount)) | |
168 | + | then check1 | |
169 | + | else { | |
170 | + | let p2 = prices[2] | |
171 | + | if ((0 >= p2)) | |
172 | + | then [2] | |
173 | + | else { | |
174 | + | let p20 = ((prices[0] * 100) / p2) | |
175 | + | let p21 = ((prices[1] * 100) / p2) | |
176 | + | let p23 = ((prices[3] * 100) / p2) | |
177 | + | let p24 = ((prices[4] * 100) / p2) | |
178 | + | let array1 = if (if ((maxPercentBound > p20)) | |
179 | + | then (p20 > minPercentBound) | |
180 | + | else false) | |
181 | + | then [0, 2] | |
182 | + | else [2] | |
183 | + | let array2 = if (if ((maxPercentBound > p21)) | |
184 | + | then (p21 > minPercentBound) | |
185 | + | else false) | |
186 | + | then 1 :: array1 | |
187 | + | else array1 | |
188 | + | let array3 = if (if ((maxPercentBound > p23)) | |
189 | + | then (p23 > minPercentBound) | |
190 | + | else false) | |
191 | + | then 3 :: array2 | |
192 | + | else array2 | |
193 | + | if (if ((maxPercentBound > p24)) | |
194 | + | then (p24 > minPercentBound) | |
195 | + | else false) | |
196 | + | then 4 :: array3 | |
197 | + | else array3 | |
198 | + | } | |
199 | + | } | |
200 | + | let check3 = if ((size(check2) >= minPricesCount)) | |
201 | + | then check2 | |
202 | + | else { | |
203 | + | let p3 = prices[3] | |
204 | + | if ((0 >= p3)) | |
205 | + | then [3] | |
206 | + | else { | |
207 | + | let p30 = ((prices[0] * 100) / p3) | |
208 | + | let p31 = ((prices[1] * 100) / p3) | |
209 | + | let p32 = ((prices[2] * 100) / p3) | |
210 | + | let p34 = ((prices[4] * 100) / p3) | |
211 | + | let array1 = if (if ((maxPercentBound > p30)) | |
212 | + | then (p30 > minPercentBound) | |
213 | + | else false) | |
214 | + | then [0, 3] | |
215 | + | else [3] | |
216 | + | let array2 = if (if ((maxPercentBound > p31)) | |
217 | + | then (p31 > minPercentBound) | |
218 | + | else false) | |
219 | + | then 1 :: array1 | |
220 | + | else array1 | |
221 | + | let array3 = if (if ((maxPercentBound > p32)) | |
222 | + | then (p32 > minPercentBound) | |
223 | + | else false) | |
224 | + | then 2 :: array2 | |
225 | + | else array2 | |
226 | + | if (if ((maxPercentBound > p34)) | |
227 | + | then (p34 > minPercentBound) | |
228 | + | else false) | |
229 | + | then 4 :: array3 | |
230 | + | else array3 | |
231 | + | } | |
232 | + | } | |
233 | + | if ((size(check3) >= minPricesCount)) | |
234 | + | then check3 | |
235 | + | else { | |
236 | + | let p4 = prices[4] | |
237 | + | if ((0 >= p4)) | |
238 | + | then [4] | |
239 | + | else { | |
240 | + | let p40 = ((prices[0] * 100) / p4) | |
241 | + | let p41 = ((prices[1] * 100) / p4) | |
242 | + | let p42 = ((prices[2] * 100) / p4) | |
243 | + | let p43 = ((prices[3] * 100) / p4) | |
244 | + | let array1 = if (if ((maxPercentBound > p40)) | |
245 | + | then (p40 > minPercentBound) | |
246 | + | else false) | |
247 | + | then [0, 4] | |
248 | + | else [4] | |
249 | + | let array2 = if (if ((maxPercentBound > p41)) | |
250 | + | then (p41 > minPercentBound) | |
251 | + | else false) | |
252 | + | then 1 :: array1 | |
253 | + | else array1 | |
254 | + | let array3 = if (if ((maxPercentBound > p42)) | |
255 | + | then (p42 > minPercentBound) | |
256 | + | else false) | |
257 | + | then 2 :: array2 | |
258 | + | else array2 | |
259 | + | if (if ((maxPercentBound > p43)) | |
260 | + | then (p43 > minPercentBound) | |
261 | + | else false) | |
262 | + | then 3 :: array3 | |
263 | + | else array3 | |
264 | + | } | |
265 | + | } | |
266 | + | } | |
267 | + | ||
268 | + | ||
269 | + | func formattingPriceMsg (currencyCode,price) = toBytes(((((("WAVESDEFOPREFIX_" + currencyCode) + "_") + toString(height)) + "_") + toString(price))) | |
270 | + | ||
271 | + | ||
272 | + | @Callable(i) | |
273 | + | func callEmergencyShutdown (reason) = { | |
274 | + | let AutoEmergencyOracleAddress = "3P7ihFVxBNbHK237TNdPxT1xHEu8pHexXTr" | |
275 | + | let callerAddress = toString(i.caller) | |
276 | + | if ((AutoEmergencyOracleAddress != callerAddress)) | |
277 | + | then throw("caller must be one an emergency oracle") | |
278 | + | else [BooleanEntry(keyIsBlocked(), true), StringEntry(keyIsBlockedSender(), callerAddress), StringEntry(keyIsBlockedReason(), reason)] | |
279 | + | } | |
280 | + | ||
281 | + | ||
282 | + | ||
283 | + | @Callable(i) | |
284 | + | func finalizeCurrentPrice (currencyCode,price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = { | |
285 | + | let price = valueOrElse(getInteger(this, keyPrice(currencyCode)), 0) | |
286 | + | let idx = valueOrElse(getInteger(this, keyIdx(currencyCode)), 0) | |
287 | + | let currencyCfg = factoryReadAssetCfgByCode(currencyCode)._2 | |
288 | + | if (isBlocked) | |
289 | + | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
290 | + | else if ((currencyCfg[IdxDefoAssetStatus] != "ISSUED")) | |
291 | + | then throw(((currencyCode + " has not been issued yet: status=") + currencyCfg[IdxDefoAssetStatus])) | |
292 | + | else if ((readPriceByHeight(currencyCode, height) != 0)) | |
293 | + | then throw("wait next block") | |
294 | + | else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey))) | |
295 | + | then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)])) | |
296 | + | else { | |
297 | + | let prices = [if (sigVerify_8Kb(formattingPriceMsg(currencyCode, price1), sign1, fromBase58String(pubKeyOraclesList[0]))) | |
298 | + | then price1 | |
299 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(currencyCode, price2), sign2, fromBase58String(pubKeyOraclesList[1]))) | |
300 | + | then price2 | |
301 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(currencyCode, price3), sign3, fromBase58String(pubKeyOraclesList[2]))) | |
302 | + | then price3 | |
303 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(currencyCode, price4), sign4, fromBase58String(pubKeyOraclesList[3]))) | |
304 | + | then price4 | |
305 | + | else 0, if (sigVerify_8Kb(formattingPriceMsg(currencyCode, price5), sign5, fromBase58String(pubKeyOraclesList[4]))) | |
306 | + | then price5 | |
307 | + | else 0] | |
308 | + | let zeroPriceCount = (((((if ((prices[0] == 0)) | |
309 | + | then 1 | |
310 | + | else 0) + (if ((prices[1] == 0)) | |
311 | + | then 1 | |
312 | + | else 0)) + (if ((prices[2] == 0)) | |
313 | + | then 1 | |
314 | + | else 0)) + (if ((prices[3] == 0)) | |
315 | + | then 1 | |
316 | + | else 0)) + (if ((prices[4] == 0)) | |
317 | + | then 1 | |
318 | + | else 0)) | |
319 | + | if ((zeroPriceCount >= minPricesCount)) | |
320 | + | then throw((toString(minPricesCount) + " prices or more are equals to 0")) | |
321 | + | else { | |
322 | + | let pricesInRange = findPricesInRange(prices) | |
323 | + | let priceProvidingCount = size(pricesInRange) | |
324 | + | if ((minPricesCount > priceProvidingCount)) | |
325 | + | then throw(((((((((((((((((((((("Could not finalize price because of big variation: height=" + toString(height)) + " | |
326 | + | ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + " | |
327 | + | ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + " | |
328 | + | ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + " | |
329 | + | ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + " | |
330 | + | ") + pubKeyOraclesList[4]) + "=") + toString(prices[4]))) | |
331 | + | else { | |
332 | + | let sum1 = ((prices[pricesInRange[0]] + prices[pricesInRange[1]]) + prices[pricesInRange[2]]) | |
333 | + | let sum2 = if ((priceProvidingCount >= 4)) | |
334 | + | then (sum1 + prices[pricesInRange[3]]) | |
335 | + | else sum1 | |
336 | + | let priceSum = if ((priceProvidingCount >= 5)) | |
337 | + | then (sum2 + prices[pricesInRange[4]]) | |
338 | + | else sum2 | |
339 | + | if ((priceProvidingCount >= 6)) | |
340 | + | then throw("Invalid pricesInRange creation") | |
341 | + | else { | |
342 | + | let newPrice = (priceSum / priceProvidingCount) | |
343 | + | if (if ((price != 0)) | |
344 | + | then if ((newPrice >= (price + ((price * percentPriceOffset) / 100)))) | |
345 | + | then true | |
346 | + | else ((price - ((price * percentPriceOffset) / 100)) >= newPrice) | |
347 | + | else false) | |
348 | + | then { | |
349 | + | let reason = "automatic emergency shutdown because of large price variability" | |
350 | + | [BooleanEntry(keyIsBlocked(), true), StringEntry(keyIsBlockedSender(), toString(this)), StringEntry(keyIsBlockedReason(), reason), IntegerEntry(keyBlackSwarmPrice(height), newPrice)] | |
351 | + | } | |
352 | + | else { | |
353 | + | let newIdx = (idx + 1) | |
354 | + | [IntegerEntry(keyPrice(currencyCode), newPrice), IntegerEntry(keyLastHeight(currencyCode), height), IntegerEntry(keyPriceByHeight(currencyCode, height), newPrice), IntegerEntry(keyIdx(currencyCode), newIdx), IntegerEntry(keyIdx2Height(currencyCode, newIdx), height), IntegerEntry(keyHeight2Idx(currencyCode, height), newIdx)] | |
355 | + | } | |
356 | + | } | |
357 | + | } | |
358 | + | } | |
359 | + | } | |
360 | + | } | |
361 | + | ||
362 | + |
github/deemru/w8io/169f3d6 28.89 ms ◑