tx · ENSaAqFBmZqcNXXLwV2rq6MohGAmVMqK6AkD7gtm8RFo 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx: -0.01000000 Waves 2023.03.06 18:32 [2478413] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves
{ "type": 13, "id": "ENSaAqFBmZqcNXXLwV2rq6MohGAmVMqK6AkD7gtm8RFo", "fee": 1000000, "feeAssetId": null, "timestamp": 1678116766868, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "66FosodkNYrKv69MvhBBEgaHfwUbVr3VNN8tYEHZNKXVZX2CdfSJqZXRmk5DLShkaKuFi7xr5DP1kTYijQGrPpZ5" ], "script": "base64:BgIgCAISBAoCAQESABIDCgEBEgQKAhgREgQKAggIEgMKAQgCAAxvcHRpb25zX2FkZHIJAQdBZGRyZXNzAQEaAVRBW/gr9hfqKqHLxIrx+8e7siBhMf6HIMEABHRVU0QBIKskSmq2Qkbr0vzjebBhusOuaVdNUnrKRRynQB0RsCkOBgFpAQlpc3N1ZUJpbGwCCXByb3ZpZGluZwRzaXplBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQRbWluQmlsbERlcG9zaXRTdHIEByRtYXRjaDAJAJ0IAgUMb3B0aW9uc19hZGRyAhBtaW5fYmlsbF9kZXBvc2l0AwkAAQIFByRtYXRjaDACBFVuaXQCATADCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF4BQckbWF0Y2gwBQF4CQACAQILTWF0Y2ggZXJyb3IED2V4Y2hhbmdlUmF0ZVN0cgQHJG1hdGNo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sZXJBZGRyZXNzU3RyOiAFEGNhbGxlckFkZHJlc3NTdHICAiwgCQACAQIQVW5zZXQgYWRtaW4gbGlzdAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkToGjo", "height": 2478413, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GF7ZjKbMbMU39ckahaE9wLTz4tGNaFMAoUnMnbS7LuLB Next: 49XtyS85XjTeLT4bqe1jDDMS9QMcVHwvRUetZ7HHCmRr Diff:
Old | New | Differences | |
---|---|---|---|
61 | 61 | } | |
62 | 62 | else throw("Match error") | |
63 | 63 | } | |
64 | - | let p = (g - d) | |
64 | + | let p = (g * o) | |
65 | + | let q = (g - d) | |
65 | 66 | if (((m * 100) > d)) | |
66 | 67 | then throw((((("The security deposit must be more than " + j) + ". You set the size: ") + toString((d / 100))) + ".00")) | |
67 | - | else if ((0 > | |
68 | + | else if ((0 > q)) | |
68 | 69 | then throw("Not enough balance") | |
69 | - | else if ((e > | |
70 | - | then throw((("The nominal value of the promissory bill exceeds the collateral minimum (" + j) + ")")) | |
70 | + | else if ((e > p)) | |
71 | + | then throw((((("The nominal value of the promissory bill exceeds the collateral minimum" + toString(p)) + "₽ (") + j) + "tUSD)")) | |
71 | 72 | else { | |
72 | - | let | |
73 | - | let | |
74 | - | $Tuple2([IntegerEntry(f, | |
73 | + | let r = Issue(("bill for:" + toString((d / 100))), ((f + ":") + toString(e)), 1, 0, false) | |
74 | + | let s = calculateAssetId(r) | |
75 | + | $Tuple2([IntegerEntry(f, q), r, ScriptTransfer(c.caller, 1, s), IntegerEntry(("l_u_" + toBase58String(s)), d)], unit) | |
75 | 76 | } | |
76 | 77 | } | |
77 | 78 | ||
81 | 82 | func deposit () = if ((size(c.payments) == 0)) | |
82 | 83 | then throw("Payment not attached") | |
83 | 84 | else { | |
84 | - | let | |
85 | - | let | |
85 | + | let t = value(c.payments)[0] | |
86 | + | let u = { | |
86 | 87 | let h = getString(a, "min_deposit") | |
87 | 88 | if ($isInstanceOf(h, "Unit")) | |
88 | 89 | then "0" | |
93 | 94 | } | |
94 | 95 | else throw("Match error") | |
95 | 96 | } | |
96 | - | let | |
97 | - | let h = parseInt(split( | |
97 | + | let v = { | |
98 | + | let h = parseInt(split(u, ".")[0]) | |
98 | 99 | if ($isInstanceOf(h, "Unit")) | |
99 | 100 | then 0 | |
100 | 101 | else if ($isInstanceOf(h, "Int")) | |
104 | 105 | } | |
105 | 106 | else throw("Match error") | |
106 | 107 | } | |
107 | - | if (( | |
108 | + | if ((t.assetId != b)) | |
108 | 109 | then throw("holded payment not tUSD") | |
109 | - | else if ((( | |
110 | - | then throw((((("You have set the deposit amount to " + toString(( | |
110 | + | else if (((v * 100) > t.amount)) | |
111 | + | then throw((((("You have set the deposit amount to " + toString((t.amount / 100))) + ".00, which is less than the minimum (") + u) + ")")) | |
111 | 112 | else { | |
112 | 113 | let f = toBase58String(c.caller.bytes) | |
113 | 114 | let g = { | |
119 | 120 | } | |
120 | 121 | else 0 | |
121 | 122 | } | |
122 | - | let | |
123 | - | [IntegerEntry(f, | |
123 | + | let q = (g + t.amount) | |
124 | + | [IntegerEntry(f, q)] | |
124 | 125 | } | |
125 | 126 | } | |
126 | 127 | ||
127 | 128 | ||
128 | 129 | ||
129 | 130 | @Callable(c) | |
130 | - | func withdraw ( | |
131 | + | func withdraw (w) = { | |
131 | 132 | let f = toBase58String(c.caller.bytes) | |
132 | 133 | let g = { | |
133 | 134 | let h = getInteger(this, f) | |
138 | 139 | } | |
139 | 140 | else 0 | |
140 | 141 | } | |
141 | - | let | |
142 | - | if ((0 > | |
142 | + | let q = (g - w) | |
143 | + | if ((0 > w)) | |
143 | 144 | then throw("Can't withdraw negative amount") | |
144 | - | else if ((0 > | |
145 | + | else if ((0 > q)) | |
145 | 146 | then throw("Not enough balance") | |
146 | - | else $Tuple2([IntegerEntry(f, | |
147 | + | else $Tuple2([IntegerEntry(f, q), ScriptTransfer(c.caller, w, b)], unit) | |
147 | 148 | } | |
148 | 149 | ||
149 | 150 | ||
150 | 151 | ||
151 | 152 | @Callable(c) | |
152 | - | func setOptions ( | |
153 | - | let | |
154 | - | if ((100 >= | |
153 | + | func setOptions (x,y) = { | |
154 | + | let z = size(x) | |
155 | + | if ((100 >= z)) | |
155 | 156 | then { | |
156 | - | let | |
157 | + | let A = { | |
157 | 158 | let h = getString(a, "admin_list") | |
158 | 159 | if ($isInstanceOf(h, "Unit")) | |
159 | 160 | then "unset" | |
164 | 165 | } | |
165 | 166 | else throw("Match error") | |
166 | 167 | } | |
167 | - | func | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | $Tuple2(( | |
168 | + | func B (C,D) = { | |
169 | + | let E = C | |
170 | + | let F = E._1 | |
171 | + | let G = E._2 | |
172 | + | $Tuple2((F :+ IntegerEntry(x[G], D)), (G + 1)) | |
172 | 173 | } | |
173 | 174 | ||
174 | - | let | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | func | |
179 | - | then | |
180 | - | else | |
175 | + | let H = { | |
176 | + | let I = y | |
177 | + | let J = size(I) | |
178 | + | let K = $Tuple2(nil, 0) | |
179 | + | func L (M,N) = if ((N >= J)) | |
180 | + | then M | |
181 | + | else B(M, I[N]) | |
181 | 182 | ||
182 | - | func | |
183 | - | then | |
183 | + | func O (M,N) = if ((N >= J)) | |
184 | + | then M | |
184 | 185 | else throw("List size exceeds 100") | |
185 | 186 | ||
186 | - | | |
187 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
187 | 188 | } | |
188 | - | let | |
189 | - | if (( | |
189 | + | let P = toString(c.caller) | |
190 | + | if ((A != "unset")) | |
190 | 191 | then { | |
191 | - | let | |
192 | - | let | |
193 | - | let h = | |
192 | + | let Q = getString(addressFromStringValue(A), P) | |
193 | + | let R = { | |
194 | + | let h = Q | |
194 | 195 | if ($isInstanceOf(h, "String")) | |
195 | 196 | then { | |
196 | 197 | let k = h | |
200 | 201 | then "no admin" | |
201 | 202 | else throw("Match error") | |
202 | 203 | } | |
203 | - | func | |
204 | - | let | |
205 | - | StringEntry( | |
204 | + | func S (T) = { | |
205 | + | let U = split(T, "|") | |
206 | + | StringEntry(U[0], U[1]) | |
206 | 207 | } | |
207 | 208 | ||
208 | - | if (( | |
209 | - | then | |
210 | - | else throw((((((("You not admin: " + | |
209 | + | if ((R != "no admin")) | |
210 | + | then H | |
211 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
211 | 212 | } | |
212 | 213 | else throw("Unset admin list") | |
213 | 214 | } | |
217 | 218 | ||
218 | 219 | ||
219 | 220 | @Callable(c) | |
220 | - | func setOption ( | |
221 | - | let | |
221 | + | func setOption (V,W) = { | |
222 | + | let A = { | |
222 | 223 | let h = getString(a, "admin_list") | |
223 | 224 | if ($isInstanceOf(h, "Unit")) | |
224 | 225 | then "unset" | |
229 | 230 | } | |
230 | 231 | else throw("Match error") | |
231 | 232 | } | |
232 | - | let | |
233 | - | if (( | |
233 | + | let P = toString(c.caller) | |
234 | + | if ((A != "unset")) | |
234 | 235 | then { | |
235 | - | let | |
236 | - | let | |
237 | - | let h = | |
236 | + | let Q = getString(addressFromStringValue(A), P) | |
237 | + | let R = { | |
238 | + | let h = Q | |
238 | 239 | if ($isInstanceOf(h, "String")) | |
239 | 240 | then { | |
240 | 241 | let k = h | |
244 | 245 | then "no admin" | |
245 | 246 | else throw("Match error") | |
246 | 247 | } | |
247 | - | if (( | |
248 | - | then $Tuple2([StringEntry( | |
249 | - | else throw((((((("You not admin: " + | |
248 | + | if ((R != "no admin")) | |
249 | + | then $Tuple2([StringEntry(V, W)], unit) | |
250 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
250 | 251 | } | |
251 | 252 | else throw("Unset admin list") | |
252 | 253 | } | |
254 | 255 | ||
255 | 256 | ||
256 | 257 | @Callable(c) | |
257 | - | func delOption ( | |
258 | - | let | |
258 | + | func delOption (V) = { | |
259 | + | let A = { | |
259 | 260 | let h = getString(a, "admin_list") | |
260 | 261 | if ($isInstanceOf(h, "Unit")) | |
261 | 262 | then "unset" | |
266 | 267 | } | |
267 | 268 | else throw("Match error") | |
268 | 269 | } | |
269 | - | let | |
270 | - | if (( | |
270 | + | let P = toString(c.caller) | |
271 | + | if ((A != "unset")) | |
271 | 272 | then { | |
272 | - | let | |
273 | - | let | |
274 | - | let h = | |
273 | + | let Q = getString(addressFromStringValue(A), P) | |
274 | + | let R = { | |
275 | + | let h = Q | |
275 | 276 | if ($isInstanceOf(h, "String")) | |
276 | 277 | then { | |
277 | 278 | let k = h | |
281 | 282 | then "no admin" | |
282 | 283 | else throw("Match error") | |
283 | 284 | } | |
284 | - | if (( | |
285 | - | then $Tuple2([DeleteEntry( | |
286 | - | else throw((((((("You not admin: " + | |
285 | + | if ((R != "no admin")) | |
286 | + | then $Tuple2([DeleteEntry(V)], unit) | |
287 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
287 | 288 | } | |
288 | 289 | else throw("Unset admin list") | |
289 | 290 | } | |
290 | 291 | ||
291 | 292 | ||
292 | - | @Verifier( | |
293 | - | func | |
293 | + | @Verifier(X) | |
294 | + | func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey) | |
294 | 295 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6') | |
5 | 5 | ||
6 | 6 | let b = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85' | |
7 | 7 | ||
8 | 8 | @Callable(c) | |
9 | 9 | func issueBill (d,e) = { | |
10 | 10 | let f = toBase58String(c.caller.bytes) | |
11 | 11 | let g = { | |
12 | 12 | let h = getInteger(this, f) | |
13 | 13 | if ($isInstanceOf(h, "Int")) | |
14 | 14 | then { | |
15 | 15 | let i = h | |
16 | 16 | i | |
17 | 17 | } | |
18 | 18 | else 0 | |
19 | 19 | } | |
20 | 20 | let j = { | |
21 | 21 | let h = getString(a, "min_bill_deposit") | |
22 | 22 | if ($isInstanceOf(h, "Unit")) | |
23 | 23 | then "0" | |
24 | 24 | else if ($isInstanceOf(h, "String")) | |
25 | 25 | then { | |
26 | 26 | let k = h | |
27 | 27 | k | |
28 | 28 | } | |
29 | 29 | else throw("Match error") | |
30 | 30 | } | |
31 | 31 | let l = { | |
32 | 32 | let h = getString(a, "exchange_rate") | |
33 | 33 | if ($isInstanceOf(h, "Unit")) | |
34 | 34 | then "0" | |
35 | 35 | else if ($isInstanceOf(h, "String")) | |
36 | 36 | then { | |
37 | 37 | let k = h | |
38 | 38 | k | |
39 | 39 | } | |
40 | 40 | else throw("Match error") | |
41 | 41 | } | |
42 | 42 | let m = { | |
43 | 43 | let h = parseInt(split(j, ".")[0]) | |
44 | 44 | if ($isInstanceOf(h, "Unit")) | |
45 | 45 | then 0 | |
46 | 46 | else if ($isInstanceOf(h, "Int")) | |
47 | 47 | then { | |
48 | 48 | let n = h | |
49 | 49 | n | |
50 | 50 | } | |
51 | 51 | else throw("Match error") | |
52 | 52 | } | |
53 | 53 | let o = { | |
54 | 54 | let h = parseInt(split(l, ".")[0]) | |
55 | 55 | if ($isInstanceOf(h, "Unit")) | |
56 | 56 | then 0 | |
57 | 57 | else if ($isInstanceOf(h, "Int")) | |
58 | 58 | then { | |
59 | 59 | let n = h | |
60 | 60 | n | |
61 | 61 | } | |
62 | 62 | else throw("Match error") | |
63 | 63 | } | |
64 | - | let p = (g - d) | |
64 | + | let p = (g * o) | |
65 | + | let q = (g - d) | |
65 | 66 | if (((m * 100) > d)) | |
66 | 67 | then throw((((("The security deposit must be more than " + j) + ". You set the size: ") + toString((d / 100))) + ".00")) | |
67 | - | else if ((0 > | |
68 | + | else if ((0 > q)) | |
68 | 69 | then throw("Not enough balance") | |
69 | - | else if ((e > | |
70 | - | then throw((("The nominal value of the promissory bill exceeds the collateral minimum (" + j) + ")")) | |
70 | + | else if ((e > p)) | |
71 | + | then throw((((("The nominal value of the promissory bill exceeds the collateral minimum" + toString(p)) + "₽ (") + j) + "tUSD)")) | |
71 | 72 | else { | |
72 | - | let | |
73 | - | let | |
74 | - | $Tuple2([IntegerEntry(f, | |
73 | + | let r = Issue(("bill for:" + toString((d / 100))), ((f + ":") + toString(e)), 1, 0, false) | |
74 | + | let s = calculateAssetId(r) | |
75 | + | $Tuple2([IntegerEntry(f, q), r, ScriptTransfer(c.caller, 1, s), IntegerEntry(("l_u_" + toBase58String(s)), d)], unit) | |
75 | 76 | } | |
76 | 77 | } | |
77 | 78 | ||
78 | 79 | ||
79 | 80 | ||
80 | 81 | @Callable(c) | |
81 | 82 | func deposit () = if ((size(c.payments) == 0)) | |
82 | 83 | then throw("Payment not attached") | |
83 | 84 | else { | |
84 | - | let | |
85 | - | let | |
85 | + | let t = value(c.payments)[0] | |
86 | + | let u = { | |
86 | 87 | let h = getString(a, "min_deposit") | |
87 | 88 | if ($isInstanceOf(h, "Unit")) | |
88 | 89 | then "0" | |
89 | 90 | else if ($isInstanceOf(h, "String")) | |
90 | 91 | then { | |
91 | 92 | let k = h | |
92 | 93 | k | |
93 | 94 | } | |
94 | 95 | else throw("Match error") | |
95 | 96 | } | |
96 | - | let | |
97 | - | let h = parseInt(split( | |
97 | + | let v = { | |
98 | + | let h = parseInt(split(u, ".")[0]) | |
98 | 99 | if ($isInstanceOf(h, "Unit")) | |
99 | 100 | then 0 | |
100 | 101 | else if ($isInstanceOf(h, "Int")) | |
101 | 102 | then { | |
102 | 103 | let n = h | |
103 | 104 | n | |
104 | 105 | } | |
105 | 106 | else throw("Match error") | |
106 | 107 | } | |
107 | - | if (( | |
108 | + | if ((t.assetId != b)) | |
108 | 109 | then throw("holded payment not tUSD") | |
109 | - | else if ((( | |
110 | - | then throw((((("You have set the deposit amount to " + toString(( | |
110 | + | else if (((v * 100) > t.amount)) | |
111 | + | then throw((((("You have set the deposit amount to " + toString((t.amount / 100))) + ".00, which is less than the minimum (") + u) + ")")) | |
111 | 112 | else { | |
112 | 113 | let f = toBase58String(c.caller.bytes) | |
113 | 114 | let g = { | |
114 | 115 | let h = getInteger(this, f) | |
115 | 116 | if ($isInstanceOf(h, "Int")) | |
116 | 117 | then { | |
117 | 118 | let i = h | |
118 | 119 | i | |
119 | 120 | } | |
120 | 121 | else 0 | |
121 | 122 | } | |
122 | - | let | |
123 | - | [IntegerEntry(f, | |
123 | + | let q = (g + t.amount) | |
124 | + | [IntegerEntry(f, q)] | |
124 | 125 | } | |
125 | 126 | } | |
126 | 127 | ||
127 | 128 | ||
128 | 129 | ||
129 | 130 | @Callable(c) | |
130 | - | func withdraw ( | |
131 | + | func withdraw (w) = { | |
131 | 132 | let f = toBase58String(c.caller.bytes) | |
132 | 133 | let g = { | |
133 | 134 | let h = getInteger(this, f) | |
134 | 135 | if ($isInstanceOf(h, "Int")) | |
135 | 136 | then { | |
136 | 137 | let i = h | |
137 | 138 | i | |
138 | 139 | } | |
139 | 140 | else 0 | |
140 | 141 | } | |
141 | - | let | |
142 | - | if ((0 > | |
142 | + | let q = (g - w) | |
143 | + | if ((0 > w)) | |
143 | 144 | then throw("Can't withdraw negative amount") | |
144 | - | else if ((0 > | |
145 | + | else if ((0 > q)) | |
145 | 146 | then throw("Not enough balance") | |
146 | - | else $Tuple2([IntegerEntry(f, | |
147 | + | else $Tuple2([IntegerEntry(f, q), ScriptTransfer(c.caller, w, b)], unit) | |
147 | 148 | } | |
148 | 149 | ||
149 | 150 | ||
150 | 151 | ||
151 | 152 | @Callable(c) | |
152 | - | func setOptions ( | |
153 | - | let | |
154 | - | if ((100 >= | |
153 | + | func setOptions (x,y) = { | |
154 | + | let z = size(x) | |
155 | + | if ((100 >= z)) | |
155 | 156 | then { | |
156 | - | let | |
157 | + | let A = { | |
157 | 158 | let h = getString(a, "admin_list") | |
158 | 159 | if ($isInstanceOf(h, "Unit")) | |
159 | 160 | then "unset" | |
160 | 161 | else if ($isInstanceOf(h, "String")) | |
161 | 162 | then { | |
162 | 163 | let k = h | |
163 | 164 | k | |
164 | 165 | } | |
165 | 166 | else throw("Match error") | |
166 | 167 | } | |
167 | - | func | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | $Tuple2(( | |
168 | + | func B (C,D) = { | |
169 | + | let E = C | |
170 | + | let F = E._1 | |
171 | + | let G = E._2 | |
172 | + | $Tuple2((F :+ IntegerEntry(x[G], D)), (G + 1)) | |
172 | 173 | } | |
173 | 174 | ||
174 | - | let | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | func | |
179 | - | then | |
180 | - | else | |
175 | + | let H = { | |
176 | + | let I = y | |
177 | + | let J = size(I) | |
178 | + | let K = $Tuple2(nil, 0) | |
179 | + | func L (M,N) = if ((N >= J)) | |
180 | + | then M | |
181 | + | else B(M, I[N]) | |
181 | 182 | ||
182 | - | func | |
183 | - | then | |
183 | + | func O (M,N) = if ((N >= J)) | |
184 | + | then M | |
184 | 185 | else throw("List size exceeds 100") | |
185 | 186 | ||
186 | - | | |
187 | + | O(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(L(K, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
187 | 188 | } | |
188 | - | let | |
189 | - | if (( | |
189 | + | let P = toString(c.caller) | |
190 | + | if ((A != "unset")) | |
190 | 191 | then { | |
191 | - | let | |
192 | - | let | |
193 | - | let h = | |
192 | + | let Q = getString(addressFromStringValue(A), P) | |
193 | + | let R = { | |
194 | + | let h = Q | |
194 | 195 | if ($isInstanceOf(h, "String")) | |
195 | 196 | then { | |
196 | 197 | let k = h | |
197 | 198 | k | |
198 | 199 | } | |
199 | 200 | else if ($isInstanceOf(h, "Unit")) | |
200 | 201 | then "no admin" | |
201 | 202 | else throw("Match error") | |
202 | 203 | } | |
203 | - | func | |
204 | - | let | |
205 | - | StringEntry( | |
204 | + | func S (T) = { | |
205 | + | let U = split(T, "|") | |
206 | + | StringEntry(U[0], U[1]) | |
206 | 207 | } | |
207 | 208 | ||
208 | - | if (( | |
209 | - | then | |
210 | - | else throw((((((("You not admin: " + | |
209 | + | if ((R != "no admin")) | |
210 | + | then H | |
211 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
211 | 212 | } | |
212 | 213 | else throw("Unset admin list") | |
213 | 214 | } | |
214 | 215 | else throw("The number of list elements must not exceed 100") | |
215 | 216 | } | |
216 | 217 | ||
217 | 218 | ||
218 | 219 | ||
219 | 220 | @Callable(c) | |
220 | - | func setOption ( | |
221 | - | let | |
221 | + | func setOption (V,W) = { | |
222 | + | let A = { | |
222 | 223 | let h = getString(a, "admin_list") | |
223 | 224 | if ($isInstanceOf(h, "Unit")) | |
224 | 225 | then "unset" | |
225 | 226 | else if ($isInstanceOf(h, "String")) | |
226 | 227 | then { | |
227 | 228 | let k = h | |
228 | 229 | k | |
229 | 230 | } | |
230 | 231 | else throw("Match error") | |
231 | 232 | } | |
232 | - | let | |
233 | - | if (( | |
233 | + | let P = toString(c.caller) | |
234 | + | if ((A != "unset")) | |
234 | 235 | then { | |
235 | - | let | |
236 | - | let | |
237 | - | let h = | |
236 | + | let Q = getString(addressFromStringValue(A), P) | |
237 | + | let R = { | |
238 | + | let h = Q | |
238 | 239 | if ($isInstanceOf(h, "String")) | |
239 | 240 | then { | |
240 | 241 | let k = h | |
241 | 242 | k | |
242 | 243 | } | |
243 | 244 | else if ($isInstanceOf(h, "Unit")) | |
244 | 245 | then "no admin" | |
245 | 246 | else throw("Match error") | |
246 | 247 | } | |
247 | - | if (( | |
248 | - | then $Tuple2([StringEntry( | |
249 | - | else throw((((((("You not admin: " + | |
248 | + | if ((R != "no admin")) | |
249 | + | then $Tuple2([StringEntry(V, W)], unit) | |
250 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
250 | 251 | } | |
251 | 252 | else throw("Unset admin list") | |
252 | 253 | } | |
253 | 254 | ||
254 | 255 | ||
255 | 256 | ||
256 | 257 | @Callable(c) | |
257 | - | func delOption ( | |
258 | - | let | |
258 | + | func delOption (V) = { | |
259 | + | let A = { | |
259 | 260 | let h = getString(a, "admin_list") | |
260 | 261 | if ($isInstanceOf(h, "Unit")) | |
261 | 262 | then "unset" | |
262 | 263 | else if ($isInstanceOf(h, "String")) | |
263 | 264 | then { | |
264 | 265 | let k = h | |
265 | 266 | k | |
266 | 267 | } | |
267 | 268 | else throw("Match error") | |
268 | 269 | } | |
269 | - | let | |
270 | - | if (( | |
270 | + | let P = toString(c.caller) | |
271 | + | if ((A != "unset")) | |
271 | 272 | then { | |
272 | - | let | |
273 | - | let | |
274 | - | let h = | |
273 | + | let Q = getString(addressFromStringValue(A), P) | |
274 | + | let R = { | |
275 | + | let h = Q | |
275 | 276 | if ($isInstanceOf(h, "String")) | |
276 | 277 | then { | |
277 | 278 | let k = h | |
278 | 279 | k | |
279 | 280 | } | |
280 | 281 | else if ($isInstanceOf(h, "Unit")) | |
281 | 282 | then "no admin" | |
282 | 283 | else throw("Match error") | |
283 | 284 | } | |
284 | - | if (( | |
285 | - | then $Tuple2([DeleteEntry( | |
286 | - | else throw((((((("You not admin: " + | |
285 | + | if ((R != "no admin")) | |
286 | + | then $Tuple2([DeleteEntry(V)], unit) | |
287 | + | else throw((((((("You not admin: " + A) + ", isAdmin: ") + R) + ", callerAddressStr: ") + P) + ", ")) | |
287 | 288 | } | |
288 | 289 | else throw("Unset admin list") | |
289 | 290 | } | |
290 | 291 | ||
291 | 292 | ||
292 | - | @Verifier( | |
293 | - | func | |
293 | + | @Verifier(X) | |
294 | + | func Y () = sigVerify(X.bodyBytes, X.proofs[0], X.senderPublicKey) | |
294 | 295 |
github/deemru/w8io/169f3d6 95.42 ms ◑