tx · 8MMAPLgc1dx9wweySh4pAuwYek7XLArWYsFvws4y56t8

3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx:  -0.02000000 Waves

2020.09.16 14:01 [1179740] smart account 3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx > SELF 0.00000000 Waves

{ "type": 13, "id": "8MMAPLgc1dx9wweySh4pAuwYek7XLArWYsFvws4y56t8", "fee": 2000000, "feeAssetId": null, "timestamp": 1600254072425, "version": 1, "sender": "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx", "senderPublicKey": "NaY7sqttWGpnVrcb6uE8xPp2VnMjT7fhv3q1TKGL9ar", "proofs": [ "5qxZySHaRhDBxC1oE9cvroMN2NU68cbYog1H41BoCiMUg42P4pQGmJZ3v5ti2gq4TNUDYYTZk9do7fzjFwkT6vyQ", "4LJ668ukgRi4VAPgfbKTzz6mLkVpAgU3M7kkk2um1PohyvTfqNzceNUXBE3P1E3PHDNQM5fjdqBEWAfszm4c41v6", "4Y8C8WV26B2svptWwVeFHJQveULEvcXK1br3q52wejZCsM7rUP2SJuygB1PiuvAz8QFTCNiSBYzeRwUD1d7we1ai" ], "script": "base64:AAIEAAAAAAAAABUIAhIDCgEIEgwKCgECAQIBAgECAQIAAAAUAQAAABZjb252ZXJ0V2F2ZXNUb05ldXRyaW5vAAAAAgAAAAZhbW91bnQAAAAFcHJpY2UJAABrAAAAAwkAAGsAAAADBQAAAAZhbW91bnQFAAAABXByaWNlAAAAAAAAD0JAAAAAAAAAD0JAAAAAAAAF9eEAAQAAABhnZXROdW1iZXJCeUFkZHJlc3NBbmRLZXkAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAAB2FkZHJlc3MFAAAAA2tleQAAAAAAAAAAAAEAAAAYZ2V0U3RyaW5nQnlBZGRyZXNzQW5kS2V5AAAAAgAA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AsNVdSWEZTandjVGJOZktjSnM4WnFYbVNTV1lzU1ZKVXRNdk1xWmo1aEg0TmMFAAAAA25pbAQAAAAFY291bnQJAABkAAAAAgkAAGQAAAACCQAAZAAAAAIDCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAQkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAgkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAwkAAlkAAAABCQABkQAAAAIFAAAAEHB1YktleUFkbWluc0xpc3QAAAAAAAAAAAMAAAAAAAAAAAIAAAAAAAAAAAAJAABnAAAAAgUAAAAFY291bnQAAAAAAAAAAAMhUNXD", "chainId": 84, "height": 1179740, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FnaSDvZJ9CqkxySJfcFzA1vj6Ux1DGV9bURgun74yWz5 Next: DDvS8M4E879kMFRKsuKngHG2f7MvRzNqCVFo2BfgSdWD Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 1000000), 1000000, 100000000)
55
66
7-func getStringByKey (key) = match getString(this, key) {
8- case a: String =>
9- a
10- case _ =>
11- ""
12-}
7+func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0)
138
149
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- }
10+func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "")
4511
4612
4713 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
4814
4915
50-let price = match getInteger(this, "price") {
51- case a: Int =>
52- a
53- case _ =>
54- 0
55-}
16+let price = valueOrElse(getInteger(this, "price"), 0)
5617
57-let priceIndex = match getInteger(this, "price_index") {
58- case a: Int =>
59- a
60- case _ =>
61- 0
62-}
18+let priceIndex = valueOrElse(getInteger(this, "price_index"), 0)
6319
64-let isBlocked = match getBoolean(this, "is_blocked") {
65- case a: Boolean =>
66- a
67- case _ =>
68- false
69-}
20+let isBlocked = valueOrElse(getBoolean(this, "is_blocked"), false)
7021
7122 let percentPriceOffset = 25
7223
73-let pubKeyOracles = getStringByKey("oracles")
24+let pubKeyOracles = valueOrElse(getString(this, "oracles"), "")
7425
7526 let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles)
7627
77-let bftCoefficientOracle = 3
28+let neutrinoAddress = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we')
7829
79-let neutrinoAddress = addressFromPublicKey(fromBase58String("BxuvXsg8sFXf7MNECYrdsEgrMMMkWVKKhbcFdoormLWF"))
30+let liquidationAddress = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62')
8031
81-let liquidationAddress = addressFromPublicKey(fromBase58String("6PBV8fVJwLaUQbCyG7iqoKR3x1nqFRZFNeuN9qodoiTu"))
32+let neutrinoAsset = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
8233
83-let neutrinoAsset = fromBase58String("25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT")
34+let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_neutrino"), 0)
8435
85-let neutrinoLockedBalance = match getInteger(neutrinoAddress, "balance_lock_neutrino") {
86- case a: Int =>
87- a
88- case _ =>
89- 0
90-}
36+let wavesLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_waves"), 0)
9137
92-let wavesLockedBalance = match getInteger(neutrinoAddress, "balance_lock_waves") {
93- case a: Int =>
94- a
95- case _ =>
96- 0
97-}
38+let reserve = (wavesBalance(neutrinoAddress).regular - wavesLockedBalance)
9839
99-let reserve = (wavesBalance(neutrinoAddress) - wavesLockedBalance)
100-
101-let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset))
40+let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset))
10241
10342 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price))
10443
269208 }
270209
271210
272-func formattingPriceMsg (price,height) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price)))
211+func formattingPriceMsg (price) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price)))
273212
274213
275214 @Callable(i)
278217 let callerAddress = toString(i.caller)
279218 if ((AutoEmergencyOracleAddress != callerAddress))
280219 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)])
220+ else [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", callerAddress), StringEntry("is_blocked_reason", reason)]
282221 }
283222
284223
286225 @Callable(i)
287226 func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked)
288227 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))
228+ else if ((valueOrElse(getInteger(this, ("price_" + toString(height))), 0) != 0))
295229 then throw("wait next block")
296230 else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey)))
297231 then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)]))
298232 else {
299- let prices = [if (sigVerify(formattingPriceMsg(price1, height), sign1, fromBase58String(pubKeyOraclesList[0])))
233+ let prices = [if (sigVerify_8Kb(formattingPriceMsg(price1), sign1, fromBase58String(pubKeyOraclesList[0])))
300234 then price1
301- else 0, if (sigVerify(formattingPriceMsg(price2, height), sign2, fromBase58String(pubKeyOraclesList[1])))
235+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price2), sign2, fromBase58String(pubKeyOraclesList[1])))
302236 then price2
303- else 0, if (sigVerify(formattingPriceMsg(price3, height), sign3, fromBase58String(pubKeyOraclesList[2])))
237+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price3), sign3, fromBase58String(pubKeyOraclesList[2])))
304238 then price3
305- else 0, if (sigVerify(formattingPriceMsg(price4, height), sign4, fromBase58String(pubKeyOraclesList[3])))
239+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price4), sign4, fromBase58String(pubKeyOraclesList[3])))
306240 then price4
307- else 0, if (sigVerify(formattingPriceMsg(price5, height), sign5, fromBase58String(pubKeyOraclesList[4])))
241+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price5), sign5, fromBase58String(pubKeyOraclesList[4])))
308242 then price5
309243 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)) + "
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)) + "
314262 ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + "
315263 ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + "
316264 ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + "
317265 ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + "
318266 ") + 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")
329267 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 {
335- let reason = "automatic emergency shutdown because of large price variability"
336- WriteSet([DataEntry("is_blocked", true), DataEntry("is_blocked_caller", toString(this)), DataEntry("is_blocked_reason", reason), DataEntry((("black_swarm_price" + "_") + toString(height)), newPrice)])
337- }
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")
338277 else {
339- let newPriceIndex = (priceIndex + 1)
340- 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))
341- then ((deficit * 100) / neutrinoSupply)
342- else 0)])
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+ }
343292 }
344293 }
345294 }
346295 }
347-
348-
349-
350-@Callable(i)
351-func updateReservesAndNeutrinoSupply () = {
352- func getNumberByKeyInternal (key) = match getInteger(this, key) {
353- case a: Int =>
354- a
355- case _ =>
356- 0
357- }
358-
359- let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
360- let newIdx = (idx + 1)
361- WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)])
362- }
363296
364297
365298 @Verifier(tx)
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 1000000), 1000000, 100000000)
55
66
7-func getStringByKey (key) = match getString(this, key) {
8- case a: String =>
9- a
10- case _ =>
11- ""
12-}
7+func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0)
138
149
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- }
10+func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "")
4511
4612
4713 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
4814
4915
50-let price = match getInteger(this, "price") {
51- case a: Int =>
52- a
53- case _ =>
54- 0
55-}
16+let price = valueOrElse(getInteger(this, "price"), 0)
5617
57-let priceIndex = match getInteger(this, "price_index") {
58- case a: Int =>
59- a
60- case _ =>
61- 0
62-}
18+let priceIndex = valueOrElse(getInteger(this, "price_index"), 0)
6319
64-let isBlocked = match getBoolean(this, "is_blocked") {
65- case a: Boolean =>
66- a
67- case _ =>
68- false
69-}
20+let isBlocked = valueOrElse(getBoolean(this, "is_blocked"), false)
7021
7122 let percentPriceOffset = 25
7223
73-let pubKeyOracles = getStringByKey("oracles")
24+let pubKeyOracles = valueOrElse(getString(this, "oracles"), "")
7425
7526 let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles)
7627
77-let bftCoefficientOracle = 3
28+let neutrinoAddress = Address(base58'3Mzbx34Ex5rRbn39vUHx9kiwh3nneF8S5we')
7829
79-let neutrinoAddress = addressFromPublicKey(fromBase58String("BxuvXsg8sFXf7MNECYrdsEgrMMMkWVKKhbcFdoormLWF"))
30+let liquidationAddress = Address(base58'3N5nmMvMH8o3RPEyCKCaoWahBTYTexnZy62')
8031
81-let liquidationAddress = addressFromPublicKey(fromBase58String("6PBV8fVJwLaUQbCyG7iqoKR3x1nqFRZFNeuN9qodoiTu"))
32+let neutrinoAsset = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'
8233
83-let neutrinoAsset = fromBase58String("25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT")
34+let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_neutrino"), 0)
8435
85-let neutrinoLockedBalance = match getInteger(neutrinoAddress, "balance_lock_neutrino") {
86- case a: Int =>
87- a
88- case _ =>
89- 0
90-}
36+let wavesLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_waves"), 0)
9137
92-let wavesLockedBalance = match getInteger(neutrinoAddress, "balance_lock_waves") {
93- case a: Int =>
94- a
95- case _ =>
96- 0
97-}
38+let reserve = (wavesBalance(neutrinoAddress).regular - wavesLockedBalance)
9839
99-let reserve = (wavesBalance(neutrinoAddress) - wavesLockedBalance)
100-
101-let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset))
40+let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset))
10241
10342 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price))
10443
10544 func findPricesInRange (prices) = {
10645 let minPercentBound = 90
10746 let maxPercentBound = 110
10847 let p0 = prices[0]
10948 let check0 = if ((0 >= prices[0]))
11049 then [0]
11150 else {
11251 let p01 = ((prices[1] * 100) / p0)
11352 let p02 = ((prices[2] * 100) / p0)
11453 let p03 = ((prices[3] * 100) / p0)
11554 let p04 = ((prices[4] * 100) / p0)
11655 let array1 = if (if ((maxPercentBound > p01))
11756 then (p01 > minPercentBound)
11857 else false)
11958 then [1, 0]
12059 else [0]
12160 let array2 = if (if ((maxPercentBound > p02))
12261 then (p02 > minPercentBound)
12362 else false)
12463 then 2 :: array1
12564 else array1
12665 let array3 = if (if ((maxPercentBound > p03))
12766 then (p03 > minPercentBound)
12867 else false)
12968 then 3 :: array2
13069 else array2
13170 if (if ((maxPercentBound > p04))
13271 then (p04 > minPercentBound)
13372 else false)
13473 then 4 :: array3
13574 else array3
13675 }
13776 let check1 = if ((size(check0) >= 3))
13877 then check0
13978 else {
14079 let p1 = prices[1]
14180 if ((0 >= p1))
14281 then [1]
14382 else {
14483 let p10 = ((prices[0] * 100) / p1)
14584 let p12 = ((prices[2] * 100) / p1)
14685 let p13 = ((prices[3] * 100) / p1)
14786 let p14 = ((prices[4] * 100) / p1)
14887 let array1 = if (if ((maxPercentBound > p10))
14988 then (p10 > minPercentBound)
15089 else false)
15190 then [0, 1]
15291 else [1]
15392 let array2 = if (if ((maxPercentBound > p12))
15493 then (p12 > minPercentBound)
15594 else false)
15695 then 2 :: array1
15796 else array1
15897 let array3 = if (if ((maxPercentBound > p13))
15998 then (p13 > minPercentBound)
16099 else false)
161100 then 3 :: array2
162101 else array2
163102 if (if ((maxPercentBound > p14))
164103 then (p14 > minPercentBound)
165104 else false)
166105 then 4 :: array3
167106 else array3
168107 }
169108 }
170109 let check2 = if ((size(check1) >= 3))
171110 then check1
172111 else {
173112 let p2 = prices[2]
174113 if ((0 >= p2))
175114 then [2]
176115 else {
177116 let p20 = ((prices[0] * 100) / p2)
178117 let p21 = ((prices[1] * 100) / p2)
179118 let p23 = ((prices[3] * 100) / p2)
180119 let p24 = ((prices[4] * 100) / p2)
181120 let array1 = if (if ((maxPercentBound > p20))
182121 then (p20 > minPercentBound)
183122 else false)
184123 then [0, 2]
185124 else [2]
186125 let array2 = if (if ((maxPercentBound > p21))
187126 then (p21 > minPercentBound)
188127 else false)
189128 then 1 :: array1
190129 else array1
191130 let array3 = if (if ((maxPercentBound > p23))
192131 then (p23 > minPercentBound)
193132 else false)
194133 then 3 :: array2
195134 else array2
196135 if (if ((maxPercentBound > p24))
197136 then (p24 > minPercentBound)
198137 else false)
199138 then 4 :: array3
200139 else array3
201140 }
202141 }
203142 let check3 = if ((size(check2) >= 3))
204143 then check2
205144 else {
206145 let p3 = prices[3]
207146 if ((0 >= p3))
208147 then [3]
209148 else {
210149 let p30 = ((prices[0] * 100) / p3)
211150 let p31 = ((prices[1] * 100) / p3)
212151 let p32 = ((prices[2] * 100) / p3)
213152 let p34 = ((prices[4] * 100) / p3)
214153 let array1 = if (if ((maxPercentBound > p30))
215154 then (p30 > minPercentBound)
216155 else false)
217156 then [0, 3]
218157 else [3]
219158 let array2 = if (if ((maxPercentBound > p31))
220159 then (p31 > minPercentBound)
221160 else false)
222161 then 1 :: array1
223162 else array1
224163 let array3 = if (if ((maxPercentBound > p32))
225164 then (p32 > minPercentBound)
226165 else false)
227166 then 2 :: array2
228167 else array2
229168 if (if ((maxPercentBound > p34))
230169 then (p34 > minPercentBound)
231170 else false)
232171 then 4 :: array3
233172 else array3
234173 }
235174 }
236175 if ((size(check3) >= 3))
237176 then check3
238177 else {
239178 let p4 = prices[4]
240179 if ((0 >= p4))
241180 then [4]
242181 else {
243182 let p40 = ((prices[0] * 100) / p4)
244183 let p41 = ((prices[1] * 100) / p4)
245184 let p42 = ((prices[2] * 100) / p4)
246185 let p43 = ((prices[3] * 100) / p4)
247186 let array1 = if (if ((maxPercentBound > p40))
248187 then (p40 > minPercentBound)
249188 else false)
250189 then [0, 4]
251190 else [4]
252191 let array2 = if (if ((maxPercentBound > p41))
253192 then (p41 > minPercentBound)
254193 else false)
255194 then 1 :: array1
256195 else array1
257196 let array3 = if (if ((maxPercentBound > p42))
258197 then (p42 > minPercentBound)
259198 else false)
260199 then 2 :: array2
261200 else array2
262201 if (if ((maxPercentBound > p43))
263202 then (p43 > minPercentBound)
264203 else false)
265204 then 3 :: array3
266205 else array3
267206 }
268207 }
269208 }
270209
271210
272-func formattingPriceMsg (price,height) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price)))
211+func formattingPriceMsg (price) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price)))
273212
274213
275214 @Callable(i)
276215 func callEmergencyShutdown (reason) = {
277216 let AutoEmergencyOracleAddress = "3N65UDbSkK72XdSgH3NhvJ8HaH57x8VmoW3"
278217 let callerAddress = toString(i.caller)
279218 if ((AutoEmergencyOracleAddress != callerAddress))
280219 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)])
220+ else [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", callerAddress), StringEntry("is_blocked_reason", reason)]
282221 }
283222
284223
285224
286225 @Callable(i)
287226 func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked)
288227 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))
228+ else if ((valueOrElse(getInteger(this, ("price_" + toString(height))), 0) != 0))
295229 then throw("wait next block")
296230 else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey)))
297231 then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)]))
298232 else {
299- let prices = [if (sigVerify(formattingPriceMsg(price1, height), sign1, fromBase58String(pubKeyOraclesList[0])))
233+ let prices = [if (sigVerify_8Kb(formattingPriceMsg(price1), sign1, fromBase58String(pubKeyOraclesList[0])))
300234 then price1
301- else 0, if (sigVerify(formattingPriceMsg(price2, height), sign2, fromBase58String(pubKeyOraclesList[1])))
235+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price2), sign2, fromBase58String(pubKeyOraclesList[1])))
302236 then price2
303- else 0, if (sigVerify(formattingPriceMsg(price3, height), sign3, fromBase58String(pubKeyOraclesList[2])))
237+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price3), sign3, fromBase58String(pubKeyOraclesList[2])))
304238 then price3
305- else 0, if (sigVerify(formattingPriceMsg(price4, height), sign4, fromBase58String(pubKeyOraclesList[3])))
239+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price4), sign4, fromBase58String(pubKeyOraclesList[3])))
306240 then price4
307- else 0, if (sigVerify(formattingPriceMsg(price5, height), sign5, fromBase58String(pubKeyOraclesList[4])))
241+ else 0, if (sigVerify_8Kb(formattingPriceMsg(price5), sign5, fromBase58String(pubKeyOraclesList[4])))
308242 then price5
309243 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)) + "
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)) + "
314262 ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + "
315263 ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + "
316264 ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + "
317265 ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + "
318266 ") + 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")
329267 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 {
335- let reason = "automatic emergency shutdown because of large price variability"
336- WriteSet([DataEntry("is_blocked", true), DataEntry("is_blocked_caller", toString(this)), DataEntry("is_blocked_reason", reason), DataEntry((("black_swarm_price" + "_") + toString(height)), newPrice)])
337- }
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")
338277 else {
339- let newPriceIndex = (priceIndex + 1)
340- 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))
341- then ((deficit * 100) / neutrinoSupply)
342- else 0)])
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+ }
343292 }
344293 }
345294 }
346295 }
347-
348-
349-
350-@Callable(i)
351-func updateReservesAndNeutrinoSupply () = {
352- func getNumberByKeyInternal (key) = match getInteger(this, key) {
353- case a: Int =>
354- a
355- case _ =>
356- 0
357- }
358-
359- let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
360- let newIdx = (idx + 1)
361- WriteSet([DataEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), DataEntry("reserve", reserve), DataEntry("neutrinoSupply", neutrinoSupply), DataEntry("deficit", deficit)])
362- }
363296
364297
365298 @Verifier(tx)
366299 func verify () = {
367300 let pubKeyAdminsList = ["GXxmZaCigPgJsT6d1cLr8nUXA65nGX8V7FuAzzrY8wQE", "3xumx4hrPpeeoo79HLGbZCgfz95L39ZFdxxwWeSUC2Pu", "D4CqtK5fBsnzRo33ZMhrM7niLseDH2uRoK6weBq2JQ3A", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
368301 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
369302 then 1
370303 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
371304 then 1
372305 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
373306 then 1
374307 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
375308 then 2
376309 else 0))
377310 (count >= 3)
378311 }
379312

github/deemru/w8io/169f3d6 
54.12 ms