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