tx · CwJVvzCg4MZ6x5kksHPBJfDiuJddPJmSi1uNrE8hvYwk

3N3QGoxpTairHzyavoHpRPyTVMyLdX46MwJ:  -0.01400000 Waves

2021.02.02 19:02 [1380756] smart account 3N3QGoxpTairHzyavoHpRPyTVMyLdX46MwJ > SELF 0.00000000 Waves

{ "type": 13, "id": "CwJVvzCg4MZ6x5kksHPBJfDiuJddPJmSi1uNrE8hvYwk", "fee": 1400000, "feeAssetId": null, "timestamp": 1612281672559, "version": 2, "chainId": 84, "sender": "3N3QGoxpTairHzyavoHpRPyTVMyLdX46MwJ", "senderPublicKey": "84ye9pvBU1ixETjmeNbvvD5czb8ZEjsSJuNyFGkYFmwd", "proofs": [ "1XPTQe48FLBX2upXj1wDxioWmLA9kY9cjkFEwSfxocQVitVaAyUPQkWNQyzUNtHgigqjDQZED5jBYuC8cdPuNpt" ], "script": "base64:AAIEAAAAAAAAAB0IAhIDCgEIEgMKAQgSAwoBCBIECgIIARIECgIICAAAACIAAAAABE5PTkUCAAAABG5vbmUAAAAABkJBTk5FRAIAAAAGYmFubmVkAAAAAAZBQ1RJVkUCAAAABmFjdGl2ZQAAAAAFQ0xPU0UCAAAABWNsb3NlAAAAAARPUEVOAgAAAARvcGVuAAAAAAhhc3NldEtleQIAAAAFYXNzZXQAAAAAC2tleVByaWNlS2V5AgAAAAlrZXlfcHJpY2UAAAAACG93bmVyS2V5AgAAAAVvd25lcgAAAAAQcmVjaGFyZ2VMaW1pdEtleQIAAAAOcmVjaGFyZ2VfbGltaXQAAAAAB2FjdGlvbnMJAARMAAAAAgUAAAAET1BFTgkABEwAAAACBQAAAAVDTE9TRQUAAAADbmlsAAAAABRkZXZpY2VJbml0aWFsQ291bnRlcgAAAAAAAAAAAAAAAAAJa2V5RGV2aWNlAAAAAAAAAAAAAAAAAA1rZXlWYWxpZFVudGlsAAAAAAAAAAABAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAAB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AAAAGZGV2aWNlBQAAAAVrZXlJRAkAAAIAAAABAgAAABNLZXkgbm90IHdoaXRlbGlzdGVkAwkBAAAAFm5vdEFsbG93ZWREZXZpY2VBY3Rpb24AAAABBQAAAAZhY3Rpb24JAAACAAAAAQIAAAAVQWN0aW9uIGlzIG5vdCBhbGxvd2VkAwkBAAAAE2tleVRpbWVzdGFtcEludmFsaWQAAAABBQAAAAdrZXlJbmZvCQAAAgAAAAECAAAAC0tleSBleHBpcmVkBAAAAAdjaGFuZ2VzCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAA9kZXZpY2VBY3Rpb25LZXkAAAABBQAAAAlkZXZpY2VTdHIFAAAABmFjdGlvbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAAFmRldmljZUFjdGlvbkNvdW50ZXJLZXkAAAABBQAAAAlkZXZpY2VTdHIJAABkAAAAAgkBAAAAGGRldmljZUFjdGlvbkNvdW50ZXJWYWx1ZQAAAAEFAAAACWRldmljZVN0cgAAAAAAAAAAAQUAAAADbmlsAwMJAABmAAAAAgUAAAAIcmVjaGFyZ2UICQAD7wAAAAEIBQAAAAFpAAAABmNhbGxlcgAAAAdyZWd1bGFyCQEAAAACIT0AAAACBQAAAAhyZWNoYXJnZQAAAAAAAAAAAAcJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAhyZWNoYXJnZQUAAAAEdW5pdAUAAAAHY2hhbmdlcwUAAAAHY2hhbmdlcwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5leiI/w==", "height": 1380756, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EEbZ7Ps4jtbkz3vi6ya4xvpCyE7aWk9qosu8zydH39ft Next: B54YdMfGDWnR6kuqDQohKzjNtYWw6TapBw7VQejkmWct Diff:
OldNewDifferences
1717
1818 let h = "owner"
1919
20-let i = [e, d]
20+let i = "recharge_limit"
2121
22-let j = 0
22+let j = [e, d]
2323
2424 let k = 0
2525
26-let l = 1
26+let l = 0
2727
28-func m (n) = {
29- let o = getInteger(this, n)
30- if ($isInstanceOf(o, "Int"))
28+let m = 1
29+
30+func n (o) = {
31+ let p = getInteger(this, o)
32+ if ($isInstanceOf(p, "Int"))
3133 then {
32- let p = o
33- p
34+ let q = p
35+ q
3436 }
3537 else 0
3638 }
3739
3840
39-func q (n) = {
40- let o = getString(this, n)
41- if ($isInstanceOf(o, "String"))
41+func r (o) = {
42+ let p = getString(this, o)
43+ if ($isInstanceOf(p, "String"))
4244 then {
43- let p = o
44- p
45+ let q = p
46+ q
4547 }
4648 else a
4749 }
4850
4951
50-func r (n) = {
51- let o = getInteger(this, n)
52- if ($isInstanceOf(o, "Int"))
52+func s (o) = {
53+ let p = getInteger(this, o)
54+ if ($isInstanceOf(p, "Int"))
5355 then {
54- let p = o
55- p
56+ let q = p
57+ q
5658 }
5759 else 0
5860 }
5961
6062
61-func s (t,n) = {
62- let o = getString(t, n)
63- if ($isInstanceOf(o, "String"))
63+func t (u,o) = {
64+ let p = getString(u, o)
65+ if ($isInstanceOf(p, "String"))
6466 then {
65- let p = o
66- p
67+ let q = p
68+ q
6769 }
6870 else a
6971 }
7072
7173
72-func u () = fromBase58String(q(f))
74+func v () = fromBase58String(r(f))
7375
7476
75-func v (t) = ("user_" + t)
77+func w (u) = ("user_" + u)
7678
7779
78-func w (t) = {
79- let o = getString(this, v(t))
80- if ($isInstanceOf(o, "String"))
80+func x (u) = {
81+ let p = getString(this, w(u))
82+ if ($isInstanceOf(p, "String"))
8183 then {
82- let p = o
83- p
84+ let q = p
85+ q
8486 }
8587 else a
8688 }
8789
8890
89-func x (t) = ("device_" + t)
91+func y (u) = ("device_" + u)
9092
9193
92-func y (t) = ("device_counter_" + t)
94+func z (u) = ("device_counter_" + u)
9395
9496
95-func z (t) = q(x(t))
97+func A (u) = r(y(u))
9698
9799
98-func A (t) = m(y(t))
100+func B (u) = n(z(u))
99101
100102
101-func B (C) = ("key_" + C)
103+func C (D) = ("key_" + D)
102104
103105
104-func D (C) = q(B(C))
106+func E (D) = r(C(D))
105107
106108
107-func E (F,n) = {
108- let G = B(n)
109- let H = s(F, G)
110- if ((H != a))
109+func F (G,o) = {
110+ let H = C(o)
111+ let I = t(G, H)
112+ if ((I != a))
111113 then false
112114 else true
113115 }
114116
115117
116-func I (n) = {
117- let F = split(n.description, "_")[k]
118- let o = addressFromString(F)
119- if ($isInstanceOf(o, "Address"))
118+func J (o) = {
119+ let G = split(o.description, "_")[l]
120+ let p = addressFromString(G)
121+ if ($isInstanceOf(p, "Address"))
120122 then {
121- let J = o
122- J
123+ let K = p
124+ K
123125 }
124126 else throw("Not a device key")
125127 }
126128
127129
128-func K (L) = {
129- let o = assetInfo(L)
130- if ($isInstanceOf(o, "Asset"))
130+func L (M) = {
131+ let p = assetInfo(M)
132+ if ($isInstanceOf(p, "Asset"))
131133 then {
132- let J = o
133- J
134+ let K = p
135+ K
134136 }
135137 else throw("Not a key")
136138 }
137139
138140
139-func M (n) = {
140- let N = parseIntValue(split(n.description, "_")[l])
141- (lastBlock.timestamp > N)
141+func N (o) = {
142+ let O = parseIntValue(split(o.description, "_")[m])
143+ (lastBlock.timestamp > O)
142144 }
143145
144146
145-func O (F) = {
146- let o = getInteger(F, g)
147- if ($isInstanceOf(o, "Int"))
147+func P (G) = {
148+ let p = getInteger(G, g)
149+ if ($isInstanceOf(p, "Int"))
148150 then {
149- let J = o
150- J
151+ let K = p
152+ K
151153 }
152154 else throw("Price not specified in device")
153155 }
154156
155157
156-func P (F) = {
157- let o = getString(F, h)
158- if ($isInstanceOf(o, "String"))
158+func Q (G) = {
159+ let p = getString(G, h)
160+ if ($isInstanceOf(p, "String"))
159161 then {
160- let J = o
161- J
162+ let K = p
163+ K
162164 }
163165 else throw("Owner not specified in device")
164166 }
165167
166168
167-func Q (R,S,T) = if ((1 > size(R.payments)))
169+func R (S,T,U) = if ((1 > size(S.payments)))
168170 then throw("wrong payments count")
169- else if ((R.payments[0].assetId != S))
170- then throw("wrong asset, supported only xyz")
171- else if ((R.payments[0].amount != T))
172- then throw(("wrong payment value, expected " + toString(T)))
171+ else if ((S.payments[0].assetId != unit))
172+ then throw("wrong asset, supported only wws")
173+ else if ((S.payments[0].amount != U))
174+ then throw(("wrong payment value, expected " + toString(U)))
173175 else false
174176
175177
176-func U (V) = {
177- let o = indexOf(i, V)
178- if ($isInstanceOf(o, "Int"))
178+func V (W) = {
179+ let p = indexOf(j, W)
180+ if ($isInstanceOf(p, "Int"))
179181 then {
180- let p = o
182+ let q = p
181183 false
182184 }
183185 else true
184186 }
185187
186188
187-@Callable(R)
188-func addDevice (W) = if ((R.caller != this))
189+@Callable(S)
190+func addDevice (X) = if ((S.caller != this))
189191 then throw("Not permitted")
190- else if ((z(W) != a))
192+ else if ((A(X) != a))
191193 then throw("Device already added")
192- else [StringEntry(x(W), d), IntegerEntry(y(W), j)]
194+ else [StringEntry(y(X), d), IntegerEntry(z(X), k)]
193195
194196
195197
196-@Callable(R)
197-func addUser (W) = if ((R.caller != this))
198+@Callable(S)
199+func addUser (X) = if ((S.caller != this))
198200 then throw("Not permitted")
199- else [StringEntry(v(W), c)]
201+ else [StringEntry(w(X), c)]
200202
201203
202204
203-@Callable(R)
204-func removeUser (W) = if ((R.caller != this))
205+@Callable(S)
206+func removeUser (X) = if ((S.caller != this))
205207 then throw("Not permitted")
206- else [DeleteEntry(v(W))]
208+ else [DeleteEntry(w(X))]
207209
208210
209211
210-@Callable(R)
211-func requestKey (W,X) = {
212- let Y = lastBlock.timestamp
213- let Z = (Y + X)
214- let aa = P(addressFromStringValue(W))
215- let ab = O(addressFromStringValue(W))
216- let S = u()
217- if ((toBase58String(R.caller.bytes) != aa))
212+@Callable(S)
213+func requestKey (X,Y) = {
214+ let Z = lastBlock.timestamp
215+ let aa = (Z + Y)
216+ let ab = Q(addressFromStringValue(X))
217+ let ac = P(addressFromStringValue(X))
218+ let T = v()
219+ if ((toBase58String(S.caller.bytes) != ab))
218220 then throw("Not permitted")
219- else if ((x(W) == a))
221+ else if ((y(X) == a))
220222 then throw("No such device")
221- else if (Q(R, S, ab))
223+ else if (R(S, T, ac))
222224 then throw("wrong price")
223225 else {
224- let ac = Issue("DeviceKeyGen", ((W + "_") + toString(Z)), 1, 0, false)
225- let ad = calculateAssetId(ac)
226-[ac, ScriptTransfer(R.caller, 1, ad)]
226+ let ad = Issue("DeviceKeyGen", ((X + "_") + toString(aa)), 1, 0, false)
227+ let ae = calculateAssetId(ad)
228+[ad, ScriptTransfer(S.caller, 1, ae)]
227229 }
228230 }
229231
230232
231233
232-@Callable(R)
233-func deviceAction (ae,V) = {
234- let af = (1 > assetBalance(R.caller, fromBase58String(ae)))
235- let ag = K(fromBase58String(ae))
236- let F = I(ag)
237- let ah = toBase58String(F.bytes)
238- if (af)
234+@Callable(S)
235+func deviceAction (af,W) = {
236+ let ag = (1 > assetBalance(S.caller, fromBase58String(af)))
237+ let ah = L(fromBase58String(af))
238+ let G = J(ah)
239+ let ai = toBase58String(G.bytes)
240+ let aj = s(i)
241+ if (ag)
239242 then throw("Key not owned")
240- else if ((x(ah) == a))
243+ else if ((y(ai) == a))
241244 then throw("No such device")
242- else if (E(F, ae))
245+ else if (F(G, af))
243246 then throw("Key not whitelisted")
244- else if (U(V))
247+ else if (V(W))
245248 then throw("Action is not allowed")
246- else if (M(ag))
249+ else if (N(ah))
247250 then throw("Key expired")
248- else [StringEntry(x(ah), V), IntegerEntry(y(ah), (A(ah) + 1))]
251+ else {
252+ let ak = [StringEntry(y(ai), W), IntegerEntry(z(ai), (B(ai) + 1))]
253+ if (if ((aj > wavesBalance(S.caller).regular))
254+ then (aj != 0)
255+ else false)
256+ then ScriptTransfer(S.caller, aj, unit) :: ak
257+ else ak
258+ }
249259 }
250260
251261
252-@Verifier(ai)
253-func aj () = sigVerify(ai.bodyBytes, ai.proofs[0], ai.senderPublicKey)
262+@Verifier(al)
263+func am () = sigVerify(al.bodyBytes, al.proofs[0], al.senderPublicKey)
254264
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "none"
55
66 let b = "banned"
77
88 let c = "active"
99
1010 let d = "close"
1111
1212 let e = "open"
1313
1414 let f = "asset"
1515
1616 let g = "key_price"
1717
1818 let h = "owner"
1919
20-let i = [e, d]
20+let i = "recharge_limit"
2121
22-let j = 0
22+let j = [e, d]
2323
2424 let k = 0
2525
26-let l = 1
26+let l = 0
2727
28-func m (n) = {
29- let o = getInteger(this, n)
30- if ($isInstanceOf(o, "Int"))
28+let m = 1
29+
30+func n (o) = {
31+ let p = getInteger(this, o)
32+ if ($isInstanceOf(p, "Int"))
3133 then {
32- let p = o
33- p
34+ let q = p
35+ q
3436 }
3537 else 0
3638 }
3739
3840
39-func q (n) = {
40- let o = getString(this, n)
41- if ($isInstanceOf(o, "String"))
41+func r (o) = {
42+ let p = getString(this, o)
43+ if ($isInstanceOf(p, "String"))
4244 then {
43- let p = o
44- p
45+ let q = p
46+ q
4547 }
4648 else a
4749 }
4850
4951
50-func r (n) = {
51- let o = getInteger(this, n)
52- if ($isInstanceOf(o, "Int"))
52+func s (o) = {
53+ let p = getInteger(this, o)
54+ if ($isInstanceOf(p, "Int"))
5355 then {
54- let p = o
55- p
56+ let q = p
57+ q
5658 }
5759 else 0
5860 }
5961
6062
61-func s (t,n) = {
62- let o = getString(t, n)
63- if ($isInstanceOf(o, "String"))
63+func t (u,o) = {
64+ let p = getString(u, o)
65+ if ($isInstanceOf(p, "String"))
6466 then {
65- let p = o
66- p
67+ let q = p
68+ q
6769 }
6870 else a
6971 }
7072
7173
72-func u () = fromBase58String(q(f))
74+func v () = fromBase58String(r(f))
7375
7476
75-func v (t) = ("user_" + t)
77+func w (u) = ("user_" + u)
7678
7779
78-func w (t) = {
79- let o = getString(this, v(t))
80- if ($isInstanceOf(o, "String"))
80+func x (u) = {
81+ let p = getString(this, w(u))
82+ if ($isInstanceOf(p, "String"))
8183 then {
82- let p = o
83- p
84+ let q = p
85+ q
8486 }
8587 else a
8688 }
8789
8890
89-func x (t) = ("device_" + t)
91+func y (u) = ("device_" + u)
9092
9193
92-func y (t) = ("device_counter_" + t)
94+func z (u) = ("device_counter_" + u)
9395
9496
95-func z (t) = q(x(t))
97+func A (u) = r(y(u))
9698
9799
98-func A (t) = m(y(t))
100+func B (u) = n(z(u))
99101
100102
101-func B (C) = ("key_" + C)
103+func C (D) = ("key_" + D)
102104
103105
104-func D (C) = q(B(C))
106+func E (D) = r(C(D))
105107
106108
107-func E (F,n) = {
108- let G = B(n)
109- let H = s(F, G)
110- if ((H != a))
109+func F (G,o) = {
110+ let H = C(o)
111+ let I = t(G, H)
112+ if ((I != a))
111113 then false
112114 else true
113115 }
114116
115117
116-func I (n) = {
117- let F = split(n.description, "_")[k]
118- let o = addressFromString(F)
119- if ($isInstanceOf(o, "Address"))
118+func J (o) = {
119+ let G = split(o.description, "_")[l]
120+ let p = addressFromString(G)
121+ if ($isInstanceOf(p, "Address"))
120122 then {
121- let J = o
122- J
123+ let K = p
124+ K
123125 }
124126 else throw("Not a device key")
125127 }
126128
127129
128-func K (L) = {
129- let o = assetInfo(L)
130- if ($isInstanceOf(o, "Asset"))
130+func L (M) = {
131+ let p = assetInfo(M)
132+ if ($isInstanceOf(p, "Asset"))
131133 then {
132- let J = o
133- J
134+ let K = p
135+ K
134136 }
135137 else throw("Not a key")
136138 }
137139
138140
139-func M (n) = {
140- let N = parseIntValue(split(n.description, "_")[l])
141- (lastBlock.timestamp > N)
141+func N (o) = {
142+ let O = parseIntValue(split(o.description, "_")[m])
143+ (lastBlock.timestamp > O)
142144 }
143145
144146
145-func O (F) = {
146- let o = getInteger(F, g)
147- if ($isInstanceOf(o, "Int"))
147+func P (G) = {
148+ let p = getInteger(G, g)
149+ if ($isInstanceOf(p, "Int"))
148150 then {
149- let J = o
150- J
151+ let K = p
152+ K
151153 }
152154 else throw("Price not specified in device")
153155 }
154156
155157
156-func P (F) = {
157- let o = getString(F, h)
158- if ($isInstanceOf(o, "String"))
158+func Q (G) = {
159+ let p = getString(G, h)
160+ if ($isInstanceOf(p, "String"))
159161 then {
160- let J = o
161- J
162+ let K = p
163+ K
162164 }
163165 else throw("Owner not specified in device")
164166 }
165167
166168
167-func Q (R,S,T) = if ((1 > size(R.payments)))
169+func R (S,T,U) = if ((1 > size(S.payments)))
168170 then throw("wrong payments count")
169- else if ((R.payments[0].assetId != S))
170- then throw("wrong asset, supported only xyz")
171- else if ((R.payments[0].amount != T))
172- then throw(("wrong payment value, expected " + toString(T)))
171+ else if ((S.payments[0].assetId != unit))
172+ then throw("wrong asset, supported only wws")
173+ else if ((S.payments[0].amount != U))
174+ then throw(("wrong payment value, expected " + toString(U)))
173175 else false
174176
175177
176-func U (V) = {
177- let o = indexOf(i, V)
178- if ($isInstanceOf(o, "Int"))
178+func V (W) = {
179+ let p = indexOf(j, W)
180+ if ($isInstanceOf(p, "Int"))
179181 then {
180- let p = o
182+ let q = p
181183 false
182184 }
183185 else true
184186 }
185187
186188
187-@Callable(R)
188-func addDevice (W) = if ((R.caller != this))
189+@Callable(S)
190+func addDevice (X) = if ((S.caller != this))
189191 then throw("Not permitted")
190- else if ((z(W) != a))
192+ else if ((A(X) != a))
191193 then throw("Device already added")
192- else [StringEntry(x(W), d), IntegerEntry(y(W), j)]
194+ else [StringEntry(y(X), d), IntegerEntry(z(X), k)]
193195
194196
195197
196-@Callable(R)
197-func addUser (W) = if ((R.caller != this))
198+@Callable(S)
199+func addUser (X) = if ((S.caller != this))
198200 then throw("Not permitted")
199- else [StringEntry(v(W), c)]
201+ else [StringEntry(w(X), c)]
200202
201203
202204
203-@Callable(R)
204-func removeUser (W) = if ((R.caller != this))
205+@Callable(S)
206+func removeUser (X) = if ((S.caller != this))
205207 then throw("Not permitted")
206- else [DeleteEntry(v(W))]
208+ else [DeleteEntry(w(X))]
207209
208210
209211
210-@Callable(R)
211-func requestKey (W,X) = {
212- let Y = lastBlock.timestamp
213- let Z = (Y + X)
214- let aa = P(addressFromStringValue(W))
215- let ab = O(addressFromStringValue(W))
216- let S = u()
217- if ((toBase58String(R.caller.bytes) != aa))
212+@Callable(S)
213+func requestKey (X,Y) = {
214+ let Z = lastBlock.timestamp
215+ let aa = (Z + Y)
216+ let ab = Q(addressFromStringValue(X))
217+ let ac = P(addressFromStringValue(X))
218+ let T = v()
219+ if ((toBase58String(S.caller.bytes) != ab))
218220 then throw("Not permitted")
219- else if ((x(W) == a))
221+ else if ((y(X) == a))
220222 then throw("No such device")
221- else if (Q(R, S, ab))
223+ else if (R(S, T, ac))
222224 then throw("wrong price")
223225 else {
224- let ac = Issue("DeviceKeyGen", ((W + "_") + toString(Z)), 1, 0, false)
225- let ad = calculateAssetId(ac)
226-[ac, ScriptTransfer(R.caller, 1, ad)]
226+ let ad = Issue("DeviceKeyGen", ((X + "_") + toString(aa)), 1, 0, false)
227+ let ae = calculateAssetId(ad)
228+[ad, ScriptTransfer(S.caller, 1, ae)]
227229 }
228230 }
229231
230232
231233
232-@Callable(R)
233-func deviceAction (ae,V) = {
234- let af = (1 > assetBalance(R.caller, fromBase58String(ae)))
235- let ag = K(fromBase58String(ae))
236- let F = I(ag)
237- let ah = toBase58String(F.bytes)
238- if (af)
234+@Callable(S)
235+func deviceAction (af,W) = {
236+ let ag = (1 > assetBalance(S.caller, fromBase58String(af)))
237+ let ah = L(fromBase58String(af))
238+ let G = J(ah)
239+ let ai = toBase58String(G.bytes)
240+ let aj = s(i)
241+ if (ag)
239242 then throw("Key not owned")
240- else if ((x(ah) == a))
243+ else if ((y(ai) == a))
241244 then throw("No such device")
242- else if (E(F, ae))
245+ else if (F(G, af))
243246 then throw("Key not whitelisted")
244- else if (U(V))
247+ else if (V(W))
245248 then throw("Action is not allowed")
246- else if (M(ag))
249+ else if (N(ah))
247250 then throw("Key expired")
248- else [StringEntry(x(ah), V), IntegerEntry(y(ah), (A(ah) + 1))]
251+ else {
252+ let ak = [StringEntry(y(ai), W), IntegerEntry(z(ai), (B(ai) + 1))]
253+ if (if ((aj > wavesBalance(S.caller).regular))
254+ then (aj != 0)
255+ else false)
256+ then ScriptTransfer(S.caller, aj, unit) :: ak
257+ else ak
258+ }
249259 }
250260
251261
252-@Verifier(ai)
253-func aj () = sigVerify(ai.bodyBytes, ai.proofs[0], ai.senderPublicKey)
262+@Verifier(al)
263+func am () = sigVerify(al.bodyBytes, al.proofs[0], al.senderPublicKey)
254264

github/deemru/w8io/169f3d6 
244.93 ms