tx · Ackk3pwzabjaxB36jNgnzEzwBbLCRSLxVVg4KjpndFu6

3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN:  -0.01000000 Waves

2022.05.09 18:19 [2044306] smart account 3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN > SELF 0.00000000 Waves

{ "type": 13, "id": "Ackk3pwzabjaxB36jNgnzEzwBbLCRSLxVVg4KjpndFu6", "fee": 1000000, "feeAssetId": null, "timestamp": 1652109608906, "version": 2, "chainId": 84, "sender": "3NBV6YavDsu2ProYhUqUac69N8RC8BBTCJN", "senderPublicKey": "HMwdLbwQuprhi3kaJNPXUEAtXSKEAA8DKYfsrmLYxaWW", "proofs": [ "4hiTjpXdMUfUHfpXbkXtnTcw9S9pkW9GwJvFVfWRc6PjWEGGqUy1uyzDZjAV2CYq1MHAU41PNmkXyKCBHTJ4D5tx" ], "script": "base64:AAIFAAAAAAAAACEIAhIDCgECEgUKAwICAhIICgYCAgECAgISBwoFAgIBAgIAAAAUAAAAABBrZXlMb2NrUmVjaXBpZW50AgAAAANfbHIAAAAADWtleUxvY2tBbW91bnQCAAAAA19sYQAAAAASa2V5TG9ja0Rlc3RpbmF0aW9uAgAAAANfbGQAAAAAEmtleUxvY2tBc3NldFNvdXJjZQIAAAAEX2xhcwAAAAAKa2V5VmVyc2lvbgIAAAACX3YAAAAACWtleUJyaWRnZQIAAAACX2IAAAAACWtleU9yYWNsZQIAAAACX28AAAAACGtleUFkbWluAgAAAAJfYQAAAAAJa2V5VW5sb2NrAgAAAAJfdQAAAAAPZXJyVW5hdXRob3JpemVkAgAAAAx1bmF1dGhvcml6ZWQAAAAAEGVyclVuaW5pdGlhbGl6ZWQCAAAADXVuaW5pdGlhbGl6ZWQAAAAAE2VyckludmFsaWRTaWduYXR1cmUCAAAAEWludmFsaWQgc2lnbmF0dXJlAAAAABFlcnJBbHJlYWR5Q2xhaW1lZAIAAAAHY2xhaW1lZAAAAAAQZXJyQWxyZWFkeUxvY2tlZAIAAAAGbG9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ljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAHI/5Wk=", "height": 2044306, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6ErSoC9tfjpbNLCLLAwq9Ga9pwhBBG2SBu67Aq6NPigf Next: CSpyis2m1gzLxCbRKSzgW1EJEvxW3DLPtwQZjNbDURjT Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "_aa"
4+let a = "_lr"
55
6-let b = "_at"
6+let b = "_la"
77
8-let c = "_ap"
8+let c = "_ld"
99
10-let d = "_amf"
10+let d = "_las"
1111
12-let e = "_aia"
12+let e = "_v"
1313
14-let f = "_bfr"
14+let f = "_b"
1515
16-let g = "_v"
16+let g = "_o"
1717
18-let h = "_fc"
18+let h = "_a"
1919
20-let i = "_us"
20+let i = "_u"
2121
22-let j = "_ia"
22+let j = "unauthorized"
2323
24-let k = "_m"
24+let k = "uninitialized"
2525
26-let l = "BRIDGE_MANAGER"
26+let l = "invalid signature"
2727
28-let m = "ASSET_MANAGER"
28+let m = "claimed"
2929
30-let n = "STOP_MANAGER"
30+let n = "locked"
3131
32-let o = base58'FbV8QW7Jusz'
32+let o = "not bridge"
3333
34-let p = base58'3EMsPJ'
34+let p = "invalid lockId"
3535
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 = "birdge is disabled"
63-
64-let E = "asset is disabled"
65-
66-let F = 0
67-
68-let G = 1
69-
70-let H = 2
71-
72-func I (J,K) = {
73- let L = getBinary((K + k))
74- if ($isInstanceOf(L, "ByteVector"))
36+func q (r,s) = {
37+ let t = getBinary(s)
38+ if ($isInstanceOf(t, "ByteVector"))
7539 then {
76- let M = L
77- if ((M != J.caller.bytes))
78- then throw(t)
79- else unit
40+ let u = t
41+ (u != r.caller.bytes)
8042 }
81- else throw(u)
43+ else false
8244 }
8345
8446
85-func N () = if (!(valueOrElse(getBoolean(j), false)))
86- then throw(D)
47+func v (r) = if (q(r, f))
48+ then throw(o)
8749 else unit
8850
8951
90-func O (P) = {
91- let L = getBoolean((P + e))
92- if ($isInstanceOf(L, "Boolean"))
93- then {
94- let Q = L
95- if (Q)
96- then unit
97- else throw(E)
98- }
99- else throw(A)
52+func w (x) = {
53+ let y = valueOrErrorMessage(getBinary(e), k)
54+ if (if ((size(x) != 16))
55+ then true
56+ else (take(x, 1) != y))
57+ then throw(p)
58+ else unit
10059 }
10160
10261
103-func R (S,P) = {
104- let T = valueOrErrorMessage(getInteger(f), u)
105- let U = valueOrErrorMessage(getInteger((P + d)), A)
106- let V = ((S * T) / r)
107- if ((U > V))
108- then U
109- else V
62+func z (A) = {
63+ let t = getBinary(A)
64+ if ($isInstanceOf(t, "ByteVector"))
65+ then {
66+ let B = t
67+ throw(n)
68+ }
69+ else unit
11070 }
11171
11272
113-func W (X,Y) = {
114- let Z = if ((0 > Y))
115- then -(Y)
116- else Y
117- let aa = if ((Z == 0))
118- then 1
119- else if ((Z == 1))
120- then 10
121- else if ((Z == 2))
122- then 100
123- else if ((Z == 3))
124- then 1000
125- else if ((Z == 4))
126- then 10000
127- else if ((Z == 5))
128- then 100000
129- else if ((Z == 6))
130- then 1000000
131- else if ((Z == 7))
132- then 10000000
133- else if ((Z == 8))
134- then 100000000
135- else if ((Z == 9))
136- then 1000000000
137- else throw(C)
138- if ((0 > Y))
139- then (X / aa)
140- else (X * aa)
141- }
142-
143-
144-func ab (S,ac) = W(S, (s - ac))
145-
146-
147-func ad (S,ac) = W(S, (ac - s))
148-
149-
150-@Callable(J)
151-func setConfig (ae,af,ag,ah,T) = if (isDefined(getBinary((l + k))))
152- then throw(v)
153- else [BinaryEntry((l + k), ae), BinaryEntry(g, af), BinaryEntry(h, ag), BinaryEntry(i, ah), IntegerEntry(f, T), BooleanEntry(j, true)]
73+@Callable(r)
74+func setAdmin (C) = if (q(r, h))
75+ then throw(j)
76+ else [BinaryEntry(h, C)]
15477
15578
15679
157-@Callable(J)
158-func addAsset (ai,aj,ak,al,am,ac,U) = {
159- let an = I(J, m)
160- if ((an == an))
161- then {
162- let ao = if ((ak == F))
163- then if (if (if ((ai != o))
164- then true
165- else (aj != p))
166- then true
167- else (ac != 8))
168- then throw(y)
169- else $Tuple2(nil, aj)
170- else if ((ak == G))
171- then $Tuple2(nil, aj)
172- else if ((ak == H))
173- then if ((size(aj) == 0))
174- then {
175- let ap = Issue(al, am, 0, ac, true)
176- $Tuple2([ap], calculateAssetId(ap))
177- }
178- else $Tuple2(nil, aj)
179- else throw(y)
180- let aq = ao._1
181- let ar = ao._2
182- let P = toBase64String(ar)
183- let as = (toBase64String(ai) + a)
184- let at = (P + a)
185- if (if (isDefined(getBinary(as)))
186- then true
187- else isDefined(getBinary(at)))
188- then throw(w)
189- else (aq ++ [BinaryEntry(as, ar), BinaryEntry(at, ai), IntegerEntry((P + b), ak), IntegerEntry((P + c), ac), IntegerEntry((P + d), U), BooleanEntry((P + e), true)])
190- }
191- else throw("Strict value is not equal to itself.")
192- }
80+@Callable(r)
81+func setConfig (y,D,E) = if (q(r, h))
82+ then throw(j)
83+ else [BinaryEntry(e, y), BinaryEntry(f, D), BinaryEntry(g, E)]
19384
19485
19586
196-@Callable(J)
197-func removeAsset (ai,au) = {
198- let an = I(J, m)
199- if ((an == an))
87+@Callable(r)
88+func createUnlock (x,F,G,H,I,J) = {
89+ let K = w(x)
90+ if ((K == K))
20091 then {
201- let as = (toBase64String(ai) + a)
202- let ar = valueOrErrorMessage(getBinary(as), x)
203- let P = toBase64String(ar)
204- let ak = valueOrErrorMessage(getInteger((P + b)), x)
205- let aq = if ((ak == F))
92+ let L = v(r)
93+ if ((L == L))
20694 then {
207- let av = wavesBalance(this)
208- if ((av.available > 0))
209- then [ScriptTransfer(Address(au), av.available, unit)]
210- else nil
211- }
212- else if ((ak == G))
213- then {
214- let av = assetBalance(this, ar)
215- if ((av > 0))
216- then [ScriptTransfer(Address(au), av, ar)]
217- else nil
218- }
219- else if ((ak == H))
220- then nil
221- else throw(y)
222- (aq ++ [DeleteEntry(as), DeleteEntry((P + a)), DeleteEntry((P + b)), DeleteEntry((P + c)), DeleteEntry((P + d)), DeleteEntry((P + e))])
223- }
224- else throw("Strict value is not equal to itself.")
225- }
226-
227-
228-
229-@Callable(J)
230-func lock (aw,ax,ay) = {
231- let az = N()
232- if ((az == az))
233- then if ((size(J.payments) != 1))
234- then throw(z)
235- else {
236- let ar = valueOrElse(J.payments[0].assetId, p)
237- let P = toBase64String(ar)
238- let aA = O(P)
239- if ((aA == aA))
240- then {
241- let S = J.payments[0].amount
242- let af = valueOrErrorMessage(getBinary(g), u)
243- let V = R(S, P)
244- let aB = (S - V)
245- if ((0 >= aB))
246- then throw(B)
247- else {
248- let ai = valueOrErrorMessage(getBinary((P + a)), A)
249- let ak = valueOrErrorMessage(getInteger((P + b)), A)
250- let ac = valueOrErrorMessage(getInteger((P + c)), A)
251- let ag = valueOrErrorMessage(getBinary(h), u)
252- let aC = invoke(Address(af), "createLock", [aw, ax, ab(aB, ac), ay, ai], nil)
253- if ((aC == aC))
254- then if ((ak == F))
255- then [ScriptTransfer(Address(ag), V, unit)]
256- else if ((ak == G))
257- then [ScriptTransfer(Address(ag), V, ar)]
258- else if ((ak == H))
259- then [Burn(ar, aB), ScriptTransfer(Address(ag), V, ar)]
260- else throw(y)
261- else throw("Strict value is not equal to itself.")
262- }
263- }
264- else throw("Strict value is not equal to itself.")
265- }
266- else throw("Strict value is not equal to itself.")
267- }
268-
269-
270-
271-@Callable(J)
272-func unlock (aw,ax,S,aD,ai,aE) = {
273- let az = N()
274- if ((az == az))
275- then {
276- let ar = valueOrErrorMessage(getBinary((toBase64String(ai) + a)), A)
277- let P = toBase64String(ar)
278- let ak = valueOrErrorMessage(getInteger((P + b)), A)
279- let ac = valueOrErrorMessage(getInteger((P + c)), A)
280- let af = valueOrErrorMessage(getBinary(g), u)
281- let ah = valueOrErrorMessage(getBinary(i), u)
282- let ag = valueOrErrorMessage(getBinary(h), u)
283- let aF = invoke(Address(af), "createUnlock", [aw, ax, S, aD, ai, aE], nil)
284- if ((aF == aF))
285- then {
286- let aG = {
287- let L = aF
288- if ($isInstanceOf(L, "Boolean"))
289- then {
290- let aH = L
291- aH
292- }
293- else false
294- }
295- if (!(aG))
296- then throw(y)
95+ let M = toBase64String(x)
96+ let N = toBase64String(H)
97+ let O = (((N + "_") + M) + i)
98+ if (isDefined(getBoolean(O)))
99+ then throw(m)
297100 else {
298- let V = if ((ah == J.caller.bytes))
299- then valueOrErrorMessage(getInteger((P + d)), A)
300- else 0
301- let aI = ad(S, ac)
302- let aJ = (aI - V)
303- if ((0 >= aJ))
304- then throw(B)
305- else if ((ak == F))
306- then ([ScriptTransfer(Address(ax), aJ, unit)] ++ (if ((V > 0))
307- then [ScriptTransfer(Address(ag), V, unit)]
308- else nil))
309- else if ((ak == G))
310- then ([ScriptTransfer(Address(ax), aJ, ar)] ++ (if ((V > 0))
311- then [ScriptTransfer(Address(ag), V, ar)]
312- else nil))
313- else if ((ak == H))
314- then ([Reissue(ar, aI, true), ScriptTransfer(Address(ax), aJ, ar)] ++ (if ((V > 0))
315- then [ScriptTransfer(Address(ag), V, ar)]
316- else nil))
317- else throw(y)
101+ let P = makeString([toBase64String(x), toBase64String(F), toString(G), toBase64String(H), toBase64String(I)], "_")
102+ let Q = keccak256(toBytes(P))
103+ let R = ecrecover(Q, J)
104+ if ((R != getBinaryValue(g)))
105+ then throw(l)
106+ else $Tuple2([BooleanEntry(O, true)], true)
318107 }
319108 }
320109 else throw("Strict value is not equal to itself.")
324113
325114
326115
327-@Callable(J)
328-func setManager (K,aK) = {
329- let an = I(J, l)
330- if ((an == an))
331- then [BinaryEntry((K + k), aK)]
332- else throw("Strict value is not equal to itself.")
333- }
334-
335-
336-
337-@Callable(J)
338-func setFeeCollector (ag) = {
339- let an = I(J, l)
340- if ((an == an))
341- then [BinaryEntry(h, ag)]
342- else throw("Strict value is not equal to itself.")
343- }
344-
345-
346-
347-@Callable(J)
348-func setValidator (aL) = {
349- let an = I(J, l)
350- if ((an == an))
351- then [BinaryEntry(g, aL)]
352- else throw("Strict value is not equal to itself.")
353- }
354-
355-
356-
357-@Callable(J)
358-func startBridge () = {
359- let an = I(J, l)
360- if ((an == an))
361- then [BooleanEntry(j, true)]
362- else throw("Strict value is not equal to itself.")
363- }
364-
365-
366-
367-@Callable(J)
368-func stopBridge () = {
369- let an = I(J, n)
370- if ((an == an))
371- then [BooleanEntry(j, false)]
372- else throw("Strict value is not equal to itself.")
373- }
374-
375-
376-
377-@Callable(J)
378-func setMinFee (ar,U) = {
379- let an = I(J, l)
380- if ((an == an))
116+@Callable(r)
117+func createLock (x,F,G,S,I) = {
118+ let M = toBase64String(x)
119+ let A = (M + a)
120+ let L = v(r)
121+ if ((L == L))
381122 then {
382- let P = toBase64String(ar)
383-[IntegerEntry((P + d), U)]
384- }
385- else throw("Strict value is not equal to itself.")
386- }
387-
388-
389-
390-@Callable(J)
391-func setBaseFeeRate (T) = {
392- let an = I(J, l)
393- if ((an == an))
394- then [IntegerEntry(f, T)]
395- else throw("Strict value is not equal to itself.")
396- }
397-
398-
399-
400-@Callable(J)
401-func setAssetState (ar,aM) = {
402- let an = I(J, l)
403- if ((an == an))
404- then {
405- let P = toBase64String(ar)
406-[BooleanEntry((P + e), aM)]
123+ let K = w(x)
124+ if ((K == K))
125+ then {
126+ let T = z(A)
127+ if ((T == T))
128+ then [BinaryEntry((M + a), F), IntegerEntry((M + b), G), BinaryEntry((M + c), S), BinaryEntry((M + d), I)]
129+ else throw("Strict value is not equal to itself.")
130+ }
131+ else throw("Strict value is not equal to itself.")
407132 }
408133 else throw("Strict value is not equal to itself.")
409134 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = "_aa"
4+let a = "_lr"
55
6-let b = "_at"
6+let b = "_la"
77
8-let c = "_ap"
8+let c = "_ld"
99
10-let d = "_amf"
10+let d = "_las"
1111
12-let e = "_aia"
12+let e = "_v"
1313
14-let f = "_bfr"
14+let f = "_b"
1515
16-let g = "_v"
16+let g = "_o"
1717
18-let h = "_fc"
18+let h = "_a"
1919
20-let i = "_us"
20+let i = "_u"
2121
22-let j = "_ia"
22+let j = "unauthorized"
2323
24-let k = "_m"
24+let k = "uninitialized"
2525
26-let l = "BRIDGE_MANAGER"
26+let l = "invalid signature"
2727
28-let m = "ASSET_MANAGER"
28+let m = "claimed"
2929
30-let n = "STOP_MANAGER"
30+let n = "locked"
3131
32-let o = base58'FbV8QW7Jusz'
32+let o = "not bridge"
3333
34-let p = base58'3EMsPJ'
34+let p = "invalid lockId"
3535
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 = "birdge is disabled"
63-
64-let E = "asset is disabled"
65-
66-let F = 0
67-
68-let G = 1
69-
70-let H = 2
71-
72-func I (J,K) = {
73- let L = getBinary((K + k))
74- if ($isInstanceOf(L, "ByteVector"))
36+func q (r,s) = {
37+ let t = getBinary(s)
38+ if ($isInstanceOf(t, "ByteVector"))
7539 then {
76- let M = L
77- if ((M != J.caller.bytes))
78- then throw(t)
79- else unit
40+ let u = t
41+ (u != r.caller.bytes)
8042 }
81- else throw(u)
43+ else false
8244 }
8345
8446
85-func N () = if (!(valueOrElse(getBoolean(j), false)))
86- then throw(D)
47+func v (r) = if (q(r, f))
48+ then throw(o)
8749 else unit
8850
8951
90-func O (P) = {
91- let L = getBoolean((P + e))
92- if ($isInstanceOf(L, "Boolean"))
93- then {
94- let Q = L
95- if (Q)
96- then unit
97- else throw(E)
98- }
99- else throw(A)
52+func w (x) = {
53+ let y = valueOrErrorMessage(getBinary(e), k)
54+ if (if ((size(x) != 16))
55+ then true
56+ else (take(x, 1) != y))
57+ then throw(p)
58+ else unit
10059 }
10160
10261
103-func R (S,P) = {
104- let T = valueOrErrorMessage(getInteger(f), u)
105- let U = valueOrErrorMessage(getInteger((P + d)), A)
106- let V = ((S * T) / r)
107- if ((U > V))
108- then U
109- else V
62+func z (A) = {
63+ let t = getBinary(A)
64+ if ($isInstanceOf(t, "ByteVector"))
65+ then {
66+ let B = t
67+ throw(n)
68+ }
69+ else unit
11070 }
11171
11272
113-func W (X,Y) = {
114- let Z = if ((0 > Y))
115- then -(Y)
116- else Y
117- let aa = if ((Z == 0))
118- then 1
119- else if ((Z == 1))
120- then 10
121- else if ((Z == 2))
122- then 100
123- else if ((Z == 3))
124- then 1000
125- else if ((Z == 4))
126- then 10000
127- else if ((Z == 5))
128- then 100000
129- else if ((Z == 6))
130- then 1000000
131- else if ((Z == 7))
132- then 10000000
133- else if ((Z == 8))
134- then 100000000
135- else if ((Z == 9))
136- then 1000000000
137- else throw(C)
138- if ((0 > Y))
139- then (X / aa)
140- else (X * aa)
141- }
142-
143-
144-func ab (S,ac) = W(S, (s - ac))
145-
146-
147-func ad (S,ac) = W(S, (ac - s))
148-
149-
150-@Callable(J)
151-func setConfig (ae,af,ag,ah,T) = if (isDefined(getBinary((l + k))))
152- then throw(v)
153- else [BinaryEntry((l + k), ae), BinaryEntry(g, af), BinaryEntry(h, ag), BinaryEntry(i, ah), IntegerEntry(f, T), BooleanEntry(j, true)]
73+@Callable(r)
74+func setAdmin (C) = if (q(r, h))
75+ then throw(j)
76+ else [BinaryEntry(h, C)]
15477
15578
15679
157-@Callable(J)
158-func addAsset (ai,aj,ak,al,am,ac,U) = {
159- let an = I(J, m)
160- if ((an == an))
161- then {
162- let ao = if ((ak == F))
163- then if (if (if ((ai != o))
164- then true
165- else (aj != p))
166- then true
167- else (ac != 8))
168- then throw(y)
169- else $Tuple2(nil, aj)
170- else if ((ak == G))
171- then $Tuple2(nil, aj)
172- else if ((ak == H))
173- then if ((size(aj) == 0))
174- then {
175- let ap = Issue(al, am, 0, ac, true)
176- $Tuple2([ap], calculateAssetId(ap))
177- }
178- else $Tuple2(nil, aj)
179- else throw(y)
180- let aq = ao._1
181- let ar = ao._2
182- let P = toBase64String(ar)
183- let as = (toBase64String(ai) + a)
184- let at = (P + a)
185- if (if (isDefined(getBinary(as)))
186- then true
187- else isDefined(getBinary(at)))
188- then throw(w)
189- else (aq ++ [BinaryEntry(as, ar), BinaryEntry(at, ai), IntegerEntry((P + b), ak), IntegerEntry((P + c), ac), IntegerEntry((P + d), U), BooleanEntry((P + e), true)])
190- }
191- else throw("Strict value is not equal to itself.")
192- }
80+@Callable(r)
81+func setConfig (y,D,E) = if (q(r, h))
82+ then throw(j)
83+ else [BinaryEntry(e, y), BinaryEntry(f, D), BinaryEntry(g, E)]
19384
19485
19586
196-@Callable(J)
197-func removeAsset (ai,au) = {
198- let an = I(J, m)
199- if ((an == an))
87+@Callable(r)
88+func createUnlock (x,F,G,H,I,J) = {
89+ let K = w(x)
90+ if ((K == K))
20091 then {
201- let as = (toBase64String(ai) + a)
202- let ar = valueOrErrorMessage(getBinary(as), x)
203- let P = toBase64String(ar)
204- let ak = valueOrErrorMessage(getInteger((P + b)), x)
205- let aq = if ((ak == F))
92+ let L = v(r)
93+ if ((L == L))
20694 then {
207- let av = wavesBalance(this)
208- if ((av.available > 0))
209- then [ScriptTransfer(Address(au), av.available, unit)]
210- else nil
211- }
212- else if ((ak == G))
213- then {
214- let av = assetBalance(this, ar)
215- if ((av > 0))
216- then [ScriptTransfer(Address(au), av, ar)]
217- else nil
218- }
219- else if ((ak == H))
220- then nil
221- else throw(y)
222- (aq ++ [DeleteEntry(as), DeleteEntry((P + a)), DeleteEntry((P + b)), DeleteEntry((P + c)), DeleteEntry((P + d)), DeleteEntry((P + e))])
223- }
224- else throw("Strict value is not equal to itself.")
225- }
226-
227-
228-
229-@Callable(J)
230-func lock (aw,ax,ay) = {
231- let az = N()
232- if ((az == az))
233- then if ((size(J.payments) != 1))
234- then throw(z)
235- else {
236- let ar = valueOrElse(J.payments[0].assetId, p)
237- let P = toBase64String(ar)
238- let aA = O(P)
239- if ((aA == aA))
240- then {
241- let S = J.payments[0].amount
242- let af = valueOrErrorMessage(getBinary(g), u)
243- let V = R(S, P)
244- let aB = (S - V)
245- if ((0 >= aB))
246- then throw(B)
247- else {
248- let ai = valueOrErrorMessage(getBinary((P + a)), A)
249- let ak = valueOrErrorMessage(getInteger((P + b)), A)
250- let ac = valueOrErrorMessage(getInteger((P + c)), A)
251- let ag = valueOrErrorMessage(getBinary(h), u)
252- let aC = invoke(Address(af), "createLock", [aw, ax, ab(aB, ac), ay, ai], nil)
253- if ((aC == aC))
254- then if ((ak == F))
255- then [ScriptTransfer(Address(ag), V, unit)]
256- else if ((ak == G))
257- then [ScriptTransfer(Address(ag), V, ar)]
258- else if ((ak == H))
259- then [Burn(ar, aB), ScriptTransfer(Address(ag), V, ar)]
260- else throw(y)
261- else throw("Strict value is not equal to itself.")
262- }
263- }
264- else throw("Strict value is not equal to itself.")
265- }
266- else throw("Strict value is not equal to itself.")
267- }
268-
269-
270-
271-@Callable(J)
272-func unlock (aw,ax,S,aD,ai,aE) = {
273- let az = N()
274- if ((az == az))
275- then {
276- let ar = valueOrErrorMessage(getBinary((toBase64String(ai) + a)), A)
277- let P = toBase64String(ar)
278- let ak = valueOrErrorMessage(getInteger((P + b)), A)
279- let ac = valueOrErrorMessage(getInteger((P + c)), A)
280- let af = valueOrErrorMessage(getBinary(g), u)
281- let ah = valueOrErrorMessage(getBinary(i), u)
282- let ag = valueOrErrorMessage(getBinary(h), u)
283- let aF = invoke(Address(af), "createUnlock", [aw, ax, S, aD, ai, aE], nil)
284- if ((aF == aF))
285- then {
286- let aG = {
287- let L = aF
288- if ($isInstanceOf(L, "Boolean"))
289- then {
290- let aH = L
291- aH
292- }
293- else false
294- }
295- if (!(aG))
296- then throw(y)
95+ let M = toBase64String(x)
96+ let N = toBase64String(H)
97+ let O = (((N + "_") + M) + i)
98+ if (isDefined(getBoolean(O)))
99+ then throw(m)
297100 else {
298- let V = if ((ah == J.caller.bytes))
299- then valueOrErrorMessage(getInteger((P + d)), A)
300- else 0
301- let aI = ad(S, ac)
302- let aJ = (aI - V)
303- if ((0 >= aJ))
304- then throw(B)
305- else if ((ak == F))
306- then ([ScriptTransfer(Address(ax), aJ, unit)] ++ (if ((V > 0))
307- then [ScriptTransfer(Address(ag), V, unit)]
308- else nil))
309- else if ((ak == G))
310- then ([ScriptTransfer(Address(ax), aJ, ar)] ++ (if ((V > 0))
311- then [ScriptTransfer(Address(ag), V, ar)]
312- else nil))
313- else if ((ak == H))
314- then ([Reissue(ar, aI, true), ScriptTransfer(Address(ax), aJ, ar)] ++ (if ((V > 0))
315- then [ScriptTransfer(Address(ag), V, ar)]
316- else nil))
317- else throw(y)
101+ let P = makeString([toBase64String(x), toBase64String(F), toString(G), toBase64String(H), toBase64String(I)], "_")
102+ let Q = keccak256(toBytes(P))
103+ let R = ecrecover(Q, J)
104+ if ((R != getBinaryValue(g)))
105+ then throw(l)
106+ else $Tuple2([BooleanEntry(O, true)], true)
318107 }
319108 }
320109 else throw("Strict value is not equal to itself.")
321110 }
322111 else throw("Strict value is not equal to itself.")
323112 }
324113
325114
326115
327-@Callable(J)
328-func setManager (K,aK) = {
329- let an = I(J, l)
330- if ((an == an))
331- then [BinaryEntry((K + k), aK)]
332- else throw("Strict value is not equal to itself.")
333- }
334-
335-
336-
337-@Callable(J)
338-func setFeeCollector (ag) = {
339- let an = I(J, l)
340- if ((an == an))
341- then [BinaryEntry(h, ag)]
342- else throw("Strict value is not equal to itself.")
343- }
344-
345-
346-
347-@Callable(J)
348-func setValidator (aL) = {
349- let an = I(J, l)
350- if ((an == an))
351- then [BinaryEntry(g, aL)]
352- else throw("Strict value is not equal to itself.")
353- }
354-
355-
356-
357-@Callable(J)
358-func startBridge () = {
359- let an = I(J, l)
360- if ((an == an))
361- then [BooleanEntry(j, true)]
362- else throw("Strict value is not equal to itself.")
363- }
364-
365-
366-
367-@Callable(J)
368-func stopBridge () = {
369- let an = I(J, n)
370- if ((an == an))
371- then [BooleanEntry(j, false)]
372- else throw("Strict value is not equal to itself.")
373- }
374-
375-
376-
377-@Callable(J)
378-func setMinFee (ar,U) = {
379- let an = I(J, l)
380- if ((an == an))
116+@Callable(r)
117+func createLock (x,F,G,S,I) = {
118+ let M = toBase64String(x)
119+ let A = (M + a)
120+ let L = v(r)
121+ if ((L == L))
381122 then {
382- let P = toBase64String(ar)
383-[IntegerEntry((P + d), U)]
384- }
385- else throw("Strict value is not equal to itself.")
386- }
387-
388-
389-
390-@Callable(J)
391-func setBaseFeeRate (T) = {
392- let an = I(J, l)
393- if ((an == an))
394- then [IntegerEntry(f, T)]
395- else throw("Strict value is not equal to itself.")
396- }
397-
398-
399-
400-@Callable(J)
401-func setAssetState (ar,aM) = {
402- let an = I(J, l)
403- if ((an == an))
404- then {
405- let P = toBase64String(ar)
406-[BooleanEntry((P + e), aM)]
123+ let K = w(x)
124+ if ((K == K))
125+ then {
126+ let T = z(A)
127+ if ((T == T))
128+ then [BinaryEntry((M + a), F), IntegerEntry((M + b), G), BinaryEntry((M + c), S), BinaryEntry((M + d), I)]
129+ else throw("Strict value is not equal to itself.")
130+ }
131+ else throw("Strict value is not equal to itself.")
407132 }
408133 else throw("Strict value is not equal to itself.")
409134 }
410135
411136

github/deemru/w8io/026f985 
75.92 ms