tx · 2w8uJgwuWtM6udzDVUBe8SvBmL2v8kk99HsfXZWY42jy

3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz:  -0.14000000 Waves

2022.11.29 12:44 [2338224] smart account 3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz > SELF 0.00000000 Waves

{ "type": 13, "id": "2w8uJgwuWtM6udzDVUBe8SvBmL2v8kk99HsfXZWY42jy", "fee": 14000000, "feeAssetId": null, "timestamp": 1669715085714, "version": 2, "chainId": 84, "sender": "3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz", "senderPublicKey": "C3v9sfZTmGuW7YXwjUKypU41QpFcHCoJxLpvdR4d3iSv", "proofs": [ "3BJarhwxC7RdXjQpKdPfKgwgTVSNw1zuWWW4uUe71TwVhgUjnP9Xy4xMWjtn2c2ywsGpx2k2mQpL32mho2NKtCGS", "2uv6opzACnm3Ppi49tAvFcQCG4gkgYVqsLuFic5rrvhQUfVHEj8MgcHi8HjNs7UREYPGdinj9SfBrDtMKBWtu48H" ], "script": "base64:BgIhCAISBAoCAQgSBAoCCAgSAwoBBBIDCgEIEgMKAQgSABIAFQAPa1ByZWZpeFBvb2xOYW1lAgVwb29sXwAFa1BhaXICBXBhaXJfAAlrQXNzZXRJZEECCkFfYXNzZXRfaWQACWtBc3NldElkQgIKQl9hc3NldF9pZAAfa0xhdW5jaHBhZERhdGFUcmFuc2FjdGlvblN0YXR1cwIhbGF1bmNocGFkX2RhdGFfdHJhbnNhY3Rpb25fc3RhdHVzABNrQWN0aXZlQWxsQ29udHJhY3RzAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwAMa0FkbWluUHViS2V5AglhZG1pbl9wdWIADWtBZG1pblB1YktleTECC2FkbWluX3B1Yl8xAA1rQWRtaW5QdWJLZXkyAgthZG1pbl9wdWJfMgANa0FkbWluUHViS2V5MwILYWRtaW5fcHViXzMAEmtBZG1pbkludm9rZVB1YktleQIQYWRtaW5faW52b2tlX3B1YgAUa0FjaGlldmVt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25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAKYnTC8", "height": 2338224, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ddeeor5SDGD6B2nPC1pVpLBz5FW7grpWRMMNyXHCbEce Next: 7WuhyMQV8CMDevX7Jjz7Ku465fvef12LV2ykRC85YXcf Diff:
OldNewDifferences
1111
1212 let e = "launchpad_data_transaction_status"
1313
14-let f = "admin_pub_1"
14+let f = "active_all_contracts"
1515
16-let g = "admin_pub_2"
16+let g = "admin_pub"
1717
18-let h = "admin_pub_3"
18+let h = "admin_pub_1"
1919
20-let i = "admin_invoke_pub"
20+let i = "admin_pub_2"
2121
22-let j = "achievements_writers"
22+let j = "admin_pub_3"
2323
24-let k = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
24+let k = "admin_invoke_pub"
2525
26-let l = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
26+let l = "achievements_writers"
2727
28-let m = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
28+let m = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
2929
30-let n = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
30+let n = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
3131
32-func o (p) = if ((p.caller == this))
32+let o = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
33+
34+let p = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
35+
36+let q = getBooleanValue(this, f)
37+
38+func r (s) = if ((s.caller == this))
3339 then unit
3440 else throw("Only the Oracle itself can invoke this function")
3541
3642
37-func q (r) = {
38- let s = valueOrErrorMessage(getString(r, "version"), "Pool is not initialized")
39- if ((s == "1.0.0"))
43+func t (u) = {
44+ let v = valueOrErrorMessage(getString(u, "version"), "Pool is not initialized")
45+ if ((v == "1.0.0"))
4046 then "cpmm"
41- else if ((s == "2.0.0"))
47+ else if ((v == "2.0.0"))
4248 then "flat"
43- else if ((s == "3.0.0"))
49+ else if ((v == "3.0.0"))
4450 then "multycurve"
4551 else throw("Unknown version of pool")
4652 }
4753
4854
49-func t (u) = toString(valueOrErrorMessage(addressFromString(u), (("Can't parse \"" + u) + "\" as address")))
55+func w (x) = toString(valueOrErrorMessage(addressFromString(x), (("Can't parse \"" + x) + "\" as address")))
5056
5157
52-@Callable(p)
53-func setAdmin () = valueOrElse(o(p), [StringEntry(f, toBase58String(k)), StringEntry(g, toBase58String(l)), StringEntry(h, toBase58String(m)), StringEntry(i, toBase58String(n))])
58+func y (s) = if (containsElement([m, n, o], s.callerPublicKey))
59+ then unit
60+ else throw("Only admin can call this function")
61+
62+
63+@Callable(s)
64+func setAdmin (z,A) = valueOrElse(r(s), if (if ((0 > z))
65+ then (z > 3)
66+ else false)
67+ then throw("Wrong admin id")
68+ else [StringEntry((g + toString(z)), A)])
5469
5570
5671
57-@Callable(p)
58-func addPool (r,v) = valueOrElse(o(p), {
59- let w = t(r)
60- let x = (a + w)
61- let y = getString(this, x)
62- if (isDefined(y))
63- then throw((((("Pool with address \"" + w) + "\" is already defined with name \"") + value(y)) + "\""))
64- else ([StringEntry(x, v)] ++ (if ((q(value(addressFromString(r))) == "multycurve"))
72+@Callable(s)
73+func addPool (u,B) = valueOrElse(y(s), {
74+ let C = w(u)
75+ let D = (a + C)
76+ let E = getString(this, D)
77+ if (isDefined(E))
78+ then throw((((("Pool with address \"" + C) + "\" is already defined with name \"") + value(E)) + "\""))
79+ else ([StringEntry(D, B)] ++ (if ((t(value(addressFromString(u))) == "multycurve"))
6580 then nil
6681 else {
67- let z = valueOrErrorMessage(getString(value(addressFromString(r)), c), "Asset id A is incorrect")
68- let A = valueOrErrorMessage(getString(value(addressFromString(r)), d), "Asset id B is incorrect")
69-[StringEntry((((b + z) + "_") + A), r)]
82+ let F = valueOrErrorMessage(getString(value(addressFromString(u)), c), "Asset id A is incorrect")
83+ let G = valueOrErrorMessage(getString(value(addressFromString(u)), d), "Asset id B is incorrect")
84+[StringEntry((((b + F) + "_") + G), u)]
7085 }))
7186 })
7287
7388
7489
75-@Callable(p)
76-func renamePool (r,B) = valueOrElse(o(p), {
77- let w = t(r)
78- let x = (a + w)
79- let y = getString(this, x)
80- if (isDefined(y))
81- then [StringEntry(x, B)]
82- else throw((("Pool with address \"" + w) + "\" has not yet been added"))
90+@Callable(s)
91+func launchpadDataTransactionStatus (H) = valueOrElse(y(s), [BooleanEntry(e, H)])
92+
93+
94+
95+@Callable(s)
96+func addAchievementsWriter (x) = valueOrElse(y(s), {
97+ let I = valueOrElse(getString(this, l), "")
98+ let J = if ((I == ""))
99+ then nil
100+ else split(I, ",")
101+[StringEntry(l, makeString((J :+ x), ","))]
83102 })
84103
85104
86105
87-@Callable(p)
88-func launchpadDataTransactionStatus (C) = valueOrElse(o(p), [BooleanEntry(e, C)])
89-
90-
91-
92-@Callable(p)
93-func addAchievementsWriter (u) = valueOrElse(o(p), {
94- let D = valueOrElse(getString(this, j), "")
95- let E = if ((D == ""))
96- then nil
97- else split(D, ",")
98-[StringEntry(j, makeString((E :+ u), ","))]
106+@Callable(s)
107+func removeAchievementsWriter (x) = valueOrElse(y(s), {
108+ let I = split(valueOrElse(getString(this, l), ""), ",")
109+ let K = valueOrErrorMessage(indexOf(I, x), "Can't find address in the list")
110+[StringEntry(l, makeString(removeByIndex(I, K), ","))]
99111 })
100112
101113
102114
103-@Callable(p)
104-func removeAchievementsWriter (u) = valueOrElse(o(p), {
105- let D = split(valueOrElse(getString(this, j), ""), ",")
106- let F = valueOrErrorMessage(indexOf(D, u), "Can't find address in the list")
107-[StringEntry(j, makeString(removeByIndex(D, F), ","))]
108- })
115+@Callable(s)
116+func shutdownAllContracts () = valueOrElse(y(s), if (!(q))
117+ then throw("All contracts already shutdown")
118+ else [BooleanEntry(f, false)])
109119
110120
111-@Verifier(G)
112-func H () = {
113- let I = if (sigVerify(G.bodyBytes, G.proofs[0], k))
121+
122+@Callable(s)
123+func activateAllContracts () = valueOrElse(y(s), if (q)
124+ then throw("All contracts already active")
125+ else [BooleanEntry(f, true)])
126+
127+
128+@Verifier(L)
129+func M () = {
130+ let N = if (sigVerify(L.bodyBytes, L.proofs[0], m))
114131 then 1
115132 else 0
116- let J = if (sigVerify(G.bodyBytes, G.proofs[1], l))
133+ let O = if (sigVerify(L.bodyBytes, L.proofs[1], n))
117134 then 1
118135 else 0
119- let K = if (sigVerify(G.bodyBytes, G.proofs[2], m))
136+ let P = if (sigVerify(L.bodyBytes, L.proofs[2], o))
120137 then 1
121138 else 0
122- let L = (((I + J) + K) >= 2)
123- let M = (((I + J) + K) >= 1)
124- let N = G
125- if ($isInstanceOf(N, "InvokeScriptTransaction"))
126- then {
127- let O = N
128- let P = if ((O.dApp == this))
129- then containsElement(["renamePool"], O.function)
130- else false
131- let Q = if ((O.dApp == this))
132- then containsElement(["setAdmin"], O.function)
133- else false
134- let R = if ((O.dApp == this))
135- then containsElement(["addPool"], O.function)
136- else false
137- let S = if ((O.dApp == this))
138- then containsElement(["launchpadDataTransactionStatus"], O.function)
139- else false
140- let T = if ((O.dApp == this))
141- then containsElement(["addAchievementsWriter"], O.function)
142- else false
143- let U = if ((O.dApp == this))
144- then containsElement(["removeAchievementsWriter"], O.function)
145- else false
146- if (if (if (if (if (if (if (L)
147- then (size(O.payments) == 0)
148- else false)
149- then P
150- else false)
151- then true
152- else if (if (M)
153- then (size(O.payments) == 0)
154- else false)
155- then R
156- else false)
157- then true
158- else if (if (L)
159- then (size(O.payments) == 0)
160- else false)
161- then Q
162- else false)
163- then true
164- else if (if (L)
165- then (size(O.payments) == 0)
166- else false)
167- then S
168- else false)
169- then true
170- else if (if (L)
171- then (size(O.payments) == 0)
172- else false)
173- then T
174- else false)
175- then true
176- else if (if (L)
177- then (size(O.payments) == 0)
178- else false)
179- then U
180- else false
181- }
182- else if (if ($isInstanceOf(N, "Order"))
183- then true
184- else if ($isInstanceOf(N, "DataTransaction"))
185- then true
186- else if ($isInstanceOf(N, "SponsorFeeTransaction"))
187- then true
188- else if ($isInstanceOf(N, "SetScriptTransaction"))
189- then true
190- else if ($isInstanceOf(N, "CreateAliasTransaction"))
191- then true
192- else if ($isInstanceOf(N, "LeaseCancelTransaction"))
193- then true
194- else if ($isInstanceOf(N, "LeaseTransaction"))
195- then true
196- else if ($isInstanceOf(N, "IssueTransaction"))
197- then true
198- else if ($isInstanceOf(N, "InvokeExpressionTransaction"))
199- then true
200- else if ($isInstanceOf(N, "UpdateAssetInfoTransaction"))
201- then true
202- else if ($isInstanceOf(N, "InvokeScriptTransaction"))
203- then true
204- else if ($isInstanceOf(N, "SetAssetScriptTransaction"))
205- then true
206- else if ($isInstanceOf(N, "TransferTransaction"))
207- then true
208- else if ($isInstanceOf(N, "ExchangeTransaction"))
209- then true
210- else if ($isInstanceOf(N, "MassTransferTransaction"))
211- then true
212- else if ($isInstanceOf(N, "BurnTransaction"))
213- then true
214- else $isInstanceOf(N, "ReissueTransaction"))
215- then L
216- else throw("Match error")
139+ (((N + O) + P) >= 2)
217140 }
218141
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "pool_"
55
66 let b = "pair_"
77
88 let c = "A_asset_id"
99
1010 let d = "B_asset_id"
1111
1212 let e = "launchpad_data_transaction_status"
1313
14-let f = "admin_pub_1"
14+let f = "active_all_contracts"
1515
16-let g = "admin_pub_2"
16+let g = "admin_pub"
1717
18-let h = "admin_pub_3"
18+let h = "admin_pub_1"
1919
20-let i = "admin_invoke_pub"
20+let i = "admin_pub_2"
2121
22-let j = "achievements_writers"
22+let j = "admin_pub_3"
2323
24-let k = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
24+let k = "admin_invoke_pub"
2525
26-let l = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
26+let l = "achievements_writers"
2727
28-let m = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
28+let m = base58'GFmKZ2naZFRoCvNbwKAQVGmLb1uBeWGDgFabdGBuZiuy'
2929
30-let n = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
30+let n = base58'GmJXRyhRA79g8yUGgKBAVdnFfQFDMjQG98b1MmLDh5kk'
3131
32-func o (p) = if ((p.caller == this))
32+let o = base58'CFhbV6h41hVjbGHudGtS3fYUv7QAKRxFQzKNtx4B5PqP'
33+
34+let p = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
35+
36+let q = getBooleanValue(this, f)
37+
38+func r (s) = if ((s.caller == this))
3339 then unit
3440 else throw("Only the Oracle itself can invoke this function")
3541
3642
37-func q (r) = {
38- let s = valueOrErrorMessage(getString(r, "version"), "Pool is not initialized")
39- if ((s == "1.0.0"))
43+func t (u) = {
44+ let v = valueOrErrorMessage(getString(u, "version"), "Pool is not initialized")
45+ if ((v == "1.0.0"))
4046 then "cpmm"
41- else if ((s == "2.0.0"))
47+ else if ((v == "2.0.0"))
4248 then "flat"
43- else if ((s == "3.0.0"))
49+ else if ((v == "3.0.0"))
4450 then "multycurve"
4551 else throw("Unknown version of pool")
4652 }
4753
4854
49-func t (u) = toString(valueOrErrorMessage(addressFromString(u), (("Can't parse \"" + u) + "\" as address")))
55+func w (x) = toString(valueOrErrorMessage(addressFromString(x), (("Can't parse \"" + x) + "\" as address")))
5056
5157
52-@Callable(p)
53-func setAdmin () = valueOrElse(o(p), [StringEntry(f, toBase58String(k)), StringEntry(g, toBase58String(l)), StringEntry(h, toBase58String(m)), StringEntry(i, toBase58String(n))])
58+func y (s) = if (containsElement([m, n, o], s.callerPublicKey))
59+ then unit
60+ else throw("Only admin can call this function")
61+
62+
63+@Callable(s)
64+func setAdmin (z,A) = valueOrElse(r(s), if (if ((0 > z))
65+ then (z > 3)
66+ else false)
67+ then throw("Wrong admin id")
68+ else [StringEntry((g + toString(z)), A)])
5469
5570
5671
57-@Callable(p)
58-func addPool (r,v) = valueOrElse(o(p), {
59- let w = t(r)
60- let x = (a + w)
61- let y = getString(this, x)
62- if (isDefined(y))
63- then throw((((("Pool with address \"" + w) + "\" is already defined with name \"") + value(y)) + "\""))
64- else ([StringEntry(x, v)] ++ (if ((q(value(addressFromString(r))) == "multycurve"))
72+@Callable(s)
73+func addPool (u,B) = valueOrElse(y(s), {
74+ let C = w(u)
75+ let D = (a + C)
76+ let E = getString(this, D)
77+ if (isDefined(E))
78+ then throw((((("Pool with address \"" + C) + "\" is already defined with name \"") + value(E)) + "\""))
79+ else ([StringEntry(D, B)] ++ (if ((t(value(addressFromString(u))) == "multycurve"))
6580 then nil
6681 else {
67- let z = valueOrErrorMessage(getString(value(addressFromString(r)), c), "Asset id A is incorrect")
68- let A = valueOrErrorMessage(getString(value(addressFromString(r)), d), "Asset id B is incorrect")
69-[StringEntry((((b + z) + "_") + A), r)]
82+ let F = valueOrErrorMessage(getString(value(addressFromString(u)), c), "Asset id A is incorrect")
83+ let G = valueOrErrorMessage(getString(value(addressFromString(u)), d), "Asset id B is incorrect")
84+[StringEntry((((b + F) + "_") + G), u)]
7085 }))
7186 })
7287
7388
7489
75-@Callable(p)
76-func renamePool (r,B) = valueOrElse(o(p), {
77- let w = t(r)
78- let x = (a + w)
79- let y = getString(this, x)
80- if (isDefined(y))
81- then [StringEntry(x, B)]
82- else throw((("Pool with address \"" + w) + "\" has not yet been added"))
90+@Callable(s)
91+func launchpadDataTransactionStatus (H) = valueOrElse(y(s), [BooleanEntry(e, H)])
92+
93+
94+
95+@Callable(s)
96+func addAchievementsWriter (x) = valueOrElse(y(s), {
97+ let I = valueOrElse(getString(this, l), "")
98+ let J = if ((I == ""))
99+ then nil
100+ else split(I, ",")
101+[StringEntry(l, makeString((J :+ x), ","))]
83102 })
84103
85104
86105
87-@Callable(p)
88-func launchpadDataTransactionStatus (C) = valueOrElse(o(p), [BooleanEntry(e, C)])
89-
90-
91-
92-@Callable(p)
93-func addAchievementsWriter (u) = valueOrElse(o(p), {
94- let D = valueOrElse(getString(this, j), "")
95- let E = if ((D == ""))
96- then nil
97- else split(D, ",")
98-[StringEntry(j, makeString((E :+ u), ","))]
106+@Callable(s)
107+func removeAchievementsWriter (x) = valueOrElse(y(s), {
108+ let I = split(valueOrElse(getString(this, l), ""), ",")
109+ let K = valueOrErrorMessage(indexOf(I, x), "Can't find address in the list")
110+[StringEntry(l, makeString(removeByIndex(I, K), ","))]
99111 })
100112
101113
102114
103-@Callable(p)
104-func removeAchievementsWriter (u) = valueOrElse(o(p), {
105- let D = split(valueOrElse(getString(this, j), ""), ",")
106- let F = valueOrErrorMessage(indexOf(D, u), "Can't find address in the list")
107-[StringEntry(j, makeString(removeByIndex(D, F), ","))]
108- })
115+@Callable(s)
116+func shutdownAllContracts () = valueOrElse(y(s), if (!(q))
117+ then throw("All contracts already shutdown")
118+ else [BooleanEntry(f, false)])
109119
110120
111-@Verifier(G)
112-func H () = {
113- let I = if (sigVerify(G.bodyBytes, G.proofs[0], k))
121+
122+@Callable(s)
123+func activateAllContracts () = valueOrElse(y(s), if (q)
124+ then throw("All contracts already active")
125+ else [BooleanEntry(f, true)])
126+
127+
128+@Verifier(L)
129+func M () = {
130+ let N = if (sigVerify(L.bodyBytes, L.proofs[0], m))
114131 then 1
115132 else 0
116- let J = if (sigVerify(G.bodyBytes, G.proofs[1], l))
133+ let O = if (sigVerify(L.bodyBytes, L.proofs[1], n))
117134 then 1
118135 else 0
119- let K = if (sigVerify(G.bodyBytes, G.proofs[2], m))
136+ let P = if (sigVerify(L.bodyBytes, L.proofs[2], o))
120137 then 1
121138 else 0
122- let L = (((I + J) + K) >= 2)
123- let M = (((I + J) + K) >= 1)
124- let N = G
125- if ($isInstanceOf(N, "InvokeScriptTransaction"))
126- then {
127- let O = N
128- let P = if ((O.dApp == this))
129- then containsElement(["renamePool"], O.function)
130- else false
131- let Q = if ((O.dApp == this))
132- then containsElement(["setAdmin"], O.function)
133- else false
134- let R = if ((O.dApp == this))
135- then containsElement(["addPool"], O.function)
136- else false
137- let S = if ((O.dApp == this))
138- then containsElement(["launchpadDataTransactionStatus"], O.function)
139- else false
140- let T = if ((O.dApp == this))
141- then containsElement(["addAchievementsWriter"], O.function)
142- else false
143- let U = if ((O.dApp == this))
144- then containsElement(["removeAchievementsWriter"], O.function)
145- else false
146- if (if (if (if (if (if (if (L)
147- then (size(O.payments) == 0)
148- else false)
149- then P
150- else false)
151- then true
152- else if (if (M)
153- then (size(O.payments) == 0)
154- else false)
155- then R
156- else false)
157- then true
158- else if (if (L)
159- then (size(O.payments) == 0)
160- else false)
161- then Q
162- else false)
163- then true
164- else if (if (L)
165- then (size(O.payments) == 0)
166- else false)
167- then S
168- else false)
169- then true
170- else if (if (L)
171- then (size(O.payments) == 0)
172- else false)
173- then T
174- else false)
175- then true
176- else if (if (L)
177- then (size(O.payments) == 0)
178- else false)
179- then U
180- else false
181- }
182- else if (if ($isInstanceOf(N, "Order"))
183- then true
184- else if ($isInstanceOf(N, "DataTransaction"))
185- then true
186- else if ($isInstanceOf(N, "SponsorFeeTransaction"))
187- then true
188- else if ($isInstanceOf(N, "SetScriptTransaction"))
189- then true
190- else if ($isInstanceOf(N, "CreateAliasTransaction"))
191- then true
192- else if ($isInstanceOf(N, "LeaseCancelTransaction"))
193- then true
194- else if ($isInstanceOf(N, "LeaseTransaction"))
195- then true
196- else if ($isInstanceOf(N, "IssueTransaction"))
197- then true
198- else if ($isInstanceOf(N, "InvokeExpressionTransaction"))
199- then true
200- else if ($isInstanceOf(N, "UpdateAssetInfoTransaction"))
201- then true
202- else if ($isInstanceOf(N, "InvokeScriptTransaction"))
203- then true
204- else if ($isInstanceOf(N, "SetAssetScriptTransaction"))
205- then true
206- else if ($isInstanceOf(N, "TransferTransaction"))
207- then true
208- else if ($isInstanceOf(N, "ExchangeTransaction"))
209- then true
210- else if ($isInstanceOf(N, "MassTransferTransaction"))
211- then true
212- else if ($isInstanceOf(N, "BurnTransaction"))
213- then true
214- else $isInstanceOf(N, "ReissueTransaction"))
215- then L
216- else throw("Match error")
139+ (((N + O) + P) >= 2)
217140 }
218141

github/deemru/w8io/026f985 
52.20 ms