tx · FHyT84G87XCHwkuN9rtemCuVBhaFtUxgKJ3xKCDcwioG 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc: -0.04000000 Waves 2022.07.11 10:08 [2134755] smart account 3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc > SELF 0.00000000 Waves
{ "type": 13, "id": "FHyT84G87XCHwkuN9rtemCuVBhaFtUxgKJ3xKCDcwioG", "fee": 4000000, "feeAssetId": null, "timestamp": 1657523377126, "version": 1, "sender": "3MyBtJnMg6n7m1sDczbrijVyosLnRh4FFbc", "senderPublicKey": "H3EzJ6fSm7jHKo92xYdNTXaaQYKj9z5q2DJFovRDLJpf", "proofs": [ "4qKADvdKxWm24EADq4wR7TUcWNK7oJX3MhbddbsSbLsFFqWgqF11F7axNdjkVe5X1z6rwhNgLM8fR1Eh8vRY1W4G" ], "script": "base64:AAIFAAAAAAAAACQIAhIECgIICBIECgIIARIDCgEIEgUKAwgBCBIDCgEIEgMKAQgAAAAJAAAAAANTRVACAAAAAl9fAQAAABFrZXlDb250cm9sQWRkcmVzcwAAAAACAAAAHCVzJXNfX2NvbmZpZ19fY29udHJvbEFkZHJlc3MBAAAADmtleVJlc3RBZGRyZXNzAAAAAAIAAAAZJXMlc19fY29uZmlnX19yZXN0QWRkcmVzcwEAAAAMZ2V0U3RyT3JGYWlsAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACAgAAAA9NYW5kYXRvcnkgdGhpcy4FAAAAA2tleQIAAAAPIGlzIG5vdCBkZWZpbmVkAQAAABBnZXRBZGRyZXNzT3JGYWlsAAAAAQAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABCQEAAAAMZ2V0U3RyT3JGYWlsAAAAAQUAAAADa2V5CQABLAAAAAICAAAAH2ZhaWwgdG8gcGFyc2UgYWRkcmVzcyBm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QAAAAAAAAAAAUAAAAAAAAAAAYAAAAAAAAAAAcAAAAAAAAAAAgAAAAAAAAAAAkAAAAAAAAAAAoJAAUUAAAAAgUAAAADbmlsCQEAAAALcHJvZHVjZUpzb24AAAABBQAAAA5pbnZva2VzUmVzdWx0cwAAAADH9Lt0", "chainId": 84, "height": 2134755, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2N54abUa41mC4ktzXrbmpRLi2GccJ1p5gW9b7vsUWwct Next: ERn1r7yVZGrP31ycuv6gQap9c2DYq66PEYC8zjj6dw4k Diff:
Old | New | Differences | |
---|---|---|---|
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(i) | |
100 | + | func walletPageREADONLY (userAddressStr) = { | |
101 | + | let walletInfo = asString(invoke(restAcc, "walletInfoREADONLY", [userAddressStr], nil)) | |
102 | + | $Tuple2(nil, produceJson(["walletInfoREADONLY", walletInfo])) | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | @Callable(i) | |
100 | 108 | func genericREADONLY (payload) = { | |
101 | 109 | let funcsIndexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
102 | 110 | let paramIndexes = [1, 3, 5, 7, 9, 11] |
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 produceJson (strMap) = { | |
27 | 27 | let indexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
28 | 28 | let length = size(strMap) | |
29 | 29 | if (((length % 2) != 0)) | |
30 | 30 | then throw("only even args size is accepeted") | |
31 | 31 | else if ((length > size(indexes))) | |
32 | 32 | then throw(("strMap length is greater then " + toString(size(indexes)))) | |
33 | 33 | else { | |
34 | 34 | func produceJson (jsonAccum,nextIdx) = if (if (((nextIdx % 2) == 0)) | |
35 | 35 | then (length >= (nextIdx + 1)) | |
36 | 36 | else false) | |
37 | 37 | then (((((jsonAccum + " | |
38 | 38 | \"") + strMap[nextIdx]) + "\": \"") + strMap[(nextIdx + 1)]) + "\",") | |
39 | 39 | else jsonAccum | |
40 | 40 | ||
41 | 41 | let preJsonResult = { | |
42 | 42 | let $l = indexes | |
43 | 43 | let $s = size($l) | |
44 | 44 | let $acc0 = "" | |
45 | 45 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
46 | 46 | then $a | |
47 | 47 | else produceJson($a, $l[$i]) | |
48 | 48 | ||
49 | 49 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
50 | 50 | then $a | |
51 | 51 | else throw("List size exceeds 20") | |
52 | 52 | ||
53 | 53 | $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) | |
54 | 54 | } | |
55 | 55 | (("{" + dropRight(preJsonResult, 1)) + "}") | |
56 | 56 | } | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | let controlAcc = getAddressOrFail(keyControlAddress()) | |
61 | 61 | ||
62 | 62 | let restAcc = getAddressOrFail(keyRestAddress()) | |
63 | 63 | ||
64 | 64 | @Callable(i) | |
65 | 65 | func constructor (controlAddress58,restAddress58) = if ((i.caller != this)) | |
66 | 66 | then throw("not authorized") | |
67 | 67 | else [StringEntry(keyControlAddress(), controlAddress58), StringEntry(keyRestAddress(), restAddress58)] | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | ||
71 | 71 | @Callable(i) | |
72 | 72 | func stakeNsbtPageREADONLY (userAddressStrOpt,nsbtAmtDiff) = { | |
73 | 73 | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, nsbtAmtDiff], nil)) | |
74 | 74 | let swapInfo = asString(invoke(restAcc, "swapInfoREADONLY", [userAddressStrOpt], nil)) | |
75 | 75 | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "swapInfoREADONLY", swapInfo])) | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func buyNsbtPageREADONLY (userAddressStrOpt) = { | |
82 | 82 | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, 0], nil)) | |
83 | 83 | let neutrinoStats = asString(invoke(restAcc, "neutrinoStatsREADONLY", nil, nil)) | |
84 | 84 | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "neutrinoStatsREADONLY", neutrinoStats])) | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(i) | |
90 | 90 | func buySurfPageREADONLY (userAddressStrOpt,amount,assetIdStr) = { | |
91 | 91 | let gnsbtInfo = asString(invoke(restAcc, "gnsbtInfoREADONLY", [userAddressStrOpt, 0], nil)) | |
92 | 92 | let neutrinoStats = asString(invoke(restAcc, "neutrinoStatsREADONLY", nil, nil)) | |
93 | 93 | let surfBuy = asString(invoke(restAcc, "buySurfREADONLY", [userAddressStrOpt, amount, assetIdStr], nil)) | |
94 | 94 | $Tuple2(nil, produceJson(["gnsbtInfoREADONLY", gnsbtInfo, "neutrinoStatsREADONLY", neutrinoStats, "buySurfREADONLY", surfBuy])) | |
95 | 95 | } | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | ||
99 | 99 | @Callable(i) | |
100 | + | func walletPageREADONLY (userAddressStr) = { | |
101 | + | let walletInfo = asString(invoke(restAcc, "walletInfoREADONLY", [userAddressStr], nil)) | |
102 | + | $Tuple2(nil, produceJson(["walletInfoREADONLY", walletInfo])) | |
103 | + | } | |
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | @Callable(i) | |
100 | 108 | func genericREADONLY (payload) = { | |
101 | 109 | let funcsIndexes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
102 | 110 | let paramIndexes = [1, 3, 5, 7, 9, 11] | |
103 | 111 | let payloadArr = split(payload, SEP) | |
104 | 112 | let payloadSize = size(payloadArr) | |
105 | 113 | func invokesAgregator (accum,funcIdx) = if ((funcIdx >= payloadSize)) | |
106 | 114 | then accum | |
107 | 115 | else { | |
108 | 116 | let call = payloadArr[funcIdx] | |
109 | 117 | let callArr = split(call, "+") | |
110 | 118 | let address = addressFromStringValue(callArr[0]) | |
111 | 119 | let funcName = callArr[1] | |
112 | 120 | let paramsArr = split(callArr[2], ":") | |
113 | 121 | let paramsSize = size(paramsArr) | |
114 | 122 | func paramsAgregator (paramsAcc,paramIdx) = if ((paramIdx >= paramsSize)) | |
115 | 123 | then paramsAcc | |
116 | 124 | else { | |
117 | 125 | let p = if ((paramsArr[(paramIdx - 1)] == "s")) | |
118 | 126 | then paramsArr[paramIdx] | |
119 | 127 | else parseIntValue(paramsArr[paramIdx]) | |
120 | 128 | (paramsAcc :+ p) | |
121 | 129 | } | |
122 | 130 | ||
123 | 131 | let params = { | |
124 | 132 | let $l = paramIndexes | |
125 | 133 | let $s = size($l) | |
126 | 134 | let $acc0 = nil | |
127 | 135 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
128 | 136 | then $a | |
129 | 137 | else paramsAgregator($a, $l[$i]) | |
130 | 138 | ||
131 | 139 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
132 | 140 | then $a | |
133 | 141 | else throw("List size exceeds 6") | |
134 | 142 | ||
135 | 143 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
136 | 144 | } | |
137 | 145 | let result = asString(invoke(address, funcName, params, nil)) | |
138 | 146 | (accum ++ [funcName, result]) | |
139 | 147 | } | |
140 | 148 | ||
141 | 149 | let invokesResults = { | |
142 | 150 | let $l = funcsIndexes | |
143 | 151 | let $s = size($l) | |
144 | 152 | let $acc0 = nil | |
145 | 153 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
146 | 154 | then $a | |
147 | 155 | else invokesAgregator($a, $l[$i]) | |
148 | 156 | ||
149 | 157 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
150 | 158 | then $a | |
151 | 159 | else throw("List size exceeds 10") | |
152 | 160 | ||
153 | 161 | $f0_2($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) | |
154 | 162 | } | |
155 | 163 | $Tuple2(nil, produceJson(invokesResults)) | |
156 | 164 | } | |
157 | 165 | ||
158 | 166 |
github/deemru/w8io/026f985 33.73 ms ◑