tx · GxEkRJaegkHtUsFyxrFXFaEm4TWjqN3Ghw1e57rwGAzP 3Mx9KU2qWAgHfp1h3iyVsdiHiz3uuZFbBUG: -0.01400000 Waves 2020.12.30 07:29 [1330951] smart account 3Mx9KU2qWAgHfp1h3iyVsdiHiz3uuZFbBUG > SELF 0.00000000 Waves
{ "type": 13, "id": "GxEkRJaegkHtUsFyxrFXFaEm4TWjqN3Ghw1e57rwGAzP", "fee": 1400000, "feeAssetId": null, "timestamp": 1609302634343, "version": 2, "chainId": 84, "sender": "3Mx9KU2qWAgHfp1h3iyVsdiHiz3uuZFbBUG", "senderPublicKey": "x1aRSsyD7D2CQzJbQGVnX4LjWQ2qX7B9QwBw4gz7FXU", "proofs": [ "3rNdHjGS9P53xApcsVJb2zC2oZGNGLXNnGsmSH5vK8ewCcef8FMsKFkUs5qhMDosMi3W6eqgSADuHFiQjgcsLZkB" ], "script": "base64:AAIEAAAAAAAAAAsIAhIHCgUICAgICAAAAAoBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAPZ2V0Qm9vbGVhbkJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBwEAAAAPZ2V0SW50ZWdlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWkFAAAAByRtYXRjaDAFAAAAAWkAAAAAAAAAAAABAAAAC2tleVVzZXJBZGRyAAAAAQAAA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JpbmdFbnRyeQAAAAIJAQAAAAxrZXlVc2VyVGh1bWIAAAABBQAAAAZjYWxsZXIFAAAABXRodW1iCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAA1rZXlVc2VyU3RhdHVzAAAAAQUAAAAGY2FsbGVyBQAAAAZzdGF0dXMJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkAASwAAAACAgAAAAhBTExPV0VEXwUAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAZzdGF0dXMCAAAAAV8FAAAABmNhbGxlcgUAAAAEanNvbgUAAAADbmlsAAAAANPUXU4=", "height": 1330951, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ENBputjoRXrV6GmDC8UGkeHZzmsMUsGKay2hJtR8BG1r Next: Duws2ua2zxZzaKc5Aet1mhCSrWupwJLRTxjsX887rp1 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
5 | - | ||
6 | - | let b = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
7 | - | ||
8 | - | let c = "3Mzm4VLwsN9uZwbTMzPj3XuxV6kEfAR8UDN" | |
9 | - | ||
10 | - | let d = "conf_dapp_is_running" | |
11 | - | ||
12 | - | let e = "conf_maintenance_msg" | |
13 | - | ||
14 | - | let f = "conf_whitelisted_only" | |
15 | - | ||
16 | - | let g = { | |
17 | - | let h = getBoolean(this, d) | |
18 | - | if ($isInstanceOf(h, "Boolean")) | |
4 | + | func a (b) = { | |
5 | + | let c = getString(this, b) | |
6 | + | if ($isInstanceOf(c, "String")) | |
19 | 7 | then { | |
20 | - | let i = h | |
21 | - | i | |
22 | - | } | |
23 | - | else true | |
24 | - | } | |
25 | - | ||
26 | - | let j = { | |
27 | - | let h = getString(this, e) | |
28 | - | if ($isInstanceOf(h, "String")) | |
29 | - | then { | |
30 | - | let i = h | |
31 | - | i | |
32 | - | } | |
33 | - | else "" | |
34 | - | } | |
35 | - | ||
36 | - | let k = { | |
37 | - | let h = getBoolean(this, f) | |
38 | - | if ($isInstanceOf(h, "Boolean")) | |
39 | - | then { | |
40 | - | let i = h | |
41 | - | i | |
42 | - | } | |
43 | - | else true | |
44 | - | } | |
45 | - | ||
46 | - | let l = "ALLOWED" | |
47 | - | ||
48 | - | let m = "REGISTERED" | |
49 | - | ||
50 | - | let n = "VERIFIED" | |
51 | - | ||
52 | - | let o = "SUSPENDED" | |
53 | - | ||
54 | - | let p = "REMOVED" | |
55 | - | ||
56 | - | let q = "CHANGE_REQUIRED" | |
57 | - | ||
58 | - | let r = "UNREGISTERED" | |
59 | - | ||
60 | - | let s = "RESET" | |
61 | - | ||
62 | - | func t (u) = { | |
63 | - | let h = getString(this, u) | |
64 | - | if ($isInstanceOf(h, "String")) | |
65 | - | then { | |
66 | - | let i = h | |
67 | - | i | |
8 | + | let d = c | |
9 | + | d | |
68 | 10 | } | |
69 | 11 | else "" | |
70 | 12 | } | |
71 | 13 | ||
72 | 14 | ||
73 | - | func | |
74 | - | let | |
75 | - | if ($isInstanceOf( | |
15 | + | func e (b) = { | |
16 | + | let c = getBoolean(this, b) | |
17 | + | if ($isInstanceOf(c, "Boolean")) | |
76 | 18 | then { | |
77 | - | let | |
78 | - | | |
19 | + | let d = c | |
20 | + | d | |
79 | 21 | } | |
80 | 22 | else false | |
81 | 23 | } | |
82 | 24 | ||
83 | 25 | ||
84 | - | func | |
85 | - | let | |
86 | - | if ($isInstanceOf( | |
26 | + | func f (b) = { | |
27 | + | let c = getInteger(this, b) | |
28 | + | if ($isInstanceOf(c, "Int")) | |
87 | 29 | then { | |
88 | - | let | |
89 | - | | |
30 | + | let g = c | |
31 | + | g | |
90 | 32 | } | |
91 | 33 | else 0 | |
92 | 34 | } | |
93 | 35 | ||
94 | 36 | ||
95 | - | func y (z) = if (if ((75 > size(z))) | |
96 | - | then (60 > size(split(z, "/")[0])) | |
97 | - | else false) | |
98 | - | then (16 > size(split(z, "/")[1])) | |
99 | - | else false | |
37 | + | func h (i) = ("user_" + i) | |
100 | 38 | ||
101 | 39 | ||
102 | - | func | |
40 | + | func j (i) = ("user_name_" + i) | |
103 | 41 | ||
104 | 42 | ||
105 | - | func | |
43 | + | func k (i) = ("user_desc_" + i) | |
106 | 44 | ||
107 | 45 | ||
108 | - | func | |
46 | + | func l (i) = ("user_social_" + i) | |
109 | 47 | ||
110 | 48 | ||
111 | - | func | |
49 | + | func m (i) = ("user_thumb_" + i) | |
112 | 50 | ||
113 | 51 | ||
114 | - | func | |
52 | + | func n (i) = ("user_status_" + i) | |
115 | 53 | ||
116 | 54 | ||
117 | - | func | |
55 | + | func o (i) = ("user_date_" + i) | |
118 | 56 | ||
119 | 57 | ||
120 | - | func H (B) = ("user_date_" + B) | |
121 | - | ||
122 | - | ||
123 | - | @Callable(x) | |
124 | - | func appRunning (I,J) = { | |
125 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
126 | - | let K = toBase58String(x.transactionId) | |
127 | - | if (containsElement([b, c, toString(this)], B)) | |
128 | - | then [BooleanEntry(d, I), StringEntry(e, J)] | |
129 | - | else throw("You are not allowed to change this") | |
130 | - | } | |
131 | - | ||
132 | - | ||
133 | - | ||
134 | - | @Callable(x) | |
135 | - | func registrationMode (L) = { | |
136 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
137 | - | let K = toBase58String(x.transactionId) | |
138 | - | if (containsElement([b, c, toString(this)], B)) | |
139 | - | then [BooleanEntry(f, L)] | |
140 | - | else throw("You are not allowed to change this") | |
141 | - | } | |
142 | - | ||
143 | - | ||
144 | - | ||
145 | - | @Callable(x) | |
146 | - | func registerUser (M,N,O,P) = if (!(g)) | |
147 | - | then throw(j) | |
148 | - | else { | |
149 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
150 | - | let Q = t(G(B)) | |
151 | - | let K = toBase58String(x.transactionId) | |
152 | - | let R = lastBlock.timestamp | |
153 | - | if (if ((Q == o)) | |
154 | - | then true | |
155 | - | else (Q == p)) | |
156 | - | then throw("Account suspended/ removed.") | |
157 | - | else if ((Q == m)) | |
158 | - | then throw("Already registered") | |
159 | - | else if (if ((Q == "")) | |
160 | - | then k | |
161 | - | else false) | |
162 | - | then throw("Can't register, get approved first.") | |
163 | - | else if (if ((M == "")) | |
164 | - | then true | |
165 | - | else (N == "")) | |
166 | - | then throw("Name and description cannot be empty") | |
167 | - | else if ((size(N) > 600)) | |
168 | - | then throw("600 Char. max description") | |
169 | - | else if ((size(M) > 45)) | |
170 | - | then throw("45 Char. max name") | |
171 | - | else { | |
172 | - | let S = (((((("{\"user_name\": \"" + toBase64String(toBytes(M))) + "\", \"user_thumb\":\"") + toBase64String(toBytes(O))) + "\",\"user_date\":\"") + toString(R)) + "\"}") | |
173 | - | [IntegerEntry(H(B), R), StringEntry(A(B), ((K + "_") + toString(R))), StringEntry(C(B), M), StringEntry(D(B), N), StringEntry(E(B), P), StringEntry(F(B), O), StringEntry(G(B), m), DeleteEntry(("ALLOWED_" + B)), StringEntry(((m + "_") + B), S)] | |
174 | - | } | |
175 | - | } | |
176 | - | ||
177 | - | ||
178 | - | ||
179 | - | @Callable(x) | |
180 | - | func updateUser (M,N,O,P) = if (!(g)) | |
181 | - | then throw(j) | |
182 | - | else { | |
183 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
184 | - | let K = toBase58String(x.transactionId) | |
185 | - | let T = t(G(B)) | |
186 | - | if (if ((T == o)) | |
187 | - | then true | |
188 | - | else (T == p)) | |
189 | - | then throw("Account suspended/ removed.") | |
190 | - | else if (if ((T == "")) | |
191 | - | then true | |
192 | - | else (T == l)) | |
193 | - | then throw("Register first") | |
194 | - | else if (if ((M == "")) | |
195 | - | then true | |
196 | - | else (N == "")) | |
197 | - | then throw("Name & description cannot be empty") | |
198 | - | else if ((size(N) > 600)) | |
199 | - | then throw("600 Char. max for description") | |
200 | - | else if ((size(M) > 45)) | |
201 | - | then throw("45 Char. max name") | |
202 | - | else { | |
203 | - | let U = w(H(B)) | |
204 | - | let S = (((((("{\"user_name\": \"" + toBase64String(toBytes(M))) + "\", \"user_thumb\":\"") + toBase64String(toBytes(O))) + "\",\"user_date\":\"") + toString(U)) + "\"}") | |
205 | - | [StringEntry(C(B), M), StringEntry(D(B), N), StringEntry(E(B), P), StringEntry(F(B), O), StringEntry(((T + "_") + B), S)] | |
206 | - | } | |
207 | - | } | |
208 | - | ||
209 | - | ||
210 | - | ||
211 | - | @Callable(x) | |
212 | - | func changeUserStatus (V,W) = if (!(g)) | |
213 | - | then throw(j) | |
214 | - | else { | |
215 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
216 | - | let K = toBase58String(x.transactionId) | |
217 | - | let X = t(G(V)) | |
218 | - | let Y = if ((W == n)) | |
219 | - | then n | |
220 | - | else if ((W == m)) | |
221 | - | then m | |
222 | - | else if ((W == o)) | |
223 | - | then o | |
224 | - | else if ((W == p)) | |
225 | - | then p | |
226 | - | else if ((W == l)) | |
227 | - | then l | |
228 | - | else if ((W == q)) | |
229 | - | then q | |
230 | - | else if (if ((W == s)) | |
231 | - | then (X == l) | |
232 | - | else false) | |
233 | - | then "" | |
234 | - | else throw("Unknown status") | |
235 | - | let Z = w(H(V)) | |
236 | - | if (if ((Z == 0)) | |
237 | - | then (W != l) | |
238 | - | else false) | |
239 | - | then throw("You cant set this status, user is not registered.") | |
240 | - | else if (if ((X == l)) | |
241 | - | then (W == l) | |
242 | - | else false) | |
243 | - | then throw("User already allowed") | |
244 | - | else if (if ((X == m)) | |
245 | - | then (W == l) | |
246 | - | else false) | |
247 | - | then throw("User already allowed & registered") | |
248 | - | else if (if ((X == n)) | |
249 | - | then (W == l) | |
250 | - | else false) | |
251 | - | then throw("User already allowed & verified") | |
252 | - | else { | |
253 | - | let M = toBase64String(toBytes(t(C(V)))) | |
254 | - | let O = toBase64String(toBytes(t(F(V)))) | |
255 | - | let U = w(H(V)) | |
256 | - | let S = (((((("{\"user_name\": \"" + M) + "\", \"user_thumb\":\"") + O) + "\",\"user_date\":\"") + toString(U)) + "\"}") | |
257 | - | if (containsElement([b, c, toString(this)], B)) | |
258 | - | then [StringEntry(G(V), Y), DeleteEntry(((X + "_") + V)), StringEntry(((Y + "_") + V), S)] | |
259 | - | else throw("Not allowed to change user status") | |
260 | - | } | |
261 | - | } | |
262 | - | ||
263 | - | ||
264 | - | ||
265 | - | @Callable(x) | |
266 | - | func deleteUser (V) = { | |
267 | - | let B = toString(addressFromPublicKey(x.callerPublicKey)) | |
268 | - | let K = toBase58String(x.transactionId) | |
269 | - | let X = t(G(V)) | |
270 | - | if (containsElement([b, toString(this)], B)) | |
271 | - | then [DeleteEntry(H(V)), DeleteEntry(A(V)), DeleteEntry(C(V)), DeleteEntry(D(V)), DeleteEntry(E(V)), DeleteEntry(F(V)), DeleteEntry(((X + "_") + V)), StringEntry(G(V), p)] | |
272 | - | else throw("Not allowed") | |
58 | + | @Callable(g) | |
59 | + | func registerUser (p,q,r,s,t) = { | |
60 | + | let i = toString(addressFromPublicKey(g.callerPublicKey)) | |
61 | + | let u = a(n(i)) | |
62 | + | let v = toBase58String(g.transactionId) | |
63 | + | let w = lastBlock.timestamp | |
64 | + | if (if ((p == "")) | |
65 | + | then true | |
66 | + | else (q == "")) | |
67 | + | then throw("Name and description cannot be empty") | |
68 | + | else if ((size(q) > 600)) | |
69 | + | then throw("600 Char. max description") | |
70 | + | else if ((size(p) > 45)) | |
71 | + | then throw("45 Char. max name") | |
72 | + | else { | |
73 | + | let x = (((((("{\"user_name\": \"" + toBase64String(toBytes(p))) + "\", \"user_thumb\":\"") + toBase64String(toBytes(r))) + "\",\"user_date\":\"") + toString(w)) + "\"}") | |
74 | + | [IntegerEntry(o(i), w), StringEntry(h(i), ((v + "_") + toString(w))), StringEntry(j(i), p), StringEntry(k(i), q), StringEntry(l(i), s), StringEntry(m(i), r), StringEntry(n(i), t), DeleteEntry(("ALLOWED_" + i)), StringEntry(((t + "_") + i), x)] | |
75 | + | } | |
273 | 76 | } | |
274 | 77 | ||
275 | 78 |
github/deemru/w8io/169f3d6 43.64 ms ◑