tx · 3BJqnDuXnrnoLxfWkeXrcaSz2nfbUuxZxGHNK1CpL4kL 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc: -0.01000000 Waves 2022.04.21 08:43 [2017896] smart account 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc > SELF 0.00000000 Waves
{ "type": 13, "id": "3BJqnDuXnrnoLxfWkeXrcaSz2nfbUuxZxGHNK1CpL4kL", "fee": 1000000, "feeAssetId": null, "timestamp": 1650519799196, "version": 2, "chainId": 84, "sender": "3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc", "senderPublicKey": "H3EzJ6fSm7jHKo92xYdNTXaaQYKj9z5q2DJFovRDLJpf", "proofs": [ "2pVALxuMz6Zo1Jo1DeB1Bau9t4irzthrxFo2MCCJqxWZQcRKw3EK2F4FbjQRbdCXY85YgpgffmX25j2YejmBFqRG" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIICBIECgIIAQAAAAoAAAAAA1NFUAIAAAACX18BAAAAEWtleUNvbnRyb2xBZGRyZXNzAAAAAAIAAAAcJXMlc19fY29uZmlnX19jb250cm9sQWRkcmVzcwEAAAAOa2V5UmVzdEFkZHJlc3MAAAAAAgAAABklcyVzX19jb25maWdfX3Jlc3RBZGRyZXNzAQAAAAxnZXRTdHJPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD01hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAAEGdldEFkZHJlc3NPckZhaWwAAAABAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEJgAAAAEJAQAAAAxnZXRTdHJPckZhaWwAAAABBQAAAANrZXkJAAEsAAAAAgIAAAAfZmFpbCB0byBwYXJzZSBhZGRyZXNzIGZvciB0aGlzLgUAAAADa2V5AQ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AAAAgUAAAADbmlsCQEAAAALcHJvZHVjZUpzb24AAAABCQAETAAAAAICAAAAEWduc2J0SW5mb1JFQURPTkxZCQAETAAAAAIFAAAACWduc2J0SW5mbwkABEwAAAACAgAAABBzd2FwSW5mb1JFQURPTkxZCQAETAAAAAIFAAAACHN3YXBJbmZvBQAAAANuaWwAAAAAN9fLXA==", "height": 2017896, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 74UBUAKrHFCoSq99AUi2AsvK96x8TGeBhKiARnwV3RUZ Next: HiYMz66R8BGkRkbVVSzGbXo2YUZRgHtgwWBfSPY3W8Nq Diff:
Old | New | Differences | |
---|---|---|---|
80 | 80 | @Callable(i) | |
81 | 81 | func nsbtPageREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
82 | 82 | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
83 | - | let $ | |
84 | - | let gNsbtInfoMETA = $ | |
85 | - | let gNsbtInfoDATA = $ | |
83 | + | let $t020942182 = parseRestResult(gnsbtInfo) | |
84 | + | let gNsbtInfoMETA = $t020942182._1 | |
85 | + | let gNsbtInfoDATA = $t020942182._2 | |
86 | 86 | let swapInfo = asString(invoke(restAcc, "swapInfoREADONLY", [userAddressStrOpt], nil)) | |
87 | 87 | let swapInfoArray = split(swapInfo, SEP) | |
88 | 88 | let blocks2LmtReset = swapInfoArray[8] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func keyControlAddress () = "%s%s__config__controlAddress" | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyRestAddress () = "%s%s__config__restAddress" | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func getStrOrFail (key) = valueOrErrorMessage(getString(this, key), (("Mandatory this." + key) + " is not defined")) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getAddressOrFail (key) = valueOrErrorMessage(addressFromString(getStrOrFail(key)), ("fail to parse address for this." + key)) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func asString (val) = match val { | |
19 | 19 | case valStr: String => | |
20 | 20 | valStr | |
21 | 21 | case _ => | |
22 | 22 | throw("fail to cast into String") | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func parseRestResult (restResultStr) = { | |
27 | 27 | let idx = valueOrErrorMessage(indexOf(restResultStr, SEP), "unsupported REST format") | |
28 | 28 | let metaPart = take(restResultStr, idx) | |
29 | 29 | let dataPart = drop(restResultStr, (idx + size(SEP))) | |
30 | 30 | $Tuple2(metaPart, dataPart) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func produceJson (strMap) = { | |
35 | 35 | let indexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
36 | 36 | let length = size(strMap) | |
37 | 37 | if (((length % 2) != 0)) | |
38 | 38 | then throw("only even args size is accepeted") | |
39 | 39 | else if ((length > size(indexes))) | |
40 | 40 | then throw(("strMap length is greater then " + toString(size(indexes)))) | |
41 | 41 | else { | |
42 | 42 | func produceJson (jsonAccum,nextIdx) = if (if (((nextIdx % 2) == 0)) | |
43 | 43 | then (length >= (nextIdx + 1)) | |
44 | 44 | else false) | |
45 | 45 | then (((((jsonAccum + " | |
46 | 46 | \"") + strMap[nextIdx]) + "\": \"") + strMap[(nextIdx + 1)]) + "\", | |
47 | 47 | ") | |
48 | 48 | else jsonAccum | |
49 | 49 | ||
50 | 50 | let preJsonResult = { | |
51 | 51 | let $l = indexes | |
52 | 52 | let $s = size($l) | |
53 | 53 | let $acc0 = "" | |
54 | 54 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
55 | 55 | then $a | |
56 | 56 | else produceJson($a, $l[$i]) | |
57 | 57 | ||
58 | 58 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
59 | 59 | then $a | |
60 | 60 | else throw("List size exceeds 20") | |
61 | 61 | ||
62 | 62 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
63 | 63 | } | |
64 | 64 | (("{" + dropRight(preJsonResult, 2)) + "}") | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | let controlAcc = getAddressOrFail(keyControlAddress()) | |
70 | 70 | ||
71 | 71 | let restAcc = getAddressOrFail(keyRestAddress()) | |
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func constructor (controlAddress58,restAddress58) = if ((i.caller != this)) | |
75 | 75 | then throw("not authorized") | |
76 | 76 | else [StringEntry(keyControlAddress(), controlAddress58), StringEntry(keyRestAddress(), restAddress58)] | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func nsbtPageREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
82 | 82 | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
83 | - | let $ | |
84 | - | let gNsbtInfoMETA = $ | |
85 | - | let gNsbtInfoDATA = $ | |
83 | + | let $t020942182 = parseRestResult(gnsbtInfo) | |
84 | + | let gNsbtInfoMETA = $t020942182._1 | |
85 | + | let gNsbtInfoDATA = $t020942182._2 | |
86 | 86 | let swapInfo = asString(invoke(restAcc, "swapInfoREADONLY", [userAddressStrOpt], nil)) | |
87 | 87 | let swapInfoArray = split(swapInfo, SEP) | |
88 | 88 | let blocks2LmtReset = swapInfoArray[8] | |
89 | 89 | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "swapInfoREADONLY", swapInfo])) | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 |
github/deemru/w8io/026f985 47.89 ms ◑