tx · F4LhcqZYvbaG74MnUZNpdS4iM6rMcfBaF5c3ZLTdKpyM

3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx:  -0.01000000 Waves

2023.02.17 09:28 [2453257] smart account 3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx > SELF 0.00000000 Waves

{ "type": 13, "id": "F4LhcqZYvbaG74MnUZNpdS4iM6rMcfBaF5c3ZLTdKpyM", "fee": 1000000, "feeAssetId": null, "timestamp": 1676615324744, "version": 2, "chainId": 84, "sender": "3Mr7HCJPTazuYjJbfbbpRMvZX8xrNTjT1Kx", "senderPublicKey": "D35PGQCSSdrp9pvujggj7b2DaCK1BhcU3kho7tikKJYs", "proofs": [ "2igQPWLaTEBBa3kwt8sunk3ER45KhjbpGJqro42jU1hyFnrQKvzDsYQgv8L23wG59fhmyd31GjN2Z4UnD1TmHmX7" ], "script": "base64:BgIaCAISABIDCgEBEgQKAhgREgQKAggBEgMKAQgBAAR0VVNEASCrJEpqtkJG69L843mwYbrDrmlXTVJ6ykUcp0AdEbApDgUBaQEHZGVwb3NpdAAEA3BtdAkAkQMCCQEFdmFsdWUBCAUBaQhwYXltZW50cwAAAwkBCWlzRGVmaW5lZAEIBQNwbXQHYXNzZXRJZAkAAgECIWNhbiBob2RsIHdhdmVzIG9ubHkgYXQgdGhlIG1vbWVudAMJAQIhPQIIBQNwbXQHYXNzZXRJZAUEdFVTRAkAAgECF2hvbGRlZCBwYXltZW50IG5vdCB0VVNEBApjdXJyZW50S2V5CQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMEDWN1cnJlbnRBbW91bnQEByRtYXRjaDAJAJoIAgUEdGhpcwUKY3VycmVudEtleQMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEAAAQJbmV3QW1vdW50CQBkAgUNY3VycmVudEFtb3VudAgFA3BtdAZhbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFCmN1cnJlbnRLZXkFCW5ld0Ftb3VudA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eded", "spentComplexity": 0 } View: original | compacted Prev: 63b8Fc3aNNDxvaPTY4FtDMpRAJHiuKqHjkNN3y4qUHe2 Next: 4q1xdM2iyqiSDxLytspKghbxdJXXWkhaA3hbPT1wRMqD Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85'
45
5-
6-@Callable(a)
6+@Callable(b)
77 func deposit () = {
8- let b = value(a.payments)[0]
9- if (isDefined(b.assetId))
8+ let c = value(b.payments)[0]
9+ if (isDefined(c.assetId))
1010 then throw("can hodl waves only at the moment")
11- else {
12- let c = toBase58String(a.caller.bytes)
13- let d = {
14- let e = getInteger(this, c)
15- if ($isInstanceOf(e, "Int"))
16- then {
17- let f = e
18- f
19- }
20- else 0
11+ else if ((c.assetId != a))
12+ then throw("holded payment not tUSD")
13+ else {
14+ let d = toBase58String(b.caller.bytes)
15+ let e = {
16+ let f = getInteger(this, d)
17+ if ($isInstanceOf(f, "Int"))
18+ then {
19+ let g = f
20+ g
21+ }
22+ else 0
23+ }
24+ let h = (e + c.amount)
25+[IntegerEntry(d, h)]
2126 }
22- let g = (d + b.amount)
23-[IntegerEntry(c, g)]
24- }
2527 }
2628
2729
2830
29-@Callable(a)
30-func withdraw (h) = {
31- let c = toBase58String(a.caller.bytes)
32- let d = {
33- let e = getInteger(this, c)
34- if ($isInstanceOf(e, "Int"))
31+@Callable(b)
32+func withdraw (i) = {
33+ let d = toBase58String(b.caller.bytes)
34+ let e = {
35+ let f = getInteger(this, d)
36+ if ($isInstanceOf(f, "Int"))
3537 then {
36- let f = e
37- f
38+ let g = f
39+ g
3840 }
3941 else 0
4042 }
41- let g = (d - h)
42- if ((0 > h))
43+ let h = (e - i)
44+ if ((0 > i))
4345 then throw("Can't withdraw negative amount")
44- else if ((0 > g))
46+ else if ((0 > h))
4547 then throw("Not enough balance")
46- else $Tuple2([IntegerEntry(c, g), ScriptTransfer(a.caller, h, unit)], unit)
48+ else $Tuple2([IntegerEntry(d, h), ScriptTransfer(b.caller, i, unit)], unit)
4749 }
4850
4951
5052
51-@Callable(a)
52-func setOptions (i,j) = {
53- let k = size(i)
54- if ((100 >= k))
53+@Callable(b)
54+func setOptions (j,k) = {
55+ let l = size(j)
56+ if ((100 >= l))
5557 then {
56- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
57- let m = {
58- let e = getString(l, "admin_list")
59- if ($isInstanceOf(e, "Unit"))
58+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
59+ let n = {
60+ let f = getString(m, "admin_list")
61+ if ($isInstanceOf(f, "Unit"))
6062 then "unset"
61- else if ($isInstanceOf(e, "String"))
63+ else if ($isInstanceOf(f, "String"))
6264 then {
63- let n = e
64- n
65+ let o = f
66+ o
6567 }
6668 else throw("Match error")
6769 }
68- func o (p,q) = {
69- let r = p
70- let s = r._1
71- let t = r._2
72- $Tuple2((s :+ IntegerEntry(i[t], q)), (t + 1))
70+ func p (q,r) = {
71+ let s = q
72+ let t = s._1
73+ let u = s._2
74+ $Tuple2((t :+ IntegerEntry(j[u], r)), (u + 1))
7375 }
7476
75- let u = {
76- let v = j
77- let w = size(v)
78- let x = $Tuple2(nil, 0)
79- func y (z,A) = if ((A >= w))
80- then z
81- else o(z, v[A])
77+ let v = {
78+ let w = k
79+ let x = size(w)
80+ let y = $Tuple2(nil, 0)
81+ func z (A,B) = if ((B >= x))
82+ then A
83+ else p(A, w[B])
8284
83- func B (z,A) = if ((A >= w))
84- then z
85+ func C (A,B) = if ((B >= x))
86+ then A
8587 else throw("List size exceeds 100")
8688
87- B(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(x, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
89+ C(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(y, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
8890 }
89- let C = toString(a.caller)
90- if ((m != "unset"))
91+ let D = toString(b.caller)
92+ if ((n != "unset"))
9193 then {
92- let D = getString(addressFromStringValue(m), C)
93- let E = {
94- let e = D
95- if ($isInstanceOf(e, "String"))
94+ let E = getString(addressFromStringValue(n), D)
95+ let F = {
96+ let f = E
97+ if ($isInstanceOf(f, "String"))
9698 then {
97- let n = e
98- n
99+ let o = f
100+ o
99101 }
100- else if ($isInstanceOf(e, "Unit"))
102+ else if ($isInstanceOf(f, "Unit"))
101103 then "no admin"
102104 else throw("Match error")
103105 }
104- func F (G) = {
105- let H = split(G, "|")
106- StringEntry(H[0], H[1])
106+ func G (H) = {
107+ let I = split(H, "|")
108+ StringEntry(I[0], I[1])
107109 }
108110
109- if ((E != "no admin"))
110- then u
111- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
111+ if ((F != "no admin"))
112+ then v
113+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
112114 }
113115 else throw("Unset admin list")
114116 }
117119
118120
119121
120-@Callable(a)
121-func setOption (I,J) = {
122- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
123- let m = {
124- let e = getString(l, "admin_list")
125- if ($isInstanceOf(e, "Unit"))
122+@Callable(b)
123+func setOption (J,K) = {
124+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
125+ let n = {
126+ let f = getString(m, "admin_list")
127+ if ($isInstanceOf(f, "Unit"))
126128 then "unset"
127- else if ($isInstanceOf(e, "String"))
129+ else if ($isInstanceOf(f, "String"))
128130 then {
129- let n = e
130- n
131+ let o = f
132+ o
131133 }
132134 else throw("Match error")
133135 }
134- let C = toString(a.caller)
135- if ((m != "unset"))
136+ let D = toString(b.caller)
137+ if ((n != "unset"))
136138 then {
137- let D = getString(addressFromStringValue(m), C)
138- let E = {
139- let e = D
140- if ($isInstanceOf(e, "String"))
139+ let E = getString(addressFromStringValue(n), D)
140+ let F = {
141+ let f = E
142+ if ($isInstanceOf(f, "String"))
141143 then {
142- let n = e
143- n
144+ let o = f
145+ o
144146 }
145- else if ($isInstanceOf(e, "Unit"))
147+ else if ($isInstanceOf(f, "Unit"))
146148 then "no admin"
147149 else throw("Match error")
148150 }
149- if ((E != "no admin"))
150- then $Tuple2([IntegerEntry(I, J)], unit)
151- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
151+ if ((F != "no admin"))
152+ then $Tuple2([IntegerEntry(J, K)], unit)
153+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
152154 }
153155 else throw("Unset admin list")
154156 }
155157
156158
157159
158-@Callable(a)
159-func delOption (I) = {
160- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
161- let m = {
162- let e = getString(l, "admin_list")
163- if ($isInstanceOf(e, "Unit"))
160+@Callable(b)
161+func delOption (J) = {
162+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
163+ let n = {
164+ let f = getString(m, "admin_list")
165+ if ($isInstanceOf(f, "Unit"))
164166 then "unset"
165- else if ($isInstanceOf(e, "String"))
167+ else if ($isInstanceOf(f, "String"))
166168 then {
167- let n = e
168- n
169+ let o = f
170+ o
169171 }
170172 else throw("Match error")
171173 }
172- let C = toString(a.caller)
173- if ((m != "unset"))
174+ let D = toString(b.caller)
175+ if ((n != "unset"))
174176 then {
175- let D = getString(addressFromStringValue(m), C)
176- let E = {
177- let e = D
178- if ($isInstanceOf(e, "String"))
177+ let E = getString(addressFromStringValue(n), D)
178+ let F = {
179+ let f = E
180+ if ($isInstanceOf(f, "String"))
179181 then {
180- let n = e
181- n
182+ let o = f
183+ o
182184 }
183- else if ($isInstanceOf(e, "Unit"))
185+ else if ($isInstanceOf(f, "Unit"))
184186 then "no admin"
185187 else throw("Match error")
186188 }
187- if ((E != "no admin"))
188- then $Tuple2([DeleteEntry(I)], unit)
189- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
189+ if ((F != "no admin"))
190+ then $Tuple2([DeleteEntry(J)], unit)
191+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
190192 }
191193 else throw("Unset admin list")
192194 }
193195
194196
195-@Verifier(K)
196-func L () = sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey)
197+@Verifier(L)
198+func M () = sigVerify(L.bodyBytes, L.proofs[0], L.senderPublicKey)
197199
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let a = base58'CX4p6XcuSBUvv44r1avCqYka5PYAVzBK5hSXaT7maU85'
45
5-
6-@Callable(a)
6+@Callable(b)
77 func deposit () = {
8- let b = value(a.payments)[0]
9- if (isDefined(b.assetId))
8+ let c = value(b.payments)[0]
9+ if (isDefined(c.assetId))
1010 then throw("can hodl waves only at the moment")
11- else {
12- let c = toBase58String(a.caller.bytes)
13- let d = {
14- let e = getInteger(this, c)
15- if ($isInstanceOf(e, "Int"))
16- then {
17- let f = e
18- f
19- }
20- else 0
11+ else if ((c.assetId != a))
12+ then throw("holded payment not tUSD")
13+ else {
14+ let d = toBase58String(b.caller.bytes)
15+ let e = {
16+ let f = getInteger(this, d)
17+ if ($isInstanceOf(f, "Int"))
18+ then {
19+ let g = f
20+ g
21+ }
22+ else 0
23+ }
24+ let h = (e + c.amount)
25+[IntegerEntry(d, h)]
2126 }
22- let g = (d + b.amount)
23-[IntegerEntry(c, g)]
24- }
2527 }
2628
2729
2830
29-@Callable(a)
30-func withdraw (h) = {
31- let c = toBase58String(a.caller.bytes)
32- let d = {
33- let e = getInteger(this, c)
34- if ($isInstanceOf(e, "Int"))
31+@Callable(b)
32+func withdraw (i) = {
33+ let d = toBase58String(b.caller.bytes)
34+ let e = {
35+ let f = getInteger(this, d)
36+ if ($isInstanceOf(f, "Int"))
3537 then {
36- let f = e
37- f
38+ let g = f
39+ g
3840 }
3941 else 0
4042 }
41- let g = (d - h)
42- if ((0 > h))
43+ let h = (e - i)
44+ if ((0 > i))
4345 then throw("Can't withdraw negative amount")
44- else if ((0 > g))
46+ else if ((0 > h))
4547 then throw("Not enough balance")
46- else $Tuple2([IntegerEntry(c, g), ScriptTransfer(a.caller, h, unit)], unit)
48+ else $Tuple2([IntegerEntry(d, h), ScriptTransfer(b.caller, i, unit)], unit)
4749 }
4850
4951
5052
51-@Callable(a)
52-func setOptions (i,j) = {
53- let k = size(i)
54- if ((100 >= k))
53+@Callable(b)
54+func setOptions (j,k) = {
55+ let l = size(j)
56+ if ((100 >= l))
5557 then {
56- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
57- let m = {
58- let e = getString(l, "admin_list")
59- if ($isInstanceOf(e, "Unit"))
58+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
59+ let n = {
60+ let f = getString(m, "admin_list")
61+ if ($isInstanceOf(f, "Unit"))
6062 then "unset"
61- else if ($isInstanceOf(e, "String"))
63+ else if ($isInstanceOf(f, "String"))
6264 then {
63- let n = e
64- n
65+ let o = f
66+ o
6567 }
6668 else throw("Match error")
6769 }
68- func o (p,q) = {
69- let r = p
70- let s = r._1
71- let t = r._2
72- $Tuple2((s :+ IntegerEntry(i[t], q)), (t + 1))
70+ func p (q,r) = {
71+ let s = q
72+ let t = s._1
73+ let u = s._2
74+ $Tuple2((t :+ IntegerEntry(j[u], r)), (u + 1))
7375 }
7476
75- let u = {
76- let v = j
77- let w = size(v)
78- let x = $Tuple2(nil, 0)
79- func y (z,A) = if ((A >= w))
80- then z
81- else o(z, v[A])
77+ let v = {
78+ let w = k
79+ let x = size(w)
80+ let y = $Tuple2(nil, 0)
81+ func z (A,B) = if ((B >= x))
82+ then A
83+ else p(A, w[B])
8284
83- func B (z,A) = if ((A >= w))
84- then z
85+ func C (A,B) = if ((B >= x))
86+ then A
8587 else throw("List size exceeds 100")
8688
87- B(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(y(x, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
89+ C(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(z(y, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
8890 }
89- let C = toString(a.caller)
90- if ((m != "unset"))
91+ let D = toString(b.caller)
92+ if ((n != "unset"))
9193 then {
92- let D = getString(addressFromStringValue(m), C)
93- let E = {
94- let e = D
95- if ($isInstanceOf(e, "String"))
94+ let E = getString(addressFromStringValue(n), D)
95+ let F = {
96+ let f = E
97+ if ($isInstanceOf(f, "String"))
9698 then {
97- let n = e
98- n
99+ let o = f
100+ o
99101 }
100- else if ($isInstanceOf(e, "Unit"))
102+ else if ($isInstanceOf(f, "Unit"))
101103 then "no admin"
102104 else throw("Match error")
103105 }
104- func F (G) = {
105- let H = split(G, "|")
106- StringEntry(H[0], H[1])
106+ func G (H) = {
107+ let I = split(H, "|")
108+ StringEntry(I[0], I[1])
107109 }
108110
109- if ((E != "no admin"))
110- then u
111- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
111+ if ((F != "no admin"))
112+ then v
113+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
112114 }
113115 else throw("Unset admin list")
114116 }
115117 else throw("The number of list elements must not exceed 100")
116118 }
117119
118120
119121
120-@Callable(a)
121-func setOption (I,J) = {
122- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
123- let m = {
124- let e = getString(l, "admin_list")
125- if ($isInstanceOf(e, "Unit"))
122+@Callable(b)
123+func setOption (J,K) = {
124+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
125+ let n = {
126+ let f = getString(m, "admin_list")
127+ if ($isInstanceOf(f, "Unit"))
126128 then "unset"
127- else if ($isInstanceOf(e, "String"))
129+ else if ($isInstanceOf(f, "String"))
128130 then {
129- let n = e
130- n
131+ let o = f
132+ o
131133 }
132134 else throw("Match error")
133135 }
134- let C = toString(a.caller)
135- if ((m != "unset"))
136+ let D = toString(b.caller)
137+ if ((n != "unset"))
136138 then {
137- let D = getString(addressFromStringValue(m), C)
138- let E = {
139- let e = D
140- if ($isInstanceOf(e, "String"))
139+ let E = getString(addressFromStringValue(n), D)
140+ let F = {
141+ let f = E
142+ if ($isInstanceOf(f, "String"))
141143 then {
142- let n = e
143- n
144+ let o = f
145+ o
144146 }
145- else if ($isInstanceOf(e, "Unit"))
147+ else if ($isInstanceOf(f, "Unit"))
146148 then "no admin"
147149 else throw("Match error")
148150 }
149- if ((E != "no admin"))
150- then $Tuple2([IntegerEntry(I, J)], unit)
151- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
151+ if ((F != "no admin"))
152+ then $Tuple2([IntegerEntry(J, K)], unit)
153+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
152154 }
153155 else throw("Unset admin list")
154156 }
155157
156158
157159
158-@Callable(a)
159-func delOption (I) = {
160- let l = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
161- let m = {
162- let e = getString(l, "admin_list")
163- if ($isInstanceOf(e, "Unit"))
160+@Callable(b)
161+func delOption (J) = {
162+ let m = Address(base58'3MusfsY6PqDh1YnF7YyTi5ffVT16Dm2bqf6')
163+ let n = {
164+ let f = getString(m, "admin_list")
165+ if ($isInstanceOf(f, "Unit"))
164166 then "unset"
165- else if ($isInstanceOf(e, "String"))
167+ else if ($isInstanceOf(f, "String"))
166168 then {
167- let n = e
168- n
169+ let o = f
170+ o
169171 }
170172 else throw("Match error")
171173 }
172- let C = toString(a.caller)
173- if ((m != "unset"))
174+ let D = toString(b.caller)
175+ if ((n != "unset"))
174176 then {
175- let D = getString(addressFromStringValue(m), C)
176- let E = {
177- let e = D
178- if ($isInstanceOf(e, "String"))
177+ let E = getString(addressFromStringValue(n), D)
178+ let F = {
179+ let f = E
180+ if ($isInstanceOf(f, "String"))
179181 then {
180- let n = e
181- n
182+ let o = f
183+ o
182184 }
183- else if ($isInstanceOf(e, "Unit"))
185+ else if ($isInstanceOf(f, "Unit"))
184186 then "no admin"
185187 else throw("Match error")
186188 }
187- if ((E != "no admin"))
188- then $Tuple2([DeleteEntry(I)], unit)
189- else throw((((((("You not admin: " + m) + ", isAdmin: ") + E) + ", callerAddressStr: ") + C) + ", "))
189+ if ((F != "no admin"))
190+ then $Tuple2([DeleteEntry(J)], unit)
191+ else throw((((((("You not admin: " + n) + ", isAdmin: ") + F) + ", callerAddressStr: ") + D) + ", "))
190192 }
191193 else throw("Unset admin list")
192194 }
193195
194196
195-@Verifier(K)
196-func L () = sigVerify(K.bodyBytes, K.proofs[0], K.senderPublicKey)
197+@Verifier(L)
198+func M () = sigVerify(L.bodyBytes, L.proofs[0], L.senderPublicKey)
197199

github/deemru/w8io/169f3d6 
113.34 ms