tx · 3aoN9AuXMwdLHaBekAL7buTEmtTJQuxrgBgzypWPaab7 3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx: -0.01200000 Waves 2023.09.05 16:25 [2742135] smart account 3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx > SELF 0.00000000 Waves
{ "type": 13, "id": "3aoN9AuXMwdLHaBekAL7buTEmtTJQuxrgBgzypWPaab7", "fee": 1200000, "feeAssetId": null, "timestamp": 1693920398119, "version": 2, "chainId": 84, "sender": "3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx", "senderPublicKey": "UGqkWsCpv7xRVXkQRXyLd6pWPDtYGXmPip7FxSd1pAu", "proofs": [ "18wBmDuhtPoNgRvvWtGQCkN6N3bqhpyUDVo1hjvmAk8GBCC2MNK7sToFLNrk7yKP9Mt9kTQmKgzadoNKh8ZaHrX" ], "script": "base64:BgIgCAISBwoFAQEBAQESABIAEgQKAggBEgQKAggBEgMKAQE0AA9ERUZBVUxUTE9DQVRJT04CD0FmcmljYV9GX0FmcmljYQEUa2V5U3Rha2VkRHVja0J5T3duZXIBCW93bmVyQWRkcgkArAICAhJzdGFrZWREdWNrQnlPd25lcl8FCW93bmVyQWRkcgEPa2V5RHVja0xvY2F0aW9uAQtkdWNrQXNzZXRJZAkArAICAg1kdWNrTG9jYXRpb25fBQtkdWNrQXNzZXRJZAANbGFzdFRvdXJJZEtleQIOJXNfX2xhc3RUb3VySWQBFWtleVRvdXJTdGF0aWNEYXRhQnlJZAEDdElkCQCsAgICFiVzJWRfX3RvdXJTdGF0aWNEYXRhX18JAKQDAQUDdElkARZrZXlUb3VyRHluYW1pY0RhdGFCeUlkAQN0SWQJAKwCAgIXJXMlZF9fdG91ckR5bmFtaWNEYXRhX18JAKQDAQUDdElkARNrZXlTY29yZUJvYXJkQnlUb3VyAQN0SWQJAKwCAgISJXMlZF9fc2NvcmVCb2FyZF9fCQCkAwEFA3RJZAEba2V5TGFzdFJlZ2lzdGVyZWRUb3Vy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ZAUSdXBkYXRlZER5bmFtaWNEYXRhBQNuaWwAAADd0Buc", "height": 2742135, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9YC1hZU7qSPga9Ts4kUWFAtsycG6RRXnCFPiP3exZyRE Next: 9iiwT1LASVMPfQGFTWbMTRfNsirwT1jUcnHy6CQqRRkw Diff:
Old | New | Differences | |
---|---|---|---|
159 | 159 | else throw("Unknown chain") | |
160 | 160 | }] | |
161 | 161 | ||
162 | - | func ar (as,at,au,av,aw,ax) = makeString(["%s%d%d%d%d%d", as, toString(at), toString(au), toString(av), toString(aw), toString(ax)], I) | |
162 | + | func ar (as,at,au,av,aw,ax,ay) = makeString(["%s%d%d%d%d%d%d", as, toString(at), toString(au), toString(av), toString(aw), toString(ax), toString(ay)], I) | |
163 | 163 | ||
164 | 164 | ||
165 | - | func | |
165 | + | func az (aA,aB,aC,aD,aE) = makeString(["%s%s%d%d%d", aA, aB, toString(aC), toString(aD), toString(aE)], I) | |
166 | 166 | ||
167 | 167 | ||
168 | - | func | |
168 | + | func aF () = ad(invoke(W, "saveLastTx", nil, nil)) | |
169 | 169 | ||
170 | 170 | ||
171 | - | func | |
171 | + | func aG (aH) = valueOrErrorMessage(getString(W, b(toString(aH))), "You don't have a duck staked") | |
172 | 172 | ||
173 | 173 | ||
174 | - | @Callable( | |
175 | - | func createTournament (aw,ax,at,au) = { | |
176 | - | let | |
177 | - | if (!(containsElement(aq, | |
174 | + | @Callable(aI) | |
175 | + | func createTournament (aw,ax,at,au,ay) = { | |
176 | + | let aH = toString(aI.caller) | |
177 | + | if (!(containsElement(aq, aH))) | |
178 | 178 | then throw("Permission denied") | |
179 | 179 | else { | |
180 | - | let | |
181 | - | let h = if (isDefined( | |
180 | + | let aJ = getInteger(f) | |
181 | + | let h = if (isDefined(aJ)) | |
182 | 182 | then { | |
183 | - | let | |
184 | - | let t = valueOrErrorMessage(getString(i( | |
185 | - | let | |
186 | - | if (( | |
187 | - | then throw(("Current tournement is not completed, status=" + | |
188 | - | else ( | |
183 | + | let aK = value(aJ) | |
184 | + | let t = valueOrErrorMessage(getString(i(aK)), (("Error reading tournament " + toString(aK)) + " data")) | |
185 | + | let aA = split(t, I)[y] | |
186 | + | if ((aA != "ARCHIVED")) | |
187 | + | then throw(("Current tournement is not completed, status=" + aA)) | |
188 | + | else (aK + 1) | |
189 | 189 | } | |
190 | 190 | else 1 | |
191 | - | let | |
192 | - | if (( | |
193 | - | then throw(((("startTime=" + toString(aw)) + " < creationTime=") + toString( | |
191 | + | let aL = lastBlock.timestamp | |
192 | + | if ((aL > aw)) | |
193 | + | then throw(((("startTime=" + toString(aw)) + " < creationTime=") + toString(aL))) | |
194 | 194 | else if ((aw > ax)) | |
195 | 195 | then throw(((("endTime=" + toString(ax)) + " < startTime=") + toString(aw))) | |
196 | 196 | else if (((ax - aw) > ao)) | |
199 | 199 | then true | |
200 | 200 | else (0 >= au)) | |
201 | 201 | then throw(((("Cost should be positive, but passed " + toString(at)) + " and ") + toString(au))) | |
202 | - | else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ar(toBase58String(aH.transactionId), at, au, aK, aw, ax)), StringEntry(i(h), ay("CREATED", " ", 0, 0, 0))], h) | |
202 | + | else if ((0 > ay)) | |
203 | + | then throw("Number of Grand Prizes should be non-negative") | |
204 | + | else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ar(toBase58String(aI.transactionId), at, au, aL, aw, ax, ay)), StringEntry(i(h), az("CREATED", " ", 0, 0, 0))], h) | |
203 | 205 | } | |
204 | 206 | } | |
205 | 207 | ||
206 | 208 | ||
207 | 209 | ||
208 | - | @Callable( | |
210 | + | @Callable(aI) | |
209 | 211 | func register () = { | |
210 | - | let | |
211 | - | if ((size( | |
212 | + | let aM = aF() | |
213 | + | if ((size(aI.payments) != 1)) | |
212 | 214 | then throw("exactly 1 payment must be attached") | |
213 | 215 | else { | |
214 | - | let | |
215 | - | let | |
216 | - | let | |
217 | - | if (( | |
216 | + | let aN = aI.payments[0] | |
217 | + | let aO = aN.amount | |
218 | + | let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!") | |
219 | + | if ((aP != Z)) | |
218 | 220 | then throw("WLGOLD payments only!") | |
219 | 221 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let s = | |
224 | - | let t = | |
225 | - | let | |
226 | - | if (!(if (if (if (( | |
227 | - | then ( | |
222 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
223 | + | let aL = lastBlock.timestamp | |
224 | + | let aQ = q(this, aJ) | |
225 | + | let s = aQ[o] | |
226 | + | let t = aQ[p] | |
227 | + | let aA = t[y] | |
228 | + | if (!(if (if (if ((aA == "CREATED")) | |
229 | + | then (aL > parseIntValue(s[w])) | |
228 | 230 | else false) | |
229 | - | then ((parseIntValue(s[x]) - ap) > | |
231 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
230 | 232 | else false) | |
231 | 233 | then true | |
232 | - | else if (( | |
233 | - | then ((parseIntValue(s[x]) - ap) > | |
234 | + | else if ((aA == "INPROGRESS")) | |
235 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
234 | 236 | else false)) | |
235 | 237 | then throw("Cannot register now") | |
236 | 238 | else { | |
237 | - | let | |
238 | - | if (( | |
239 | - | then throw((("Need payment of " + af( | |
239 | + | let aR = parseIntValue(s[u]) | |
240 | + | if ((aO != aR)) | |
241 | + | then throw((("Need payment of " + af(aR, 8)) + " WLGOLD")) | |
240 | 242 | else { | |
241 | - | let e = | |
242 | - | let | |
243 | - | if (if (valueOrElse(getBoolean(l( | |
243 | + | let e = aG(aI.originCaller) | |
244 | + | let aS = valueOrElse(getString(j(aJ)), "") | |
245 | + | if (if (valueOrElse(getBoolean(l(aJ, e)), false)) | |
244 | 246 | then true | |
245 | - | else contains( | |
246 | - | then throw(((("Your duck " + e) + " is already registered at tournament ") + toString( | |
247 | + | else contains(aS, e)) | |
248 | + | then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aJ))) | |
247 | 249 | else { | |
248 | - | let | |
249 | - | $Tuple2([IntegerEntry(k(e), | |
250 | + | let aT = az("INPROGRESS", t[z], parseIntValue(t[A]), (parseIntValue(t[B]) + 1), parseIntValue(t[C])) | |
251 | + | $Tuple2([IntegerEntry(k(e), aJ), BooleanEntry(l(aJ, e), true), StringEntry(j(aJ), if ((aS == "")) | |
250 | 252 | then (e + ":000") | |
251 | - | else ((( | |
253 | + | else (((aS + "_") + e) + ":000")), StringEntry(i(aJ), aT)], aM) | |
252 | 254 | } | |
253 | 255 | } | |
254 | 256 | } | |
258 | 260 | ||
259 | 261 | ||
260 | 262 | ||
261 | - | @Callable( | |
263 | + | @Callable(aI) | |
262 | 264 | func newAttempt () = { | |
263 | - | let | |
264 | - | let e = | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | let s = | |
269 | - | let t = | |
270 | - | let | |
271 | - | if (!(if (( | |
272 | - | then ((parseIntValue(s[x]) - ap) > | |
265 | + | let aM = aF() | |
266 | + | let e = aG(aI.originCaller) | |
267 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
268 | + | let aL = lastBlock.timestamp | |
269 | + | let aQ = q(this, aJ) | |
270 | + | let s = aQ[o] | |
271 | + | let t = aQ[p] | |
272 | + | let aA = t[y] | |
273 | + | if (!(if ((aA == "INPROGRESS")) | |
274 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
273 | 275 | else false)) | |
274 | 276 | then throw("Attempt is not possible") | |
275 | - | else if (!(valueOrElse(getBoolean(l( | |
276 | - | then throw(((("Your duck " + e) + " is not registered at tournament ") + toString( | |
277 | + | else if (!(valueOrElse(getBoolean(l(aJ, e)), false))) | |
278 | + | then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aJ))) | |
277 | 279 | else { | |
278 | - | let | |
279 | - | let | |
280 | - | let | |
280 | + | let aU = m(aJ, e) | |
281 | + | let aV = getInteger(aU) | |
282 | + | let aW = if (!(isDefined(aV))) | |
281 | 283 | then $Tuple2(0, 0) | |
282 | - | else if ((size( | |
284 | + | else if ((size(aI.payments) != 1)) | |
283 | 285 | then throw("exactly 1 payment must be attached") | |
284 | 286 | else { | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | if (( | |
287 | + | let aN = aI.payments[0] | |
288 | + | let aO = aN.amount | |
289 | + | let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!") | |
290 | + | if ((aP != Z)) | |
289 | 291 | then throw("WLGOLD payments only!") | |
290 | 292 | else { | |
291 | - | let | |
292 | - | if (( | |
293 | - | then throw((("Need payment of " + af( | |
294 | - | else $Tuple2((value( | |
293 | + | let aX = parseIntValue(s[v]) | |
294 | + | if ((aO != aX)) | |
295 | + | then throw((("Need payment of " + af(aX, 8)) + " WLGOLD")) | |
296 | + | else $Tuple2((value(aV) + 1), 1) | |
295 | 297 | } | |
296 | 298 | } | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | $Tuple2([IntegerEntry( | |
299 | + | let aY = aW._1 | |
300 | + | let aZ = aW._2 | |
301 | + | let aT = az("INPROGRESS", t[z], parseIntValue(t[A]), parseIntValue(t[B]), (parseIntValue(t[C]) + aZ)) | |
302 | + | let ba = aa(invoke(W, "initDuckTourAttempt", [e], nil)) | |
303 | + | $Tuple2([IntegerEntry(aU, aY), StringEntry(i(aJ), aT)], [aM, aY, ba]) | |
302 | 304 | } | |
303 | 305 | } | |
304 | 306 | ||
305 | 307 | ||
306 | 308 | ||
307 | - | @Callable( | |
308 | - | func updateDynamicData (e, | |
309 | + | @Callable(aI) | |
310 | + | func updateDynamicData (e,bb) = if ((aI.caller != W)) | |
309 | 311 | then throw("Access denied") | |
310 | 312 | else { | |
311 | - | let | |
312 | - | let | |
313 | - | let s = | |
314 | - | let t = | |
315 | - | if (if (if ((parseIntValue(t[A]) >= | |
313 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
314 | + | let aQ = q(this, aJ) | |
315 | + | let s = aQ[o] | |
316 | + | let t = aQ[p] | |
317 | + | if (if (if ((parseIntValue(t[A]) >= bb)) | |
316 | 318 | then true | |
317 | 319 | else (t[y] != "INPROGRESS")) | |
318 | 320 | then true | |
319 | 321 | else (lastBlock.timestamp > parseIntValue(s[x]))) | |
320 | 322 | then $Tuple2(nil, 0) | |
321 | 323 | else { | |
322 | - | let | |
323 | - | $Tuple2([StringEntry(i( | |
324 | + | let aT = az("INPROGRESS", e, bb, parseIntValue(t[B]), parseIntValue(t[C])) | |
325 | + | $Tuple2([StringEntry(i(aJ), aT)], 0) | |
324 | 326 | } | |
325 | 327 | } | |
326 | 328 | ||
327 | 329 | ||
328 | 330 | ||
329 | - | @Callable( | |
330 | - | func saveDuckResult (e, | |
331 | + | @Callable(aI) | |
332 | + | func saveDuckResult (e,bb) = if ((aI.caller != W)) | |
331 | 333 | then throw("Access denied") | |
332 | 334 | else { | |
333 | - | let | |
334 | - | let | |
335 | - | let s = | |
336 | - | let t = | |
337 | - | let | |
338 | - | let | |
339 | - | if (if (if (if (( | |
340 | - | then (parseIntValue( | |
335 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
336 | + | let aQ = q(this, aJ) | |
337 | + | let s = aQ[o] | |
338 | + | let t = aQ[p] | |
339 | + | let bc = split(valueOrElse(getString(W, d(e)), a), "_") | |
340 | + | let bd = n(aJ, e) | |
341 | + | if (if (if (if ((bc[E] == "T")) | |
342 | + | then (parseIntValue(bc[D]) == aJ) | |
341 | 343 | else false) | |
342 | 344 | then (t[y] == "INPROGRESS") | |
343 | 345 | else false) | |
344 | 346 | then (parseIntValue(s[x]) >= lastBlock.timestamp) | |
345 | 347 | else false) | |
346 | 348 | then { | |
347 | - | let | |
348 | - | let | |
349 | - | let | |
350 | - | let | |
351 | - | then if (!(contains( | |
349 | + | let be = valueOrElse(getInteger(bd), 0) | |
350 | + | let bf = j(aJ) | |
351 | + | let aS = valueOrElse(getString(bf), "") | |
352 | + | let bg = if ((bb > be)) | |
353 | + | then if (!(contains(aS, e))) | |
352 | 354 | then throw(("scoreBoard does not contain " + e)) | |
353 | 355 | else { | |
354 | - | let | |
355 | - | (((( | |
356 | + | let bh = split_51C(aS, e) | |
357 | + | ((((bh[0] + e) + ":") + al(bb, 3)) + drop(bh[1], 4)) | |
356 | 358 | } | |
357 | - | else | |
358 | - | $Tuple2([IntegerEntry( | |
359 | + | else aS | |
360 | + | $Tuple2([IntegerEntry(bd, max([be, bb])), StringEntry(bf, bg)], 0) | |
359 | 361 | } | |
360 | 362 | else $Tuple2(nil, 0) | |
361 | 363 | } | |
362 | 364 | ||
363 | 365 | ||
364 | 366 | ||
365 | - | @Callable( | |
367 | + | @Callable(aI) | |
366 | 368 | func finishTournament (h) = { | |
367 | - | let | |
368 | - | if (!(containsElement(aq, | |
369 | + | let aH = toString(aI.caller) | |
370 | + | if (!(containsElement(aq, aH))) | |
369 | 371 | then throw("Permission denied") | |
370 | 372 | else { | |
371 | - | let | |
372 | - | let t = | |
373 | - | let | |
374 | - | if (( | |
373 | + | let aQ = q(this, h) | |
374 | + | let t = aQ[p] | |
375 | + | let aA = t[y] | |
376 | + | if ((aA == "ARCHIVED")) | |
375 | 377 | then throw((("Tournament " + toString(h)) + " is already ARCHIVED")) | |
376 | 378 | else { | |
377 | - | let | |
378 | - | $Tuple2([StringEntry(i(h), | |
379 | + | let aT = az("ARCHIVED", t[z], parseIntValue(t[A]), parseIntValue(t[B]), parseIntValue(t[C])) | |
380 | + | $Tuple2([StringEntry(i(h), aT)], 0) | |
379 | 381 | } | |
380 | 382 | } | |
381 | 383 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "Africa_F_Africa" | |
5 | 5 | ||
6 | 6 | func b (c) = ("stakedDuckByOwner_" + c) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func d (e) = ("duckLocation_" + e) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | let f = "%s__lastTourId" | |
13 | 13 | ||
14 | 14 | func g (h) = ("%s%d__tourStaticData__" + toString(h)) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func i (h) = ("%s%d__tourDynamicData__" + toString(h)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func j (h) = ("%s%d__scoreBoard__" + toString(h)) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func k (e) = ("%s%s__lastRegisteredTourByDuck__" + e) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func l (h,e) = makeString(["%s%d%s__isRegisteredByTourAndDuck", toString(h), e], "__") | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func m (h,e) = makeString(["%s%d%s__lastAttemptByTourAndDuck", toString(h), e], "__") | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func n (h,e) = makeString(["%s%d%s__bestResultByTourAndDuck", toString(h), e], "__") | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | let o = 0 | |
36 | 36 | ||
37 | 37 | let p = 1 | |
38 | 38 | ||
39 | 39 | func q (r,h) = { | |
40 | 40 | let s = split(valueOrErrorMessage(getString(r, g(h)), (("Error reading tournament " + toString(h)) + " data")), "__") | |
41 | 41 | let t = split(valueOrErrorMessage(getString(r, i(h)), (("Error reading tournament " + toString(h)) + " data")), "__") | |
42 | 42 | [s, t] | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | let u = 2 | |
47 | 47 | ||
48 | 48 | let v = 3 | |
49 | 49 | ||
50 | 50 | let w = 5 | |
51 | 51 | ||
52 | 52 | let x = 6 | |
53 | 53 | ||
54 | 54 | let y = 1 | |
55 | 55 | ||
56 | 56 | let z = 2 | |
57 | 57 | ||
58 | 58 | let A = 3 | |
59 | 59 | ||
60 | 60 | let B = 4 | |
61 | 61 | ||
62 | 62 | let C = 5 | |
63 | 63 | ||
64 | 64 | let D = 0 | |
65 | 65 | ||
66 | 66 | let E = 1 | |
67 | 67 | ||
68 | 68 | let F = take(drop(this.bytes, 1), 1) | |
69 | 69 | ||
70 | 70 | let G = { | |
71 | 71 | let H = F | |
72 | 72 | if ((base58'2W' == H)) | |
73 | 73 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
74 | 74 | else if ((base58'2T' == H)) | |
75 | 75 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
76 | 76 | else throw("Unknown chain") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | let I = "__" | |
80 | 80 | ||
81 | 81 | func J (K,L) = valueOrErrorMessage(getString(K, L), makeString(["mandatory ", toString(K), ".", L, " is not defined"], "")) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | let M = 1 | |
85 | 85 | ||
86 | 86 | let N = 4 | |
87 | 87 | ||
88 | 88 | func O () = "%s__restConfig" | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func P () = "%s__restAddr" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func Q (R) = split_4C(J(R, O()), I) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func S (T,U) = valueOrErrorMessage(addressFromString(T[U]), ("Rest cfg doesn't contain address at index " + toString(U))) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | let V = addressFromStringValue(valueOrElse(getString(this, P()), G)) | |
101 | 101 | ||
102 | 102 | let T = Q(V) | |
103 | 103 | ||
104 | 104 | let W = S(T, M) | |
105 | 105 | ||
106 | 106 | let X = S(T, N) | |
107 | 107 | ||
108 | 108 | let Y = "wlg_assetId" | |
109 | 109 | ||
110 | 110 | let Z = valueOrErrorMessage(getBinary(X, Y), "Not initialized yet") | |
111 | 111 | ||
112 | 112 | func aa (ab) = { | |
113 | 113 | let H = ab | |
114 | 114 | if ($isInstanceOf(H, "String")) | |
115 | 115 | then { | |
116 | 116 | let ac = H | |
117 | 117 | ac | |
118 | 118 | } | |
119 | 119 | else throw("fail to cast into String") | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func ad (ab) = { | |
124 | 124 | let H = ab | |
125 | 125 | if ($isInstanceOf(H, "Int")) | |
126 | 126 | then { | |
127 | 127 | let ae = H | |
128 | 128 | ae | |
129 | 129 | } | |
130 | 130 | else throw("fail to cast into Int") | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func af (ag,ah) = { | |
135 | 135 | let ai = pow(10, 0, ah, 0, 0, DOWN) | |
136 | 136 | let aj = toString((ag % ai)) | |
137 | 137 | let ak = drop(toString(ai), (1 + size(aj))) | |
138 | 138 | (((toString((ag / ai)) + ".") + ak) + aj) | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func al (ag,am) = { | |
143 | 143 | let an = toString(ag) | |
144 | 144 | let ak = drop(toString(pow(10, 0, (am - size(an)), 0, 0, DOWN)), 1) | |
145 | 145 | (ak + an) | |
146 | 146 | } | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | let ao = 432000000 | |
150 | 150 | ||
151 | 151 | let ap = 3600000 | |
152 | 152 | ||
153 | 153 | let aq = [toString(this), { | |
154 | 154 | let H = F | |
155 | 155 | if ((base58'2W' == H)) | |
156 | 156 | then "3PEe2RELUHCFCBsmSCNcBJ8N3URLVQende7" | |
157 | 157 | else if ((base58'2T' == H)) | |
158 | 158 | then "3MtBgJTaLxPB3C7UJD1UE8qjkHthfKvFQYY" | |
159 | 159 | else throw("Unknown chain") | |
160 | 160 | }] | |
161 | 161 | ||
162 | - | func ar (as,at,au,av,aw,ax) = makeString(["%s%d%d%d%d%d", as, toString(at), toString(au), toString(av), toString(aw), toString(ax)], I) | |
162 | + | func ar (as,at,au,av,aw,ax,ay) = makeString(["%s%d%d%d%d%d%d", as, toString(at), toString(au), toString(av), toString(aw), toString(ax), toString(ay)], I) | |
163 | 163 | ||
164 | 164 | ||
165 | - | func | |
165 | + | func az (aA,aB,aC,aD,aE) = makeString(["%s%s%d%d%d", aA, aB, toString(aC), toString(aD), toString(aE)], I) | |
166 | 166 | ||
167 | 167 | ||
168 | - | func | |
168 | + | func aF () = ad(invoke(W, "saveLastTx", nil, nil)) | |
169 | 169 | ||
170 | 170 | ||
171 | - | func | |
171 | + | func aG (aH) = valueOrErrorMessage(getString(W, b(toString(aH))), "You don't have a duck staked") | |
172 | 172 | ||
173 | 173 | ||
174 | - | @Callable( | |
175 | - | func createTournament (aw,ax,at,au) = { | |
176 | - | let | |
177 | - | if (!(containsElement(aq, | |
174 | + | @Callable(aI) | |
175 | + | func createTournament (aw,ax,at,au,ay) = { | |
176 | + | let aH = toString(aI.caller) | |
177 | + | if (!(containsElement(aq, aH))) | |
178 | 178 | then throw("Permission denied") | |
179 | 179 | else { | |
180 | - | let | |
181 | - | let h = if (isDefined( | |
180 | + | let aJ = getInteger(f) | |
181 | + | let h = if (isDefined(aJ)) | |
182 | 182 | then { | |
183 | - | let | |
184 | - | let t = valueOrErrorMessage(getString(i( | |
185 | - | let | |
186 | - | if (( | |
187 | - | then throw(("Current tournement is not completed, status=" + | |
188 | - | else ( | |
183 | + | let aK = value(aJ) | |
184 | + | let t = valueOrErrorMessage(getString(i(aK)), (("Error reading tournament " + toString(aK)) + " data")) | |
185 | + | let aA = split(t, I)[y] | |
186 | + | if ((aA != "ARCHIVED")) | |
187 | + | then throw(("Current tournement is not completed, status=" + aA)) | |
188 | + | else (aK + 1) | |
189 | 189 | } | |
190 | 190 | else 1 | |
191 | - | let | |
192 | - | if (( | |
193 | - | then throw(((("startTime=" + toString(aw)) + " < creationTime=") + toString( | |
191 | + | let aL = lastBlock.timestamp | |
192 | + | if ((aL > aw)) | |
193 | + | then throw(((("startTime=" + toString(aw)) + " < creationTime=") + toString(aL))) | |
194 | 194 | else if ((aw > ax)) | |
195 | 195 | then throw(((("endTime=" + toString(ax)) + " < startTime=") + toString(aw))) | |
196 | 196 | else if (((ax - aw) > ao)) | |
197 | 197 | then throw(((("Tournament period exceeds max: " + toString((ax - aw))) + " > ") + toString(ao))) | |
198 | 198 | else if (if ((0 >= at)) | |
199 | 199 | then true | |
200 | 200 | else (0 >= au)) | |
201 | 201 | then throw(((("Cost should be positive, but passed " + toString(at)) + " and ") + toString(au))) | |
202 | - | else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ar(toBase58String(aH.transactionId), at, au, aK, aw, ax)), StringEntry(i(h), ay("CREATED", " ", 0, 0, 0))], h) | |
202 | + | else if ((0 > ay)) | |
203 | + | then throw("Number of Grand Prizes should be non-negative") | |
204 | + | else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ar(toBase58String(aI.transactionId), at, au, aL, aw, ax, ay)), StringEntry(i(h), az("CREATED", " ", 0, 0, 0))], h) | |
203 | 205 | } | |
204 | 206 | } | |
205 | 207 | ||
206 | 208 | ||
207 | 209 | ||
208 | - | @Callable( | |
210 | + | @Callable(aI) | |
209 | 211 | func register () = { | |
210 | - | let | |
211 | - | if ((size( | |
212 | + | let aM = aF() | |
213 | + | if ((size(aI.payments) != 1)) | |
212 | 214 | then throw("exactly 1 payment must be attached") | |
213 | 215 | else { | |
214 | - | let | |
215 | - | let | |
216 | - | let | |
217 | - | if (( | |
216 | + | let aN = aI.payments[0] | |
217 | + | let aO = aN.amount | |
218 | + | let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!") | |
219 | + | if ((aP != Z)) | |
218 | 220 | then throw("WLGOLD payments only!") | |
219 | 221 | else { | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let s = | |
224 | - | let t = | |
225 | - | let | |
226 | - | if (!(if (if (if (( | |
227 | - | then ( | |
222 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
223 | + | let aL = lastBlock.timestamp | |
224 | + | let aQ = q(this, aJ) | |
225 | + | let s = aQ[o] | |
226 | + | let t = aQ[p] | |
227 | + | let aA = t[y] | |
228 | + | if (!(if (if (if ((aA == "CREATED")) | |
229 | + | then (aL > parseIntValue(s[w])) | |
228 | 230 | else false) | |
229 | - | then ((parseIntValue(s[x]) - ap) > | |
231 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
230 | 232 | else false) | |
231 | 233 | then true | |
232 | - | else if (( | |
233 | - | then ((parseIntValue(s[x]) - ap) > | |
234 | + | else if ((aA == "INPROGRESS")) | |
235 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
234 | 236 | else false)) | |
235 | 237 | then throw("Cannot register now") | |
236 | 238 | else { | |
237 | - | let | |
238 | - | if (( | |
239 | - | then throw((("Need payment of " + af( | |
239 | + | let aR = parseIntValue(s[u]) | |
240 | + | if ((aO != aR)) | |
241 | + | then throw((("Need payment of " + af(aR, 8)) + " WLGOLD")) | |
240 | 242 | else { | |
241 | - | let e = | |
242 | - | let | |
243 | - | if (if (valueOrElse(getBoolean(l( | |
243 | + | let e = aG(aI.originCaller) | |
244 | + | let aS = valueOrElse(getString(j(aJ)), "") | |
245 | + | if (if (valueOrElse(getBoolean(l(aJ, e)), false)) | |
244 | 246 | then true | |
245 | - | else contains( | |
246 | - | then throw(((("Your duck " + e) + " is already registered at tournament ") + toString( | |
247 | + | else contains(aS, e)) | |
248 | + | then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aJ))) | |
247 | 249 | else { | |
248 | - | let | |
249 | - | $Tuple2([IntegerEntry(k(e), | |
250 | + | let aT = az("INPROGRESS", t[z], parseIntValue(t[A]), (parseIntValue(t[B]) + 1), parseIntValue(t[C])) | |
251 | + | $Tuple2([IntegerEntry(k(e), aJ), BooleanEntry(l(aJ, e), true), StringEntry(j(aJ), if ((aS == "")) | |
250 | 252 | then (e + ":000") | |
251 | - | else ((( | |
253 | + | else (((aS + "_") + e) + ":000")), StringEntry(i(aJ), aT)], aM) | |
252 | 254 | } | |
253 | 255 | } | |
254 | 256 | } | |
255 | 257 | } | |
256 | 258 | } | |
257 | 259 | } | |
258 | 260 | ||
259 | 261 | ||
260 | 262 | ||
261 | - | @Callable( | |
263 | + | @Callable(aI) | |
262 | 264 | func newAttempt () = { | |
263 | - | let | |
264 | - | let e = | |
265 | - | let | |
266 | - | let | |
267 | - | let | |
268 | - | let s = | |
269 | - | let t = | |
270 | - | let | |
271 | - | if (!(if (( | |
272 | - | then ((parseIntValue(s[x]) - ap) > | |
265 | + | let aM = aF() | |
266 | + | let e = aG(aI.originCaller) | |
267 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
268 | + | let aL = lastBlock.timestamp | |
269 | + | let aQ = q(this, aJ) | |
270 | + | let s = aQ[o] | |
271 | + | let t = aQ[p] | |
272 | + | let aA = t[y] | |
273 | + | if (!(if ((aA == "INPROGRESS")) | |
274 | + | then ((parseIntValue(s[x]) - ap) > aL) | |
273 | 275 | else false)) | |
274 | 276 | then throw("Attempt is not possible") | |
275 | - | else if (!(valueOrElse(getBoolean(l( | |
276 | - | then throw(((("Your duck " + e) + " is not registered at tournament ") + toString( | |
277 | + | else if (!(valueOrElse(getBoolean(l(aJ, e)), false))) | |
278 | + | then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aJ))) | |
277 | 279 | else { | |
278 | - | let | |
279 | - | let | |
280 | - | let | |
280 | + | let aU = m(aJ, e) | |
281 | + | let aV = getInteger(aU) | |
282 | + | let aW = if (!(isDefined(aV))) | |
281 | 283 | then $Tuple2(0, 0) | |
282 | - | else if ((size( | |
284 | + | else if ((size(aI.payments) != 1)) | |
283 | 285 | then throw("exactly 1 payment must be attached") | |
284 | 286 | else { | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | if (( | |
287 | + | let aN = aI.payments[0] | |
288 | + | let aO = aN.amount | |
289 | + | let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!") | |
290 | + | if ((aP != Z)) | |
289 | 291 | then throw("WLGOLD payments only!") | |
290 | 292 | else { | |
291 | - | let | |
292 | - | if (( | |
293 | - | then throw((("Need payment of " + af( | |
294 | - | else $Tuple2((value( | |
293 | + | let aX = parseIntValue(s[v]) | |
294 | + | if ((aO != aX)) | |
295 | + | then throw((("Need payment of " + af(aX, 8)) + " WLGOLD")) | |
296 | + | else $Tuple2((value(aV) + 1), 1) | |
295 | 297 | } | |
296 | 298 | } | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | $Tuple2([IntegerEntry( | |
299 | + | let aY = aW._1 | |
300 | + | let aZ = aW._2 | |
301 | + | let aT = az("INPROGRESS", t[z], parseIntValue(t[A]), parseIntValue(t[B]), (parseIntValue(t[C]) + aZ)) | |
302 | + | let ba = aa(invoke(W, "initDuckTourAttempt", [e], nil)) | |
303 | + | $Tuple2([IntegerEntry(aU, aY), StringEntry(i(aJ), aT)], [aM, aY, ba]) | |
302 | 304 | } | |
303 | 305 | } | |
304 | 306 | ||
305 | 307 | ||
306 | 308 | ||
307 | - | @Callable( | |
308 | - | func updateDynamicData (e, | |
309 | + | @Callable(aI) | |
310 | + | func updateDynamicData (e,bb) = if ((aI.caller != W)) | |
309 | 311 | then throw("Access denied") | |
310 | 312 | else { | |
311 | - | let | |
312 | - | let | |
313 | - | let s = | |
314 | - | let t = | |
315 | - | if (if (if ((parseIntValue(t[A]) >= | |
313 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
314 | + | let aQ = q(this, aJ) | |
315 | + | let s = aQ[o] | |
316 | + | let t = aQ[p] | |
317 | + | if (if (if ((parseIntValue(t[A]) >= bb)) | |
316 | 318 | then true | |
317 | 319 | else (t[y] != "INPROGRESS")) | |
318 | 320 | then true | |
319 | 321 | else (lastBlock.timestamp > parseIntValue(s[x]))) | |
320 | 322 | then $Tuple2(nil, 0) | |
321 | 323 | else { | |
322 | - | let | |
323 | - | $Tuple2([StringEntry(i( | |
324 | + | let aT = az("INPROGRESS", e, bb, parseIntValue(t[B]), parseIntValue(t[C])) | |
325 | + | $Tuple2([StringEntry(i(aJ), aT)], 0) | |
324 | 326 | } | |
325 | 327 | } | |
326 | 328 | ||
327 | 329 | ||
328 | 330 | ||
329 | - | @Callable( | |
330 | - | func saveDuckResult (e, | |
331 | + | @Callable(aI) | |
332 | + | func saveDuckResult (e,bb) = if ((aI.caller != W)) | |
331 | 333 | then throw("Access denied") | |
332 | 334 | else { | |
333 | - | let | |
334 | - | let | |
335 | - | let s = | |
336 | - | let t = | |
337 | - | let | |
338 | - | let | |
339 | - | if (if (if (if (( | |
340 | - | then (parseIntValue( | |
335 | + | let aJ = valueOrErrorMessage(getInteger(f), "No active tournaments") | |
336 | + | let aQ = q(this, aJ) | |
337 | + | let s = aQ[o] | |
338 | + | let t = aQ[p] | |
339 | + | let bc = split(valueOrElse(getString(W, d(e)), a), "_") | |
340 | + | let bd = n(aJ, e) | |
341 | + | if (if (if (if ((bc[E] == "T")) | |
342 | + | then (parseIntValue(bc[D]) == aJ) | |
341 | 343 | else false) | |
342 | 344 | then (t[y] == "INPROGRESS") | |
343 | 345 | else false) | |
344 | 346 | then (parseIntValue(s[x]) >= lastBlock.timestamp) | |
345 | 347 | else false) | |
346 | 348 | then { | |
347 | - | let | |
348 | - | let | |
349 | - | let | |
350 | - | let | |
351 | - | then if (!(contains( | |
349 | + | let be = valueOrElse(getInteger(bd), 0) | |
350 | + | let bf = j(aJ) | |
351 | + | let aS = valueOrElse(getString(bf), "") | |
352 | + | let bg = if ((bb > be)) | |
353 | + | then if (!(contains(aS, e))) | |
352 | 354 | then throw(("scoreBoard does not contain " + e)) | |
353 | 355 | else { | |
354 | - | let | |
355 | - | (((( | |
356 | + | let bh = split_51C(aS, e) | |
357 | + | ((((bh[0] + e) + ":") + al(bb, 3)) + drop(bh[1], 4)) | |
356 | 358 | } | |
357 | - | else | |
358 | - | $Tuple2([IntegerEntry( | |
359 | + | else aS | |
360 | + | $Tuple2([IntegerEntry(bd, max([be, bb])), StringEntry(bf, bg)], 0) | |
359 | 361 | } | |
360 | 362 | else $Tuple2(nil, 0) | |
361 | 363 | } | |
362 | 364 | ||
363 | 365 | ||
364 | 366 | ||
365 | - | @Callable( | |
367 | + | @Callable(aI) | |
366 | 368 | func finishTournament (h) = { | |
367 | - | let | |
368 | - | if (!(containsElement(aq, | |
369 | + | let aH = toString(aI.caller) | |
370 | + | if (!(containsElement(aq, aH))) | |
369 | 371 | then throw("Permission denied") | |
370 | 372 | else { | |
371 | - | let | |
372 | - | let t = | |
373 | - | let | |
374 | - | if (( | |
373 | + | let aQ = q(this, h) | |
374 | + | let t = aQ[p] | |
375 | + | let aA = t[y] | |
376 | + | if ((aA == "ARCHIVED")) | |
375 | 377 | then throw((("Tournament " + toString(h)) + " is already ARCHIVED")) | |
376 | 378 | else { | |
377 | - | let | |
378 | - | $Tuple2([StringEntry(i(h), | |
379 | + | let aT = az("ARCHIVED", t[z], parseIntValue(t[A]), parseIntValue(t[B]), parseIntValue(t[C])) | |
380 | + | $Tuple2([StringEntry(i(h), aT)], 0) | |
379 | 381 | } | |
380 | 382 | } | |
381 | 383 | } | |
382 | 384 | ||
383 | 385 |
github/deemru/w8io/169f3d6 102.62 ms ◑