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