1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = Address(base58'3MvJMBxdrVAf1nCHiarJcQVnKy91HhBKe6w') |
---|
5 | | - | |
---|
6 | | - | let b = base58'7A8H5cWfJVSpSrnB71CzWqyNm8KMxZPjwFcj1mDUU8an' |
---|
7 | | - | |
---|
8 | | - | let c = "3N2FjnCq4gcpewsYQVT4scz9MjTgD6a4kQK" |
---|
9 | | - | |
---|
10 | | - | let d = "3NCKoFQxRf7zsDNbivLFw1oJ7y8qJzLmEs4" |
---|
11 | | - | |
---|
12 | | - | let e = base58'Ft8X1v1LTa1ABafufpaCWyVj8KkaxUWE6xBhW6sNFJck' |
---|
13 | | - | |
---|
14 | | - | let f = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU' |
---|
15 | | - | |
---|
16 | | - | let g = base58'8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS' |
---|
17 | | - | |
---|
18 | | - | let h = base58'FiKspxSpkpzT4pMUA9ccZkbJmVXTdu4JhFDXNNXr5noW' |
---|
19 | | - | |
---|
20 | | - | let i = base58'474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu' |
---|
21 | | - | |
---|
22 | | - | let j = base58'HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk' |
---|
23 | | - | |
---|
24 | | - | let k = (1 * 1000000) |
---|
25 | | - | |
---|
26 | | - | let l = "none" |
---|
27 | | - | |
---|
28 | | - | func m (n) = { |
---|
29 | | - | let o = { |
---|
30 | | - | let p = getInteger(this, n) |
---|
31 | | - | if ($isInstanceOf(p, "Int")) |
---|
32 | | - | then { |
---|
33 | | - | let q = p |
---|
34 | | - | q |
---|
35 | | - | } |
---|
36 | | - | else 0 |
---|
37 | | - | } |
---|
38 | | - | o |
---|
39 | | - | } |
---|
40 | | - | |
---|
41 | | - | |
---|
42 | | - | func r (n) = { |
---|
43 | | - | let s = { |
---|
44 | | - | let p = getString(this, n) |
---|
45 | | - | if ($isInstanceOf(p, "String")) |
---|
46 | | - | then { |
---|
47 | | - | let q = p |
---|
48 | | - | q |
---|
49 | | - | } |
---|
50 | | - | else l |
---|
51 | | - | } |
---|
52 | | - | s |
---|
53 | | - | } |
---|
54 | | - | |
---|
55 | | - | |
---|
56 | | - | let t = "registered" |
---|
57 | | - | |
---|
58 | | - | let u = "blacklisted" |
---|
59 | | - | |
---|
60 | | - | let v = "invited" |
---|
61 | | - | |
---|
62 | | - | let w = "spend_invite" |
---|
63 | | - | |
---|
64 | | - | let x = "moderator" |
---|
65 | | - | |
---|
66 | | - | let y = 5 |
---|
67 | | - | |
---|
68 | | - | func z (A,B) = ("item_" + toBase58String(sha256(toBytes((A + B))))) |
---|
69 | | - | |
---|
70 | | - | |
---|
71 | | - | func C (D) = ("document_" + D) |
---|
72 | | - | |
---|
73 | | - | |
---|
74 | | - | func E (B) = r(C(B)) |
---|
75 | | - | |
---|
76 | | - | |
---|
77 | | - | func F (G) = ("wl_ref_" + G) |
---|
78 | | - | |
---|
79 | | - | |
---|
80 | | - | func H (G) = r(F(G)) |
---|
81 | | - | |
---|
82 | | - | |
---|
83 | | - | func I (G) = ("wl_sts_" + G) |
---|
84 | | - | |
---|
85 | | - | |
---|
86 | | - | func J (G) = ("balance_" + G) |
---|
87 | | - | |
---|
88 | | - | |
---|
89 | | - | func K (G) = ("wl_bio_" + G) |
---|
90 | | - | |
---|
91 | | - | |
---|
92 | | - | func L (G) = ("wl_blk_" + G) |
---|
93 | | - | |
---|
94 | | - | |
---|
95 | | - | func M (B,G) = ((("report_" + B) + "_") + G) |
---|
96 | | - | |
---|
97 | | - | |
---|
98 | | - | func N (G) = m(J(G)) |
---|
99 | | - | |
---|
100 | | - | |
---|
101 | | - | func O (G) = r(I(G)) |
---|
102 | | - | |
---|
103 | | - | |
---|
104 | | - | func P (B) = ("author_" + B) |
---|
105 | | - | |
---|
106 | | - | |
---|
107 | | - | func Q (B) = r(P(B)) |
---|
108 | | - | |
---|
109 | | - | |
---|
110 | | - | func R (B) = ("deadlineblock_" + B) |
---|
111 | | - | |
---|
112 | | - | |
---|
113 | | - | func S (B) = m(R(B)) |
---|
114 | | - | |
---|
115 | | - | |
---|
116 | | - | func T (B) = ("block_" + B) |
---|
117 | | - | |
---|
118 | | - | |
---|
119 | | - | func U (B) = m(T(B)) |
---|
120 | | - | |
---|
121 | | - | |
---|
122 | | - | func V (B) = ("typeofwork_" + B) |
---|
123 | | - | |
---|
124 | | - | |
---|
125 | | - | func W (B) = m(V(B)) |
---|
126 | | - | |
---|
127 | | - | |
---|
128 | | - | func X (B) = ("wordcount_" + B) |
---|
129 | | - | |
---|
130 | | - | |
---|
131 | | - | func Y (B) = m(X(B)) |
---|
132 | | - | |
---|
133 | | - | |
---|
134 | | - | func Z (B) = ("priceUSD_" + B) |
---|
135 | | - | |
---|
136 | | - | |
---|
137 | | - | func aa (B) = m(Z(B)) |
---|
138 | | - | |
---|
139 | | - | |
---|
140 | | - | func ab (B) = ("pmtassetID_" + B) |
---|
141 | | - | |
---|
142 | | - | |
---|
143 | | - | func ac (B) = r(ab(B)) |
---|
144 | | - | |
---|
145 | | - | |
---|
146 | | - | func ad (B) = ("priceassetID_" + B) |
---|
147 | | - | |
---|
148 | | - | |
---|
149 | | - | func ae (B) = m(ad(B)) |
---|
150 | | - | |
---|
151 | | - | |
---|
152 | | - | func af (B) = ("datajson_" + B) |
---|
153 | | - | |
---|
154 | | - | |
---|
155 | | - | func ag (B) = r(af(B)) |
---|
156 | | - | |
---|
157 | | - | |
---|
158 | | - | func ah (B) = ("status_" + B) |
---|
159 | | - | |
---|
160 | | - | |
---|
161 | | - | func ai (B) = r(ah(B)) |
---|
162 | | - | |
---|
163 | | - | |
---|
164 | | - | func aj (B) = ("translator_" + B) |
---|
165 | | - | |
---|
166 | | - | |
---|
167 | | - | func ak (B) = r(aj(B)) |
---|
168 | | - | |
---|
169 | | - | |
---|
170 | | - | func al (B) = ("due_for_" + B) |
---|
171 | | - | |
---|
172 | | - | |
---|
173 | | - | func am (B) = m(al(B)) |
---|
174 | | - | |
---|
175 | | - | |
---|
176 | | - | func an (B) = ("disputedby_" + B) |
---|
177 | | - | |
---|
178 | | - | |
---|
179 | | - | func ao (B) = r(an(B)) |
---|
180 | | - | |
---|
181 | | - | |
---|
182 | | - | func ap (B) = ("disputeclosedby_" + B) |
---|
183 | | - | |
---|
184 | | - | |
---|
185 | | - | func aq (B) = r(ap(B)) |
---|
186 | | - | |
---|
187 | | - | |
---|
188 | | - | func ar (B) = "dispute_winner_" |
---|
189 | | - | |
---|
190 | | - | |
---|
191 | | - | func as (B) = r(ar(B)) |
---|
192 | | - | |
---|
193 | | - | |
---|
194 | | - | func at (B) = ("last_update_" + B) |
---|
195 | | - | |
---|
196 | | - | |
---|
197 | | - | func au (B) = m(at(B)) |
---|
198 | | - | |
---|
199 | | - | |
---|
200 | | - | func av (B) = ("cnt_translator_" + B) |
---|
201 | | - | |
---|
202 | | - | |
---|
203 | | - | func aw (B) = m(av(B)) |
---|
204 | | - | |
---|
205 | | - | |
---|
206 | | - | func ax (B) = ("cnt_user_" + B) |
---|
207 | | - | |
---|
208 | | - | |
---|
209 | | - | func ay (B) = m(ax(B)) |
---|
210 | | - | |
---|
211 | | - | |
---|
212 | | - | func az (B) = ("balance_" + B) |
---|
213 | | - | |
---|
214 | | - | |
---|
215 | | - | func aA (B) = m(az(B)) |
---|
216 | | - | |
---|
217 | | - | |
---|
218 | | - | func aB (B) = ("balance_assetID" + B) |
---|
219 | | - | |
---|
220 | | - | |
---|
221 | | - | func aC (B) = m(aB(B)) |
---|
222 | | - | |
---|
223 | | - | |
---|
224 | | - | func aD (G) = ("verifier_status_" + G) |
---|
225 | | - | |
---|
226 | | - | |
---|
227 | | - | func aE (aF,G) = { |
---|
228 | | - | let s = { |
---|
229 | | - | let p = getString(aF, aD(G)) |
---|
230 | | - | if ($isInstanceOf(p, "String")) |
---|
231 | | - | then { |
---|
232 | | - | let q = p |
---|
233 | | - | q |
---|
234 | | - | } |
---|
235 | | - | else l |
---|
236 | | - | } |
---|
237 | | - | s |
---|
238 | | - | } |
---|
239 | | - | |
---|
240 | | - | |
---|
241 | | - | @Callable(aG) |
---|
242 | | - | func submitTranslation (D,aH,aI,aJ,aK,aL,aM) = { |
---|
243 | | - | let A = toBase58String(aG.caller.bytes) |
---|
244 | | - | let B = z(A, D) |
---|
245 | | - | let aN = extract(aG.payment) |
---|
246 | | - | let aO = (lastBlock.height + aJ) |
---|
247 | | - | let aP = aE(a, A) |
---|
248 | | - | if (if (if ((aP != t)) |
---|
249 | | - | then (A != c) |
---|
250 | | - | else false) |
---|
251 | | - | then (aP != d) |
---|
252 | | - | else false) |
---|
253 | | - | then throw(("Your account is not registered. status: " + aP)) |
---|
254 | | - | else if (if (if (if (if (if ((aN.assetId != i)) |
---|
255 | | - | then true |
---|
256 | | - | else (aN.assetId != j)) |
---|
257 | | - | then true |
---|
258 | | - | else (aN.assetId != f)) |
---|
259 | | - | then true |
---|
260 | | - | else (aN.assetId != e)) |
---|
261 | | - | then true |
---|
262 | | - | else (aN.assetId != g)) |
---|
263 | | - | then true |
---|
264 | | - | else (aN.assetId != h)) |
---|
265 | | - | then throw("can only use WAVES, USD, EUR, BTC, ETH, LTC and KOLIN as payment methods") |
---|
266 | | - | else if ((aN.amount != k)) |
---|
267 | | - | then throw(((("Please pay exact amount for the listing: " + toString(k)) + ", actual payment is: ") + toString(aN.amount))) |
---|
268 | | - | else if ((Q(B) != l)) |
---|
269 | | - | then throw("Item already exist") |
---|
270 | | - | else if ((1440 > aJ)) |
---|
271 | | - | then throw("please allow at least 24 h (~1440 blocks) for the translation work to be published properly") |
---|
272 | | - | else if ((aJ > 44640)) |
---|
273 | | - | then throw("a translation work can not be posted for longer than 31 days (~44640 blocks) ") |
---|
274 | | - | else WriteSet([DataEntry(C(D), B), DataEntry(P(B), A), DataEntry(T(B), height), DataEntry(at(B), height), DataEntry(R(B), aO), DataEntry(V(B), aL), DataEntry(X(B), aK), DataEntry(Z(B), (aL * aK)), DataEntry(ab(B), aI), DataEntry(ad(B), aM), DataEntry(ah(B), "new post"), DataEntry(af(B), aH)]) |
---|
275 | | - | } |
---|
276 | | - | |
---|
277 | | - | |
---|
278 | | - | |
---|
279 | | - | @Callable(aG) |
---|
280 | | - | func escrow (B,aQ,aJ) = { |
---|
281 | | - | let A = toBase58String(aG.caller.bytes) |
---|
282 | | - | let aN = extract(aG.payment) |
---|
283 | | - | let aO = (lastBlock.height + aJ) |
---|
284 | | - | let aR = ae(B) |
---|
285 | | - | let aS = ac(B) |
---|
286 | | - | let aT = aE(a, aQ) |
---|
287 | | - | let aU = aE(a, A) |
---|
288 | | - | let aP = O(A) |
---|
289 | | - | if (if (if ((aP != t)) |
---|
290 | | - | then (A != c) |
---|
291 | | - | else false) |
---|
292 | | - | then (aP != d) |
---|
293 | | - | else false) |
---|
294 | | - | then throw(("Your account is not registered. status: " + aP)) |
---|
295 | | - | else if ((E(B) != B)) |
---|
296 | | - | then throw("translation work not found") |
---|
297 | | - | else if ((S(B) >= lastBlock.height)) |
---|
298 | | - | then throw("deadline for this work has been already achieved") |
---|
299 | | - | else if ((aR > aN.amount)) |
---|
300 | | - | then throw("price lower than posted for this translation work") |
---|
301 | | - | else if ((aN.amount > aR)) |
---|
302 | | - | then throw("money payed is higher than this translation work, no need to overspend") |
---|
303 | | - | else if ((A != Q(B))) |
---|
304 | | - | then throw("User is different than translation's post creator") |
---|
305 | | - | else if ((aU == u)) |
---|
306 | | - | then throw("user's account has been blacklisted") |
---|
307 | | - | else if ((aT == u)) |
---|
308 | | - | then throw("translator's account has been blacklisted") |
---|
309 | | - | else if ((1440 > aJ)) |
---|
310 | | - | then throw("please allow at least 24 h (~1440 blocks) for the translation work to be published properly") |
---|
311 | | - | else if ((aJ > 44640)) |
---|
312 | | - | then throw("a translation work can not be posted for longer than 31 days (~44640 blocks) ") |
---|
313 | | - | else if ((ai(B) != "new post")) |
---|
314 | | - | then throw("escrow for this work already present") |
---|
315 | | - | else ScriptResult(WriteSet([DataEntry(ah(B), "work allocated to translator"), DataEntry(aj(B), aQ), DataEntry(al(B), aO), DataEntry(at(B), height), DataEntry(az(B), aN.amount), DataEntry(aB(B), aS)]), TransferSet(nil)) |
---|
316 | | - | } |
---|
317 | | - | |
---|
318 | | - | |
---|
319 | | - | |
---|
320 | | - | @Callable(aG) |
---|
321 | | - | func disputeEscrow (B) = { |
---|
322 | | - | let aV = toBase58String(aG.caller.bytes) |
---|
323 | | - | let aW = ae(B) |
---|
324 | | - | let aI = ac(B) |
---|
325 | | - | let aX = am(B) |
---|
326 | | - | let aT = aE(a, ak(B)) |
---|
327 | | - | let aU = aE(a, Q(B)) |
---|
328 | | - | let aP = O(aV) |
---|
329 | | - | if (if (if ((aP != t)) |
---|
330 | | - | then (aV != c) |
---|
331 | | - | else false) |
---|
332 | | - | then (aP != d) |
---|
333 | | - | else false) |
---|
334 | | - | then throw(("Your account is not registered. status: " + aP)) |
---|
335 | | - | else if (if (if ((aV != ak(B))) |
---|
336 | | - | then true |
---|
337 | | - | else (aV != Q(B))) |
---|
338 | | - | then true |
---|
339 | | - | else (aV != d)) |
---|
340 | | - | then throw("just work creator, translator or an admin can initiate a dispute") |
---|
341 | | - | else if ((ah(B) == "dispute in progress")) |
---|
342 | | - | then throw("This work is currently under dispute") |
---|
343 | | - | else if ((aU == u)) |
---|
344 | | - | then throw("user's account has been blacklisted") |
---|
345 | | - | else if ((aT == u)) |
---|
346 | | - | then throw("translator's account has been blacklisted") |
---|
347 | | - | else ScriptResult(WriteSet([DataEntry(ah(B), "dispute in progress"), DataEntry(an(B), aV), DataEntry(al(B), (lastBlock.height + 1440)), DataEntry(at(B), height), DataEntry(ap(B), l), DataEntry(ar(B), l)]), TransferSet(nil)) |
---|
348 | | - | } |
---|
349 | | - | |
---|
350 | | - | |
---|
351 | | - | |
---|
352 | | - | @Callable(aG) |
---|
353 | | - | func disputeCloseEscrow (B) = { |
---|
354 | | - | let aV = toBase58String(aG.caller.bytes) |
---|
355 | | - | let aW = ae(B) |
---|
356 | | - | let aI = ac(B) |
---|
357 | | - | let aX = am(B) |
---|
358 | | - | let aT = aE(a, ak(B)) |
---|
359 | | - | let aU = aE(a, Q(B)) |
---|
360 | | - | let aP = O(aV) |
---|
361 | | - | if (if (if ((aP != t)) |
---|
362 | | - | then (aV != c) |
---|
363 | | - | else false) |
---|
364 | | - | then (aP != d) |
---|
365 | | - | else false) |
---|
366 | | - | then throw(("Your account is not registered. status: " + aP)) |
---|
367 | | - | else if ((aP != d)) |
---|
368 | | - | then throw("just admins can close a dispute") |
---|
369 | | - | else if ((ah(B) != "dispute in progress")) |
---|
370 | | - | then throw("This work is not under dispute") |
---|
371 | | - | else if ((aU == u)) |
---|
372 | | - | then throw("user's account has been blacklisted") |
---|
373 | | - | else if ((aT == u)) |
---|
374 | | - | then throw("translator's account has been blacklisted") |
---|
375 | | - | else if (if ((y > aw(B))) |
---|
376 | | - | then (y > ay(B)) |
---|
377 | | - | else false) |
---|
378 | | - | then throw("Votes are not enough to favour any involved part") |
---|
379 | | - | else if ((aw(B) >= y)) |
---|
380 | | - | then ScriptResult(WriteSet([DataEntry(ah(B), "dispute closed"), DataEntry(ap(B), aV), DataEntry(ar(B), ak(B)), DataEntry(at(B), height)]), TransferSet([ScriptTransfer(addressFromStringValue(ak(B)), aW, fromBase58String(aI))])) |
---|
381 | | - | else if ((ay(B) >= y)) |
---|
382 | | - | then ScriptResult(WriteSet([DataEntry(ah(B), "dispute closed"), DataEntry(ap(B), aV), DataEntry(ar(B), Q(B)), DataEntry(at(B), height)]), TransferSet([ScriptTransfer(addressFromStringValue(Q(B)), aW, fromBase58String(aI))])) |
---|
383 | | - | else ScriptResult(WriteSet([DataEntry(ah(B), "dispute still under review"), DataEntry(ap(B), l), DataEntry(ar(B), l), DataEntry(at(B), height), DataEntry(al(B), (lastBlock.height + 1440))]), TransferSet(nil)) |
---|
384 | | - | } |
---|
385 | | - | |
---|
386 | | - | |
---|
387 | | - | |
---|
388 | | - | @Callable(aG) |
---|
389 | | - | func voteDisputeEscrow (B,aY) = { |
---|
390 | | - | let aV = toBase58String(aG.caller.bytes) |
---|
391 | | - | if ((ai(B) == "dispute closed")) |
---|
392 | | - | then throw("this dispute is closed") |
---|
393 | | - | else if (if ((O(aV) != x)) |
---|
394 | | - | then true |
---|
395 | | - | else (O(aV) != d)) |
---|
396 | | - | then throw("you either need to be an ADMIN or a MODERATOR to vote in disputes") |
---|
397 | | - | else if (if ((ai(B) != "dispute in progress")) |
---|
398 | | - | then true |
---|
399 | | - | else (ai(B) != "dispute still under review")) |
---|
400 | | - | then throw("translation work not under dispute") |
---|
401 | | - | else if ((aw(B) >= y)) |
---|
402 | | - | then throw("Votes are enough to favour the Translator") |
---|
403 | | - | else if ((ay(B) >= y)) |
---|
404 | | - | then throw("Votes are enough to favour the User") |
---|
405 | | - | else if ((aY == Q(B))) |
---|
406 | | - | then WriteSet([DataEntry(ax(B), (ay(B) + 1))]) |
---|
407 | | - | else if ((aY == ak(B))) |
---|
408 | | - | then WriteSet([DataEntry(av(B), (aw(B) + 1))]) |
---|
409 | | - | else throw("vote not submitted") |
---|
410 | | - | } |
---|
411 | | - | |
---|
412 | | - | |
---|
413 | | - | |
---|
414 | | - | @Callable(aG) |
---|
415 | | - | func withdrawEscrow (aZ,B) = { |
---|
416 | | - | let aV = toBase58String(aG.caller.bytes) |
---|
417 | | - | let aI = ac(B) |
---|
418 | | - | let aW = ae(B) |
---|
419 | | - | let aP = O(aV) |
---|
420 | | - | let aT = aE(a, ak(B)) |
---|
421 | | - | let aU = aE(a, Q(B)) |
---|
422 | | - | if (if (if ((aP != t)) |
---|
423 | | - | then (aV != c) |
---|
424 | | - | else false) |
---|
425 | | - | then (aP != d) |
---|
426 | | - | else false) |
---|
427 | | - | then throw(("Your account is not registered. status: " + aP)) |
---|
428 | | - | else if ((am(B) > lastBlock.height)) |
---|
429 | | - | then throw("Deadline has not finished yet") |
---|
430 | | - | else if ((ah(B) == "dispute in progress")) |
---|
431 | | - | then throw("This work is currently under dispute") |
---|
432 | | - | else if (if ((aV != ak(B))) |
---|
433 | | - | then true |
---|
434 | | - | else (aV != Q(B))) |
---|
435 | | - | then throw("just work creator or translator can withdraw funds. Admins must initiate a dispute") |
---|
436 | | - | else if (if ((aV == Q(B))) |
---|
437 | | - | then (aU == u) |
---|
438 | | - | else false) |
---|
439 | | - | then throw("user's account has been blacklisted") |
---|
440 | | - | else if (if ((aV == ak(B))) |
---|
441 | | - | then (aT == u) |
---|
442 | | - | else false) |
---|
443 | | - | then throw("translator's account has been blacklisted") |
---|
444 | | - | else ScriptResult(WriteSet([DataEntry(az(B), 0), DataEntry(ah(B), ("money withdrawn by " + aV)), DataEntry(at(B), height)]), TransferSet([ScriptTransfer(addressFromStringValue(aV), aW, fromBase58String(aI))])) |
---|
445 | | - | } |
---|
446 | | - | |
---|
447 | | - | |
---|
448 | | - | |
---|
449 | | - | @Callable(aG) |
---|
450 | | - | func inviteuser (ba,aH) = { |
---|
451 | | - | let aV = toBase58String(aG.caller.bytes) |
---|
452 | | - | let bb = O(ba) |
---|
453 | | - | let aP = O(aV) |
---|
454 | | - | if (if (if ((bb == t)) |
---|
455 | | - | then true |
---|
456 | | - | else (bb == x)) |
---|
457 | | - | then true |
---|
458 | | - | else (bb == d)) |
---|
459 | | - | then throw("User has already been registered") |
---|
460 | | - | else if ((bb == u)) |
---|
461 | | - | then throw("The user you want to invite is already Blacklisted") |
---|
462 | | - | else if (if (if ((aP != t)) |
---|
463 | | - | then (aV != c) |
---|
464 | | - | else false) |
---|
465 | | - | then (aP != d) |
---|
466 | | - | else false) |
---|
467 | | - | then throw(("Your account should be whitelisted. status: " + aP)) |
---|
468 | | - | else WriteSet([DataEntry(F(ba), aV), DataEntry(K(ba), aH), DataEntry(I(ba), v)]) |
---|
469 | | - | } |
---|
470 | | - | |
---|
471 | | - | |
---|
472 | | - | |
---|
473 | | - | @Callable(aG) |
---|
474 | | - | func userupdate (aH,bc) = { |
---|
475 | | - | let G = toBase58String(aG.caller.bytes) |
---|
476 | | - | if (if (if ((bc == x)) |
---|
477 | | - | then true |
---|
478 | | - | else (bc == d)) |
---|
479 | | - | then (O(G) == t) |
---|
480 | | - | else false) |
---|
481 | | - | then throw("an ADMIN or MODERATOR account can be created by an ADMIN only") |
---|
482 | | - | else if (if ((bc == d)) |
---|
483 | | - | then (O(G) != d) |
---|
484 | | - | else false) |
---|
485 | | - | then throw("an ADMIN account can be created by another ADMIN only") |
---|
486 | | - | else WriteSet([DataEntry(K(G), aH), DataEntry(I(G), if ((bc == x)) |
---|
487 | | - | then x |
---|
488 | | - | else if ((bc == d)) |
---|
489 | | - | then d |
---|
490 | | - | else t)]) |
---|
491 | | - | } |
---|
492 | | - | |
---|
493 | | - | |
---|
494 | | - | |
---|
495 | | - | @Callable(aG) |
---|
496 | | - | func signupbylink (bd,aH,bc) = { |
---|
497 | | - | let G = toBase58String(aG.caller.bytes) |
---|
498 | | - | let be = O(bd) |
---|
499 | | - | if ((be != v)) |
---|
500 | | - | then throw(((((("Referral invite needed. Current status: " + be) + ", key:") + I(bd)) + ", account:") + bd)) |
---|
501 | | - | else WriteSet([DataEntry(K(G), aH), DataEntry(L(G), height), DataEntry(I(G), if ((bc == x)) |
---|
502 | | - | then x |
---|
503 | | - | else t), DataEntry(I(bd), w), DataEntry(F(G), H(bd))]) |
---|
504 | | - | } |
---|
505 | | - | |
---|
506 | | - | |
---|
507 | | - | |
---|
508 | | - | @Callable(aG) |
---|
509 | | - | func signup (aH,bc) = { |
---|
510 | | - | let G = toBase58String(aG.caller.bytes) |
---|
511 | | - | let be = O(G) |
---|
512 | | - | if ((be == l)) |
---|
513 | | - | then throw(((((("Referral invite needed. Current status: " + be) + ", key:") + I(G)) + ", account:") + G)) |
---|
514 | | - | else WriteSet([DataEntry(K(G), aH), DataEntry(L(G), height), DataEntry(I(G), if ((bc == x)) |
---|
515 | | - | then x |
---|
516 | | - | else t)]) |
---|
517 | | - | } |
---|
518 | | - | |
---|
519 | | - | |
---|
520 | | - | |
---|
521 | | - | @Callable(aG) |
---|
522 | | - | func reportProject (B,aH) = { |
---|
523 | | - | let G = toBase58String(aG.caller.bytes) |
---|
524 | | - | WriteSet([DataEntry(M(B, G), aH)]) |
---|
525 | | - | } |
---|
526 | | - | |
---|
527 | | - | |
---|
| 1 | + | # no script |
---|