tx · J89hJBRUFTkgdm6Ftvy1cBjJq2DD3qr7dqhVq88EjbWG

3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx:  -0.01600000 Waves

2023.08.31 15:33 [2734863] smart account 3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx > SELF 0.00000000 Waves

{ "type": 13, "id": "J89hJBRUFTkgdm6Ftvy1cBjJq2DD3qr7dqhVq88EjbWG", "fee": 1600000, "feeAssetId": null, "timestamp": 1693485263178, "version": 2, "chainId": 84, "sender": "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx", "senderPublicKey": "NaY7sqttWGpnVrcb6uE8xPp2VnMjT7fhv3q1TKGL9ar", "proofs": [ "3iDRbqgAUbvvsj6v9tSg1mxLP2YGn6BKBBi1ar7Qug5nU9SPBT1PHF2ZD1Vw3DJdw7ZrsLLP6BEbwxKcxZifcjUH", "2DEf6PCYu4fPZdqFkqt5ejGgH7FFpfiKLUnjvq3fmTScRjxFetHjkYWYxXbVZvVpcBcsu4edAsdCNJd5wk99eHN", "4Byq4q7SBSKQ79aACxhUHuqjdnYTdSreHeL9nbG1Mn7PYzR2sKhEafr8TvsuEAwCohTEhGfGoqe5C1RMEd9vrkgq" ], "script": "base64:BgIuCAISEAoOCAgICAgICAgICAgICAgSAwoBCBIMCgoBAgECAQIBAgECEgUKAwEBCCsAA1NFUAICX18AGUlkeENvbnRyb2xDZmdOZXV0cmlub0RhcHAAAQAYSWR4Q29udHJvbENmZ0F1Y3Rpb25EYXBwAAIAFElkeENvbnRyb2xDZmdScGREYXBwAAMAFUlkeENvbnRyb2xDZmdNYXRoRGFwcAAEABxJZHhDb250cm9sQ2ZnTGlxdWlkYXRpb25EYXBwAAUAFUlkeENvbnRyb2xDZmdSZXN0RGFwcAAGAB1JZHhDb250cm9sQ2ZnTm9kZVJlZ2lzdHJ5RGFwcAAHABxJZHhDb250cm9sQ2ZnTnNidFN0YWtpbmdEYXBwAAgAGUlkeENvbnRyb2xD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4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEJANkEAQkAkQMCBRBwdWJLZXlBZG1pbnNMaXN0AAEAAQAAAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgkA2QQBCQCRAwIFEHB1YktleUFkbWluc0xpc3QAAgABAAADCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwADCQDZBAEJAJEDAgUQcHViS2V5QWRtaW5zTGlzdAADAAIAAAkAZwIFBWNvdW50AANgWkjy", "height": 2734863, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ajCXgRPfUP8AouVnQTqBrji87Qdfzn2UXDV6q2ozskD Next: 6R61zSjuQy4cG1PtnxAtvcGxNQ8V2sFvqqhNK1DegBdN Diff:
OldNewDifferences
278278
279279 @Callable(i)
280280 func callEmergencyShutdown (reason) = {
281- let AutoEmergencyOracleAddress = "3NBtdbWhuTWzYRhCJtq22JKK7QnKGMzHXZn"
281+ let AutoEmergencyOracleAddress = "3MrRCbZhD9cPBT1efEkzAfaeaU26Ukvf9mh"
282282 let callerAddress = toString(i.caller)
283283 if (if ((AutoEmergencyOracleAddress != callerAddress))
284284 then (toString(governanceContract) != callerAddress)
366366 }
367367
368368
369+
370+@Callable(i)
371+func validatePrice (averagingPeriodMs,toleranceX6,assetIdStr) = $Tuple2(nil, true)
372+
373+
369374 @Verifier(tx)
370375 func verify () = {
371376 let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let IdxControlCfgNeutrinoDapp = 1
77
88 let IdxControlCfgAuctionDapp = 2
99
1010 let IdxControlCfgRpdDapp = 3
1111
1212 let IdxControlCfgMathDapp = 4
1313
1414 let IdxControlCfgLiquidationDapp = 5
1515
1616 let IdxControlCfgRestDapp = 6
1717
1818 let IdxControlCfgNodeRegistryDapp = 7
1919
2020 let IdxControlCfgNsbtStakingDapp = 8
2121
2222 let IdxControlCfgMediatorDapp = 9
2323
2424 let IdxControlCfgSurfStakingDapp = 10
2525
2626 let IdxControlCfgGnsbtControllerDapp = 11
2727
2828 let IdxControlCfgRestV2Dapp = 12
2929
3030 let IdxControlCfgGovernanceDapp = 13
3131
3232 let IdxControlCfgPegProviderDapp = 14
3333
3434 func keyControlConfig () = "%s__controlConfig"
3535
3636
3737 func dataControlCfg (neutrinoContract,auctionContract,rpdContract,mathContract,liquidationContract,restContract,nodeRegistryContract,nsbtStakingContract,mediatorContract,surfStakingContract,gnsbtControllerContract,restV2Contract,governanceContract,doraContract) = makeString(["%s%s%s%s%s%s%s%s%s%s%s%s%s%s", neutrinoContract, auctionContract, rpdContract, mathContract, liquidationContract, restContract, nodeRegistryContract, nsbtStakingContract, mediatorContract, surfStakingContract, gnsbtControllerContract, restV2Contract, governanceContract, doraContract], SEP)
3838
3939
4040 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 1000000), 1000000, 100000000)
4141
4242
4343 func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0)
4444
4545
4646 func getStringByAddressAndKey (address,key) = valueOrElse(getString(address, key), "")
4747
4848
4949 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
5050
5151
5252 let price = valueOrElse(getInteger(this, "price"), 0)
5353
5454 let priceIndex = valueOrElse(getInteger(this, "price_index"), 0)
5555
5656 let isBlocked = valueOrElse(getBoolean(this, "is_blocked"), false)
5757
5858 let percentPriceOffset = 1000
5959
6060 let pubKeyOracles = valueOrElse(getString(this, "oracles"), "")
6161
6262 let pubKeyOraclesList = convertJsonArrayToList(pubKeyOracles)
6363
6464 let neutrinoAddress = Address(base58'3N9be2mwrA52WJho6DiesZkk4351GvpnWuj')
6565
6666 let liquidationAddress = Address(base58'3N24ZPUAMhFm76N3vbNiiDtFqfUnmBHTc5N')
6767
6868 let neutrinoAsset = base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
6969
7070 let controlContract = this
7171
7272 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
7373
7474
7575 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
7676
7777
7878 let controlCfg = split_4C(getStringOrFail(this, keyControlConfig()), SEP)
7979
8080 let governanceContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp)
8181
8282 let neutrinoLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_neutrino"), 0)
8383
8484 let wavesLockedBalance = valueOrElse(getInteger(neutrinoAddress, "balance_lock_waves"), 0)
8585
8686 let reserve = (wavesBalance(neutrinoAddress).regular - wavesLockedBalance)
8787
8888 let neutrinoSupply = (((neutrinoLockedBalance + value(assetInfo(neutrinoAsset)).quantity) - assetBalance(neutrinoAddress, neutrinoAsset)) - assetBalance(liquidationAddress, neutrinoAsset))
8989
9090 let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, price))
9191
9292 func findPricesInRange (prices) = {
9393 let minPercentBound = 90
9494 let maxPercentBound = 110
9595 let p0 = prices[0]
9696 let check0 = if ((0 >= prices[0]))
9797 then [0]
9898 else {
9999 let p01 = ((prices[1] * 100) / p0)
100100 let p02 = ((prices[2] * 100) / p0)
101101 let p03 = ((prices[3] * 100) / p0)
102102 let p04 = ((prices[4] * 100) / p0)
103103 let array1 = if (if ((maxPercentBound > p01))
104104 then (p01 > minPercentBound)
105105 else false)
106106 then [1, 0]
107107 else [0]
108108 let array2 = if (if ((maxPercentBound > p02))
109109 then (p02 > minPercentBound)
110110 else false)
111111 then 2 :: array1
112112 else array1
113113 let array3 = if (if ((maxPercentBound > p03))
114114 then (p03 > minPercentBound)
115115 else false)
116116 then 3 :: array2
117117 else array2
118118 if (if ((maxPercentBound > p04))
119119 then (p04 > minPercentBound)
120120 else false)
121121 then 4 :: array3
122122 else array3
123123 }
124124 let check1 = if ((size(check0) >= 3))
125125 then check0
126126 else {
127127 let p1 = prices[1]
128128 if ((0 >= p1))
129129 then [1]
130130 else {
131131 let p10 = ((prices[0] * 100) / p1)
132132 let p12 = ((prices[2] * 100) / p1)
133133 let p13 = ((prices[3] * 100) / p1)
134134 let p14 = ((prices[4] * 100) / p1)
135135 let array1 = if (if ((maxPercentBound > p10))
136136 then (p10 > minPercentBound)
137137 else false)
138138 then [0, 1]
139139 else [1]
140140 let array2 = if (if ((maxPercentBound > p12))
141141 then (p12 > minPercentBound)
142142 else false)
143143 then 2 :: array1
144144 else array1
145145 let array3 = if (if ((maxPercentBound > p13))
146146 then (p13 > minPercentBound)
147147 else false)
148148 then 3 :: array2
149149 else array2
150150 if (if ((maxPercentBound > p14))
151151 then (p14 > minPercentBound)
152152 else false)
153153 then 4 :: array3
154154 else array3
155155 }
156156 }
157157 let check2 = if ((size(check1) >= 3))
158158 then check1
159159 else {
160160 let p2 = prices[2]
161161 if ((0 >= p2))
162162 then [2]
163163 else {
164164 let p20 = ((prices[0] * 100) / p2)
165165 let p21 = ((prices[1] * 100) / p2)
166166 let p23 = ((prices[3] * 100) / p2)
167167 let p24 = ((prices[4] * 100) / p2)
168168 let array1 = if (if ((maxPercentBound > p20))
169169 then (p20 > minPercentBound)
170170 else false)
171171 then [0, 2]
172172 else [2]
173173 let array2 = if (if ((maxPercentBound > p21))
174174 then (p21 > minPercentBound)
175175 else false)
176176 then 1 :: array1
177177 else array1
178178 let array3 = if (if ((maxPercentBound > p23))
179179 then (p23 > minPercentBound)
180180 else false)
181181 then 3 :: array2
182182 else array2
183183 if (if ((maxPercentBound > p24))
184184 then (p24 > minPercentBound)
185185 else false)
186186 then 4 :: array3
187187 else array3
188188 }
189189 }
190190 let check3 = if ((size(check2) >= 3))
191191 then check2
192192 else {
193193 let p3 = prices[3]
194194 if ((0 >= p3))
195195 then [3]
196196 else {
197197 let p30 = ((prices[0] * 100) / p3)
198198 let p31 = ((prices[1] * 100) / p3)
199199 let p32 = ((prices[2] * 100) / p3)
200200 let p34 = ((prices[4] * 100) / p3)
201201 let array1 = if (if ((maxPercentBound > p30))
202202 then (p30 > minPercentBound)
203203 else false)
204204 then [0, 3]
205205 else [3]
206206 let array2 = if (if ((maxPercentBound > p31))
207207 then (p31 > minPercentBound)
208208 else false)
209209 then 1 :: array1
210210 else array1
211211 let array3 = if (if ((maxPercentBound > p32))
212212 then (p32 > minPercentBound)
213213 else false)
214214 then 2 :: array2
215215 else array2
216216 if (if ((maxPercentBound > p34))
217217 then (p34 > minPercentBound)
218218 else false)
219219 then 4 :: array3
220220 else array3
221221 }
222222 }
223223 if ((size(check3) >= 3))
224224 then check3
225225 else {
226226 let p4 = prices[4]
227227 if ((0 >= p4))
228228 then [4]
229229 else {
230230 let p40 = ((prices[0] * 100) / p4)
231231 let p41 = ((prices[1] * 100) / p4)
232232 let p42 = ((prices[2] * 100) / p4)
233233 let p43 = ((prices[3] * 100) / p4)
234234 let array1 = if (if ((maxPercentBound > p40))
235235 then (p40 > minPercentBound)
236236 else false)
237237 then [0, 4]
238238 else [4]
239239 let array2 = if (if ((maxPercentBound > p41))
240240 then (p41 > minPercentBound)
241241 else false)
242242 then 1 :: array1
243243 else array1
244244 let array3 = if (if ((maxPercentBound > p42))
245245 then (p42 > minPercentBound)
246246 else false)
247247 then 2 :: array2
248248 else array2
249249 if (if ((maxPercentBound > p43))
250250 then (p43 > minPercentBound)
251251 else false)
252252 then 3 :: array3
253253 else array3
254254 }
255255 }
256256 }
257257
258258
259259 func formattingPriceMsg (price) = toBytes((((("WAVESNEUTRINOPREFIX" + "_") + toString(height)) + "_") + toString(price)))
260260
261261
262262 func PriceEntry (newPrice,assetIdStr,newPriceIndex) = {
263263 let heightStr = toString(height)
264264 let newPriceIndexStr = toString(newPriceIndex)
265265 let priceByAssetKEY = makeString(["%s%s%s__common__priceByAsset", assetIdStr], SEP)
266266 let priceByHeightKEY = makeString(["%s%s%s%d__common__priceByHeight", assetIdStr, heightStr], SEP)
267267 let priceByIndexKEY = makeString(["%s%s%s%d__common__priceByIndex", assetIdStr, newPriceIndexStr], SEP)
268268 [IntegerEntry(priceByAssetKEY, newPrice), IntegerEntry(priceByIndexKEY, newPrice), IntegerEntry(priceByHeightKEY, newPrice)]
269269 }
270270
271271
272272 @Callable(i)
273273 func constructorV1 (neutrinoContract,auctionContract,rpdContract,mathContract,liquidationContract,restContract,nodeRegistryContract,nsbtStakingContract,mediatorContract,surfStakingContract,gnsbtControllerContract,restV2Contract,governanceContract,doraContract) = if ((i.caller != this))
274274 then throw("permissions denied")
275275 else [StringEntry(keyControlConfig(), dataControlCfg(neutrinoContract, auctionContract, rpdContract, mathContract, liquidationContract, restContract, nodeRegistryContract, nsbtStakingContract, mediatorContract, surfStakingContract, gnsbtControllerContract, restV2Contract, governanceContract, doraContract))]
276276
277277
278278
279279 @Callable(i)
280280 func callEmergencyShutdown (reason) = {
281- let AutoEmergencyOracleAddress = "3NBtdbWhuTWzYRhCJtq22JKK7QnKGMzHXZn"
281+ let AutoEmergencyOracleAddress = "3MrRCbZhD9cPBT1efEkzAfaeaU26Ukvf9mh"
282282 let callerAddress = toString(i.caller)
283283 if (if ((AutoEmergencyOracleAddress != callerAddress))
284284 then (toString(governanceContract) != callerAddress)
285285 else false)
286286 then throw("caller must be one an emergency oracle or Governance contract")
287287 else [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", callerAddress), StringEntry("is_blocked_reason", reason)]
288288 }
289289
290290
291291
292292 @Callable(i)
293293 func finalizeCurrentPrice (price1,sign1,price2,sign2,price3,sign3,price4,sign4,price5,sign5) = if (isBlocked)
294294 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
295295 else if ((valueOrElse(getInteger(this, ("price_" + toString(height))), 0) != 0))
296296 then throw("wait next block")
297297 else if ((pubKeyOraclesList[(height % 5)] != toBase58String(i.callerPublicKey)))
298298 then throw(((("Out of turn finalization: " + toString(height)) + " block should be finalize by ") + pubKeyOraclesList[(height % 5)]))
299299 else {
300300 let prices = [if (sigVerify_8Kb(formattingPriceMsg(price1), sign1, fromBase58String(pubKeyOraclesList[0])))
301301 then price1
302302 else 0, if (sigVerify_8Kb(formattingPriceMsg(price2), sign2, fromBase58String(pubKeyOraclesList[1])))
303303 then price2
304304 else 0, if (sigVerify_8Kb(formattingPriceMsg(price3), sign3, fromBase58String(pubKeyOraclesList[2])))
305305 then price3
306306 else 0, if (sigVerify_8Kb(formattingPriceMsg(price4), sign4, fromBase58String(pubKeyOraclesList[3])))
307307 then price4
308308 else 0, if (sigVerify_8Kb(formattingPriceMsg(price5), sign5, fromBase58String(pubKeyOraclesList[4])))
309309 then price5
310310 else 0]
311311 let zeroPriceCount = if ((prices[0] == 0))
312312 then 1
313313 else (0 + (if ((prices[1] == 0))
314314 then 1
315315 else (0 + (if ((prices[2] == 0))
316316 then 1
317317 else (0 + (if ((prices[3] == 0))
318318 then 1
319319 else (0 + (if ((prices[4] == 0))
320320 then 1
321321 else 0))))))))
322322 if ((zeroPriceCount >= 3))
323323 then throw("3 prices or more are equals to 0")
324324 else {
325325 let pricesInRange = findPricesInRange(prices)
326326 let priceProvidingCount = size(pricesInRange)
327327 if ((3 > priceProvidingCount))
328328 then throw(((((((((((((((((((((("Could not finalize price because of big variation: height=" + toString(height)) + "
329329 ") + pubKeyOraclesList[0]) + "=") + toString(prices[0])) + "
330330 ") + pubKeyOraclesList[1]) + "=") + toString(prices[1])) + "
331331 ") + pubKeyOraclesList[2]) + "=") + toString(prices[2])) + "
332332 ") + pubKeyOraclesList[3]) + "=") + toString(prices[3])) + "
333333 ") + pubKeyOraclesList[4]) + "=") + toString(prices[4])))
334334 else {
335335 let sum1 = ((prices[pricesInRange[0]] + prices[pricesInRange[1]]) + prices[pricesInRange[2]])
336336 let sum2 = if ((priceProvidingCount >= 4))
337337 then (sum1 + prices[pricesInRange[3]])
338338 else sum1
339339 let priceSum = if ((priceProvidingCount >= 5))
340340 then (sum2 + prices[pricesInRange[4]])
341341 else sum2
342342 if ((priceProvidingCount >= 6))
343343 then throw("Invalid pricesInRange creation")
344344 else {
345345 let newPrice = (priceSum / priceProvidingCount)
346346 let newWxPrice = valueOrElse(getInteger("wx_stub_price"), 81109)
347347 let wxAssetId = "EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc"
348348 let newViresPrice = valueOrElse(getInteger("vires_stub_price"), 1330432)
349349 let viresAssetId = "9RE43pPoy64Hy9BmC9xM9DG1hKqnAMAqNRnbAniqZ1Pf"
350350 if (if ((newPrice >= (price + ((price * percentPriceOffset) / 100))))
351351 then true
352352 else ((price - ((price * percentPriceOffset) / 100)) >= newPrice))
353353 then {
354354 let reason = "automatic emergency shutdown because of large price variability"
355355 [BooleanEntry("is_blocked", true), StringEntry("is_blocked_caller", toString(this)), StringEntry("is_blocked_reason", reason), IntegerEntry((("black_swarm_price" + "_") + toString(height)), newPrice)]
356356 }
357357 else {
358358 let newPriceIndex = (priceIndex + 1)
359359 ((([IntegerEntry("price", newPrice), IntegerEntry(("price_" + toString(height)), newPrice), IntegerEntry(("price_index_" + toString(newPriceIndex)), height), IntegerEntry("price_index", newPriceIndex), IntegerEntry(("indexByHeight_" + toString(height)), newPriceIndex), IntegerEntry(("priceByIndex_" + toString(newPriceIndex)), newPrice), IntegerEntry(("deficit_" + toString(height)), deficit), IntegerEntry(("neutrinoSupply_" + toString(height)), neutrinoSupply), IntegerEntry(("deficit_percent_" + toString(height)), if ((neutrinoSupply != 0))
360360 then ((deficit * 100) / neutrinoSupply)
361361 else 0)] ++ PriceEntry(newPrice, "WAVES", newPriceIndex)) ++ PriceEntry(newWxPrice, wxAssetId, newPriceIndex)) ++ PriceEntry(newViresPrice, viresAssetId, newPriceIndex))
362362 }
363363 }
364364 }
365365 }
366366 }
367367
368368
369+
370+@Callable(i)
371+func validatePrice (averagingPeriodMs,toleranceX6,assetIdStr) = $Tuple2(nil, true)
372+
373+
369374 @Verifier(tx)
370375 func verify () = {
371376 let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP)
372377 let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP)
373378 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
374379 then 1
375380 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
376381 then 1
377382 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
378383 then 1
379384 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
380385 then 2
381386 else 0))
382387 (count >= 3)
383388 }
384389

github/deemru/w8io/169f3d6 
88.51 ms