tx · Cp18vEpvtLDpFCCX1jDoaVB319Y23dee28pask1uKhZ8

3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr:  -0.01700000 Waves

2023.04.06 17:28 [2522824] smart account 3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr > SELF 0.00000000 Waves

{ "type": 13, "id": "Cp18vEpvtLDpFCCX1jDoaVB319Y23dee28pask1uKhZ8", "fee": 1700000, "feeAssetId": null, "timestamp": 1680791379823, "version": 2, "chainId": 84, "sender": "3N5BB6iE58rujeTEkymeLNcdsYF4f6iKoxr", "senderPublicKey": "EtZZHS4uqNXY5WPneZ8jY2aA95peXwthJVLzAMxMp379", "proofs": [ "x1tRcK8NWEavWuA359HN6suawRD34kHuufoEPnaJ8g1TUrVh1swAaYHxJe8WP98ix6KnkB8JoW4MYtSWib7tPRb" ], "script": "base64:AAIFAAAAAAAABfYIAhIECgIICBIECgIICBIECgIIGBIDCgEIEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIICBIECgIICBIECgIICBIDCgEIEgUKAwgIBBIECgIICBIECgIIBBIDCgEIEgMKARgSAwoBCBIAEgMKAQgiA1NFUCIFRU1QVFkiDnN0YXR1c1ZlcmlmaWVkIhBzdGF0dXNVbnZlcmlmaWVkIhZsYWJlbENvbW11bml0eVZlcmlmaWVkIgxsYWJlbFBvb2xzTHAiDWRlZmF1bHRMYWJlbHMiB3Rocm93UEQiDHRocm93Tm9Bc3NldCISdGhyb3dJbnZhbGlkVGlja2VyIhNrZXlNYW5hZ2VyUHVibGljS2V5IhprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleSIPa2V5QWRtaW5QdWJLZXlzIhRrZXlVc2VyUG9vbHNDb250cmFjdCISa2V5RmFjdG9yeUNvbnRyYWN0IgprZXlDcmVhdGVkIgdhc3NldElkIgdrZXlMb2dvIglrZXlUaWNrZXIiCWtleVN0YXR1cyITa2V5QXNzZXRQb29sc051bWJlciISa2V5VGlja2VyVG9Bc3NldElkIgZ0aWNrZ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vZHlCeXRlcwkAAZEAAAACCAUAAAACYVYAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJhWGQnadI=", "height": 2522824, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7aNd3A3TnchNwvXagYynRYZgsHYwD4JeqGfjrsYbmrWM Next: ErYRZHxSgKfhuhsdiMmRRjpNvLHw7xNxHKYyFjM5XHia Diff:
OldNewDifferences
1919
2020
2121 func throwNoAsset () = throw("Asset doesn't exists")
22+
23+
24+func throwInvalidTicker () = throw("Invalid ticker")
2225
2326
2427 func keyManagerPublicKey () = "%s__managerPublicKey"
220223 }
221224
222225
223-func updateTickerActions (assetId,ticker) = {
224- let checkTicker = {
225- let tickerIsValid = (ticker != "")
226- if (tickerIsValid)
227- then true
228- else throw("Invalid ticker")
229- }
230- if ((checkTicker == checkTicker))
231- then [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
232- else throw("Strict value is not equal to itself.")
233- }
234-
235-
236226 @Callable(i)
237227 func setAssetName (assetID,assetName) = {
238228 let checkCaller = mustAdmin(i)
374364 then true
375365 else throwNoAsset()
376366 if ((checkAsset == checkAsset))
377- then updateTickerActions(assetId, ticker)
367+ then {
368+ let checkTicker = if ((ticker != ""))
369+ then true
370+ else throwInvalidTicker()
371+ if ((checkTicker == checkTicker))
372+ then {
373+ let deleteActions = ( match getString(keyTickerToAssetId(ticker)) {
374+ case assetIdOld: String =>
375+[DeleteEntry(keyAssetIdToTicker(assetIdOld))]
376+ case _: Unit =>
377+ nil
378+ case _ =>
379+ throw("Match error")
380+ } ++ match getString(keyAssetIdToTicker(assetId)) {
381+ case tickerOld: String =>
382+[DeleteEntry(keyTickerToAssetId(tickerOld))]
383+ case _: Unit =>
384+ nil
385+ case _ =>
386+ throw("Match error")
387+ })
388+ let updateActions = [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
389+ (deleteActions ++ updateActions)
390+ }
391+ else throw("Strict value is not equal to itself.")
392+ }
378393 else throw("Strict value is not equal to itself.")
379394 }
380395 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let EMPTY = ""
77
88 let statusVerified = 2
99
1010 let statusUnverified = 0
1111
1212 let labelCommunityVerified = "COMMUNITY_VERIFIED"
1313
1414 let labelPoolsLp = "POOLS_LP"
1515
1616 let defaultLabels = [labelCommunityVerified, labelPoolsLp]
1717
1818 func throwPD () = throw("Permission denied")
1919
2020
2121 func throwNoAsset () = throw("Asset doesn't exists")
22+
23+
24+func throwInvalidTicker () = throw("Invalid ticker")
2225
2326
2427 func keyManagerPublicKey () = "%s__managerPublicKey"
2528
2629
2730 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
2831
2932
3033 func keyAdminPubKeys () = "%s__adminPubKeys"
3134
3235
3336 func keyUserPoolsContract () = "%s__userPoolsContract"
3437
3538
3639 func keyFactoryContract () = "%s__factoryContract"
3740
3841
3942 func keyCreated (assetId) = (("created_<" + assetId) + ">")
4043
4144
4245 func keyLogo (assetId) = (("logo_<" + assetId) + ">")
4346
4447
4548 func keyTicker (assetId) = (("ticker_<" + assetId) + ">")
4649
4750
4851 func keyStatus (assetId) = (("status_<" + assetId) + ">")
4952
5053
5154 func keyAssetPoolsNumber (assetId) = makeString(["%s%s", "pools", assetId], SEP)
5255
5356
5457 func keyTickerToAssetId (ticker) = makeString(["%s%s", "ticker2assetId", ticker], SEP)
5558
5659
5760 func keyAssetIdToTicker (assetId) = makeString(["%s%s", "assetId2ticker", assetId], SEP)
5861
5962
6063 func keyAmountAndPriceAssetsToLpAsset (amountAsset,priceAsset) = makeString(["%s%s%s", "amountAndPriceAssetsToLpAsset", amountAsset, priceAsset], SEP)
6164
6265
6366 func keyLpAssetToAmountAndPriceAssets (lpAsset) = makeString(["%s%s", "lpAssetToAmountAndPriceAssets", lpAsset], SEP)
6467
6568
6669 func keyAssetLabels (assetId) = makeString(["%s%s", "labels", assetId], SEP)
6770
6871
6972 func keyLabels () = makeString(["%s", "labels"], SEP)
7073
7174
7275 func keyAssetName (assetId) = makeString(["%s%s", "assetName", assetId], SEP)
7376
7477
7578 func keyAssetDescription (assetId) = makeString(["%s%s", "assetDescription", assetId], SEP)
7679
7780
7881 func getValueOrFail (address,key,type) = {
7982 let error = makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")
8083 valueOrErrorMessage( match type {
8184 case str: String =>
8285 getString(address, key)
8386 case int: Int =>
8487 getInteger(address, key)
8588 case _ =>
8689 throw("invalid entry type")
8790 }, error)
8891 }
8992
9093
9194 func getStrOrFail (address,key) = {
9295 let @ = getValueOrFail(address, key, "")
9396 if ($isInstanceOf(@, "String"))
9497 then @
9598 else throw("Couldn't cast Int|String to String")
9699 }
97100
98101
99102 func getIntOrFail (address,key) = {
100103 let @ = getValueOrFail(address, key, 0)
101104 if ($isInstanceOf(@, "Int"))
102105 then @
103106 else throw("Couldn't cast Int|String to Int")
104107 }
105108
106109
107110 func isVerified (assetId) = (valueOrElse(getInteger(keyStatus(assetId)), statusUnverified) == statusVerified)
108111
109112
110113 func getLabels () = match getString(keyLabels()) {
111114 case s: String =>
112115 if ((size(s) == 0))
113116 then nil
114117 else split(s, SEP)
115118 case _ =>
116119 nil
117120 }
118121
119122
120123 func getAssetLabels (assetId) = match getString(keyAssetLabels(assetId)) {
121124 case s: String =>
122125 if ((size(s) == 0))
123126 then nil
124127 else split(s, SEP)
125128 case _ =>
126129 nil
127130 }
128131
129132
130133 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
131134 case s: String =>
132135 fromBase58String(s)
133136 case _: Unit =>
134137 unit
135138 case _ =>
136139 throw("Match error")
137140 }
138141
139142
140143 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
141144 case s: String =>
142145 fromBase58String(s)
143146 case _: Unit =>
144147 unit
145148 case _ =>
146149 throw("Match error")
147150 }
148151
149152
150153 func mustManager (i) = match managerPublicKeyOrUnit() {
151154 case pk: ByteVector =>
152155 if ((i.callerPublicKey == pk))
153156 then true
154157 else throwPD()
155158 case _: Unit =>
156159 if ((i.caller == this))
157160 then true
158161 else throwPD()
159162 case _ =>
160163 throw("Match error")
161164 }
162165
163166
164167 func mustAdmin (i) = {
165168 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
166169 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
167170 then true
168171 else {
169172 let isManager = mustManager(i)
170173 if ((isManager == isManager))
171174 then true
172175 else throw("Strict value is not equal to itself.")
173176 }
174177 }
175178
176179
177180 func isCreated (assetId) = valueOrElse(getBoolean(keyCreated(assetId)), false)
178181
179182
180183 func verifiedToStatus (verified) = if (verified)
181184 then statusVerified
182185 else statusUnverified
183186
184187
185188 func addLabelActions (assetId,label,throwOnError) = {
186189 let labels = getLabels()
187190 let assetLabels = getAssetLabels(assetId)
188191 let checkLabel = if (containsElement(labels, label))
189192 then true
190193 else throw("Label doesn't exist")
191194 if ((checkLabel == checkLabel))
192195 then {
193196 let newAssetLabels = if (containsElement(assetLabels, label))
194197 then if (throwOnError)
195198 then throw("Label has already been added")
196199 else assetLabels
197200 else (assetLabels :+ label)
198201 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
199202 }
200203 else throw("Strict value is not equal to itself.")
201204 }
202205
203206
204207 func deleteLabelActions (assetId,label,throwOnError) = {
205208 let assetLabels = getAssetLabels(assetId)
206209 let newAssetLabels = if (containsElement(assetLabels, label))
207210 then removeByIndex(assetLabels, value(indexOf(assetLabels, label)))
208211 else if (throwOnError)
209212 then throw("Label wasn't added")
210213 else assetLabels
211214 [StringEntry(keyAssetLabels(assetId), makeString(newAssetLabels, SEP))]
212215 }
213216
214217
215218 func setVerifiedActions (assetId,verified) = {
216219 let labelCommunityVerifiedActions = if (verified)
217220 then addLabelActions(assetId, labelCommunityVerified, false)
218221 else deleteLabelActions(assetId, labelCommunityVerified, false)
219222 ([IntegerEntry(keyStatus(assetId), verifiedToStatus(verified))] ++ labelCommunityVerifiedActions)
220223 }
221224
222225
223-func updateTickerActions (assetId,ticker) = {
224- let checkTicker = {
225- let tickerIsValid = (ticker != "")
226- if (tickerIsValid)
227- then true
228- else throw("Invalid ticker")
229- }
230- if ((checkTicker == checkTicker))
231- then [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
232- else throw("Strict value is not equal to itself.")
233- }
234-
235-
236226 @Callable(i)
237227 func setAssetName (assetID,assetName) = {
238228 let checkCaller = mustAdmin(i)
239229 if ((checkCaller == checkCaller))
240230 then [StringEntry(keyAssetName(assetID), assetName)]
241231 else throw("Strict value is not equal to itself.")
242232 }
243233
244234
245235
246236 @Callable(i)
247237 func setAssetDescription (assetID,assetDescription) = {
248238 let checkCaller = mustAdmin(i)
249239 if ((checkCaller == checkCaller))
250240 then [StringEntry(keyAssetDescription(assetID), assetDescription)]
251241 else throw("Strict value is not equal to itself.")
252242 }
253243
254244
255245
256246 @Callable(i)
257247 func constructor (userPoolsContract,labels) = {
258248 let checkCaller = mustManager(i)
259249 if ((checkCaller == checkCaller))
260250 then {
261251 let checksAddress = valueOrErrorMessage(addressFromString(userPoolsContract), "Invalid address")
262252 if ((checksAddress == checksAddress))
263253 then [StringEntry(keyUserPoolsContract(), userPoolsContract), StringEntry(keyLabels(), makeString((defaultLabels ++ labels), SEP))]
264254 else throw("Strict value is not equal to itself.")
265255 }
266256 else throw("Strict value is not equal to itself.")
267257 }
268258
269259
270260
271261 @Callable(i)
272262 func constructorV2 (factoryContract) = {
273263 let checkCaller = mustManager(i)
274264 if ((checkCaller == checkCaller))
275265 then {
276266 let checkAddress = valueOrErrorMessage(addressFromString(factoryContract), "invalid factory contract address")
277267 if ((checkAddress == checkAddress))
278268 then [StringEntry(keyFactoryContract(), factoryContract)]
279269 else throw("Strict value is not equal to itself.")
280270 }
281271 else throw("Strict value is not equal to itself.")
282272 }
283273
284274
285275
286276 @Callable(i)
287277 func addAssetsLink (amountAsset,priceAsset,lpAsset) = {
288278 let checkCaller = mustAdmin(i)
289279 if ((checkCaller == checkCaller))
290280 then [StringEntry(keyAmountAndPriceAssetsToLpAsset(amountAsset, priceAsset), lpAsset), StringEntry(keyLpAssetToAmountAndPriceAssets(lpAsset), makeString([amountAsset, priceAsset], SEP))]
291281 else throw("Strict value is not equal to itself.")
292282 }
293283
294284
295285
296286 @Callable(i)
297287 func increaseAssetPoolsNumber (assetId) = {
298288 let checkCaller = mustAdmin(i)
299289 if ((checkCaller == checkCaller))
300290 then {
301291 let assetPoolsNumberKey = keyAssetPoolsNumber(assetId)
302292 let assetPoolsNumber = valueOrElse(getInteger(assetPoolsNumberKey), 0)
303293 [IntegerEntry(assetPoolsNumberKey, (assetPoolsNumber + 1))]
304294 }
305295 else throw("Strict value is not equal to itself.")
306296 }
307297
308298
309299
310300 @Callable(i)
311301 func createLabel (label) = {
312302 let labels = getLabels()
313303 let checkCaller = mustAdmin(i)
314304 if ((checkCaller == checkCaller))
315305 then {
316306 let checkLabel = [if (!(contains(label, SEP)))
317307 then true
318308 else throw("Invalid label name"), if (!(containsElement(labels, label)))
319309 then true
320310 else throw("Label exists")]
321311 if ((checkLabel == checkLabel))
322312 then [StringEntry(keyLabels(), makeString((labels :+ label), SEP))]
323313 else throw("Strict value is not equal to itself.")
324314 }
325315 else throw("Strict value is not equal to itself.")
326316 }
327317
328318
329319
330320 @Callable(i)
331321 func dropLabel (label) = {
332322 let labels = getLabels()
333323 let checkCaller = mustManager(i)
334324 if ((checkCaller == checkCaller))
335325 then {
336326 let checkLabel = if (containsElement(labels, label))
337327 then true
338328 else throw("Label doesn't exist")
339329 if ((checkLabel == checkLabel))
340330 then [StringEntry(keyLabels(), makeString(removeByIndex(labels, value(indexOf(labels, label))), SEP))]
341331 else throw("Strict value is not equal to itself.")
342332 }
343333 else throw("Strict value is not equal to itself.")
344334 }
345335
346336
347337
348338 @Callable(i)
349339 func addLabel (assetId,label) = {
350340 let checkCaller = mustAdmin(i)
351341 if ((checkCaller == checkCaller))
352342 then addLabelActions(assetId, label, true)
353343 else throw("Strict value is not equal to itself.")
354344 }
355345
356346
357347
358348 @Callable(i)
359349 func deleteLabel (assetId,label) = {
360350 let checkCaller = mustAdmin(i)
361351 if ((checkCaller == checkCaller))
362352 then deleteLabelActions(assetId, label, true)
363353 else throw("Strict value is not equal to itself.")
364354 }
365355
366356
367357
368358 @Callable(i)
369359 func updateTicker (assetId,ticker) = {
370360 let checkCaller = mustAdmin(i)
371361 if ((checkCaller == checkCaller))
372362 then {
373363 let checkAsset = if (isCreated(assetId))
374364 then true
375365 else throwNoAsset()
376366 if ((checkAsset == checkAsset))
377- then updateTickerActions(assetId, ticker)
367+ then {
368+ let checkTicker = if ((ticker != ""))
369+ then true
370+ else throwInvalidTicker()
371+ if ((checkTicker == checkTicker))
372+ then {
373+ let deleteActions = ( match getString(keyTickerToAssetId(ticker)) {
374+ case assetIdOld: String =>
375+[DeleteEntry(keyAssetIdToTicker(assetIdOld))]
376+ case _: Unit =>
377+ nil
378+ case _ =>
379+ throw("Match error")
380+ } ++ match getString(keyAssetIdToTicker(assetId)) {
381+ case tickerOld: String =>
382+[DeleteEntry(keyTickerToAssetId(tickerOld))]
383+ case _: Unit =>
384+ nil
385+ case _ =>
386+ throw("Match error")
387+ })
388+ let updateActions = [StringEntry(keyAssetIdToTicker(assetId), ticker), StringEntry(keyTickerToAssetId(ticker), assetId)]
389+ (deleteActions ++ updateActions)
390+ }
391+ else throw("Strict value is not equal to itself.")
392+ }
378393 else throw("Strict value is not equal to itself.")
379394 }
380395 else throw("Strict value is not equal to itself.")
381396 }
382397
383398
384399
385400 @Callable(i)
386401 func deleteTicker (assetId) = {
387402 let checkCaller = mustAdmin(i)
388403 if ((checkCaller == checkCaller))
389404 then {
390405 let ticker = valueOrErrorMessage(getString(keyAssetIdToTicker(assetId)), "Invalid asset")
391406 [DeleteEntry(keyAssetIdToTicker(assetId)), DeleteEntry(keyTickerToAssetId(ticker))]
392407 }
393408 else throw("Strict value is not equal to itself.")
394409 }
395410
396411
397412
398413 @Callable(i)
399414 func createOrUpdate (assetId,logo,verified) = {
400415 let checkCaller = mustAdmin(i)
401416 if ((checkCaller == checkCaller))
402417 then {
403418 let isCreatedNow = !(isCreated(assetId))
404419 if ((isCreatedNow == isCreatedNow))
405420 then {
406421 let setLogoActions = if ((logo == ""))
407422 then nil
408423 else [StringEntry(keyLogo(assetId), logo)]
409424 $Tuple2((([BooleanEntry(keyCreated(assetId), true)] ++ setLogoActions) ++ setVerifiedActions(assetId, verified)), isCreatedNow)
410425 }
411426 else throw("Strict value is not equal to itself.")
412427 }
413428 else throw("Strict value is not equal to itself.")
414429 }
415430
416431
417432
418433 @Callable(i)
419434 func setLogo (assetId,logo) = {
420435 let checks = [mustAdmin(i), if (isCreated(assetId))
421436 then true
422437 else throwNoAsset()]
423438 if ((checks == checks))
424439 then {
425440 let action = if ((logo == ""))
426441 then DeleteEntry(keyLogo(assetId))
427442 else StringEntry(keyLogo(assetId), logo)
428443 [action]
429444 }
430445 else throw("Strict value is not equal to itself.")
431446 }
432447
433448
434449
435450 @Callable(i)
436451 func setVerified (assetId,verified) = {
437452 let checks = [mustAdmin(i), if (isCreated(assetId))
438453 then true
439454 else throwNoAsset()]
440455 if ((checks == checks))
441456 then {
442457 let onVerificationLossInv = if (!(verified))
443458 then {
444459 let factoryContract = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyFactoryContract())), "invalid factory contract address")
445460 invoke(factoryContract, "onVerificationLoss", [assetId], nil)
446461 }
447462 else unit
448463 if ((onVerificationLossInv == onVerificationLossInv))
449464 then $Tuple2(setVerifiedActions(assetId, verified), unit)
450465 else throw("Strict value is not equal to itself.")
451466 }
452467 else throw("Strict value is not equal to itself.")
453468 }
454469
455470
456471
457472 @Callable(i)
458473 func onEliminate (assetId) = {
459474 let poolsNumber = valueOrElse(getInteger(keyAssetPoolsNumber(assetId)), 0)
460475 let actions = if ((poolsNumber > 0))
461476 then nil
462477 else [DeleteEntry(keyLogo(assetId))]
463478 $Tuple2(actions, unit)
464479 }
465480
466481
467482
468483 @Callable(i)
469484 func setAdmins (adminPubKeys) = {
470485 let checkCaller = mustManager(i)
471486 if ((checkCaller == checkCaller))
472487 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
473488 else throw("Strict value is not equal to itself.")
474489 }
475490
476491
477492
478493 @Callable(i)
479494 func setManager (pendingManagerPublicKey) = {
480495 let checkCaller = mustManager(i)
481496 if ((checkCaller == checkCaller))
482497 then {
483498 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
484499 if ((checkManagerPublicKey == checkManagerPublicKey))
485500 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
486501 else throw("Strict value is not equal to itself.")
487502 }
488503 else throw("Strict value is not equal to itself.")
489504 }
490505
491506
492507
493508 @Callable(i)
494509 func confirmManager () = {
495510 let pm = pendingManagerPublicKeyOrUnit()
496511 let hasPM = if (isDefined(pm))
497512 then true
498513 else throw("No pending manager")
499514 if ((hasPM == hasPM))
500515 then {
501516 let checkPM = if ((i.callerPublicKey == value(pm)))
502517 then true
503518 else throw("You are not pending manager")
504519 if ((checkPM == checkPM))
505520 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
506521 else throw("Strict value is not equal to itself.")
507522 }
508523 else throw("Strict value is not equal to itself.")
509524 }
510525
511526
512527
513528 @Callable(i)
514529 func isVerifiedREADONLY (assetId) = $Tuple2(nil, isVerified(assetId))
515530
516531
517532 @Verifier(tx)
518533 func verify () = {
519534 let targetPublicKey = match managerPublicKeyOrUnit() {
520535 case pk: ByteVector =>
521536 pk
522537 case _: Unit =>
523538 tx.senderPublicKey
524539 case _ =>
525540 throw("Match error")
526541 }
527542 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
528543 }
529544

github/deemru/w8io/026f985 
52.59 ms