39 | | - | func s (r) = valueOrElse(getBoolean(this, r), false) |
---|
40 | | - | |
---|
41 | | - | |
---|
42 | | - | func t (r) = valueOrElse(getInteger(this, r), 0) |
---|
43 | | - | |
---|
44 | | - | |
---|
45 | | - | func u (v) = ("user_" + v) |
---|
46 | | - | |
---|
47 | | - | |
---|
48 | | - | func w (v) = ("user_name_" + v) |
---|
49 | | - | |
---|
50 | | - | |
---|
51 | | - | func x (v) = ("user_desc_" + v) |
---|
52 | | - | |
---|
53 | | - | |
---|
54 | | - | func y (v) = ("user_social_" + v) |
---|
55 | | - | |
---|
56 | | - | |
---|
57 | | - | func z (v) = ("user_thumb_" + v) |
---|
58 | | - | |
---|
59 | | - | |
---|
60 | | - | func A (v) = ("user_status_" + v) |
---|
61 | | - | |
---|
62 | | - | |
---|
63 | | - | func B (v) = ("user_date_" + v) |
---|
64 | | - | |
---|
65 | | - | |
---|
66 | | - | func C (D) = ("artist_agent_" + D) |
---|
67 | | - | |
---|
68 | | - | |
---|
69 | | - | func E (F,D) = ((("agent_" + F) + "_") + D) |
---|
70 | | - | |
---|
71 | | - | |
---|
72 | | - | func G (D) = ("artist_agent_primary_" + D) |
---|
73 | | - | |
---|
74 | | - | |
---|
75 | | - | func H (D) = ("artist_agent_secondary_" + D) |
---|
76 | | - | |
---|
77 | | - | |
---|
78 | | - | func I (J) = if (contains(J, "/")) |
---|
79 | | - | then if (if ((76 > size(J))) |
---|
80 | | - | then (size(split(J, "/")[0]) == 59) |
---|
81 | | - | else false) |
---|
82 | | - | then (16 > size(split(J, "/")[1])) |
---|
83 | | - | else false |
---|
84 | | - | else false |
---|
85 | | - | |
---|
86 | | - | |
---|
87 | | - | func K (v,L,M,N,O) = { |
---|
88 | | - | let P = if ((size(N) != 0)) |
---|
89 | | - | then I(N) |
---|
90 | | - | else true |
---|
91 | | - | if (!(P)) |
---|
92 | | - | then throw("CID don't match requirement!") |
---|
93 | | - | else if (if ((L == "")) |
---|
94 | | - | then true |
---|
95 | | - | else (M == "")) |
---|
96 | | - | then throw("Name and description cannot be empty") |
---|
97 | | - | else if ((size(M) > 600)) |
---|
98 | | - | then throw("600 Char. max description") |
---|
99 | | - | else if ((size(L) > 45)) |
---|
100 | | - | then throw("45 Char. max name") |
---|
101 | | - | else { |
---|
102 | | - | let Q = q(A(v)) |
---|
103 | | - | if (if ((Q == l)) |
---|
104 | | - | then true |
---|
105 | | - | else (Q == m)) |
---|
106 | | - | then throw("Account suspended/ removed.") |
---|
107 | | - | else if (if (!(O)) |
---|
108 | | - | then (Q == j) |
---|
109 | | - | else false) |
---|
110 | | - | then throw("Already registered") |
---|
111 | | - | else if (if (if (!(O)) |
---|
112 | | - | then (Q == "") |
---|
113 | | - | else false) |
---|
114 | | - | then h |
---|
115 | | - | else false) |
---|
116 | | - | then throw("Can't register, get approved first.") |
---|
117 | | - | else if (if (if (O) |
---|
118 | | - | then (Q == "") |
---|
119 | | - | else false) |
---|
120 | | - | then true |
---|
121 | | - | else if (O) |
---|
122 | | - | then (Q == i) |
---|
123 | | - | else false) |
---|
124 | | - | then throw("Register first") |
---|
125 | | - | else true |
---|
126 | | - | } |
---|
| 6 | + | @Callable(a) |
---|
| 7 | + | func default () = { |
---|
| 8 | + | let b = invoke(addressFromStringValue("3PCbvPVQfSvVu88ip8Fm5YjwJhjEYk1Txhk"), "withdrawVestedAllUSDN", [false, true], nil) |
---|
| 9 | + | if ((b == b)) |
---|
| 10 | + | then nil |
---|
| 11 | + | else throw("Strict value is not equal to itself.") |
---|
158 | | - | |
---|
159 | | - | |
---|
160 | | - | func X (L,N,Y) = (((((("{\"user_name\": \"" + L) + "\", \"user_thumb\":\"") + N) + "\",\"user_date\":\"") + Y) + "\"}") |
---|
161 | | - | |
---|
162 | | - | |
---|
163 | | - | @Callable(Z) |
---|
164 | | - | func appRunning (aa,ab) = { |
---|
165 | | - | let v = toString(Z.caller) |
---|
166 | | - | let ac = toBase58String(Z.transactionId) |
---|
167 | | - | if (containsElement([a, b, toString(this)], v)) |
---|
168 | | - | then [BooleanEntry(c, aa), StringEntry(d, ab)] |
---|
169 | | - | else throw("You are not allowed to change this") |
---|
170 | | - | } |
---|
171 | | - | |
---|
172 | | - | |
---|
173 | | - | |
---|
174 | | - | @Callable(Z) |
---|
175 | | - | func registrationMode (ad) = { |
---|
176 | | - | let v = toString(Z.caller) |
---|
177 | | - | let ac = toBase58String(Z.transactionId) |
---|
178 | | - | if (containsElement([a, toString(this)], v)) |
---|
179 | | - | then [BooleanEntry(e, ad)] |
---|
180 | | - | else throw("You are not allowed to change this") |
---|
181 | | - | } |
---|
182 | | - | |
---|
183 | | - | |
---|
184 | | - | |
---|
185 | | - | @Callable(Z) |
---|
186 | | - | func registerUser (L,M,N,ae) = if (!(f)) |
---|
187 | | - | then throw(g) |
---|
188 | | - | else { |
---|
189 | | - | let v = toString(Z.caller) |
---|
190 | | - | let ac = toBase58String(Z.transactionId) |
---|
191 | | - | let af = lastBlock.timestamp |
---|
192 | | - | if (!(K(v, L, M, N, false))) |
---|
193 | | - | then throw("Something went wrong") |
---|
194 | | - | else { |
---|
195 | | - | let ag = X(toBase64String(toBytes(L)), toBase64String(toBytes(N)), toString(af)) |
---|
196 | | - | [IntegerEntry(B(v), af), StringEntry(u(v), ((ac + "_") + toString(af))), StringEntry(w(v), L), StringEntry(x(v), M), StringEntry(y(v), ae), StringEntry(z(v), N), StringEntry(A(v), j), DeleteEntry(("ALLOWED_" + v)), StringEntry(((j + "_") + v), ag)] |
---|
197 | | - | } |
---|
198 | | - | } |
---|
199 | | - | |
---|
200 | | - | |
---|
201 | | - | |
---|
202 | | - | @Callable(Z) |
---|
203 | | - | func updateUser (L,M,N,ae) = if (!(f)) |
---|
204 | | - | then throw(g) |
---|
205 | | - | else { |
---|
206 | | - | let v = toString(Z.caller) |
---|
207 | | - | let ac = toBase58String(Z.transactionId) |
---|
208 | | - | let Q = q(A(v)) |
---|
209 | | - | if (!(K(v, L, M, N, true))) |
---|
210 | | - | then throw("Something went wrong") |
---|
211 | | - | else { |
---|
212 | | - | let Y = t(B(v)) |
---|
213 | | - | let ag = X(toBase64String(toBytes(L)), toBase64String(toBytes(N)), toString(Y)) |
---|
214 | | - | [StringEntry(w(v), L), StringEntry(x(v), M), StringEntry(y(v), ae), StringEntry(z(v), N), StringEntry(((Q + "_") + v), ag)] |
---|
215 | | - | } |
---|
216 | | - | } |
---|
217 | | - | |
---|
218 | | - | |
---|
219 | | - | |
---|
220 | | - | @Callable(Z) |
---|
221 | | - | func changeUserStatus (S,Q,ah) = { |
---|
222 | | - | let v = toString(Z.caller) |
---|
223 | | - | let ac = toBase58String(Z.transactionId) |
---|
224 | | - | let T = q(A(S)) |
---|
225 | | - | let V = R(Q, S, T) |
---|
226 | | - | let L = toBase64String(toBytes(q(w(S)))) |
---|
227 | | - | let N = toBase64String(toBytes(q(z(S)))) |
---|
228 | | - | let Y = t(B(S)) |
---|
229 | | - | let ag = X(L, N, toString(Y)) |
---|
230 | | - | if (containsElement([a, b, toString(this)], v)) |
---|
231 | | - | then [StringEntry(A(S), V), DeleteEntry(((T + "_") + S)), StringEntry(((V + "_") + S), ag), StringEntry(("user_note_" + S), ah)] |
---|
232 | | - | else throw("Not allowed to change user status") |
---|
233 | | - | } |
---|
234 | | - | |
---|
235 | | - | |
---|
236 | | - | |
---|
237 | | - | @Callable(Z) |
---|
238 | | - | func deleteUser (S) = { |
---|
239 | | - | let v = toString(Z.caller) |
---|
240 | | - | let ac = toBase58String(Z.transactionId) |
---|
241 | | - | let T = q(A(S)) |
---|
242 | | - | if (containsElement([a, toString(this)], v)) |
---|
243 | | - | then [DeleteEntry(B(S)), DeleteEntry(u(S)), DeleteEntry(w(S)), DeleteEntry(x(S)), DeleteEntry(y(S)), DeleteEntry(z(S)), DeleteEntry(("user_note_" + S)), DeleteEntry(((T + "_") + S)), StringEntry(A(S), m)] |
---|
244 | | - | else throw("Not allowed") |
---|
245 | | - | } |
---|
246 | | - | |
---|
247 | | - | |
---|
248 | | - | |
---|
249 | | - | @Callable(ai) |
---|
250 | | - | func setAgent (D,F,aj,ak) = if (!(f)) |
---|
251 | | - | then throw(g) |
---|
252 | | - | else { |
---|
253 | | - | let v = toString(ai.caller) |
---|
254 | | - | if (containsElement([a, toString(this)], v)) |
---|
255 | | - | then if (if ((size(D) != 35)) |
---|
256 | | - | then true |
---|
257 | | - | else (size(F) != 35)) |
---|
258 | | - | then throw("Wrong address") |
---|
259 | | - | else [StringEntry(C(D), F), StringEntry(E(F, D), D), IntegerEntry(G(D), aj), IntegerEntry(H(D), ak)] |
---|
260 | | - | else throw("You are not allowed") |
---|
261 | | - | } |
---|
262 | | - | |
---|
263 | | - | |
---|
264 | | - | |
---|
265 | | - | @Callable(ai) |
---|
266 | | - | func unsetAgent (D,F) = if (!(f)) |
---|
267 | | - | then throw(g) |
---|
268 | | - | else { |
---|
269 | | - | let v = toString(ai.caller) |
---|
270 | | - | if (containsElement([a, toString(this)], v)) |
---|
271 | | - | then if (if ((size(D) != 35)) |
---|
272 | | - | then true |
---|
273 | | - | else (size(F) != 35)) |
---|
274 | | - | then throw("Wrong address") |
---|
275 | | - | else [DeleteEntry(C(D)), DeleteEntry(E(F, D)), DeleteEntry(G(D)), DeleteEntry(H(D))] |
---|
276 | | - | else throw("You are not allowed") |
---|
277 | | - | } |
---|
278 | | - | |
---|
279 | | - | |
---|
280 | | - | |
---|
281 | | - | @Callable(ai) |
---|
282 | | - | func deleteEntry (al) = { |
---|
283 | | - | let v = toString(ai.caller) |
---|
284 | | - | if ((v == a)) |
---|
285 | | - | then [DeleteEntry(al)] |
---|
286 | | - | else throw("no") |
---|
287 | | - | } |
---|
288 | | - | |
---|