tx · GNhFL44CgAcuVgymGrDxheB5adkPs1nZBTF845nS8dUx

3MpVunRPnNPuBCtAb95NPY1Q1aNf43a6Gyh:  -0.01400000 Waves

2019.12.24 14:44 [823043] smart account 3MpVunRPnNPuBCtAb95NPY1Q1aNf43a6Gyh > SELF 0.00000000 Waves

{ "type": 13, "id": "GNhFL44CgAcuVgymGrDxheB5adkPs1nZBTF845nS8dUx", "fee": 1400000, "feeAssetId": null, "timestamp": 1577187897555, "version": 1, "sender": "3MpVunRPnNPuBCtAb95NPY1Q1aNf43a6Gyh", "senderPublicKey": "HMJMUXBatArd2SDvjv3YbtdrY2BAsxDEfWhqv8kYH4Kj", "proofs": [ "5o4dbJhm9EtRPTaR3XWuT5kknwFQB4iH1SLKoX6QReRwtPjGuzKnydPjDa4eGaBBzqrZiwqgk7tcoRkHyeXs2oda" ], "script": "base64:AAIDAAAAAAAAABIIARIHCgUIAQEBARIAEgMKAQgAAAAbAAAAAAd3YXZlbGV0AAAAAAAF9eEAAAAAAA93YXZlc0RlcG9zaXRBbXQJAABoAAAAAgAAAAAAAAAKKAUAAAAHd2F2ZWxldAAAAAANYnRjRGVwb3NpdEFtdAkAAGkAAAACCQAAaAAAAAIAAAAAAAAACigFAAAAB3dhdmVsZXQAAAAAAAAAJxAAAAAADWV0aERlcG9zaXRBbXQJAABoAAAAAgAAAAAAAAAADQUAAAAHd2F2ZWxldAAAAAANbHRjRGVwb3NpdEFtdAkAAGgAAAACAAAAAAAAAAAnBQAAAAd3YXZlbGV0AAAAAA53ZXN0RGVwb3NpdEFtdAkAAGgAAAACAAAAAAAAAGWQBQAAAAd3YXZlbGV0AAAAAA13Y3REZXBvc2l0QW10CQAAaAAAAAIAAAAAAAAAZZAFAAAAB3dhdmVsZXQAAAAAEGRpdmlkZW5kc1BlcmNlbnQAAAAAAAAAAB4AAAAAEmRlcG9zaXRTdGFydEhlaWdodAAAAAAAAAAAAQAAAAASRHJhZ29uRnJ1aXRBZGRyZXNzAgAAACMzTXFwNDU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QAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAN0dHgFAAAAByRtYXRjaDAEAAAACWFzc2V0TmFtZQkBAAAAEWFzc2V0QmFzZTU4VG9OYW1lAAAAAQgFAAAAA3R0eAAAAAdhc3NldElkBAAAABJkaXZpZGVuZHNXaXRoZHJhd24JAQAAABtnZXREaXZpZGVuZHNXaXRoZHJhd25BbW91bnQAAAABBQAAAAlhc3NldE5hbWUEAAAACWRpdmlkZW5kcwkBAAAAEmdldERpdmlkZW5kQmFsYW5jZQAAAAIIBQAAAAN0dHgAAAAHYXNzZXRJZAUAAAASZGl2aWRlbmRzV2l0aGRyYXduBAAAAA5hY2NvdW50QmFsYW5jZQkAA+sAAAACBQAAAAR0aGlzCAUAAAADdHR4AAAAB2Fzc2V0SWQJAABnAAAAAgkAAGUAAAACBQAAAA5hY2NvdW50QmFsYW5jZQgFAAAAA3R0eAAAAAZhbW91bnQFAAAACWRpdmlkZW5kcwcHknBIhg==", "chainId": 84, "height": 823043, "spentComplexity": 0 } View: original | compacted Prev: HBkjtxwToBwT8ZimyXdAdBBEg3cdpJuivQoge9jh2NG8 Next: ENCiWiwWHwCuz3ZP59Ety2FowdweZZp8xLyQkqDQWBTn Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = fromBase58String("47yVx7y7Q9CP9VbAYgns76YMDmxeeGz2REzmVZsBC83g")
4+let a = 100000000
55
6-let b = "3Mqp45361wCutaKEqM2kCbFZmrkodQGvpUE"
6+let b = (2600 * a)
77
8-let c = fromBase58String("Cm5aPWtA6PufaZS5keg1ZMnDSzEiwkUHCZsTFkdr8YwP")
8+let c = ((2600 * a) / 10000)
99
10-let d = fromBase58String("HMJMUXBatArd2SDvjv3YbtdrY2BAsxDEfWhqv8kYH4Kj")
10+let d = (13 * a)
1111
12-let e = 1
12+let e = (39 * a)
1313
14-let f = unit
14+let f = (26000 * a)
1515
16-let g = base58'1'
16+let g = (26000 * a)
1717
18-let h = base58'1'
18+let h = 30
1919
20-let i = base58'1'
20+let i = 1
2121
22-let j = base58'1'
22+let j = "3Mqp45361wCutaKEqM2kCbFZmrkodQGvpUE"
2323
24-let k = base58'1'
24+let k = fromBase58String("HMJMUXBatArd2SDvjv3YbtdrY2BAsxDEfWhqv8kYH4Kj")
2525
26-func l (m) = if ((m == a))
27- then toBase58String(m)
28- else throw("Only predefined public keys can make deposits")
26+let l = fromBase58String("1")
27+
28+let m = ((1440 * 30) * 6)
29+
30+let n = unit
31+
32+let o = base58'1'
33+
34+let p = base58'1'
35+
36+let q = base58'1'
37+
38+let r = base58'1'
39+
40+let s = base58'1'
41+
42+func t (u) = if ((u == l))
43+ then u
44+ else throw("You cannot create deposits")
2945
3046
31-func n (o) = if (!(isDefined(o)))
47+func v (w,u) = {
48+ let x = getString(this, (w + "_DepositOwner"))
49+ if ((u == x))
50+ then u
51+ else throw("Only deposit owner can withdrawal dividends")
52+ }
53+
54+
55+func y (w) = {
56+ let z = (w + "_DepositOwner")
57+ let A = getString(this, z)
58+ let B = A
59+ if ($isInstanceOf(B, "String"))
60+ then {
61+ let C = B
62+ true
63+ }
64+ else false
65+ }
66+
67+
68+func D (w,E) = {
69+ let z = (w + "_DepositAmount")
70+ let A = getInteger(this, z)
71+ let F = {
72+ let B = A
73+ if ($isInstanceOf(B, "Int"))
74+ then {
75+ let C = B
76+ C
77+ }
78+ else throw("Couldn't find deposit amount")
79+ }
80+ if ((E == F))
81+ then E
82+ else throw("Amount is incorrect")
83+ }
84+
85+
86+func G (H) = if (!(isDefined(H)))
3287 then "WAVES"
33- else if ((o == g))
88+ else if ((H == o))
3489 then "BTC"
35- else if ((o == h))
90+ else if ((H == p))
3691 then "ETH"
37- else if ((o == i))
92+ else if ((H == q))
3893 then "LTC"
39- else if ((o == j))
94+ else if ((H == r))
4095 then "VST"
41- else if ((o == k))
96+ else if ((H == s))
4297 then "WCT"
4398 else throw("AssetId is incorrect")
4499
45100
46-func p (q) = if ((q == "WAVES"))
47- then f
48- else if ((q == "BTC"))
49- then g
50- else if ((q == "ETH"))
51- then h
52- else if ((q == "LTC"))
53- then i
54- else if ((q == "VST"))
55- then j
56- else if ((q == "WCT"))
57- then k
101+func I (w) = if ((w == "WAVES"))
102+ then n
103+ else if ((w == "BTC"))
104+ then o
105+ else if ((w == "ETH"))
106+ then p
107+ else if ((w == "LTC"))
108+ then q
109+ else if ((w == "VST"))
110+ then r
111+ else if ((w == "WCT"))
112+ then s
58113 else throw("Asset name is incorrect")
59114
60115
61-func r (s,t,u) = {
62- let v = {
63- let w = getInteger(this, (((s + "_") + t) + "_DepositAmount"))
64- if ($isInstanceOf(w, "Int"))
65- then {
66- let v = w
67- v
68- }
69- else 0
70- }
71- (v + u)
72- }
73-
74-
75-func x (o,s,q) = {
76- let y = assetBalance(this, o)
77- let z = {
78- let A = (((s + "_") + q) + "_DepositAmount")
79- let B = getInteger(this, A)
80- let w = B
81- if ($isInstanceOf(w, "Int"))
82- then {
83- let v = w
84- v
85- }
86- else 0
87- }
88- ((y - z) / 5)
89- }
90-
91-
92-func C (m,t) = {
93- let A = (((m + "_") + t) + "_DepositAmount")
94- let B = getInteger(this, A)
95- let w = B
96- if ($isInstanceOf(w, "Int"))
116+func J (w) = {
117+ let A = getInteger(this, (w + "_DividendsWithdrawn"))
118+ let B = A
119+ if ($isInstanceOf(B, "Int"))
97120 then {
98- let v = w
99- m
100- }
101- else throw("Couldn't find deposit amount for this user")
102- }
103-
104-
105-func D (s) = {
106- let A = (s + "_DepositHeight")
107- let B = getInteger(this, A)
108- let w = B
109- if ($isInstanceOf(w, "Int"))
110- then {
111- let v = w
112- v
113- }
114- else throw("Couldn't find deposit height")
115- }
116-
117-
118-func E (s,t) = {
119- let A = (((s + "_") + t) + "_DepositAmount")
120- let B = getInteger(this, A)
121- let w = B
122- if ($isInstanceOf(w, "Int"))
123- then {
124- let v = w
125- v
126- }
127- else throw("Couldn't find deposit balance")
128- }
129-
130-
131-func F () = {
132- let A = (toBase58String(a) + "_DividendBalance")
133- let B = getInteger(this, A)
134- let w = B
135- if ($isInstanceOf(w, "Int"))
136- then {
137- let v = w
138- v
121+ let C = B
122+ C
139123 }
140124 else 0
141125 }
142126
143127
144-@Callable(G)
145-func deposit () = {
146- let s = l(G.callerPublicKey)
147- let H = extract(G.payment)
148- let u = H.amount
149- let t = n(H.assetId)
150- let I = r(s, t, u)
151- WriteSet([DataEntry((((s + "_") + t) + "_DepositAmount"), I), DataEntry((s + "_DepositHeight"), height)])
128+func K (H,L) = {
129+ let M = (assetBalance(this, H) + L)
130+ let N = ((M * h) / 100)
131+ (N - L)
132+ }
133+
134+
135+@Callable(O)
136+func createDeposit (w,P,Q,R,S) = {
137+ let T = t(O.callerPublicKey)
138+ let U = y(w)
139+ if (U)
140+ then throw("Deposit is already created")
141+ else WriteSet([DataEntry((w + "_DepositState"), "Created"), DataEntry((w + "_DepositAmount"), P), DataEntry((w + "_DividendPercent"), Q), DataEntry((w + "_DepositStart"), R), DataEntry((w + "_DepositDuration"), S)])
152142 }
153143
154144
155145
156-@Callable(G)
157-func withdrawDividends (q) = {
158- let o = p(q)
159- let s = C(toBase58String(G.callerPublicKey), q)
160- let J = x(o, s, q)
161- ScriptResult(WriteSet([DataEntry((s + "_DividendBalance"), 0)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(s)), J, o)]))
146+@Callable(O)
147+func deposit () = {
148+ let T = toBase58String(O.callerPublicKey)
149+ let V = extract(O.payment)
150+ let w = G(V.assetId)
151+ let P = D(w, V.amount)
152+ let W = getString(this, (w + "_DepositState"))
153+ if ((W == "Created"))
154+ then ScriptResult(WriteSet([DataEntry((w + "_DepositOwner"), T), DataEntry((w + "_DepositState"), "Active")]), TransferSet([ScriptTransfer(addressFromStringValue(j), P, V.assetId)]))
155+ else throw("Deposit is unavailable")
162156 }
163157
164158
165159
166-@Callable(G)
167-func withdrawDeposit (q) = {
168- let t = p(q)
169- let s = C(toBase58String(G.callerPublicKey), q)
170- let K = assetBalance(this, t)
171- let L = D(s)
172- let M = (height - L)
173- let N = E(s, q)
174- let O = if (((K - N) >= 0))
175- then N
176- else K
177- if ((M > e))
178- then ScriptResult(WriteSet([DataEntry((((s + "_") + q) + "_DepositAmount"), (N - O))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(s)), O, t)]))
179- else throw((("Freezing time is not over. " + toString(M)) + " blocks left"))
160+@Callable(O)
161+func withdrawDividends (w) = {
162+ let H = I(w)
163+ let x = v(w, toBase58String(O.callerPublicKey))
164+ let L = J(w)
165+ let X = K(H, L)
166+ ScriptResult(WriteSet([DataEntry((x + "_DividendsWithdrawn"), (L + X))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(x)), X, H)]))
180167 }
181168
182169
183-
184-@Callable(G)
185-func sendToGameBalance (P,u,q) = {
186- let s = if ((G.callerPublicKey == c))
187- then G.callerPublicKey
188- else throw("You cannot send funds to game accounts")
189- let Q = if ((P == b))
190- then P
191- else throw("Funds can be sent on to defined game addresses")
192- let o = p(q)
193- ScriptResult(WriteSet(nil), TransferSet([ScriptTransfer(addressFromStringValue(Q), u, o)]))
194- }
195-
196-
197-@Verifier(R)
198-func S () = if (sigVerify(R.bodyBytes, R.proofs[0], d))
170+@Verifier(Y)
171+func Z () = if (sigVerify(Y.bodyBytes, Y.proofs[0], k))
199172 then {
200- let w = R
201- if ($isInstanceOf(w, "SetScriptTransaction"))
173+ let B = Y
174+ if ($isInstanceOf(B, "SetScriptTransaction"))
202175 then {
203- let T = w
176+ let aa = B
204177 true
205178 }
206- else if ($isInstanceOf(w, "TransferTransaction"))
179+ else if ($isInstanceOf(B, "TransferTransaction"))
207180 then {
208- let U = w
209- let V = assetBalance(this, U.assetId)
210- let W = F()
211- ((V - U.amount) >= W)
181+ let ab = B
182+ let w = G(ab.assetId)
183+ let L = J(w)
184+ let ac = K(ab.assetId, L)
185+ let ad = assetBalance(this, ab.assetId)
186+ ((ad - ab.amount) >= ac)
212187 }
213188 else false
214189 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = fromBase58String("47yVx7y7Q9CP9VbAYgns76YMDmxeeGz2REzmVZsBC83g")
4+let a = 100000000
55
6-let b = "3Mqp45361wCutaKEqM2kCbFZmrkodQGvpUE"
6+let b = (2600 * a)
77
8-let c = fromBase58String("Cm5aPWtA6PufaZS5keg1ZMnDSzEiwkUHCZsTFkdr8YwP")
8+let c = ((2600 * a) / 10000)
99
10-let d = fromBase58String("HMJMUXBatArd2SDvjv3YbtdrY2BAsxDEfWhqv8kYH4Kj")
10+let d = (13 * a)
1111
12-let e = 1
12+let e = (39 * a)
1313
14-let f = unit
14+let f = (26000 * a)
1515
16-let g = base58'1'
16+let g = (26000 * a)
1717
18-let h = base58'1'
18+let h = 30
1919
20-let i = base58'1'
20+let i = 1
2121
22-let j = base58'1'
22+let j = "3Mqp45361wCutaKEqM2kCbFZmrkodQGvpUE"
2323
24-let k = base58'1'
24+let k = fromBase58String("HMJMUXBatArd2SDvjv3YbtdrY2BAsxDEfWhqv8kYH4Kj")
2525
26-func l (m) = if ((m == a))
27- then toBase58String(m)
28- else throw("Only predefined public keys can make deposits")
26+let l = fromBase58String("1")
27+
28+let m = ((1440 * 30) * 6)
29+
30+let n = unit
31+
32+let o = base58'1'
33+
34+let p = base58'1'
35+
36+let q = base58'1'
37+
38+let r = base58'1'
39+
40+let s = base58'1'
41+
42+func t (u) = if ((u == l))
43+ then u
44+ else throw("You cannot create deposits")
2945
3046
31-func n (o) = if (!(isDefined(o)))
47+func v (w,u) = {
48+ let x = getString(this, (w + "_DepositOwner"))
49+ if ((u == x))
50+ then u
51+ else throw("Only deposit owner can withdrawal dividends")
52+ }
53+
54+
55+func y (w) = {
56+ let z = (w + "_DepositOwner")
57+ let A = getString(this, z)
58+ let B = A
59+ if ($isInstanceOf(B, "String"))
60+ then {
61+ let C = B
62+ true
63+ }
64+ else false
65+ }
66+
67+
68+func D (w,E) = {
69+ let z = (w + "_DepositAmount")
70+ let A = getInteger(this, z)
71+ let F = {
72+ let B = A
73+ if ($isInstanceOf(B, "Int"))
74+ then {
75+ let C = B
76+ C
77+ }
78+ else throw("Couldn't find deposit amount")
79+ }
80+ if ((E == F))
81+ then E
82+ else throw("Amount is incorrect")
83+ }
84+
85+
86+func G (H) = if (!(isDefined(H)))
3287 then "WAVES"
33- else if ((o == g))
88+ else if ((H == o))
3489 then "BTC"
35- else if ((o == h))
90+ else if ((H == p))
3691 then "ETH"
37- else if ((o == i))
92+ else if ((H == q))
3893 then "LTC"
39- else if ((o == j))
94+ else if ((H == r))
4095 then "VST"
41- else if ((o == k))
96+ else if ((H == s))
4297 then "WCT"
4398 else throw("AssetId is incorrect")
4499
45100
46-func p (q) = if ((q == "WAVES"))
47- then f
48- else if ((q == "BTC"))
49- then g
50- else if ((q == "ETH"))
51- then h
52- else if ((q == "LTC"))
53- then i
54- else if ((q == "VST"))
55- then j
56- else if ((q == "WCT"))
57- then k
101+func I (w) = if ((w == "WAVES"))
102+ then n
103+ else if ((w == "BTC"))
104+ then o
105+ else if ((w == "ETH"))
106+ then p
107+ else if ((w == "LTC"))
108+ then q
109+ else if ((w == "VST"))
110+ then r
111+ else if ((w == "WCT"))
112+ then s
58113 else throw("Asset name is incorrect")
59114
60115
61-func r (s,t,u) = {
62- let v = {
63- let w = getInteger(this, (((s + "_") + t) + "_DepositAmount"))
64- if ($isInstanceOf(w, "Int"))
65- then {
66- let v = w
67- v
68- }
69- else 0
70- }
71- (v + u)
72- }
73-
74-
75-func x (o,s,q) = {
76- let y = assetBalance(this, o)
77- let z = {
78- let A = (((s + "_") + q) + "_DepositAmount")
79- let B = getInteger(this, A)
80- let w = B
81- if ($isInstanceOf(w, "Int"))
82- then {
83- let v = w
84- v
85- }
86- else 0
87- }
88- ((y - z) / 5)
89- }
90-
91-
92-func C (m,t) = {
93- let A = (((m + "_") + t) + "_DepositAmount")
94- let B = getInteger(this, A)
95- let w = B
96- if ($isInstanceOf(w, "Int"))
116+func J (w) = {
117+ let A = getInteger(this, (w + "_DividendsWithdrawn"))
118+ let B = A
119+ if ($isInstanceOf(B, "Int"))
97120 then {
98- let v = w
99- m
100- }
101- else throw("Couldn't find deposit amount for this user")
102- }
103-
104-
105-func D (s) = {
106- let A = (s + "_DepositHeight")
107- let B = getInteger(this, A)
108- let w = B
109- if ($isInstanceOf(w, "Int"))
110- then {
111- let v = w
112- v
113- }
114- else throw("Couldn't find deposit height")
115- }
116-
117-
118-func E (s,t) = {
119- let A = (((s + "_") + t) + "_DepositAmount")
120- let B = getInteger(this, A)
121- let w = B
122- if ($isInstanceOf(w, "Int"))
123- then {
124- let v = w
125- v
126- }
127- else throw("Couldn't find deposit balance")
128- }
129-
130-
131-func F () = {
132- let A = (toBase58String(a) + "_DividendBalance")
133- let B = getInteger(this, A)
134- let w = B
135- if ($isInstanceOf(w, "Int"))
136- then {
137- let v = w
138- v
121+ let C = B
122+ C
139123 }
140124 else 0
141125 }
142126
143127
144-@Callable(G)
145-func deposit () = {
146- let s = l(G.callerPublicKey)
147- let H = extract(G.payment)
148- let u = H.amount
149- let t = n(H.assetId)
150- let I = r(s, t, u)
151- WriteSet([DataEntry((((s + "_") + t) + "_DepositAmount"), I), DataEntry((s + "_DepositHeight"), height)])
128+func K (H,L) = {
129+ let M = (assetBalance(this, H) + L)
130+ let N = ((M * h) / 100)
131+ (N - L)
132+ }
133+
134+
135+@Callable(O)
136+func createDeposit (w,P,Q,R,S) = {
137+ let T = t(O.callerPublicKey)
138+ let U = y(w)
139+ if (U)
140+ then throw("Deposit is already created")
141+ else WriteSet([DataEntry((w + "_DepositState"), "Created"), DataEntry((w + "_DepositAmount"), P), DataEntry((w + "_DividendPercent"), Q), DataEntry((w + "_DepositStart"), R), DataEntry((w + "_DepositDuration"), S)])
152142 }
153143
154144
155145
156-@Callable(G)
157-func withdrawDividends (q) = {
158- let o = p(q)
159- let s = C(toBase58String(G.callerPublicKey), q)
160- let J = x(o, s, q)
161- ScriptResult(WriteSet([DataEntry((s + "_DividendBalance"), 0)]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(s)), J, o)]))
146+@Callable(O)
147+func deposit () = {
148+ let T = toBase58String(O.callerPublicKey)
149+ let V = extract(O.payment)
150+ let w = G(V.assetId)
151+ let P = D(w, V.amount)
152+ let W = getString(this, (w + "_DepositState"))
153+ if ((W == "Created"))
154+ then ScriptResult(WriteSet([DataEntry((w + "_DepositOwner"), T), DataEntry((w + "_DepositState"), "Active")]), TransferSet([ScriptTransfer(addressFromStringValue(j), P, V.assetId)]))
155+ else throw("Deposit is unavailable")
162156 }
163157
164158
165159
166-@Callable(G)
167-func withdrawDeposit (q) = {
168- let t = p(q)
169- let s = C(toBase58String(G.callerPublicKey), q)
170- let K = assetBalance(this, t)
171- let L = D(s)
172- let M = (height - L)
173- let N = E(s, q)
174- let O = if (((K - N) >= 0))
175- then N
176- else K
177- if ((M > e))
178- then ScriptResult(WriteSet([DataEntry((((s + "_") + q) + "_DepositAmount"), (N - O))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(s)), O, t)]))
179- else throw((("Freezing time is not over. " + toString(M)) + " blocks left"))
160+@Callable(O)
161+func withdrawDividends (w) = {
162+ let H = I(w)
163+ let x = v(w, toBase58String(O.callerPublicKey))
164+ let L = J(w)
165+ let X = K(H, L)
166+ ScriptResult(WriteSet([DataEntry((x + "_DividendsWithdrawn"), (L + X))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(x)), X, H)]))
180167 }
181168
182169
183-
184-@Callable(G)
185-func sendToGameBalance (P,u,q) = {
186- let s = if ((G.callerPublicKey == c))
187- then G.callerPublicKey
188- else throw("You cannot send funds to game accounts")
189- let Q = if ((P == b))
190- then P
191- else throw("Funds can be sent on to defined game addresses")
192- let o = p(q)
193- ScriptResult(WriteSet(nil), TransferSet([ScriptTransfer(addressFromStringValue(Q), u, o)]))
194- }
195-
196-
197-@Verifier(R)
198-func S () = if (sigVerify(R.bodyBytes, R.proofs[0], d))
170+@Verifier(Y)
171+func Z () = if (sigVerify(Y.bodyBytes, Y.proofs[0], k))
199172 then {
200- let w = R
201- if ($isInstanceOf(w, "SetScriptTransaction"))
173+ let B = Y
174+ if ($isInstanceOf(B, "SetScriptTransaction"))
202175 then {
203- let T = w
176+ let aa = B
204177 true
205178 }
206- else if ($isInstanceOf(w, "TransferTransaction"))
179+ else if ($isInstanceOf(B, "TransferTransaction"))
207180 then {
208- let U = w
209- let V = assetBalance(this, U.assetId)
210- let W = F()
211- ((V - U.amount) >= W)
181+ let ab = B
182+ let w = G(ab.assetId)
183+ let L = J(w)
184+ let ac = K(ab.assetId, L)
185+ let ad = assetBalance(this, ab.assetId)
186+ ((ad - ab.amount) >= ac)
212187 }
213188 else false
214189 }
215190 else false
216191

github/deemru/w8io/169f3d6 
51.74 ms