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