tx · 2phCXR1eqtk6LoLrhdHwKpVFMpZM5XbJP7vYGBaLRfNj

3MzCxx3HQhveT7EPtxKiavzeG5NaWfdWaqG:  -0.00100000 Waves

2022.09.14 10:34 [2228468] smart account 3MzCxx3HQhveT7EPtxKiavzeG5NaWfdWaqG > SELF 0.00000000 Waves

{ "type": 13, "id": "2phCXR1eqtk6LoLrhdHwKpVFMpZM5XbJP7vYGBaLRfNj", "fee": 100000, "feeAssetId": null, "timestamp": 1663140952166, "version": 2, "chainId": 84, "sender": "3MzCxx3HQhveT7EPtxKiavzeG5NaWfdWaqG", "senderPublicKey": "GsZLD13DqBHEqBVXCDjp7KqkLz78GSfeRJR8LFQnSFzu", "proofs": [ "2yd3yW9YFWEvvuinmBTKdP1UbeGmZ3pn3YfA2QBkFpEFgp9jxtMsY2vtuqDxjfLEpcvtGayi3Zf2tsb5FogkXd8V" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMICAEAAAABAQAAAAdmaW5kSWR4AAAAAgAAAANzcmMAAAAGdGFyZ2V0BAAAAAt0YXJnZXRTdGFydAkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEswAAAAIFAAAAA3NyYwUAAAAGdGFyZ2V0CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABZ0aGVyZSBpcyBubyBzdWJzdHJpbmcgBQAAAAZ0YXJnZXQCAAAABCBpbiAFAAAAA3NyYwMJAABmAAAAAgUAAAALdGFyZ2V0U3RhcnQAAAAAAAAAAAAEAAAABGxlZnQJAAEvAAAAAgUAAAADc3JjBQAAAAt0YXJnZXRTdGFydAkAAZAAAAABCQAEtQAAAAIFAAAABGxlZnQCAAAAAV8AAAAAAAAAAAAAAAABAAAAAWkBAAAAC3Rlc3RGaW5kSWR4AAAAAwAAAANzcmMAAAAGdGFyZ2V0AAAAC2V4cGVjdGVkSWR4BAAAAANpZHgJAQAAAAdmaW5kSWR4AAAAAgUAAAADc3JjBQAAAAZ0YXJnZXQEAAAABnN0YXR1cwMJAAAAAAAAAgUAAAADaWR4BQAAAAtleHBlY3RlZElkeAIAAAAHc3VjY2VzcwIAAAAEZmFpbAkABRQAAAACBQAAAANuaWwFAAAABnN0YXR1cwAAAAByXDib", "height": 2228468, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5nWh7k2939e2MBBu8Ab669ddpewgn3BH9fAk5UazcPpe Next: 4Ehwndn77HobPywPzZeZtvmjeWfN1mH1Esvwd1HoTUMB Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func asAnyList (v) = match v {
5- case l: List[Any] =>
6- l
7- case _ =>
8- throw("fail to cast into List[Any]")
9-}
10-
11-
12-func asInt (v) = match v {
13- case i: Int =>
14- i
15- case _ =>
16- throw("fail to cast into Int")
17-}
18-
19-
20-func getBr () = {
21- let mathContract = addressFromStringValue("3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi")
22- let metrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
23- let br = asInt(metrics[7])
24- br
4+func findIdx (src,target) = {
5+ let targetStart = valueOrErrorMessage(indexOf(src, target), ((("there is no substring " + target) + " in ") + src))
6+ if ((targetStart > 0))
7+ then {
8+ let left = take(src, targetStart)
9+ size(split(left, "_"))
10+ }
11+ else 0
2512 }
2613
2714
2815 @Callable(i)
29-func call (nonce) = {
30- let mathContract = addressFromStringValue("3N7LYefWk1WhvCsY5A9nTq244SbVPmhCypi")
31- let metrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
32- let br = getBr()
33-[IntegerEntry(("br" + toString(nonce)), br)]
16+func testFindIdx (src,target,expectedIdx) = {
17+ let idx = findIdx(src, target)
18+ let status = if ((idx == expectedIdx))
19+ then "success"
20+ else "fail"
21+ $Tuple2(nil, status)
3422 }
3523
3624

github/deemru/w8io/026f985 
37.25 ms