tx · 4e9cB1djkmziMs3DjQ2dypH3YCvNrXtjWbwAA1eggF29 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh: -0.01000000 Waves 2023.04.19 10:03 [2541120] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves
{ "type": 13, "id": "4e9cB1djkmziMs3DjQ2dypH3YCvNrXtjWbwAA1eggF29", "fee": 1000000, "feeAssetId": null, "timestamp": 1681887893396, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2ZBVvyP4fkBHFuwRbMJNV51PBDQJwv7VMY1W5WmwmiW3fveUh3KfT97NQpRwB5tYTqgiBLxzXkmUJwbAvuKjLEkd" ], "script": "base64:BgINCAISABIDCgEIEgASABkAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBGWtleUFjdGl2ZU1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5U2V0TmV3TWFuYWdlclZvdGVQcmVmaXgBEG1hbmFnZXJQdWJsaWNLZXkJALkJAgkAzAgCAgYlcyVzJXMJAMwIAgIKc2V0TWFuYWdlcgkAzAgCBRBtYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEUa2V5U2V0TmV3TWFuYWdlclZvdGUCEG1hbmFnZXJQdWJsaWNLZXkFYWRtaW4JALkJAgkAzAgCCQE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GVNYW5hZ2VyVm90ZQEFE2NhbGxlckFkZHJlc3NTdHJpbmcECG1pblZvdGVzAAEEBnJlc3VsdAkAzAgCCQELRGVsZXRlRW50cnkBCQEZa2V5QWN0aXZlTWFuYWdlclB1YmxpY0tleQAFA25pbAkBDHZvdGVJTlRFUk5BTAUFE2NhbGxlckFkZHJlc3NTdHJpbmcFEGFkbWluQ3VycmVudFZvdGUFCWtleVByZWZpeAUIbWluVm90ZXMFBnJlc3VsdAFpAQ9hY3RpdmF0ZU1hbmFnZXIABBNjYWxsZXJBZGRyZXNzU3RyaW5nCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMECWtleVByZWZpeAkBHGtleUFjdGl2YXRlTWFuYWdlclZvdGVQcmVmaXgABBBhZG1pbkN1cnJlbnRWb3RlCQEWZ2V0QWN0aXZhdGVNYW5hZ2VyVm90ZQEFE2NhbGxlckFkZHJlc3NTdHJpbmcECG1pblZvdGVzAAIEFHBlbmRpbmdNYW5hZ2VyU3RyaW5nCQERQGV4dHJOYXRpdmUoMTA1OCkBCQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkABAZyZXN1bHQJAMwIAgkBC1N0cmluZ0VudHJ5AgkBGWtleUFjdGl2ZU1hbmFnZXJQdWJsaWNLZXkABRRwZW5kaW5nTWFuYWdlclN0cmluZwUDbmlsCQEMdm90ZUlOVEVSTkFMBQUTY2FsbGVyQWRkcmVzc1N0cmluZwUQYWRtaW5DdXJyZW50Vm90ZQUJa2V5UHJlZml4BQhtaW5Wb3RlcwUGcmVzdWx0AKSrpDs=", "height": 2541120, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CbYhGEjzPX1JjdCuyLLsou7jLwXwBGooHPFCbrykkgar Next: AuvzskD8MwFkKqx5bFQTZaNAUMMDWoN3veyxzVpJpS9o Diff:
Old | New | Differences | |
---|---|---|---|
177 | 177 | @Callable(ab) | |
178 | 178 | func voteForNewManger (af) = { | |
179 | 179 | let W = toBase58String(ab.caller.bytes) | |
180 | - | if (v(W)) | |
181 | - | then if ((k(af, W) == 1)) | |
182 | - | then c((((("Address: " + W) + " NewManager: ") + af) + " voteForNewManger() you already voted")) | |
183 | - | else { | |
184 | - | let R = Q(g(af)) | |
185 | - | if (((R + 1) >= 2)) | |
186 | - | then { | |
187 | - | let aa = U(g(af)) | |
188 | - | (aa ++ [StringEntry(f(), af)]) | |
189 | - | } | |
190 | - | else [IntegerEntry(i(af, W), 1)] | |
191 | - | } | |
192 | - | else c((("Address: " + W) + " not in Admin list")) | |
193 | - | } | |
194 | - | ||
195 | - | ||
196 | - | ||
197 | - | @Callable(ab) | |
198 | - | func voteForNewManager2 (af) = { | |
199 | - | let W = toBase58String(ab.caller.bytes) | |
200 | 180 | let F = g(af) | |
201 | 181 | let X = k(af, W) | |
202 | 182 | let Y = 2 | |
209 | 189 | @Callable(ab) | |
210 | 190 | func deactivateManager () = { | |
211 | 191 | let W = toBase58String(ab.caller.bytes) | |
212 | - | if (v(W)) | |
213 | - | then if ((n(W) == 1)) | |
214 | - | then c((("Address: " + W) + " deactivateManager() you already voted")) | |
215 | - | else { | |
216 | - | let R = Q(l()) | |
217 | - | if (((R + 1) >= 1)) | |
218 | - | then { | |
219 | - | let aa = U(l()) | |
220 | - | (aa ++ [DeleteEntry(e())]) | |
221 | - | } | |
222 | - | else [IntegerEntry(m(W), 1)] | |
223 | - | } | |
224 | - | else c((("Address: " + W) + " not in Admin list")) | |
192 | + | let F = l() | |
193 | + | let X = n(W) | |
194 | + | let Y = 1 | |
195 | + | let C = [DeleteEntry(e())] | |
196 | + | V(W, X, F, Y, C) | |
225 | 197 | } | |
226 | 198 | ||
227 | 199 | ||
229 | 201 | @Callable(ab) | |
230 | 202 | func activateManager () = { | |
231 | 203 | let W = toBase58String(ab.caller.bytes) | |
204 | + | let F = o() | |
205 | + | let X = q(W) | |
206 | + | let Y = 2 | |
232 | 207 | let ag = getStringValue(f()) | |
233 | - | if (v(W)) | |
234 | - | then if ((q(W) == 1)) | |
235 | - | then c((("Address: " + W) + " activateManager() you already voted")) | |
236 | - | else { | |
237 | - | let R = Q(o()) | |
238 | - | if (((R + 1) >= 2)) | |
239 | - | then { | |
240 | - | let aa = U(o()) | |
241 | - | (aa ++ [StringEntry(e(), ag)]) | |
242 | - | } | |
243 | - | else [IntegerEntry(p(W), 1)] | |
244 | - | } | |
245 | - | else c((("Address: " + W) + " not in Admin list")) | |
208 | + | let C = [StringEntry(e(), ag)] | |
209 | + | V(W, X, F, Y, C) | |
246 | 210 | } | |
247 | 211 | ||
248 | 212 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = "manager_vault.ride" | |
7 | 7 | ||
8 | 8 | func c (d) = throw(((b + ": ") + d)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func e () = makeString(["%s", "managerPublicKey"], a) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func f () = makeString(["%s", "pendingManagerPublicKey"], a) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func g (h) = makeString(["%s%s%s", "setManager", h], a) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func i (h,j) = makeString([g(h), j], a) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func k (h,j) = valueOrElse(getInteger(i(h, j)), 0) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func l () = makeString(["%s%s", "deactivateManager"], a) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func m (j) = makeString([l(), j], a) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func n (j) = valueOrElse(getInteger(m(j)), 0) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func o () = makeString(["%s%s", "activateManager"], a) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func p (j) = makeString([o(), j], a) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func q (j) = valueOrElse(getInteger(p(j)), 0) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func r () = makeString(["%s", "adminAddressList"], a) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func s () = { | |
48 | 48 | let t = getString(f()) | |
49 | 49 | if ($isInstanceOf(t, "String")) | |
50 | 50 | then { | |
51 | 51 | let d = t | |
52 | 52 | fromBase58String(d) | |
53 | 53 | } | |
54 | 54 | else if ($isInstanceOf(t, "Unit")) | |
55 | 55 | then unit | |
56 | 56 | else throw("Match error") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func u () = split(valueOrElse(getString(this, r()), ""), a) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func v (w) = { | |
64 | 64 | let t = indexOf(u(), w) | |
65 | 65 | if ($isInstanceOf(t, "Int")) | |
66 | 66 | then { | |
67 | 67 | let x = t | |
68 | 68 | true | |
69 | 69 | } | |
70 | 70 | else false | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func y (z,A) = { | |
75 | 75 | let B = z | |
76 | 76 | let C = B._1 | |
77 | 77 | let D = B._2 | |
78 | 78 | $Tuple2((C :+ makeString([D, A], a)), D) | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func E (F) = { | |
83 | 83 | let G = r() | |
84 | 84 | let H = u() | |
85 | 85 | let I = size(H) | |
86 | 86 | let J = $Tuple2(nil, F) | |
87 | 87 | func K (L,M) = if ((M >= I)) | |
88 | 88 | then L | |
89 | 89 | else y(L, H[M]) | |
90 | 90 | ||
91 | 91 | func N (L,M) = if ((M >= I)) | |
92 | 92 | then L | |
93 | 93 | else throw("List size exceeds 10") | |
94 | 94 | ||
95 | 95 | N(K(K(K(K(K(K(K(K(K(K(J, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func O (C,P) = (C + valueOrElse(getInteger(P), 0)) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func Q (D) = { | |
103 | 103 | let R = E(D)._1 | |
104 | 104 | let H = R | |
105 | 105 | let I = size(H) | |
106 | 106 | let J = 0 | |
107 | 107 | func K (L,M) = if ((M >= I)) | |
108 | 108 | then L | |
109 | 109 | else O(L, H[M]) | |
110 | 110 | ||
111 | 111 | func N (L,M) = if ((M >= I)) | |
112 | 112 | then L | |
113 | 113 | else throw("List size exceeds 10") | |
114 | 114 | ||
115 | 115 | N(K(K(K(K(K(K(K(K(K(K(J, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func S (C,T) = (C :+ DeleteEntry(T)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func U (D) = { | |
123 | 123 | let R = E(D)._1 | |
124 | 124 | let H = R | |
125 | 125 | let I = size(H) | |
126 | 126 | let J = nil | |
127 | 127 | func K (L,M) = if ((M >= I)) | |
128 | 128 | then L | |
129 | 129 | else S(L, H[M]) | |
130 | 130 | ||
131 | 131 | func N (L,M) = if ((M >= I)) | |
132 | 132 | then L | |
133 | 133 | else throw("List size exceeds 10") | |
134 | 134 | ||
135 | 135 | N(K(K(K(K(K(K(K(K(K(K(J, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func V (W,X,F,Y,Z) = { | |
140 | 140 | let P = makeString([F, W], a) | |
141 | 141 | if (v(W)) | |
142 | 142 | then if ((X == 1)) | |
143 | 143 | then c((P + " you already voted")) | |
144 | 144 | else { | |
145 | 145 | let R = Q(F) | |
146 | 146 | if (((R + 1) >= Y)) | |
147 | 147 | then { | |
148 | 148 | let aa = U(F) | |
149 | 149 | (aa ++ Z) | |
150 | 150 | } | |
151 | 151 | else [IntegerEntry(P, 1)] | |
152 | 152 | } | |
153 | 153 | else c((("Address: " + W) + " not in Admin list")) | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | @Callable(ab) | |
158 | 158 | func confirmManager () = { | |
159 | 159 | let ac = s() | |
160 | 160 | let ad = if (isDefined(ac)) | |
161 | 161 | then true | |
162 | 162 | else c("no pending manager") | |
163 | 163 | if ((ad == ad)) | |
164 | 164 | then { | |
165 | 165 | let ae = if ((ab.callerPublicKey == value(ac))) | |
166 | 166 | then true | |
167 | 167 | else c("you are not pending manager") | |
168 | 168 | if ((ae == ae)) | |
169 | 169 | then [StringEntry(e(), toBase58String(value(ac)))] | |
170 | 170 | else throw("Strict value is not equal to itself.") | |
171 | 171 | } | |
172 | 172 | else throw("Strict value is not equal to itself.") | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(ab) | |
178 | 178 | func voteForNewManger (af) = { | |
179 | 179 | let W = toBase58String(ab.caller.bytes) | |
180 | - | if (v(W)) | |
181 | - | then if ((k(af, W) == 1)) | |
182 | - | then c((((("Address: " + W) + " NewManager: ") + af) + " voteForNewManger() you already voted")) | |
183 | - | else { | |
184 | - | let R = Q(g(af)) | |
185 | - | if (((R + 1) >= 2)) | |
186 | - | then { | |
187 | - | let aa = U(g(af)) | |
188 | - | (aa ++ [StringEntry(f(), af)]) | |
189 | - | } | |
190 | - | else [IntegerEntry(i(af, W), 1)] | |
191 | - | } | |
192 | - | else c((("Address: " + W) + " not in Admin list")) | |
193 | - | } | |
194 | - | ||
195 | - | ||
196 | - | ||
197 | - | @Callable(ab) | |
198 | - | func voteForNewManager2 (af) = { | |
199 | - | let W = toBase58String(ab.caller.bytes) | |
200 | 180 | let F = g(af) | |
201 | 181 | let X = k(af, W) | |
202 | 182 | let Y = 2 | |
203 | 183 | let C = [StringEntry(f(), af)] | |
204 | 184 | V(W, X, F, Y, C) | |
205 | 185 | } | |
206 | 186 | ||
207 | 187 | ||
208 | 188 | ||
209 | 189 | @Callable(ab) | |
210 | 190 | func deactivateManager () = { | |
211 | 191 | let W = toBase58String(ab.caller.bytes) | |
212 | - | if (v(W)) | |
213 | - | then if ((n(W) == 1)) | |
214 | - | then c((("Address: " + W) + " deactivateManager() you already voted")) | |
215 | - | else { | |
216 | - | let R = Q(l()) | |
217 | - | if (((R + 1) >= 1)) | |
218 | - | then { | |
219 | - | let aa = U(l()) | |
220 | - | (aa ++ [DeleteEntry(e())]) | |
221 | - | } | |
222 | - | else [IntegerEntry(m(W), 1)] | |
223 | - | } | |
224 | - | else c((("Address: " + W) + " not in Admin list")) | |
192 | + | let F = l() | |
193 | + | let X = n(W) | |
194 | + | let Y = 1 | |
195 | + | let C = [DeleteEntry(e())] | |
196 | + | V(W, X, F, Y, C) | |
225 | 197 | } | |
226 | 198 | ||
227 | 199 | ||
228 | 200 | ||
229 | 201 | @Callable(ab) | |
230 | 202 | func activateManager () = { | |
231 | 203 | let W = toBase58String(ab.caller.bytes) | |
204 | + | let F = o() | |
205 | + | let X = q(W) | |
206 | + | let Y = 2 | |
232 | 207 | let ag = getStringValue(f()) | |
233 | - | if (v(W)) | |
234 | - | then if ((q(W) == 1)) | |
235 | - | then c((("Address: " + W) + " activateManager() you already voted")) | |
236 | - | else { | |
237 | - | let R = Q(o()) | |
238 | - | if (((R + 1) >= 2)) | |
239 | - | then { | |
240 | - | let aa = U(o()) | |
241 | - | (aa ++ [StringEntry(e(), ag)]) | |
242 | - | } | |
243 | - | else [IntegerEntry(p(W), 1)] | |
244 | - | } | |
245 | - | else c((("Address: " + W) + " not in Admin list")) | |
208 | + | let C = [StringEntry(e(), ag)] | |
209 | + | V(W, X, F, Y, C) | |
246 | 210 | } | |
247 | 211 | ||
248 | 212 |
github/deemru/w8io/169f3d6 63.58 ms ◑