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:BgIfCAISBgoEAQEBARIAEgASBAoCCAESBAoCCAESAwoBATUAD0RFRkFVTFRMT0NBVElPTgIPQWZyaWNhX0ZfQWZyaWNhARRrZXlTdGFrZWREdWNrQnlPd25lcgEJb3duZXJBZGRyCQCsAgICEnN0YWtlZER1Y2tCeU93bmVyXwUJb3duZXJBZGRyAQ9rZXlEdWNrTG9jYXRpb24BC2R1Y2tBc3NldElkCQCsAgICDWR1Y2tMb2NhdGlvbl8FC2R1Y2tBc3NldElkAA1sYXN0VG91cklkS2V5Ag4lc19fbGFzdFRvdXJJZAEVa2V5VG91clN0YXRpY0RhdGFCeUlkAQN0SWQJAKwCAgIWJXMlZF9fdG91clN0YXRpY0RhdGFfXwkApAMBBQN0SWQBFmtleVRvdXJEeW5hbWljRGF0YUJ5SWQBA3RJZAkArAICAhclcyVkX190b3VyRHluYW1pY0RhdGFfXwkApAMBBQN0SWQBE2tleVNjb3JlQm9hcmRCeVRvdXIBA3RJZAkArAICAhIlcyVkX19zY29yZUJvYXJkX18JAKQDAQUDdElkARtrZXlMYXN0UmVnaXN0ZXJlZFRvdXJCeUR1Y2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AACBQZzdGF0dXMCCEFSQ0hJVkVECQACAQkArAICCQCsAgICC1RvdXJuYW1lbnQgCQCkAwEFA3RJZAIUIGlzIGFscmVhZHkgQVJDSElWRUQEEnVwZGF0ZWREeW5hbWljRGF0YQkBC2R5bmFtaWNEYXRhBQIIQVJDSElWRUQJAJEDAgUHZHluYW1pYwUPdER5bmFtaWNXaW5EdWNrCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUHZHluYW1pYwURdER5bmFtaWNXaW5SZXN1bHQJAQ1wYXJzZUludFZhbHVlAQkAkQMCBQdkeW5hbWljBRV0RHluYW1pY1RvdGFsUmVnQ291bnQJAQ1wYXJzZUludFZhbHVlAQkAkQMCBQdkeW5hbWljBRV0RHluYW1pY1RvdGFsQXR0ZW1wdHMJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQEWa2V5VG91ckR5bmFtaWNEYXRhQnlJZAEFA3RJZAUSdXBkYXRlZER5bmFtaWNEYXRhBQNuaWwAAAComIki", "height": 2733482, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A5CSo1mLr5WauaKk3Zqexpcnc11dpjzFhsAYFJHbjqQd Next: k9we15it79grTzFQsYa925Nh4fPwNyc3xGEWdPeZHqm Diff:
OldNewDifferences
1717 func i (h) = ("%s%d__tourDynamicData__" + toString(h))
1818
1919
20-func j (h) = ("%s%d__allRegistrants__" + toString(h))
20+func j (h) = ("%s%d__scoreBoard__" + toString(h))
2121
2222
23-let k = 0
23+func k (e) = ("%s%s__lastRegisteredTourByDuck__" + e)
2424
25-let l = 1
2625
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]
3143 }
3244
3345
34-let q = 2
46+let u = 2
3547
36-let r = 3
48+let v = 3
3749
38-let s = 5
50+let w = 5
3951
40-let t = 6
52+let x = 6
4153
42-let u = 1
54+let y = 1
4355
44-let v = 2
56+let z = 2
4557
46-let w = 3
58+let A = 3
4759
48-let x = 4
60+let B = 4
4961
50-let y = 5
62+let C = 5
5163
52-let z = 0
64+let D = 0
5365
54-let A = 1
66+let E = 1
5567
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
6969
7070 let G = take(drop(this.bytes, 1), 1)
7171
141141 }
142142
143143
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+ }
145149
146-let an = 3600000
147150
148-let ao = [toString(this), {
151+let ap = 432000000
152+
153+let aq = 3600000
154+
155+let ar = [toString(this), {
149156 let I = G
150157 if ((base58'2W' == I))
151158 then "3PEe2RELUHCFCBsmSCNcBJ8N3URLVQende7"
154161 else throw("Unknown chain")
155162 }]
156163
157-func ap (aq,ar,as,at,au,av) = makeString(["%s%d%d%d%d%d", aq, toString(ar), toString(as), toString(at), toString(au), toString(av)], J)
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)
158165
159166
160-func aw (ax,ay,az,aA,aB) = makeString(["%s%s%d%d%d", ax, ay, toString(az), toString(aA), toString(aB)], J)
167+func az (aA,aB,aC,aD,aE) = makeString(["%s%s%d%d%d", aA, aB, toString(aC), toString(aD), toString(aE)], J)
161168
162169
163-func aC () = ae(invoke(X, "saveLastTx", nil, nil))
170+func aF () = ae(invoke(X, "saveLastTx", nil, nil))
164171
165172
166-func aD (aE) = valueOrErrorMessage(getString(X, b(toString(aE))), "You don't have a duck staked")
173+func aG (aH) = valueOrErrorMessage(getString(X, b(toString(aH))), "You don't have a duck staked")
167174
168175
169-@Callable(aF)
170-func createTournament (au,av,ar,as) = {
171- let aE = toString(aF.caller)
172- if (!(containsElement(ao, aE)))
176+@Callable(aI)
177+func createTournament (ax,ay,au,av) = {
178+ let aH = toString(aI.caller)
179+ if (!(containsElement(ar, aH)))
173180 then throw("Permission denied")
174181 else {
175- let aG = getInteger(f)
176- let h = if (isDefined(aG))
182+ let aJ = getInteger(f)
183+ let h = if (isDefined(aJ))
177184 then {
178- let aH = value(aG)
179- let p = valueOrErrorMessage(getString(i(aH)), (("Error reading tournament " + toString(aH)) + " data"))
180- let ax = split(p, J)[u]
181- if ((ax != "ARCHIVED"))
182- then throw(("Current tournement is not completed, status=" + ax))
183- else (aH + 1)
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)
184191 }
185192 else 1
186- let aI = lastBlock.timestamp
187- if ((aI > au))
188- then throw(((("startTime=" + toString(au)) + " < creationTime=") + toString(aI)))
189- else if ((au > av))
190- then throw(((("endTime=" + toString(av)) + " < startTime=") + toString(au)))
191- else if (((av - au) > am))
192- then throw(((("Tournament period exceeds max: " + toString((av - au))) + " > ") + toString(am)))
193- else if (if ((0 >= ar))
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))
194201 then true
195- else (0 >= as))
196- then throw(((("Cost should be positive, but passed " + toString(ar)) + " and ") + toString(as)))
197- else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ap(toBase58String(aF.transactionId), ar, as, aI, au, av)), StringEntry(i(h), aw("CREATED", " ", 0, 0, 0))], 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)
198205 }
199206 }
200207
201208
202209
203-@Callable(aF)
210+@Callable(aI)
204211 func register () = {
205- let aJ = aC()
206- if ((size(aF.payments) != 1))
212+ let aM = aF()
213+ if ((size(aI.payments) != 1))
207214 then throw("exactly 1 payment must be attached")
208215 else {
209- let aK = aF.payments[0]
210- let aL = aK.amount
211- let aM = valueOrErrorMessage(aK.assetId, "WLGOLD payments only!")
212- if ((aM != aa))
216+ let aN = aI.payments[0]
217+ let aO = aN.amount
218+ let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!")
219+ if ((aP != aa))
213220 then throw("WLGOLD payments only!")
214221 else {
215- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
216- let aI = lastBlock.timestamp
217- let aN = m(this, aG)
218- let o = aN[k]
219- let p = aN[l]
220- let ax = p[u]
221- if (!(if (if (if ((ax == "CREATED"))
222- then (aI > parseIntValue(o[s]))
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]))
223230 else false)
224- then ((parseIntValue(o[t]) - an) > aI)
231+ then ((parseIntValue(s[x]) - aq) > aL)
225232 else false)
226233 then true
227- else if ((ax == "INPROGRESS"))
228- then ((parseIntValue(o[t]) - an) > aI)
234+ else if ((aA == "INPROGRESS"))
235+ then ((parseIntValue(s[x]) - aq) > aL)
229236 else false))
230237 then throw("Cannot register now")
231238 else {
232- let aO = parseIntValue(o[q])
233- if ((aL != aO))
234- then throw((("Need payment of " + ag(aO, 8)) + " WLGOLD"))
239+ let aR = parseIntValue(s[u])
240+ if ((aO != aR))
241+ then throw((("Need payment of " + ag(aR, 8)) + " WLGOLD"))
235242 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))
242246 then true
243- else containsElement(aQ, e))
244- then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aG)))
247+ else contains(aS, e))
248+ then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aJ)))
245249 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)
248254 }
249255 }
250256 }
254260
255261
256262
257-@Callable(aF)
263+@Callable(aI)
258264 func newAttempt () = {
259- let aJ = aC()
260- let e = aD(aF.originCaller)
261- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
262- let aI = lastBlock.timestamp
263- let aN = m(this, aG)
264- let o = aN[k]
265- let p = aN[l]
266- let ax = p[u]
267- if (!(if ((ax == "INPROGRESS"))
268- then ((parseIntValue(o[t]) - an) > aI)
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)
269275 else false))
270276 then throw("Attempt is not possible")
271- else if (!(valueOrElse(getBoolean(D(aG, e)), false)))
272- then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aG)))
277+ else if (!(valueOrElse(getBoolean(l(aJ, e)), false)))
278+ then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aJ)))
273279 else {
274- let aS = E(aG, e)
275- let aT = getInteger(aS)
276- let aU = if (!(isDefined(aT)))
280+ let aU = m(aJ, e)
281+ let aV = getInteger(aU)
282+ let aW = if (!(isDefined(aV)))
277283 then $Tuple2(0, 0)
278- else if ((size(aF.payments) != 1))
284+ else if ((size(aI.payments) != 1))
279285 then throw("exactly 1 payment must be attached")
280286 else {
281- let aK = aF.payments[0]
282- let aL = aK.amount
283- let aM = valueOrErrorMessage(aK.assetId, "WLGOLD payments only!")
284- if ((aM != aa))
287+ let aN = aI.payments[0]
288+ let aO = aN.amount
289+ let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!")
290+ if ((aP != aa))
285291 then throw("WLGOLD payments only!")
286292 else {
287- let aV = parseIntValue(o[r])
288- if ((aL != aV))
289- then throw((("Need payment of " + ag(aV, 8)) + " WLGOLD"))
290- else $Tuple2((value(aT) + 1), 1)
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)
291297 }
292298 }
293- let aW = aU._1
294- let aX = aU._2
295- let aR = aw("INPROGRESS", p[v], parseIntValue(p[w]), parseIntValue(p[x]), (parseIntValue(p[y]) + aX))
296- let aY = split(valueOrElse(getString(X, d(e)), a), "_")
297- let aZ = F(aG, e)
298- let ba = if (if ((aY[A] == "T"))
299- then (parseIntValue(aY[z]) == aG)
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)
300306 else false)
301307 then {
302- let bb = valueOrElse(getInteger(aZ), 0)
303- let bc = parseIntValue(aY[B])
304- max([bb, bc])
308+ let bd = valueOrElse(getInteger(bb), 0)
309+ let be = parseIntValue(ba[F])
310+ max([bd, be])
305311 }
306312 else 0
307- let bd = ab(invoke(X, "initDuckTourAttempt", [e], nil))
308- $Tuple2([IntegerEntry(aZ, ba), IntegerEntry(aS, aW), StringEntry(i(aG), aR)], [aJ, aW, bd])
313+ let bf = ab(invoke(X, "initDuckTourAttempt", [e], nil))
314+ $Tuple2([IntegerEntry(bb, bc), IntegerEntry(aU, aY), StringEntry(i(aJ), aT)], [aM, aY, bf])
309315 }
310316 }
311317
312318
313319
314-@Callable(aF)
315-func updateDynamicData (e,be) = if ((aF.caller != X))
320+@Callable(aI)
321+func updateDynamicData (e,bg) = if ((aI.caller != X))
316322 then throw("Access denied")
317323 else {
318- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
319- let aN = m(this, aG)
320- let o = aN[k]
321- let p = aN[l]
322- if (if (if ((parseIntValue(p[w]) >= be))
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))
323329 then true
324- else (p[u] != "INPROGRESS"))
330+ else (t[y] != "INPROGRESS"))
325331 then true
326- else (lastBlock.timestamp > parseIntValue(o[t])))
332+ else (lastBlock.timestamp > parseIntValue(s[x])))
327333 then $Tuple2(nil, 0)
328334 else {
329- let aR = aw("INPROGRESS", e, be, parseIntValue(p[x]), parseIntValue(p[y]))
330- $Tuple2([StringEntry(i(aG), aR)], 0)
335+ let aT = az("INPROGRESS", e, bg, parseIntValue(t[B]), parseIntValue(t[C]))
336+ $Tuple2([StringEntry(i(aJ), aT)], 0)
331337 }
332338 }
333339
334340
335341
336-@Callable(aF)
337-func saveDuckResult (e,be) = if ((aF.caller != X))
342+@Callable(aI)
343+func saveDuckResult (e,bg) = if ((aI.caller != X))
338344 then throw("Access denied")
339345 else {
340- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
341- let aN = m(this, aG)
342- let o = aN[k]
343- let p = aN[l]
344- let aY = split(valueOrElse(getString(X, d(e)), a), "_")
345- let aZ = F(aG, e)
346- if (if (if (if ((aY[A] == "T"))
347- then (parseIntValue(aY[z]) == aG)
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)
348354 else false)
349- then (p[u] == "INPROGRESS")
355+ then (t[y] == "INPROGRESS")
350356 else false)
351- then (parseIntValue(o[t]) >= lastBlock.timestamp)
357+ then (parseIntValue(s[x]) >= lastBlock.timestamp)
352358 else false)
353359 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)
356372 }
357373 else $Tuple2(nil, 0)
358374 }
359375
360376
361377
362-@Callable(aF)
378+@Callable(aI)
363379 func finishTournament (h) = {
364- let aE = toString(aF.caller)
365- if (!(containsElement(ao, aE)))
380+ let aH = toString(aI.caller)
381+ if (!(containsElement(ar, aH)))
366382 then throw("Permission denied")
367383 else {
368- let aN = m(this, h)
369- let p = aN[l]
370- let ax = p[u]
371- if ((ax == "ARCHIVED"))
384+ let aQ = q(this, h)
385+ let t = aQ[p]
386+ let aA = t[y]
387+ if ((aA == "ARCHIVED"))
372388 then throw((("Tournament " + toString(h)) + " is already ARCHIVED"))
373389 else {
374- let aR = aw("ARCHIVED", p[v], parseIntValue(p[w]), parseIntValue(p[x]), parseIntValue(p[y]))
375- $Tuple2([StringEntry(i(h), aR)], 0)
390+ let aT = az("ARCHIVED", t[z], parseIntValue(t[A]), parseIntValue(t[B]), parseIntValue(t[C]))
391+ $Tuple2([StringEntry(i(h), aT)], 0)
376392 }
377393 }
378394 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "Africa_F_Africa"
55
66 func b (c) = ("stakedDuckByOwner_" + c)
77
88
99 func d (e) = ("duckLocation_" + e)
1010
1111
1212 let f = "%s__lastTourId"
1313
1414 func g (h) = ("%s%d__tourStaticData__" + toString(h))
1515
1616
1717 func i (h) = ("%s%d__tourDynamicData__" + toString(h))
1818
1919
20-func j (h) = ("%s%d__allRegistrants__" + toString(h))
20+func j (h) = ("%s%d__scoreBoard__" + toString(h))
2121
2222
23-let k = 0
23+func k (e) = ("%s%s__lastRegisteredTourByDuck__" + e)
2424
25-let l = 1
2625
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]
3143 }
3244
3345
34-let q = 2
46+let u = 2
3547
36-let r = 3
48+let v = 3
3749
38-let s = 5
50+let w = 5
3951
40-let t = 6
52+let x = 6
4153
42-let u = 1
54+let y = 1
4355
44-let v = 2
56+let z = 2
4557
46-let w = 3
58+let A = 3
4759
48-let x = 4
60+let B = 4
4961
50-let y = 5
62+let C = 5
5163
52-let z = 0
64+let D = 0
5365
54-let A = 1
66+let E = 1
5567
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
6969
7070 let G = take(drop(this.bytes, 1), 1)
7171
7272 let H = {
7373 let I = G
7474 if ((base58'2W' == I))
7575 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
7676 else if ((base58'2T' == I))
7777 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
7878 else throw("Unknown chain")
7979 }
8080
8181 let J = "__"
8282
8383 func K (L,M) = valueOrErrorMessage(getString(L, M), makeString(["mandatory ", toString(L), ".", M, " is not defined"], ""))
8484
8585
8686 let N = 1
8787
8888 let O = 4
8989
9090 func P () = "%s__restConfig"
9191
9292
9393 func Q () = "%s__restAddr"
9494
9595
9696 func R (S) = split_4C(K(S, P()), J)
9797
9898
9999 func T (U,V) = valueOrErrorMessage(addressFromString(U[V]), ("Rest cfg doesn't contain address at index " + toString(V)))
100100
101101
102102 let W = addressFromStringValue(valueOrElse(getString(this, Q()), H))
103103
104104 let U = R(W)
105105
106106 let X = T(U, N)
107107
108108 let Y = T(U, O)
109109
110110 let Z = "wlg_assetId"
111111
112112 let aa = valueOrErrorMessage(getBinary(Y, Z), "Not initialized yet")
113113
114114 func ab (ac) = {
115115 let I = ac
116116 if ($isInstanceOf(I, "String"))
117117 then {
118118 let ad = I
119119 ad
120120 }
121121 else throw("fail to cast into String")
122122 }
123123
124124
125125 func ae (ac) = {
126126 let I = ac
127127 if ($isInstanceOf(I, "Int"))
128128 then {
129129 let af = I
130130 af
131131 }
132132 else throw("fail to cast into Int")
133133 }
134134
135135
136136 func ag (ah,ai) = {
137137 let aj = pow(10, 0, ai, 0, 0, DOWN)
138138 let ak = toString((ah % aj))
139139 let al = drop(toString(aj), (1 + size(ak)))
140140 (((toString((ah / aj)) + ".") + al) + ak)
141141 }
142142
143143
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+ }
145149
146-let an = 3600000
147150
148-let ao = [toString(this), {
151+let ap = 432000000
152+
153+let aq = 3600000
154+
155+let ar = [toString(this), {
149156 let I = G
150157 if ((base58'2W' == I))
151158 then "3PEe2RELUHCFCBsmSCNcBJ8N3URLVQende7"
152159 else if ((base58'2T' == I))
153160 then "3MtBgJTaLxPB3C7UJD1UE8qjkHthfKvFQYY"
154161 else throw("Unknown chain")
155162 }]
156163
157-func ap (aq,ar,as,at,au,av) = makeString(["%s%d%d%d%d%d", aq, toString(ar), toString(as), toString(at), toString(au), toString(av)], J)
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)
158165
159166
160-func aw (ax,ay,az,aA,aB) = makeString(["%s%s%d%d%d", ax, ay, toString(az), toString(aA), toString(aB)], J)
167+func az (aA,aB,aC,aD,aE) = makeString(["%s%s%d%d%d", aA, aB, toString(aC), toString(aD), toString(aE)], J)
161168
162169
163-func aC () = ae(invoke(X, "saveLastTx", nil, nil))
170+func aF () = ae(invoke(X, "saveLastTx", nil, nil))
164171
165172
166-func aD (aE) = valueOrErrorMessage(getString(X, b(toString(aE))), "You don't have a duck staked")
173+func aG (aH) = valueOrErrorMessage(getString(X, b(toString(aH))), "You don't have a duck staked")
167174
168175
169-@Callable(aF)
170-func createTournament (au,av,ar,as) = {
171- let aE = toString(aF.caller)
172- if (!(containsElement(ao, aE)))
176+@Callable(aI)
177+func createTournament (ax,ay,au,av) = {
178+ let aH = toString(aI.caller)
179+ if (!(containsElement(ar, aH)))
173180 then throw("Permission denied")
174181 else {
175- let aG = getInteger(f)
176- let h = if (isDefined(aG))
182+ let aJ = getInteger(f)
183+ let h = if (isDefined(aJ))
177184 then {
178- let aH = value(aG)
179- let p = valueOrErrorMessage(getString(i(aH)), (("Error reading tournament " + toString(aH)) + " data"))
180- let ax = split(p, J)[u]
181- if ((ax != "ARCHIVED"))
182- then throw(("Current tournement is not completed, status=" + ax))
183- else (aH + 1)
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)
184191 }
185192 else 1
186- let aI = lastBlock.timestamp
187- if ((aI > au))
188- then throw(((("startTime=" + toString(au)) + " < creationTime=") + toString(aI)))
189- else if ((au > av))
190- then throw(((("endTime=" + toString(av)) + " < startTime=") + toString(au)))
191- else if (((av - au) > am))
192- then throw(((("Tournament period exceeds max: " + toString((av - au))) + " > ") + toString(am)))
193- else if (if ((0 >= ar))
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))
194201 then true
195- else (0 >= as))
196- then throw(((("Cost should be positive, but passed " + toString(ar)) + " and ") + toString(as)))
197- else $Tuple2([IntegerEntry(f, h), StringEntry(g(h), ap(toBase58String(aF.transactionId), ar, as, aI, au, av)), StringEntry(i(h), aw("CREATED", " ", 0, 0, 0))], 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)
198205 }
199206 }
200207
201208
202209
203-@Callable(aF)
210+@Callable(aI)
204211 func register () = {
205- let aJ = aC()
206- if ((size(aF.payments) != 1))
212+ let aM = aF()
213+ if ((size(aI.payments) != 1))
207214 then throw("exactly 1 payment must be attached")
208215 else {
209- let aK = aF.payments[0]
210- let aL = aK.amount
211- let aM = valueOrErrorMessage(aK.assetId, "WLGOLD payments only!")
212- if ((aM != aa))
216+ let aN = aI.payments[0]
217+ let aO = aN.amount
218+ let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!")
219+ if ((aP != aa))
213220 then throw("WLGOLD payments only!")
214221 else {
215- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
216- let aI = lastBlock.timestamp
217- let aN = m(this, aG)
218- let o = aN[k]
219- let p = aN[l]
220- let ax = p[u]
221- if (!(if (if (if ((ax == "CREATED"))
222- then (aI > parseIntValue(o[s]))
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]))
223230 else false)
224- then ((parseIntValue(o[t]) - an) > aI)
231+ then ((parseIntValue(s[x]) - aq) > aL)
225232 else false)
226233 then true
227- else if ((ax == "INPROGRESS"))
228- then ((parseIntValue(o[t]) - an) > aI)
234+ else if ((aA == "INPROGRESS"))
235+ then ((parseIntValue(s[x]) - aq) > aL)
229236 else false))
230237 then throw("Cannot register now")
231238 else {
232- let aO = parseIntValue(o[q])
233- if ((aL != aO))
234- then throw((("Need payment of " + ag(aO, 8)) + " WLGOLD"))
239+ let aR = parseIntValue(s[u])
240+ if ((aO != aR))
241+ then throw((("Need payment of " + ag(aR, 8)) + " WLGOLD"))
235242 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))
242246 then true
243- else containsElement(aQ, e))
244- then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aG)))
247+ else contains(aS, e))
248+ then throw(((("Your duck " + e) + " is already registered at tournament ") + toString(aJ)))
245249 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)
248254 }
249255 }
250256 }
251257 }
252258 }
253259 }
254260
255261
256262
257-@Callable(aF)
263+@Callable(aI)
258264 func newAttempt () = {
259- let aJ = aC()
260- let e = aD(aF.originCaller)
261- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
262- let aI = lastBlock.timestamp
263- let aN = m(this, aG)
264- let o = aN[k]
265- let p = aN[l]
266- let ax = p[u]
267- if (!(if ((ax == "INPROGRESS"))
268- then ((parseIntValue(o[t]) - an) > aI)
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)
269275 else false))
270276 then throw("Attempt is not possible")
271- else if (!(valueOrElse(getBoolean(D(aG, e)), false)))
272- then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aG)))
277+ else if (!(valueOrElse(getBoolean(l(aJ, e)), false)))
278+ then throw(((("Your duck " + e) + " is not registered at tournament ") + toString(aJ)))
273279 else {
274- let aS = E(aG, e)
275- let aT = getInteger(aS)
276- let aU = if (!(isDefined(aT)))
280+ let aU = m(aJ, e)
281+ let aV = getInteger(aU)
282+ let aW = if (!(isDefined(aV)))
277283 then $Tuple2(0, 0)
278- else if ((size(aF.payments) != 1))
284+ else if ((size(aI.payments) != 1))
279285 then throw("exactly 1 payment must be attached")
280286 else {
281- let aK = aF.payments[0]
282- let aL = aK.amount
283- let aM = valueOrErrorMessage(aK.assetId, "WLGOLD payments only!")
284- if ((aM != aa))
287+ let aN = aI.payments[0]
288+ let aO = aN.amount
289+ let aP = valueOrErrorMessage(aN.assetId, "WLGOLD payments only!")
290+ if ((aP != aa))
285291 then throw("WLGOLD payments only!")
286292 else {
287- let aV = parseIntValue(o[r])
288- if ((aL != aV))
289- then throw((("Need payment of " + ag(aV, 8)) + " WLGOLD"))
290- else $Tuple2((value(aT) + 1), 1)
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)
291297 }
292298 }
293- let aW = aU._1
294- let aX = aU._2
295- let aR = aw("INPROGRESS", p[v], parseIntValue(p[w]), parseIntValue(p[x]), (parseIntValue(p[y]) + aX))
296- let aY = split(valueOrElse(getString(X, d(e)), a), "_")
297- let aZ = F(aG, e)
298- let ba = if (if ((aY[A] == "T"))
299- then (parseIntValue(aY[z]) == aG)
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)
300306 else false)
301307 then {
302- let bb = valueOrElse(getInteger(aZ), 0)
303- let bc = parseIntValue(aY[B])
304- max([bb, bc])
308+ let bd = valueOrElse(getInteger(bb), 0)
309+ let be = parseIntValue(ba[F])
310+ max([bd, be])
305311 }
306312 else 0
307- let bd = ab(invoke(X, "initDuckTourAttempt", [e], nil))
308- $Tuple2([IntegerEntry(aZ, ba), IntegerEntry(aS, aW), StringEntry(i(aG), aR)], [aJ, aW, bd])
313+ let bf = ab(invoke(X, "initDuckTourAttempt", [e], nil))
314+ $Tuple2([IntegerEntry(bb, bc), IntegerEntry(aU, aY), StringEntry(i(aJ), aT)], [aM, aY, bf])
309315 }
310316 }
311317
312318
313319
314-@Callable(aF)
315-func updateDynamicData (e,be) = if ((aF.caller != X))
320+@Callable(aI)
321+func updateDynamicData (e,bg) = if ((aI.caller != X))
316322 then throw("Access denied")
317323 else {
318- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
319- let aN = m(this, aG)
320- let o = aN[k]
321- let p = aN[l]
322- if (if (if ((parseIntValue(p[w]) >= be))
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))
323329 then true
324- else (p[u] != "INPROGRESS"))
330+ else (t[y] != "INPROGRESS"))
325331 then true
326- else (lastBlock.timestamp > parseIntValue(o[t])))
332+ else (lastBlock.timestamp > parseIntValue(s[x])))
327333 then $Tuple2(nil, 0)
328334 else {
329- let aR = aw("INPROGRESS", e, be, parseIntValue(p[x]), parseIntValue(p[y]))
330- $Tuple2([StringEntry(i(aG), aR)], 0)
335+ let aT = az("INPROGRESS", e, bg, parseIntValue(t[B]), parseIntValue(t[C]))
336+ $Tuple2([StringEntry(i(aJ), aT)], 0)
331337 }
332338 }
333339
334340
335341
336-@Callable(aF)
337-func saveDuckResult (e,be) = if ((aF.caller != X))
342+@Callable(aI)
343+func saveDuckResult (e,bg) = if ((aI.caller != X))
338344 then throw("Access denied")
339345 else {
340- let aG = valueOrErrorMessage(getInteger(f), "No active tournaments")
341- let aN = m(this, aG)
342- let o = aN[k]
343- let p = aN[l]
344- let aY = split(valueOrElse(getString(X, d(e)), a), "_")
345- let aZ = F(aG, e)
346- if (if (if (if ((aY[A] == "T"))
347- then (parseIntValue(aY[z]) == aG)
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)
348354 else false)
349- then (p[u] == "INPROGRESS")
355+ then (t[y] == "INPROGRESS")
350356 else false)
351- then (parseIntValue(o[t]) >= lastBlock.timestamp)
357+ then (parseIntValue(s[x]) >= lastBlock.timestamp)
352358 else false)
353359 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)
356372 }
357373 else $Tuple2(nil, 0)
358374 }
359375
360376
361377
362-@Callable(aF)
378+@Callable(aI)
363379 func finishTournament (h) = {
364- let aE = toString(aF.caller)
365- if (!(containsElement(ao, aE)))
380+ let aH = toString(aI.caller)
381+ if (!(containsElement(ar, aH)))
366382 then throw("Permission denied")
367383 else {
368- let aN = m(this, h)
369- let p = aN[l]
370- let ax = p[u]
371- if ((ax == "ARCHIVED"))
384+ let aQ = q(this, h)
385+ let t = aQ[p]
386+ let aA = t[y]
387+ if ((aA == "ARCHIVED"))
372388 then throw((("Tournament " + toString(h)) + " is already ARCHIVED"))
373389 else {
374- let aR = aw("ARCHIVED", p[v], parseIntValue(p[w]), parseIntValue(p[x]), parseIntValue(p[y]))
375- $Tuple2([StringEntry(i(h), aR)], 0)
390+ let aT = az("ARCHIVED", t[z], parseIntValue(t[A]), parseIntValue(t[B]), parseIntValue(t[C]))
391+ $Tuple2([StringEntry(i(h), aT)], 0)
376392 }
377393 }
378394 }
379395
380396

github/deemru/w8io/169f3d6 
123.64 ms