tx · 9wWnRUe4hJ9Q2Q4HuC4Kg7efGpPsfjQuZYk6S6ES2RZ3 3N1TdY92brvvrQyVdkpHNK2aRbAsx9dYUKc: -0.01000000 Waves 2022.05.23 09:43 [2063987] smart account 3N1TdY92brvvrQyVdkpHNK2aRbAsx9dYUKc > SELF 0.00000000 Waves
{ "type": 13, "id": "9wWnRUe4hJ9Q2Q4HuC4Kg7efGpPsfjQuZYk6S6ES2RZ3", "fee": 1000000, "feeAssetId": null, "timestamp": 1653288221828, "version": 2, "chainId": 84, "sender": "3N1TdY92brvvrQyVdkpHNK2aRbAsx9dYUKc", "senderPublicKey": "3N3TSucEwKCeSJy32W5m6LB2taq7FG7aQ7XxiXvJGdCk", "proofs": [ "4XFyskgVQAJAWtiAp91BUw2uBLppgMn2M9eQsQrnJVJZFZorWQpAg45mcei59Qepecs3qMLCp3YY4V7BnuJfrMok" ], "script": "base64:AAIFAAAAAAAAACwIAhIGCgQCAgICEggKBgICAQICAhIHCgUCAgECAhIDCgECEgMKAQISAwoBAgAAABUAAAAAEGtleUxvY2tSZWNpcGllbnQCAAAAA19scgAAAAANa2V5TG9ja0Ftb3VudAIAAAADX2xhAAAAABJrZXlMb2NrRGVzdGluYXRpb24CAAAAA19sZAAAAAASa2V5TG9ja0Fzc2V0U291cmNlAgAAAARfbGFzAAAAAAprZXlWZXJzaW9uAgAAAAJfdgAAAAAJa2V5QnJpZGdlAgAAAAJfYgAAAAAJa2V5T3JhY2xlAgAAAAJfbwAAAAAIa2V5QWRtaW4CAAAAAl9hAAAAAAlrZXlVbmxvY2sCAAAAAl91AAAAAA9lcnJVbmF1dGhvcml6ZWQCAAAADHVuYXV0aG9yaXplZAAAAAAQZXJyVW5pbml0aWFsaXplZAIAAAANdW5pbml0aWFsaXplZAAAAAATZXJySW52YWxpZFNpZ25hdHVyZQIAAAARaW52YWxpZCBzaWduYXR1cmUAAAAAEWVyckFscmVhZHlDbGFpbWVkAgAAAAdjbGFpbWVkAAAAABBlcnJBbHJlYW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ZQUAAAAJbmV3QnJpZGdlBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAJlbLbE=", "height": 2063987, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2xBXLq3BhTVoBWxSLd7zx4FvsjeQumZ4kgJFyTa5824w Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = "_ | |
4 | + | let a = "_lr" | |
5 | 5 | ||
6 | - | let b = "_ | |
6 | + | let b = "_la" | |
7 | 7 | ||
8 | - | let c = "_ | |
8 | + | let c = "_ld" | |
9 | 9 | ||
10 | - | let d = "_ | |
10 | + | let d = "_las" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "_v" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "_b" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_o" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_a" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_u" | |
21 | 21 | ||
22 | - | let j = " | |
22 | + | let j = "unauthorized" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "uninitialized" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "invalid signature" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "claimed" | |
29 | 29 | ||
30 | - | let n = " | |
30 | + | let n = "locked" | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = "invalid lockId" | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = "V0FWRQ==" | |
35 | 35 | ||
36 | - | let q = base58'3EMsPJ' | |
37 | - | ||
38 | - | let r = 10000 | |
39 | - | ||
40 | - | let s = 9 | |
41 | - | ||
42 | - | let t = "unauthorized" | |
43 | - | ||
44 | - | let u = "uninitialized" | |
45 | - | ||
46 | - | let v = "initialized" | |
47 | - | ||
48 | - | let w = "exists" | |
49 | - | ||
50 | - | let x = "not exists" | |
51 | - | ||
52 | - | let y = "invalid values" | |
53 | - | ||
54 | - | let z = "not one payment" | |
55 | - | ||
56 | - | let A = "asset not found" | |
57 | - | ||
58 | - | let B = "not enough balance" | |
59 | - | ||
60 | - | let C = "pow value too big" | |
61 | - | ||
62 | - | let D = "bridge is disabled" | |
63 | - | ||
64 | - | let E = "asset is disabled" | |
65 | - | ||
66 | - | let F = "wrong destination chain" | |
67 | - | ||
68 | - | let G = 0 | |
69 | - | ||
70 | - | let H = 1 | |
71 | - | ||
72 | - | let I = 2 | |
73 | - | ||
74 | - | func J (K,L) = { | |
75 | - | let M = getBinary((L + k)) | |
76 | - | if ($isInstanceOf(M, "ByteVector")) | |
36 | + | func q (r,s) = { | |
37 | + | let t = getBinary(s) | |
38 | + | if ($isInstanceOf(t, "ByteVector")) | |
77 | 39 | then { | |
78 | - | let | |
79 | - | if (( | |
80 | - | then throw( | |
40 | + | let u = t | |
41 | + | if ((u != r.caller.bytes)) | |
42 | + | then throw(j) | |
81 | 43 | else unit | |
82 | 44 | } | |
83 | - | else throw( | |
45 | + | else throw(k) | |
84 | 46 | } | |
85 | 47 | ||
86 | 48 | ||
87 | - | func O () = if (!(valueOrElse(getBoolean(j), false))) | |
88 | - | then throw(D) | |
89 | - | else unit | |
49 | + | func v (r) = q(r, f) | |
90 | 50 | ||
91 | 51 | ||
92 | - | func | |
93 | - | ||
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | ||
98 | - | ||
99 | - | ||
100 | - | | |
101 | - | else | |
52 | + | func w (r) = q(r, h) | |
53 | + | ||
54 | + | ||
55 | + | func x (y) = { | |
56 | + | let z = valueOrErrorMessage(getBinary(e), k) | |
57 | + | if (if ((size(y) != 16)) | |
58 | + | then true | |
59 | + | else (take(y, 1) != z)) | |
60 | + | then throw(o) | |
61 | + | else unit | |
102 | 62 | } | |
103 | 63 | ||
104 | 64 | ||
105 | - | func S (T,Q) = { | |
106 | - | let U = valueOrErrorMessage(getInteger(f), u) | |
107 | - | let V = valueOrErrorMessage(getInteger((Q + d)), A) | |
108 | - | let W = ((T * U) / r) | |
109 | - | if ((V > W)) | |
110 | - | then V | |
111 | - | else W | |
65 | + | func A (B) = { | |
66 | + | let t = getBinary(B) | |
67 | + | if ($isInstanceOf(t, "ByteVector")) | |
68 | + | then { | |
69 | + | let C = t | |
70 | + | throw(n) | |
71 | + | } | |
72 | + | else unit | |
112 | 73 | } | |
113 | 74 | ||
114 | 75 | ||
115 | - | func X (Y,Z) = { | |
116 | - | let aa = if ((0 > Z)) | |
117 | - | then -(Z) | |
118 | - | else Z | |
119 | - | let ab = if ((aa == 0)) | |
120 | - | then 1 | |
121 | - | else if ((aa == 1)) | |
122 | - | then 10 | |
123 | - | else if ((aa == 2)) | |
124 | - | then 100 | |
125 | - | else if ((aa == 3)) | |
126 | - | then 1000 | |
127 | - | else if ((aa == 4)) | |
128 | - | then 10000 | |
129 | - | else if ((aa == 5)) | |
130 | - | then 100000 | |
131 | - | else if ((aa == 6)) | |
132 | - | then 1000000 | |
133 | - | else if ((aa == 7)) | |
134 | - | then 10000000 | |
135 | - | else if ((aa == 8)) | |
136 | - | then 100000000 | |
137 | - | else if ((aa == 9)) | |
138 | - | then 1000000000 | |
139 | - | else throw(C) | |
140 | - | if ((0 > Z)) | |
141 | - | then (Y / ab) | |
142 | - | else (Y * ab) | |
143 | - | } | |
144 | - | ||
145 | - | ||
146 | - | func ac (T,ad) = X(T, (s - ad)) | |
147 | - | ||
148 | - | ||
149 | - | func ae (T,ad) = X(T, (ad - s)) | |
150 | - | ||
151 | - | ||
152 | - | @Callable(K) | |
153 | - | func init (af,ag,ah,ai,U) = if (isDefined(getBinary((l + k)))) | |
154 | - | then throw(v) | |
155 | - | else [BinaryEntry((l + k), af), BinaryEntry(g, ag), BinaryEntry(h, ah), BinaryEntry(i, ai), IntegerEntry(f, U), BooleanEntry(j, true)] | |
76 | + | @Callable(r) | |
77 | + | func init (D,z,E,F) = if (isDefined(getBinary(h))) | |
78 | + | then throw(j) | |
79 | + | else [BinaryEntry(e, z), BinaryEntry(f, E), BinaryEntry(g, F), BinaryEntry(h, D)] | |
156 | 80 | ||
157 | 81 | ||
158 | 82 | ||
159 | - | @Callable( | |
160 | - | func | |
161 | - | let | |
162 | - | if (( | |
83 | + | @Callable(r) | |
84 | + | func createUnlock (y,G,H,I,J,K) = { | |
85 | + | let L = x(y) | |
86 | + | if ((L == L)) | |
163 | 87 | then { | |
164 | - | let am = if ((ak == p)) | |
165 | - | then if ((aj != o)) | |
166 | - | then throw(y) | |
167 | - | else $Tuple2(G, 8) | |
168 | - | else { | |
169 | - | let an = valueOrErrorMessage(assetInfo(ak), A) | |
170 | - | let ao = if ((an.issuer == this)) | |
171 | - | then I | |
172 | - | else H | |
173 | - | $Tuple2(ao, an.decimals) | |
174 | - | } | |
175 | - | let ao = am._1 | |
176 | - | let ad = am._2 | |
177 | - | let Q = toBase64String(ak) | |
178 | - | let ap = (toBase64String(aj) + a) | |
179 | - | let aq = (Q + a) | |
180 | - | if (if (isDefined(getBinary(ap))) | |
181 | - | then true | |
182 | - | else isDefined(getBinary(aq))) | |
183 | - | then throw(w) | |
184 | - | else [BinaryEntry(ap, ak), BinaryEntry(aq, aj), IntegerEntry((Q + b), ao), IntegerEntry((Q + c), ad), IntegerEntry((Q + d), V), BooleanEntry((Q + e), true)] | |
185 | - | } | |
186 | - | else throw("Strict value is not equal to itself.") | |
187 | - | } | |
188 | - | ||
189 | - | ||
190 | - | ||
191 | - | @Callable(K) | |
192 | - | func issue (ar,as,ad) = { | |
193 | - | let al = J(K, m) | |
194 | - | if ((al == al)) | |
195 | - | then [Issue(ar, as, 0, ad, true)] | |
196 | - | else throw("Strict value is not equal to itself.") | |
197 | - | } | |
198 | - | ||
199 | - | ||
200 | - | ||
201 | - | @Callable(K) | |
202 | - | func removeAsset (aj,at) = { | |
203 | - | let al = J(K, m) | |
204 | - | if ((al == al)) | |
205 | - | then { | |
206 | - | let ap = (toBase64String(aj) + a) | |
207 | - | let ak = valueOrErrorMessage(getBinary(ap), x) | |
208 | - | let Q = toBase64String(ak) | |
209 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), x) | |
210 | - | let au = if ((ao == G)) | |
88 | + | let M = v(r) | |
89 | + | if ((M == M)) | |
211 | 90 | then { | |
212 | - | let av = wavesBalance(this) | |
213 | - | if ((av.available > 0)) | |
214 | - | then [ScriptTransfer(Address(at), av.available, unit)] | |
215 | - | else nil | |
216 | - | } | |
217 | - | else if ((ao == H)) | |
218 | - | then { | |
219 | - | let av = assetBalance(this, ak) | |
220 | - | if ((av > 0)) | |
221 | - | then [ScriptTransfer(Address(at), av, ak)] | |
222 | - | else nil | |
223 | - | } | |
224 | - | else if ((ao == I)) | |
225 | - | then nil | |
226 | - | else throw(y) | |
227 | - | (au ++ [DeleteEntry(ap), DeleteEntry((Q + a)), DeleteEntry((Q + b)), DeleteEntry((Q + c)), DeleteEntry((Q + d)), DeleteEntry((Q + e))]) | |
228 | - | } | |
229 | - | else throw("Strict value is not equal to itself.") | |
230 | - | } | |
231 | - | ||
232 | - | ||
233 | - | ||
234 | - | @Callable(K) | |
235 | - | func lock (aw,ax,ay) = { | |
236 | - | let az = O() | |
237 | - | if ((az == az)) | |
238 | - | then if ((ay == q)) | |
239 | - | then throw(F) | |
240 | - | else if ((size(K.payments) != 1)) | |
241 | - | then throw(z) | |
242 | - | else { | |
243 | - | let ak = valueOrElse(K.payments[0].assetId, p) | |
244 | - | let Q = toBase64String(ak) | |
245 | - | let aA = P(Q) | |
246 | - | if ((aA == aA)) | |
247 | - | then { | |
248 | - | let T = K.payments[0].amount | |
249 | - | let ag = valueOrErrorMessage(getBinary(g), u) | |
250 | - | let W = S(T, Q) | |
251 | - | let aB = (T - W) | |
252 | - | if ((0 >= aB)) | |
253 | - | then throw(B) | |
254 | - | else { | |
255 | - | let aj = valueOrErrorMessage(getBinary((Q + a)), A) | |
256 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), A) | |
257 | - | let ad = valueOrErrorMessage(getInteger((Q + c)), A) | |
258 | - | let ah = valueOrErrorMessage(getBinary(h), u) | |
259 | - | let aC = invoke(Address(ag), "createLock", [aw, ax, ac(aB, ad), ay, aj], nil) | |
260 | - | if ((aC == aC)) | |
261 | - | then if ((ao == G)) | |
262 | - | then [ScriptTransfer(Address(ah), W, unit)] | |
263 | - | else if ((ao == H)) | |
264 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
265 | - | else if ((ao == I)) | |
266 | - | then [Burn(ak, aB), ScriptTransfer(Address(ah), W, ak)] | |
267 | - | else throw(y) | |
268 | - | else throw("Strict value is not equal to itself.") | |
269 | - | } | |
270 | - | } | |
271 | - | else throw("Strict value is not equal to itself.") | |
272 | - | } | |
273 | - | else throw("Strict value is not equal to itself.") | |
274 | - | } | |
275 | - | ||
276 | - | ||
277 | - | ||
278 | - | @Callable(K) | |
279 | - | func unlock (aw,ax,T,aD,aj,aE) = { | |
280 | - | let az = O() | |
281 | - | if ((az == az)) | |
282 | - | then { | |
283 | - | let ak = valueOrErrorMessage(getBinary((toBase64String(aj) + a)), A) | |
284 | - | let Q = toBase64String(ak) | |
285 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), A) | |
286 | - | let ad = valueOrErrorMessage(getInteger((Q + c)), A) | |
287 | - | let ag = valueOrErrorMessage(getBinary(g), u) | |
288 | - | let ai = valueOrErrorMessage(getBinary(i), u) | |
289 | - | let ah = valueOrErrorMessage(getBinary(h), u) | |
290 | - | let aF = invoke(Address(ag), "createUnlock", [aw, ax, T, aD, aj, aE], nil) | |
291 | - | if ((aF == aF)) | |
292 | - | then { | |
293 | - | let aG = { | |
294 | - | let M = aF | |
295 | - | if ($isInstanceOf(M, "Boolean")) | |
296 | - | then { | |
297 | - | let aH = M | |
298 | - | aH | |
299 | - | } | |
300 | - | else false | |
301 | - | } | |
302 | - | if (!(aG)) | |
303 | - | then throw(y) | |
91 | + | let N = toBase64String(y) | |
92 | + | let O = toBase64String(I) | |
93 | + | let P = (((O + "_") + N) + i) | |
94 | + | if (isDefined(getBoolean(P))) | |
95 | + | then throw(m) | |
304 | 96 | else { | |
305 | - | let W = if ((ai == K.caller.bytes)) | |
306 | - | then valueOrErrorMessage(getInteger((Q + d)), A) | |
307 | - | else 0 | |
308 | - | let aI = ae(T, ad) | |
309 | - | let aJ = (aI - W) | |
310 | - | if ((0 >= aJ)) | |
311 | - | then throw(B) | |
312 | - | else if ((ao == G)) | |
313 | - | then ([ScriptTransfer(Address(ax), aJ, unit)] ++ (if ((W > 0)) | |
314 | - | then [ScriptTransfer(Address(ah), W, unit)] | |
315 | - | else nil)) | |
316 | - | else if ((ao == H)) | |
317 | - | then ([ScriptTransfer(Address(ax), aJ, ak)] ++ (if ((W > 0)) | |
318 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
319 | - | else nil)) | |
320 | - | else if ((ao == I)) | |
321 | - | then ([Reissue(ak, aI, true), ScriptTransfer(Address(ax), aJ, ak)] ++ (if ((W > 0)) | |
322 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
323 | - | else nil)) | |
324 | - | else throw(y) | |
97 | + | let Q = makeString([N, toBase64String(G), toString(H), O, toBase64String(J), p], "_") | |
98 | + | let R = keccak256(toBytes(Q)) | |
99 | + | let S = ecrecover(R, K) | |
100 | + | if ((S != getBinaryValue(g))) | |
101 | + | then throw(l) | |
102 | + | else $Tuple2([BooleanEntry(P, true)], true) | |
325 | 103 | } | |
326 | 104 | } | |
327 | 105 | else throw("Strict value is not equal to itself.") | |
331 | 109 | ||
332 | 110 | ||
333 | 111 | ||
334 | - | @Callable(K) | |
335 | - | func setManager (L,aK) = { | |
336 | - | let al = J(K, l) | |
337 | - | if ((al == al)) | |
338 | - | then [BinaryEntry((L + k), aK)] | |
339 | - | else throw("Strict value is not equal to itself.") | |
340 | - | } | |
341 | - | ||
342 | - | ||
343 | - | ||
344 | - | @Callable(K) | |
345 | - | func setFeeCollector (ah) = { | |
346 | - | let al = J(K, l) | |
347 | - | if ((al == al)) | |
348 | - | then [BinaryEntry(h, ah)] | |
349 | - | else throw("Strict value is not equal to itself.") | |
350 | - | } | |
351 | - | ||
352 | - | ||
353 | - | ||
354 | - | @Callable(K) | |
355 | - | func setValidator (aL) = { | |
356 | - | let al = J(K, l) | |
357 | - | if ((al == al)) | |
358 | - | then [BinaryEntry(g, aL)] | |
359 | - | else throw("Strict value is not equal to itself.") | |
360 | - | } | |
361 | - | ||
362 | - | ||
363 | - | ||
364 | - | @Callable(K) | |
365 | - | func startBridge () = { | |
366 | - | let al = J(K, l) | |
367 | - | if ((al == al)) | |
368 | - | then [BooleanEntry(j, true)] | |
369 | - | else throw("Strict value is not equal to itself.") | |
370 | - | } | |
371 | - | ||
372 | - | ||
373 | - | ||
374 | - | @Callable(K) | |
375 | - | func stopBridge () = { | |
376 | - | let al = J(K, n) | |
377 | - | if ((al == al)) | |
378 | - | then [BooleanEntry(j, false)] | |
379 | - | else throw("Strict value is not equal to itself.") | |
380 | - | } | |
381 | - | ||
382 | - | ||
383 | - | ||
384 | - | @Callable(K) | |
385 | - | func setMinFee (ak,V) = { | |
386 | - | let al = J(K, m) | |
387 | - | if ((al == al)) | |
112 | + | @Callable(r) | |
113 | + | func createLock (y,G,H,T,U) = { | |
114 | + | let N = toBase64String(y) | |
115 | + | let B = (N + a) | |
116 | + | let M = v(r) | |
117 | + | if ((M == M)) | |
388 | 118 | then { | |
389 | - | let Q = toBase64String(ak) | |
390 | - | [IntegerEntry((Q + d), V)] | |
119 | + | let L = x(y) | |
120 | + | if ((L == L)) | |
121 | + | then { | |
122 | + | let V = A(B) | |
123 | + | if ((V == V)) | |
124 | + | then [BinaryEntry((N + a), G), IntegerEntry((N + b), H), BinaryEntry((N + c), T), BinaryEntry((N + d), U)] | |
125 | + | else throw("Strict value is not equal to itself.") | |
126 | + | } | |
127 | + | else throw("Strict value is not equal to itself.") | |
391 | 128 | } | |
392 | 129 | else throw("Strict value is not equal to itself.") | |
393 | 130 | } | |
394 | 131 | ||
395 | 132 | ||
396 | 133 | ||
397 | - | @Callable( | |
398 | - | func | |
399 | - | let | |
400 | - | if (( | |
401 | - | then [ | |
134 | + | @Callable(r) | |
135 | + | func setAdmin (W) = { | |
136 | + | let M = w(r) | |
137 | + | if ((M == M)) | |
138 | + | then [BinaryEntry(h, W)] | |
402 | 139 | else throw("Strict value is not equal to itself.") | |
403 | 140 | } | |
404 | 141 | ||
405 | 142 | ||
406 | 143 | ||
407 | - | @Callable(K) | |
408 | - | func setAssetState (ak,aM) = { | |
409 | - | let al = J(K, m) | |
410 | - | if ((al == al)) | |
411 | - | then { | |
412 | - | let Q = toBase64String(ak) | |
413 | - | [BooleanEntry((Q + e), aM)] | |
414 | - | } | |
144 | + | @Callable(r) | |
145 | + | func setOracle (X) = { | |
146 | + | let M = w(r) | |
147 | + | if ((M == M)) | |
148 | + | then [BinaryEntry(g, X)] | |
149 | + | else throw("Strict value is not equal to itself.") | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | ||
154 | + | @Callable(r) | |
155 | + | func setBridge (Y) = { | |
156 | + | let M = w(r) | |
157 | + | if ((M == M)) | |
158 | + | then [BinaryEntry(f, Y)] | |
415 | 159 | else throw("Strict value is not equal to itself.") | |
416 | 160 | } | |
417 | 161 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = "_ | |
4 | + | let a = "_lr" | |
5 | 5 | ||
6 | - | let b = "_ | |
6 | + | let b = "_la" | |
7 | 7 | ||
8 | - | let c = "_ | |
8 | + | let c = "_ld" | |
9 | 9 | ||
10 | - | let d = "_ | |
10 | + | let d = "_las" | |
11 | 11 | ||
12 | - | let e = "_ | |
12 | + | let e = "_v" | |
13 | 13 | ||
14 | - | let f = "_ | |
14 | + | let f = "_b" | |
15 | 15 | ||
16 | - | let g = "_ | |
16 | + | let g = "_o" | |
17 | 17 | ||
18 | - | let h = "_ | |
18 | + | let h = "_a" | |
19 | 19 | ||
20 | - | let i = "_ | |
20 | + | let i = "_u" | |
21 | 21 | ||
22 | - | let j = " | |
22 | + | let j = "unauthorized" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "uninitialized" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "invalid signature" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "claimed" | |
29 | 29 | ||
30 | - | let n = " | |
30 | + | let n = "locked" | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = "invalid lockId" | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = "V0FWRQ==" | |
35 | 35 | ||
36 | - | let q = base58'3EMsPJ' | |
37 | - | ||
38 | - | let r = 10000 | |
39 | - | ||
40 | - | let s = 9 | |
41 | - | ||
42 | - | let t = "unauthorized" | |
43 | - | ||
44 | - | let u = "uninitialized" | |
45 | - | ||
46 | - | let v = "initialized" | |
47 | - | ||
48 | - | let w = "exists" | |
49 | - | ||
50 | - | let x = "not exists" | |
51 | - | ||
52 | - | let y = "invalid values" | |
53 | - | ||
54 | - | let z = "not one payment" | |
55 | - | ||
56 | - | let A = "asset not found" | |
57 | - | ||
58 | - | let B = "not enough balance" | |
59 | - | ||
60 | - | let C = "pow value too big" | |
61 | - | ||
62 | - | let D = "bridge is disabled" | |
63 | - | ||
64 | - | let E = "asset is disabled" | |
65 | - | ||
66 | - | let F = "wrong destination chain" | |
67 | - | ||
68 | - | let G = 0 | |
69 | - | ||
70 | - | let H = 1 | |
71 | - | ||
72 | - | let I = 2 | |
73 | - | ||
74 | - | func J (K,L) = { | |
75 | - | let M = getBinary((L + k)) | |
76 | - | if ($isInstanceOf(M, "ByteVector")) | |
36 | + | func q (r,s) = { | |
37 | + | let t = getBinary(s) | |
38 | + | if ($isInstanceOf(t, "ByteVector")) | |
77 | 39 | then { | |
78 | - | let | |
79 | - | if (( | |
80 | - | then throw( | |
40 | + | let u = t | |
41 | + | if ((u != r.caller.bytes)) | |
42 | + | then throw(j) | |
81 | 43 | else unit | |
82 | 44 | } | |
83 | - | else throw( | |
45 | + | else throw(k) | |
84 | 46 | } | |
85 | 47 | ||
86 | 48 | ||
87 | - | func O () = if (!(valueOrElse(getBoolean(j), false))) | |
88 | - | then throw(D) | |
89 | - | else unit | |
49 | + | func v (r) = q(r, f) | |
90 | 50 | ||
91 | 51 | ||
92 | - | func | |
93 | - | ||
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | ||
98 | - | ||
99 | - | ||
100 | - | | |
101 | - | else | |
52 | + | func w (r) = q(r, h) | |
53 | + | ||
54 | + | ||
55 | + | func x (y) = { | |
56 | + | let z = valueOrErrorMessage(getBinary(e), k) | |
57 | + | if (if ((size(y) != 16)) | |
58 | + | then true | |
59 | + | else (take(y, 1) != z)) | |
60 | + | then throw(o) | |
61 | + | else unit | |
102 | 62 | } | |
103 | 63 | ||
104 | 64 | ||
105 | - | func S (T,Q) = { | |
106 | - | let U = valueOrErrorMessage(getInteger(f), u) | |
107 | - | let V = valueOrErrorMessage(getInteger((Q + d)), A) | |
108 | - | let W = ((T * U) / r) | |
109 | - | if ((V > W)) | |
110 | - | then V | |
111 | - | else W | |
65 | + | func A (B) = { | |
66 | + | let t = getBinary(B) | |
67 | + | if ($isInstanceOf(t, "ByteVector")) | |
68 | + | then { | |
69 | + | let C = t | |
70 | + | throw(n) | |
71 | + | } | |
72 | + | else unit | |
112 | 73 | } | |
113 | 74 | ||
114 | 75 | ||
115 | - | func X (Y,Z) = { | |
116 | - | let aa = if ((0 > Z)) | |
117 | - | then -(Z) | |
118 | - | else Z | |
119 | - | let ab = if ((aa == 0)) | |
120 | - | then 1 | |
121 | - | else if ((aa == 1)) | |
122 | - | then 10 | |
123 | - | else if ((aa == 2)) | |
124 | - | then 100 | |
125 | - | else if ((aa == 3)) | |
126 | - | then 1000 | |
127 | - | else if ((aa == 4)) | |
128 | - | then 10000 | |
129 | - | else if ((aa == 5)) | |
130 | - | then 100000 | |
131 | - | else if ((aa == 6)) | |
132 | - | then 1000000 | |
133 | - | else if ((aa == 7)) | |
134 | - | then 10000000 | |
135 | - | else if ((aa == 8)) | |
136 | - | then 100000000 | |
137 | - | else if ((aa == 9)) | |
138 | - | then 1000000000 | |
139 | - | else throw(C) | |
140 | - | if ((0 > Z)) | |
141 | - | then (Y / ab) | |
142 | - | else (Y * ab) | |
143 | - | } | |
144 | - | ||
145 | - | ||
146 | - | func ac (T,ad) = X(T, (s - ad)) | |
147 | - | ||
148 | - | ||
149 | - | func ae (T,ad) = X(T, (ad - s)) | |
150 | - | ||
151 | - | ||
152 | - | @Callable(K) | |
153 | - | func init (af,ag,ah,ai,U) = if (isDefined(getBinary((l + k)))) | |
154 | - | then throw(v) | |
155 | - | else [BinaryEntry((l + k), af), BinaryEntry(g, ag), BinaryEntry(h, ah), BinaryEntry(i, ai), IntegerEntry(f, U), BooleanEntry(j, true)] | |
76 | + | @Callable(r) | |
77 | + | func init (D,z,E,F) = if (isDefined(getBinary(h))) | |
78 | + | then throw(j) | |
79 | + | else [BinaryEntry(e, z), BinaryEntry(f, E), BinaryEntry(g, F), BinaryEntry(h, D)] | |
156 | 80 | ||
157 | 81 | ||
158 | 82 | ||
159 | - | @Callable( | |
160 | - | func | |
161 | - | let | |
162 | - | if (( | |
83 | + | @Callable(r) | |
84 | + | func createUnlock (y,G,H,I,J,K) = { | |
85 | + | let L = x(y) | |
86 | + | if ((L == L)) | |
163 | 87 | then { | |
164 | - | let am = if ((ak == p)) | |
165 | - | then if ((aj != o)) | |
166 | - | then throw(y) | |
167 | - | else $Tuple2(G, 8) | |
168 | - | else { | |
169 | - | let an = valueOrErrorMessage(assetInfo(ak), A) | |
170 | - | let ao = if ((an.issuer == this)) | |
171 | - | then I | |
172 | - | else H | |
173 | - | $Tuple2(ao, an.decimals) | |
174 | - | } | |
175 | - | let ao = am._1 | |
176 | - | let ad = am._2 | |
177 | - | let Q = toBase64String(ak) | |
178 | - | let ap = (toBase64String(aj) + a) | |
179 | - | let aq = (Q + a) | |
180 | - | if (if (isDefined(getBinary(ap))) | |
181 | - | then true | |
182 | - | else isDefined(getBinary(aq))) | |
183 | - | then throw(w) | |
184 | - | else [BinaryEntry(ap, ak), BinaryEntry(aq, aj), IntegerEntry((Q + b), ao), IntegerEntry((Q + c), ad), IntegerEntry((Q + d), V), BooleanEntry((Q + e), true)] | |
185 | - | } | |
186 | - | else throw("Strict value is not equal to itself.") | |
187 | - | } | |
188 | - | ||
189 | - | ||
190 | - | ||
191 | - | @Callable(K) | |
192 | - | func issue (ar,as,ad) = { | |
193 | - | let al = J(K, m) | |
194 | - | if ((al == al)) | |
195 | - | then [Issue(ar, as, 0, ad, true)] | |
196 | - | else throw("Strict value is not equal to itself.") | |
197 | - | } | |
198 | - | ||
199 | - | ||
200 | - | ||
201 | - | @Callable(K) | |
202 | - | func removeAsset (aj,at) = { | |
203 | - | let al = J(K, m) | |
204 | - | if ((al == al)) | |
205 | - | then { | |
206 | - | let ap = (toBase64String(aj) + a) | |
207 | - | let ak = valueOrErrorMessage(getBinary(ap), x) | |
208 | - | let Q = toBase64String(ak) | |
209 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), x) | |
210 | - | let au = if ((ao == G)) | |
88 | + | let M = v(r) | |
89 | + | if ((M == M)) | |
211 | 90 | then { | |
212 | - | let av = wavesBalance(this) | |
213 | - | if ((av.available > 0)) | |
214 | - | then [ScriptTransfer(Address(at), av.available, unit)] | |
215 | - | else nil | |
216 | - | } | |
217 | - | else if ((ao == H)) | |
218 | - | then { | |
219 | - | let av = assetBalance(this, ak) | |
220 | - | if ((av > 0)) | |
221 | - | then [ScriptTransfer(Address(at), av, ak)] | |
222 | - | else nil | |
223 | - | } | |
224 | - | else if ((ao == I)) | |
225 | - | then nil | |
226 | - | else throw(y) | |
227 | - | (au ++ [DeleteEntry(ap), DeleteEntry((Q + a)), DeleteEntry((Q + b)), DeleteEntry((Q + c)), DeleteEntry((Q + d)), DeleteEntry((Q + e))]) | |
228 | - | } | |
229 | - | else throw("Strict value is not equal to itself.") | |
230 | - | } | |
231 | - | ||
232 | - | ||
233 | - | ||
234 | - | @Callable(K) | |
235 | - | func lock (aw,ax,ay) = { | |
236 | - | let az = O() | |
237 | - | if ((az == az)) | |
238 | - | then if ((ay == q)) | |
239 | - | then throw(F) | |
240 | - | else if ((size(K.payments) != 1)) | |
241 | - | then throw(z) | |
242 | - | else { | |
243 | - | let ak = valueOrElse(K.payments[0].assetId, p) | |
244 | - | let Q = toBase64String(ak) | |
245 | - | let aA = P(Q) | |
246 | - | if ((aA == aA)) | |
247 | - | then { | |
248 | - | let T = K.payments[0].amount | |
249 | - | let ag = valueOrErrorMessage(getBinary(g), u) | |
250 | - | let W = S(T, Q) | |
251 | - | let aB = (T - W) | |
252 | - | if ((0 >= aB)) | |
253 | - | then throw(B) | |
254 | - | else { | |
255 | - | let aj = valueOrErrorMessage(getBinary((Q + a)), A) | |
256 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), A) | |
257 | - | let ad = valueOrErrorMessage(getInteger((Q + c)), A) | |
258 | - | let ah = valueOrErrorMessage(getBinary(h), u) | |
259 | - | let aC = invoke(Address(ag), "createLock", [aw, ax, ac(aB, ad), ay, aj], nil) | |
260 | - | if ((aC == aC)) | |
261 | - | then if ((ao == G)) | |
262 | - | then [ScriptTransfer(Address(ah), W, unit)] | |
263 | - | else if ((ao == H)) | |
264 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
265 | - | else if ((ao == I)) | |
266 | - | then [Burn(ak, aB), ScriptTransfer(Address(ah), W, ak)] | |
267 | - | else throw(y) | |
268 | - | else throw("Strict value is not equal to itself.") | |
269 | - | } | |
270 | - | } | |
271 | - | else throw("Strict value is not equal to itself.") | |
272 | - | } | |
273 | - | else throw("Strict value is not equal to itself.") | |
274 | - | } | |
275 | - | ||
276 | - | ||
277 | - | ||
278 | - | @Callable(K) | |
279 | - | func unlock (aw,ax,T,aD,aj,aE) = { | |
280 | - | let az = O() | |
281 | - | if ((az == az)) | |
282 | - | then { | |
283 | - | let ak = valueOrErrorMessage(getBinary((toBase64String(aj) + a)), A) | |
284 | - | let Q = toBase64String(ak) | |
285 | - | let ao = valueOrErrorMessage(getInteger((Q + b)), A) | |
286 | - | let ad = valueOrErrorMessage(getInteger((Q + c)), A) | |
287 | - | let ag = valueOrErrorMessage(getBinary(g), u) | |
288 | - | let ai = valueOrErrorMessage(getBinary(i), u) | |
289 | - | let ah = valueOrErrorMessage(getBinary(h), u) | |
290 | - | let aF = invoke(Address(ag), "createUnlock", [aw, ax, T, aD, aj, aE], nil) | |
291 | - | if ((aF == aF)) | |
292 | - | then { | |
293 | - | let aG = { | |
294 | - | let M = aF | |
295 | - | if ($isInstanceOf(M, "Boolean")) | |
296 | - | then { | |
297 | - | let aH = M | |
298 | - | aH | |
299 | - | } | |
300 | - | else false | |
301 | - | } | |
302 | - | if (!(aG)) | |
303 | - | then throw(y) | |
91 | + | let N = toBase64String(y) | |
92 | + | let O = toBase64String(I) | |
93 | + | let P = (((O + "_") + N) + i) | |
94 | + | if (isDefined(getBoolean(P))) | |
95 | + | then throw(m) | |
304 | 96 | else { | |
305 | - | let W = if ((ai == K.caller.bytes)) | |
306 | - | then valueOrErrorMessage(getInteger((Q + d)), A) | |
307 | - | else 0 | |
308 | - | let aI = ae(T, ad) | |
309 | - | let aJ = (aI - W) | |
310 | - | if ((0 >= aJ)) | |
311 | - | then throw(B) | |
312 | - | else if ((ao == G)) | |
313 | - | then ([ScriptTransfer(Address(ax), aJ, unit)] ++ (if ((W > 0)) | |
314 | - | then [ScriptTransfer(Address(ah), W, unit)] | |
315 | - | else nil)) | |
316 | - | else if ((ao == H)) | |
317 | - | then ([ScriptTransfer(Address(ax), aJ, ak)] ++ (if ((W > 0)) | |
318 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
319 | - | else nil)) | |
320 | - | else if ((ao == I)) | |
321 | - | then ([Reissue(ak, aI, true), ScriptTransfer(Address(ax), aJ, ak)] ++ (if ((W > 0)) | |
322 | - | then [ScriptTransfer(Address(ah), W, ak)] | |
323 | - | else nil)) | |
324 | - | else throw(y) | |
97 | + | let Q = makeString([N, toBase64String(G), toString(H), O, toBase64String(J), p], "_") | |
98 | + | let R = keccak256(toBytes(Q)) | |
99 | + | let S = ecrecover(R, K) | |
100 | + | if ((S != getBinaryValue(g))) | |
101 | + | then throw(l) | |
102 | + | else $Tuple2([BooleanEntry(P, true)], true) | |
325 | 103 | } | |
326 | 104 | } | |
327 | 105 | else throw("Strict value is not equal to itself.") | |
328 | 106 | } | |
329 | 107 | else throw("Strict value is not equal to itself.") | |
330 | 108 | } | |
331 | 109 | ||
332 | 110 | ||
333 | 111 | ||
334 | - | @Callable(K) | |
335 | - | func setManager (L,aK) = { | |
336 | - | let al = J(K, l) | |
337 | - | if ((al == al)) | |
338 | - | then [BinaryEntry((L + k), aK)] | |
339 | - | else throw("Strict value is not equal to itself.") | |
340 | - | } | |
341 | - | ||
342 | - | ||
343 | - | ||
344 | - | @Callable(K) | |
345 | - | func setFeeCollector (ah) = { | |
346 | - | let al = J(K, l) | |
347 | - | if ((al == al)) | |
348 | - | then [BinaryEntry(h, ah)] | |
349 | - | else throw("Strict value is not equal to itself.") | |
350 | - | } | |
351 | - | ||
352 | - | ||
353 | - | ||
354 | - | @Callable(K) | |
355 | - | func setValidator (aL) = { | |
356 | - | let al = J(K, l) | |
357 | - | if ((al == al)) | |
358 | - | then [BinaryEntry(g, aL)] | |
359 | - | else throw("Strict value is not equal to itself.") | |
360 | - | } | |
361 | - | ||
362 | - | ||
363 | - | ||
364 | - | @Callable(K) | |
365 | - | func startBridge () = { | |
366 | - | let al = J(K, l) | |
367 | - | if ((al == al)) | |
368 | - | then [BooleanEntry(j, true)] | |
369 | - | else throw("Strict value is not equal to itself.") | |
370 | - | } | |
371 | - | ||
372 | - | ||
373 | - | ||
374 | - | @Callable(K) | |
375 | - | func stopBridge () = { | |
376 | - | let al = J(K, n) | |
377 | - | if ((al == al)) | |
378 | - | then [BooleanEntry(j, false)] | |
379 | - | else throw("Strict value is not equal to itself.") | |
380 | - | } | |
381 | - | ||
382 | - | ||
383 | - | ||
384 | - | @Callable(K) | |
385 | - | func setMinFee (ak,V) = { | |
386 | - | let al = J(K, m) | |
387 | - | if ((al == al)) | |
112 | + | @Callable(r) | |
113 | + | func createLock (y,G,H,T,U) = { | |
114 | + | let N = toBase64String(y) | |
115 | + | let B = (N + a) | |
116 | + | let M = v(r) | |
117 | + | if ((M == M)) | |
388 | 118 | then { | |
389 | - | let Q = toBase64String(ak) | |
390 | - | [IntegerEntry((Q + d), V)] | |
119 | + | let L = x(y) | |
120 | + | if ((L == L)) | |
121 | + | then { | |
122 | + | let V = A(B) | |
123 | + | if ((V == V)) | |
124 | + | then [BinaryEntry((N + a), G), IntegerEntry((N + b), H), BinaryEntry((N + c), T), BinaryEntry((N + d), U)] | |
125 | + | else throw("Strict value is not equal to itself.") | |
126 | + | } | |
127 | + | else throw("Strict value is not equal to itself.") | |
391 | 128 | } | |
392 | 129 | else throw("Strict value is not equal to itself.") | |
393 | 130 | } | |
394 | 131 | ||
395 | 132 | ||
396 | 133 | ||
397 | - | @Callable( | |
398 | - | func | |
399 | - | let | |
400 | - | if (( | |
401 | - | then [ | |
134 | + | @Callable(r) | |
135 | + | func setAdmin (W) = { | |
136 | + | let M = w(r) | |
137 | + | if ((M == M)) | |
138 | + | then [BinaryEntry(h, W)] | |
402 | 139 | else throw("Strict value is not equal to itself.") | |
403 | 140 | } | |
404 | 141 | ||
405 | 142 | ||
406 | 143 | ||
407 | - | @Callable(K) | |
408 | - | func setAssetState (ak,aM) = { | |
409 | - | let al = J(K, m) | |
410 | - | if ((al == al)) | |
411 | - | then { | |
412 | - | let Q = toBase64String(ak) | |
413 | - | [BooleanEntry((Q + e), aM)] | |
414 | - | } | |
144 | + | @Callable(r) | |
145 | + | func setOracle (X) = { | |
146 | + | let M = w(r) | |
147 | + | if ((M == M)) | |
148 | + | then [BinaryEntry(g, X)] | |
149 | + | else throw("Strict value is not equal to itself.") | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | ||
154 | + | @Callable(r) | |
155 | + | func setBridge (Y) = { | |
156 | + | let M = w(r) | |
157 | + | if ((M == M)) | |
158 | + | then [BinaryEntry(f, Y)] | |
415 | 159 | else throw("Strict value is not equal to itself.") | |
416 | 160 | } | |
417 | 161 | ||
418 | 162 |
github/deemru/w8io/169f3d6 78.70 ms ◑