tx · 7DULw3wfLc9rHFBz31io411pyN33WkDEKpUs6dFXNCT4 3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx: -0.01700000 Waves 2023.11.23 20:24 [2856325] smart account 3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx > SELF 0.00000000 Waves
{ "type": 13, "id": "7DULw3wfLc9rHFBz31io411pyN33WkDEKpUs6dFXNCT4", "fee": 1700000, "feeAssetId": null, "timestamp": 1700760307023, "version": 2, "chainId": 84, "sender": "3N3nfqFcxXfd3T18V9icDdh58MJ9wQ2k2xx", "senderPublicKey": "UGqkWsCpv7xRVXkQRXyLd6pWPDtYGXmPip7FxSd1pAu", "proofs": [ "218s9DWRRXgA9egDFtStgpoJWL1xpBvaRcmVTU82tYMn3UPoGtnkhc37i6xJ8FnHQVdm25xN2fY7k87ysvwbfT6p" ], "script": "base64:BgIhCAISCQoHAQEBAQEBCBIAEgASBAoCCAESAwoBARIDCgEBPAAPREVGQVVMVExPQ0FUSU9OAg9BZnJpY2FfRl9BZnJpY2EAD2xvY0lkeENvbnRpbmVudAAAAApsb2NJZHhUeXBlAAEBFGtleVN0YWtlZER1Y2tCeU93bmVyAQlvd25lckFkZHIJAKwCAgISc3Rha2VkRHVja0J5T3duZXJfBQlvd25lckFkZHIBD2tleUR1Y2tMb2NhdGlvbgELZHVja0Fzc2V0SWQJAKwCAgINZHVja0xvY2F0aW9uXwULZHVja0Fzc2V0SWQADWxhc3RUb3VySWRLZXkCDiVzX19sYXN0VG91cklkARVrZXlUb3VyU3RhdGljRGF0YUJ5SWQBA3RJZAkArAICAhYlcyVkX190b3VyU3RhdGljRGF0YV9fCQCkAwEFA3RJZAEWa2V5VG91ckR5bmFtaWNEYXRhQnlJZAEDdElkCQCsAgICFyVzJWRfX3RvdXJEeW5hbWljRGF0YV9fCQCkAwEFA3RJZAETa2V5U2NvcmVCb2FyZEJ5VG91cgEDdElkCQCsAgICEiVzJWRfX3Njb3JlQm9hcmRfXwkApAMBBQN0S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TdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4A3LbeLw==", "height": 2856325, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EbqdnZkud8gMSFxzk7VkShd3ueK5rto52aVPgKMwes6N Next: GMDENNUJ4RGF6CpPjrJ5Zr3c85fBWe3acXFGVD6m8PL1 Diff:
Old | New | Differences | |
---|---|---|---|
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | - | func asBoolean (v) = match v { | |
164 | - | case s: Boolean => | |
165 | - | s | |
166 | - | case _ => | |
167 | - | throw("fail to cast into Boolean") | |
168 | - | } | |
169 | - | ||
170 | - | ||
171 | 163 | func fixedPoint (val,decimals) = { | |
172 | 164 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
173 | 165 | let lowPart = toString((val % tenPow)) | |
321 | 313 | if ((prologResult == prologResult)) | |
322 | 314 | then { | |
323 | 315 | let duckAssetId = duckByCaller(i.originCaller) | |
324 | - | let deliveryStatus = asBoolean(invoke(stakingContract, "checkDeliveryCallback", [duckAssetId], nil)) | |
325 | - | if (deliveryStatus) | |
326 | - | then throw("newAttempt_checkDelivery") | |
327 | - | else { | |
328 | - | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
329 | - | let now = lastBlock.timestamp | |
330 | - | let tData = getTourData(this, lastId) | |
331 | - | let static = tData[idxStatic] | |
332 | - | let dynamic = tData[idxDynamic] | |
333 | - | let status = dynamic[tDynamicStatus] | |
334 | - | if (!(if ((status == "INPROGRESS")) | |
335 | - | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
336 | - | else false)) | |
337 | - | then throw("Attempt is not possible") | |
338 | - | else if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false))) | |
339 | - | then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(lastId))) | |
340 | - | else { | |
341 | - | let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId) | |
342 | - | let lastAttempt = getInteger(attemptsIteratorKey) | |
343 | - | let $t069177782 = if (!(isDefined(lastAttempt))) | |
344 | - | then $Tuple2(0, 0) | |
345 | - | else if ((size(i.payments) != 1)) | |
346 | - | then throw("exactly 1 payment must be attached") | |
316 | + | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
317 | + | let now = lastBlock.timestamp | |
318 | + | let tData = getTourData(this, lastId) | |
319 | + | let static = tData[idxStatic] | |
320 | + | let dynamic = tData[idxDynamic] | |
321 | + | let status = dynamic[tDynamicStatus] | |
322 | + | if (!(if ((status == "INPROGRESS")) | |
323 | + | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
324 | + | else false)) | |
325 | + | then throw("Attempt is not possible") | |
326 | + | else if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false))) | |
327 | + | then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(lastId))) | |
328 | + | else { | |
329 | + | let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId) | |
330 | + | let lastAttempt = getInteger(attemptsIteratorKey) | |
331 | + | let $t067497614 = if (!(isDefined(lastAttempt))) | |
332 | + | then $Tuple2(0, 0) | |
333 | + | else if ((size(i.payments) != 1)) | |
334 | + | then throw("exactly 1 payment must be attached") | |
335 | + | else { | |
336 | + | let pmt = i.payments[0] | |
337 | + | let assetId = if ((size(static) > tStaticAsset)) | |
338 | + | then fromBase58String(static[tStaticAsset]) | |
339 | + | else wlgAssetId | |
340 | + | let nfo = valueOrErrorMessage(assetInfo(assetId), "No assetInfo available") | |
341 | + | let assetName = nfo.name | |
342 | + | let assetDecimals = nfo.decimals | |
343 | + | let amt = pmt.amount | |
344 | + | if (if (!(isDefined(pmt.assetId))) | |
345 | + | then true | |
346 | + | else (value(pmt.assetId) != assetId)) | |
347 | + | then throw((assetName + " payments only!")) | |
347 | 348 | else { | |
348 | - | let pmt = i.payments[0] | |
349 | - | let assetId = if ((size(static) > tStaticAsset)) | |
350 | - | then fromBase58String(static[tStaticAsset]) | |
351 | - | else wlgAssetId | |
352 | - | let nfo = valueOrErrorMessage(assetInfo(assetId), "No assetInfo available") | |
353 | - | let assetName = nfo.name | |
354 | - | let assetDecimals = nfo.decimals | |
355 | - | let amt = pmt.amount | |
356 | - | if (if (!(isDefined(pmt.assetId))) | |
357 | - | then true | |
358 | - | else (value(pmt.assetId) != assetId)) | |
359 | - | then throw((assetName + " payments only!")) | |
360 | - | else { | |
361 | - | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
362 | - | if ((amt != attCost)) | |
363 | - | then throw(((("Need payment of " + fixedPoint(attCost, assetDecimals)) + " ") + assetName)) | |
364 | - | else $Tuple2((value(lastAttempt) + 1), 1) | |
365 | - | } | |
349 | + | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
350 | + | if ((amt != attCost)) | |
351 | + | then throw(((("Need payment of " + fixedPoint(attCost, assetDecimals)) + " ") + assetName)) | |
352 | + | else $Tuple2((value(lastAttempt) + 1), 1) | |
366 | 353 | } | |
367 | - | | |
368 | - | ||
369 | - | ||
370 | - | ||
371 | - | | |
372 | - | | |
373 | - | } | |
354 | + | } | |
355 | + | let payedAttempts = $t067497614._1 | |
356 | + | let increment = $t067497614._2 | |
357 | + | let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicLeaders], parseIntValue(dynamic[tDynamicWinResult]), parseIntValue(dynamic[tDynamicTotalRegCount]), (parseIntValue(dynamic[tDynamicTotalAttempts]) + increment)) | |
358 | + | let tourLoc = asString(invoke(stakingContract, "initDuckTourAttempt", [duckAssetId], nil)) | |
359 | + | $Tuple2([IntegerEntry(attemptsIteratorKey, payedAttempts), StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], [prologResult, payedAttempts, tourLoc]) | |
360 | + | } | |
374 | 361 | } | |
375 | 362 | else throw("Strict value is not equal to itself.") | |
376 | 363 | } | |
394 | 381 | let duckOldBest = valueOrElse(getInteger(bestResultKey), 0) | |
395 | 382 | let scoreKey = keyScoreBoardByTour(lastId) | |
396 | 383 | let oldScoreBoard = valueOrElse(getString(scoreKey), "") | |
397 | - | let $ | |
384 | + | let $t0910710268 = if ((duckNewBest > duckOldBest)) | |
398 | 385 | then if (!(contains(oldScoreBoard, duckAssetId))) | |
399 | 386 | then throw(("scoreBoard does not contain " + duckAssetId)) | |
400 | 387 | else { | |
417 | 404 | $Tuple3(((((parts[0] + duckAssetId) + ":") + padL(duckNewBest, 3)) + drop(parts[1], 4)), ((oldSumScores + duckNewBest) - duckOldBest), [StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)]) | |
418 | 405 | } | |
419 | 406 | else $Tuple3(oldScoreBoard, oldSumScores, nil) | |
420 | - | let newScoreBoard = $ | |
421 | - | let newSumScores = $ | |
422 | - | let globalActions = $ | |
407 | + | let newScoreBoard = $t0910710268._1 | |
408 | + | let newSumScores = $t0910710268._2 | |
409 | + | let globalActions = $t0910710268._3 | |
423 | 410 | $Tuple2(([IntegerEntry(bestResultKey, max([duckOldBest, duckNewBest])), IntegerEntry(sumScoresKey, newSumScores), StringEntry(keyBestTxByTourAndDuck(lastId, duckAssetId), toBase58String(i.transactionId)), StringEntry(scoreKey, newScoreBoard)] ++ globalActions), 0) | |
424 | 411 | } | |
425 | 412 | else $Tuple2(nil, 0) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let DEFAULTLOCATION = "Africa_F_Africa" | |
5 | 5 | ||
6 | 6 | let locIdxContinent = 0 | |
7 | 7 | ||
8 | 8 | let locIdxType = 1 | |
9 | 9 | ||
10 | 10 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | let lastTourIdKey = "%s__lastTourId" | |
17 | 17 | ||
18 | 18 | func keyTourStaticDataById (tId) = ("%s%d__tourStaticData__" + toString(tId)) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func keyTourDynamicDataById (tId) = ("%s%d__tourDynamicData__" + toString(tId)) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func keyScoreBoardByTour (tId) = ("%s%d__scoreBoard__" + toString(tId)) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keySumScoresByTour (tId) = ("%s%d__sumScores__" + toString(tId)) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func keyUnpaidRewardsByTour (tId) = ("%s%d__unpaidRewards__" + toString(tId)) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func keyLastRegisteredTourByDuck (duckAssetId) = ("%s%s__lastRegisteredTourByDuck__" + duckAssetId) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func keyIsRegisteredByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__isRegisteredByTourAndDuck", toString(tId), duckAssetId], "__") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func keyIsAwardedByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__isAwardedByTourAndDuck", toString(tId), duckAssetId], "__") | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func keyLastAttemptByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__lastAttemptByTourAndDuck", toString(tId), duckAssetId], "__") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyBestResultByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__bestResultByTourAndDuck", toString(tId), duckAssetId], "__") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keyBestTxByTourAndDuck (tId,duckAssetId) = makeString(["%s%d%s__bestTxByTourAndDuck", toString(tId), duckAssetId], "__") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | let idxStatic = 0 | |
52 | 52 | ||
53 | 53 | let idxDynamic = 1 | |
54 | 54 | ||
55 | 55 | let tStaticRegisterCost = 2 | |
56 | 56 | ||
57 | 57 | let tStaticAttemptCost = 3 | |
58 | 58 | ||
59 | 59 | let tStaticStart = 5 | |
60 | 60 | ||
61 | 61 | let tStaticEnd = 6 | |
62 | 62 | ||
63 | 63 | let tStaticNumGrands = 7 | |
64 | 64 | ||
65 | 65 | let tStaticPrizeFund = 8 | |
66 | 66 | ||
67 | 67 | let tStaticAsset = 9 | |
68 | 68 | ||
69 | 69 | let tDynamicStatus = 1 | |
70 | 70 | ||
71 | 71 | let tDynamicLeaders = 2 | |
72 | 72 | ||
73 | 73 | let tDynamicWinResult = 3 | |
74 | 74 | ||
75 | 75 | let tDynamicTotalRegCount = 4 | |
76 | 76 | ||
77 | 77 | let tDynamicTotalAttempts = 5 | |
78 | 78 | ||
79 | 79 | func getTourData (tourContract,tId) = { | |
80 | 80 | let static = split(valueOrErrorMessage(getString(tourContract, keyTourStaticDataById(tId)), (("Error reading tournament " + toString(tId)) + " data")), "__") | |
81 | 81 | let dynamic = split_4C(valueOrErrorMessage(getString(tourContract, keyTourDynamicDataById(tId)), (("Error reading tournament " + toString(tId)) + " data")), "__") | |
82 | 82 | [static, dynamic] | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func isInTournament (tourContract,location) = { | |
87 | 87 | let lastId = valueOrElse(getInteger(tourContract, lastTourIdKey), 0) | |
88 | 88 | let loc = split(location, "_") | |
89 | 89 | let now = lastBlock.timestamp | |
90 | 90 | let tData = getTourData(tourContract, lastId) | |
91 | 91 | let static = tData[idxStatic] | |
92 | 92 | let dynamic = tData[idxDynamic] | |
93 | 93 | if (if (if ((loc[locIdxType] == "T")) | |
94 | 94 | then (parseIntValue(loc[locIdxContinent]) == lastId) | |
95 | 95 | else false) | |
96 | 96 | then (dynamic[tDynamicStatus] == "INPROGRESS") | |
97 | 97 | else false) | |
98 | 98 | then (parseIntValue(static[tStaticEnd]) > now) | |
99 | 99 | else false | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | let chain = take(drop(this.bytes, 1), 1) | |
104 | 104 | ||
105 | 105 | let defaultRestAddressStr = match chain { | |
106 | 106 | case _ => | |
107 | 107 | if ((base58'2W' == $match0)) | |
108 | 108 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
109 | 109 | else if ((base58'2T' == $match0)) | |
110 | 110 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
111 | 111 | else throw("Unknown chain") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | let SEP = "__" | |
115 | 115 | ||
116 | 116 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | let IdxCfgStakingDapp = 1 | |
120 | 120 | ||
121 | 121 | let IdxCfgWlgDapp = 4 | |
122 | 122 | ||
123 | 123 | func keyRestCfg () = "%s__restConfig" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyRestAddress () = "%s__restAddr" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
136 | 136 | ||
137 | 137 | let restCfg = readRestCfgOrFail(restContract) | |
138 | 138 | ||
139 | 139 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
140 | 140 | ||
141 | 141 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
142 | 142 | ||
143 | 143 | let wlgAssetIdKey = "wlg_assetId" | |
144 | 144 | ||
145 | 145 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
146 | 146 | ||
147 | 147 | func asString (v) = match v { | |
148 | 148 | case s: String => | |
149 | 149 | s | |
150 | 150 | case _ => | |
151 | 151 | throw("fail to cast into String") | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func asInt (v) = match v { | |
156 | 156 | case n: Int => | |
157 | 157 | n | |
158 | 158 | case _ => | |
159 | 159 | throw("fail to cast into Int") | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | - | func asBoolean (v) = match v { | |
164 | - | case s: Boolean => | |
165 | - | s | |
166 | - | case _ => | |
167 | - | throw("fail to cast into Boolean") | |
168 | - | } | |
169 | - | ||
170 | - | ||
171 | 163 | func fixedPoint (val,decimals) = { | |
172 | 164 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
173 | 165 | let lowPart = toString((val % tenPow)) | |
174 | 166 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
175 | 167 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
176 | 168 | } | |
177 | 169 | ||
178 | 170 | ||
179 | 171 | func padL (val,len) = { | |
180 | 172 | let valS = toString(val) | |
181 | 173 | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
182 | 174 | (zeroes + valS) | |
183 | 175 | } | |
184 | 176 | ||
185 | 177 | ||
186 | 178 | let MAXTOURNAMENTLENGTH = 1296000000 | |
187 | 179 | ||
188 | 180 | let HOUR = 3600000 | |
189 | 181 | ||
190 | 182 | let adminsList = [toString(this), match chain { | |
191 | 183 | case _ => | |
192 | 184 | if ((base58'2W' == $match0)) | |
193 | 185 | then "3PEe2RELUHCFCBsmSCNcBJ8N3URLVQende7" | |
194 | 186 | else if ((base58'2T' == $match0)) | |
195 | 187 | then "3MtBgJTaLxPB3C7UJD1UE8qjkHthfKvFQYY" | |
196 | 188 | else throw("Unknown chain") | |
197 | 189 | }] | |
198 | 190 | ||
199 | 191 | func staticData (txId,registerCost,attemptCost,creationTime,startTime,endTime,numGrands,prizeFund,prizeAsset) = makeString(["%s%d%d%d%d%d%d%d%s", txId, toString(registerCost), toString(attemptCost), toString(creationTime), toString(startTime), toString(endTime), toString(numGrands), toString(prizeFund), prizeAsset], SEP) | |
200 | 192 | ||
201 | 193 | ||
202 | 194 | func dynamicData (status,leaders,winResult,totalRegs,totalAttempts) = makeString_2C(["%s%s%d%d%d", status, leaders, toString(winResult), toString(totalRegs), toString(totalAttempts)], SEP) | |
203 | 195 | ||
204 | 196 | ||
205 | 197 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
206 | 198 | ||
207 | 199 | ||
208 | 200 | func duckByCaller (caller) = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(caller))), "You don't have a duck staked") | |
209 | 201 | ||
210 | 202 | ||
211 | 203 | @Callable(i) | |
212 | 204 | func createTournament (startTime,endTime,registerCost,attemptCost,numGrands,prizeFund,prizeAsset) = { | |
213 | 205 | let caller = toString(i.caller) | |
214 | 206 | if (!(containsElement(adminsList, caller))) | |
215 | 207 | then throw("Permission denied") | |
216 | 208 | else { | |
217 | 209 | let lastId = getInteger(lastTourIdKey) | |
218 | 210 | let tId = if (isDefined(lastId)) | |
219 | 211 | then { | |
220 | 212 | let lastTourId = value(lastId) | |
221 | 213 | let dynamic = valueOrErrorMessage(getString(keyTourDynamicDataById(lastTourId)), (("Error reading tournament " + toString(lastTourId)) + " data")) | |
222 | 214 | let status = split(dynamic, SEP)[tDynamicStatus] | |
223 | 215 | if (if ((status != "ARCHIVED")) | |
224 | 216 | then (status != "PROCESSING") | |
225 | 217 | else false) | |
226 | 218 | then throw(("Current tournement is not completed, status=" + status)) | |
227 | 219 | else (lastTourId + 1) | |
228 | 220 | } | |
229 | 221 | else 1 | |
230 | 222 | let now = lastBlock.timestamp | |
231 | 223 | if ((now > startTime)) | |
232 | 224 | then throw(((("startTime=" + toString(startTime)) + " < creationTime=") + toString(now))) | |
233 | 225 | else if ((startTime > endTime)) | |
234 | 226 | then throw(((("endTime=" + toString(endTime)) + " < startTime=") + toString(startTime))) | |
235 | 227 | else if (((endTime - startTime) > MAXTOURNAMENTLENGTH)) | |
236 | 228 | then throw(((("Tournament period exceeds max: " + toString((endTime - startTime))) + " > ") + toString(MAXTOURNAMENTLENGTH))) | |
237 | 229 | else if (if ((0 > registerCost)) | |
238 | 230 | then true | |
239 | 231 | else (0 > attemptCost)) | |
240 | 232 | then throw(((("Cost should be positive, but passed " + toString(registerCost)) + " and ") + toString(attemptCost))) | |
241 | 233 | else if ((0 > numGrands)) | |
242 | 234 | then throw("Number of Grand Prizes should be non-negative") | |
243 | 235 | else if ((0 > prizeFund)) | |
244 | 236 | then throw("Prize Fund should be non-negative") | |
245 | 237 | else $Tuple2([IntegerEntry(lastTourIdKey, tId), StringEntry(keyTourStaticDataById(tId), staticData(toBase58String(i.transactionId), registerCost, attemptCost, now, startTime, endTime, numGrands, prizeFund, prizeAsset)), StringEntry(keyTourDynamicDataById(tId), dynamicData("CREATED", " ", 0, 0, 0))], tId) | |
246 | 238 | } | |
247 | 239 | } | |
248 | 240 | ||
249 | 241 | ||
250 | 242 | ||
251 | 243 | @Callable(i) | |
252 | 244 | func register () = { | |
253 | 245 | let prologResult = prolog() | |
254 | 246 | if ((prologResult == prologResult)) | |
255 | 247 | then { | |
256 | 248 | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
257 | 249 | let now = lastBlock.timestamp | |
258 | 250 | let tData = getTourData(this, lastId) | |
259 | 251 | let static = tData[idxStatic] | |
260 | 252 | let dynamic = tData[idxDynamic] | |
261 | 253 | let status = dynamic[tDynamicStatus] | |
262 | 254 | if (!(if (if (if ((status == "CREATED")) | |
263 | 255 | then (now > parseIntValue(static[tStaticStart])) | |
264 | 256 | else false) | |
265 | 257 | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
266 | 258 | else false) | |
267 | 259 | then true | |
268 | 260 | else if ((status == "INPROGRESS")) | |
269 | 261 | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
270 | 262 | else false)) | |
271 | 263 | then throw("Cannot register now") | |
272 | 264 | else { | |
273 | 265 | let regCost = parseIntValue(static[tStaticRegisterCost]) | |
274 | 266 | let assetId = if ((size(static) > tStaticAsset)) | |
275 | 267 | then fromBase58String(static[tStaticAsset]) | |
276 | 268 | else wlgAssetId | |
277 | 269 | let nfo = valueOrErrorMessage(assetInfo(assetId), "No assetInfo available") | |
278 | 270 | let assetName = nfo.name | |
279 | 271 | let assetDecimals = nfo.decimals | |
280 | 272 | let regAmt = if ((regCost > 0)) | |
281 | 273 | then if ((size(i.payments) != 1)) | |
282 | 274 | then throw("exactly 1 payment must be attached") | |
283 | 275 | else { | |
284 | 276 | let pmt = i.payments[0] | |
285 | 277 | if (if (!(isDefined(pmt.assetId))) | |
286 | 278 | then true | |
287 | 279 | else (value(pmt.assetId) != assetId)) | |
288 | 280 | then throw((assetName + " payments only!")) | |
289 | 281 | else pmt.amount | |
290 | 282 | } | |
291 | 283 | else if ((size(i.payments) != 0)) | |
292 | 284 | then throw("No payments required") | |
293 | 285 | else 0 | |
294 | 286 | if ((regAmt != regCost)) | |
295 | 287 | then throw(((("Need payment of " + fixedPoint(regCost, assetDecimals)) + " ") + assetName)) | |
296 | 288 | else { | |
297 | 289 | let duckAssetId = duckByCaller(i.originCaller) | |
298 | 290 | let scoreKey = keyScoreBoardByTour(lastId) | |
299 | 291 | let oldScoreBoard = valueOrElse(getString(scoreKey), "") | |
300 | 292 | if (if (valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false)) | |
301 | 293 | then true | |
302 | 294 | else contains(oldScoreBoard, duckAssetId)) | |
303 | 295 | then throw(((("Your duck " + duckAssetId) + " is already registered at tournament ") + toString(lastId))) | |
304 | 296 | else { | |
305 | 297 | let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicLeaders], parseIntValue(dynamic[tDynamicWinResult]), (parseIntValue(dynamic[tDynamicTotalRegCount]) + 1), parseIntValue(dynamic[tDynamicTotalAttempts])) | |
306 | 298 | $Tuple2([IntegerEntry(keyLastRegisteredTourByDuck(duckAssetId), lastId), BooleanEntry(keyIsRegisteredByTourAndDuck(lastId, duckAssetId), true), StringEntry(scoreKey, if ((oldScoreBoard == "")) | |
307 | 299 | then (duckAssetId + ":000") | |
308 | 300 | else (((oldScoreBoard + "_") + duckAssetId) + ":000")), StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], prologResult) | |
309 | 301 | } | |
310 | 302 | } | |
311 | 303 | } | |
312 | 304 | } | |
313 | 305 | else throw("Strict value is not equal to itself.") | |
314 | 306 | } | |
315 | 307 | ||
316 | 308 | ||
317 | 309 | ||
318 | 310 | @Callable(i) | |
319 | 311 | func newAttempt () = { | |
320 | 312 | let prologResult = prolog() | |
321 | 313 | if ((prologResult == prologResult)) | |
322 | 314 | then { | |
323 | 315 | let duckAssetId = duckByCaller(i.originCaller) | |
324 | - | let deliveryStatus = asBoolean(invoke(stakingContract, "checkDeliveryCallback", [duckAssetId], nil)) | |
325 | - | if (deliveryStatus) | |
326 | - | then throw("newAttempt_checkDelivery") | |
327 | - | else { | |
328 | - | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
329 | - | let now = lastBlock.timestamp | |
330 | - | let tData = getTourData(this, lastId) | |
331 | - | let static = tData[idxStatic] | |
332 | - | let dynamic = tData[idxDynamic] | |
333 | - | let status = dynamic[tDynamicStatus] | |
334 | - | if (!(if ((status == "INPROGRESS")) | |
335 | - | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
336 | - | else false)) | |
337 | - | then throw("Attempt is not possible") | |
338 | - | else if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false))) | |
339 | - | then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(lastId))) | |
340 | - | else { | |
341 | - | let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId) | |
342 | - | let lastAttempt = getInteger(attemptsIteratorKey) | |
343 | - | let $t069177782 = if (!(isDefined(lastAttempt))) | |
344 | - | then $Tuple2(0, 0) | |
345 | - | else if ((size(i.payments) != 1)) | |
346 | - | then throw("exactly 1 payment must be attached") | |
316 | + | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
317 | + | let now = lastBlock.timestamp | |
318 | + | let tData = getTourData(this, lastId) | |
319 | + | let static = tData[idxStatic] | |
320 | + | let dynamic = tData[idxDynamic] | |
321 | + | let status = dynamic[tDynamicStatus] | |
322 | + | if (!(if ((status == "INPROGRESS")) | |
323 | + | then ((parseIntValue(static[tStaticEnd]) - HOUR) > now) | |
324 | + | else false)) | |
325 | + | then throw("Attempt is not possible") | |
326 | + | else if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(lastId, duckAssetId)), false))) | |
327 | + | then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(lastId))) | |
328 | + | else { | |
329 | + | let attemptsIteratorKey = keyLastAttemptByTourAndDuck(lastId, duckAssetId) | |
330 | + | let lastAttempt = getInteger(attemptsIteratorKey) | |
331 | + | let $t067497614 = if (!(isDefined(lastAttempt))) | |
332 | + | then $Tuple2(0, 0) | |
333 | + | else if ((size(i.payments) != 1)) | |
334 | + | then throw("exactly 1 payment must be attached") | |
335 | + | else { | |
336 | + | let pmt = i.payments[0] | |
337 | + | let assetId = if ((size(static) > tStaticAsset)) | |
338 | + | then fromBase58String(static[tStaticAsset]) | |
339 | + | else wlgAssetId | |
340 | + | let nfo = valueOrErrorMessage(assetInfo(assetId), "No assetInfo available") | |
341 | + | let assetName = nfo.name | |
342 | + | let assetDecimals = nfo.decimals | |
343 | + | let amt = pmt.amount | |
344 | + | if (if (!(isDefined(pmt.assetId))) | |
345 | + | then true | |
346 | + | else (value(pmt.assetId) != assetId)) | |
347 | + | then throw((assetName + " payments only!")) | |
347 | 348 | else { | |
348 | - | let pmt = i.payments[0] | |
349 | - | let assetId = if ((size(static) > tStaticAsset)) | |
350 | - | then fromBase58String(static[tStaticAsset]) | |
351 | - | else wlgAssetId | |
352 | - | let nfo = valueOrErrorMessage(assetInfo(assetId), "No assetInfo available") | |
353 | - | let assetName = nfo.name | |
354 | - | let assetDecimals = nfo.decimals | |
355 | - | let amt = pmt.amount | |
356 | - | if (if (!(isDefined(pmt.assetId))) | |
357 | - | then true | |
358 | - | else (value(pmt.assetId) != assetId)) | |
359 | - | then throw((assetName + " payments only!")) | |
360 | - | else { | |
361 | - | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
362 | - | if ((amt != attCost)) | |
363 | - | then throw(((("Need payment of " + fixedPoint(attCost, assetDecimals)) + " ") + assetName)) | |
364 | - | else $Tuple2((value(lastAttempt) + 1), 1) | |
365 | - | } | |
349 | + | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
350 | + | if ((amt != attCost)) | |
351 | + | then throw(((("Need payment of " + fixedPoint(attCost, assetDecimals)) + " ") + assetName)) | |
352 | + | else $Tuple2((value(lastAttempt) + 1), 1) | |
366 | 353 | } | |
367 | - | | |
368 | - | ||
369 | - | ||
370 | - | ||
371 | - | | |
372 | - | | |
373 | - | } | |
354 | + | } | |
355 | + | let payedAttempts = $t067497614._1 | |
356 | + | let increment = $t067497614._2 | |
357 | + | let updatedDynamicData = dynamicData("INPROGRESS", dynamic[tDynamicLeaders], parseIntValue(dynamic[tDynamicWinResult]), parseIntValue(dynamic[tDynamicTotalRegCount]), (parseIntValue(dynamic[tDynamicTotalAttempts]) + increment)) | |
358 | + | let tourLoc = asString(invoke(stakingContract, "initDuckTourAttempt", [duckAssetId], nil)) | |
359 | + | $Tuple2([IntegerEntry(attemptsIteratorKey, payedAttempts), StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)], [prologResult, payedAttempts, tourLoc]) | |
360 | + | } | |
374 | 361 | } | |
375 | 362 | else throw("Strict value is not equal to itself.") | |
376 | 363 | } | |
377 | 364 | ||
378 | 365 | ||
379 | 366 | ||
380 | 367 | @Callable(i) | |
381 | 368 | func saveDuckResult (duckAssetId,duckNewBest) = if ((i.caller != stakingContract)) | |
382 | 369 | then throw("Access denied") | |
383 | 370 | else { | |
384 | 371 | let lastId = valueOrErrorMessage(getInteger(lastTourIdKey), "No active tournaments") | |
385 | 372 | let tData = getTourData(this, lastId) | |
386 | 373 | let static = tData[idxStatic] | |
387 | 374 | let dynamic = tData[idxDynamic] | |
388 | 375 | let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION) | |
389 | 376 | let bestResultKey = keyBestResultByTourAndDuck(lastId, duckAssetId) | |
390 | 377 | let sumScoresKey = keySumScoresByTour(lastId) | |
391 | 378 | let oldSumScores = valueOrElse(getInteger(sumScoresKey), 0) | |
392 | 379 | if (isInTournament(this, curLocation)) | |
393 | 380 | then { | |
394 | 381 | let duckOldBest = valueOrElse(getInteger(bestResultKey), 0) | |
395 | 382 | let scoreKey = keyScoreBoardByTour(lastId) | |
396 | 383 | let oldScoreBoard = valueOrElse(getString(scoreKey), "") | |
397 | - | let $ | |
384 | + | let $t0910710268 = if ((duckNewBest > duckOldBest)) | |
398 | 385 | then if (!(contains(oldScoreBoard, duckAssetId))) | |
399 | 386 | then throw(("scoreBoard does not contain " + duckAssetId)) | |
400 | 387 | else { | |
401 | 388 | let oldBest = parseIntValue(dynamic[tDynamicWinResult]) | |
402 | 389 | let leaders = dynamic[tDynamicLeaders] | |
403 | 390 | let oldLeadersList = if (if ((leaders == "")) | |
404 | 391 | then true | |
405 | 392 | else (leaders == " ")) | |
406 | 393 | then nil | |
407 | 394 | else split_4C(leaders, ",") | |
408 | 395 | let newLeadersList = if ((duckNewBest > oldBest)) | |
409 | 396 | then [duckAssetId] | |
410 | 397 | else if (if ((oldBest > duckNewBest)) | |
411 | 398 | then true | |
412 | 399 | else containsElement(oldLeadersList, duckAssetId)) | |
413 | 400 | then oldLeadersList | |
414 | 401 | else (oldLeadersList :+ duckAssetId) | |
415 | 402 | let updatedDynamicData = dynamicData("INPROGRESS", makeString_2C(newLeadersList, ","), max([duckNewBest, oldBest]), parseIntValue(dynamic[tDynamicTotalRegCount]), parseIntValue(dynamic[tDynamicTotalAttempts])) | |
416 | 403 | let parts = split_51C(oldScoreBoard, duckAssetId) | |
417 | 404 | $Tuple3(((((parts[0] + duckAssetId) + ":") + padL(duckNewBest, 3)) + drop(parts[1], 4)), ((oldSumScores + duckNewBest) - duckOldBest), [StringEntry(keyTourDynamicDataById(lastId), updatedDynamicData)]) | |
418 | 405 | } | |
419 | 406 | else $Tuple3(oldScoreBoard, oldSumScores, nil) | |
420 | - | let newScoreBoard = $ | |
421 | - | let newSumScores = $ | |
422 | - | let globalActions = $ | |
407 | + | let newScoreBoard = $t0910710268._1 | |
408 | + | let newSumScores = $t0910710268._2 | |
409 | + | let globalActions = $t0910710268._3 | |
423 | 410 | $Tuple2(([IntegerEntry(bestResultKey, max([duckOldBest, duckNewBest])), IntegerEntry(sumScoresKey, newSumScores), StringEntry(keyBestTxByTourAndDuck(lastId, duckAssetId), toBase58String(i.transactionId)), StringEntry(scoreKey, newScoreBoard)] ++ globalActions), 0) | |
424 | 411 | } | |
425 | 412 | else $Tuple2(nil, 0) | |
426 | 413 | } | |
427 | 414 | ||
428 | 415 | ||
429 | 416 | ||
430 | 417 | @Callable(i) | |
431 | 418 | func processTournament (tId) = { | |
432 | 419 | let caller = toString(i.caller) | |
433 | 420 | if (!(containsElement(adminsList, caller))) | |
434 | 421 | then throw("Permission denied") | |
435 | 422 | else { | |
436 | 423 | let now = lastBlock.timestamp | |
437 | 424 | let tData = getTourData(this, tId) | |
438 | 425 | let static = tData[idxStatic] | |
439 | 426 | let dynamic = tData[idxDynamic] | |
440 | 427 | let status = dynamic[tDynamicStatus] | |
441 | 428 | let registrations = parseIntValue(dynamic[tDynamicTotalRegCount]) | |
442 | 429 | let paidAttempts = parseIntValue(dynamic[tDynamicTotalAttempts]) | |
443 | 430 | let regCost = parseIntValue(static[tStaticRegisterCost]) | |
444 | 431 | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
445 | 432 | if ((status == "ARCHIVED")) | |
446 | 433 | then throw((("Tournament " + toString(tId)) + " is already ARCHIVED")) | |
447 | 434 | else if (if ((status == "INPROGRESS")) | |
448 | 435 | then (parseIntValue(static[tStaticEnd]) > now) | |
449 | 436 | else false) | |
450 | 437 | then throw((("Tournament " + toString(tId)) + " is not over yet")) | |
451 | 438 | else { | |
452 | 439 | let updatedDynamicData = dynamicData("PROCESSING", dynamic[tDynamicLeaders], parseIntValue(dynamic[tDynamicWinResult]), registrations, paidAttempts) | |
453 | 440 | let prizeFund = if ((size(static) > tStaticPrizeFund)) | |
454 | 441 | then parseIntValue(static[tStaticPrizeFund]) | |
455 | 442 | else 0 | |
456 | 443 | let unpaid = ((((registrations * regCost) + (paidAttempts * attCost)) / 2) + prizeFund) | |
457 | 444 | $Tuple2([StringEntry(keyTourDynamicDataById(tId), updatedDynamicData), IntegerEntry(keyUnpaidRewardsByTour(tId), unpaid)], 0) | |
458 | 445 | } | |
459 | 446 | } | |
460 | 447 | } | |
461 | 448 | ||
462 | 449 | ||
463 | 450 | ||
464 | 451 | @Callable(i) | |
465 | 452 | func claimPrize (tId) = { | |
466 | 453 | let prologResult = prolog() | |
467 | 454 | if ((prologResult == prologResult)) | |
468 | 455 | then if ((size(i.payments) != 0)) | |
469 | 456 | then throw("No payments required") | |
470 | 457 | else { | |
471 | 458 | let tData = getTourData(this, tId) | |
472 | 459 | let static = tData[idxStatic] | |
473 | 460 | let dynamic = tData[idxDynamic] | |
474 | 461 | let status = dynamic[tDynamicStatus] | |
475 | 462 | if ((status != "PROCESSING")) | |
476 | 463 | then throw((("Tournament " + toString(tId)) + " is not PROCESSING")) | |
477 | 464 | else { | |
478 | 465 | let registrations = parseIntValue(dynamic[tDynamicTotalRegCount]) | |
479 | 466 | let paidAttempts = parseIntValue(dynamic[tDynamicTotalAttempts]) | |
480 | 467 | let regCost = parseIntValue(static[tStaticRegisterCost]) | |
481 | 468 | let attCost = parseIntValue(static[tStaticAttemptCost]) | |
482 | 469 | let prizeFund = if ((size(static) > tStaticPrizeFund)) | |
483 | 470 | then parseIntValue(static[tStaticPrizeFund]) | |
484 | 471 | else 0 | |
485 | 472 | let awardFunds = ((((registrations * regCost) + (paidAttempts * attCost)) / 2) + prizeFund) | |
486 | 473 | let unpaidKey = keyUnpaidRewardsByTour(tId) | |
487 | 474 | let unpaidFunds = valueOrElse(getInteger(unpaidKey), 0) | |
488 | 475 | let duckAssetId = duckByCaller(i.originCaller) | |
489 | 476 | if (!(valueOrElse(getBoolean(keyIsRegisteredByTourAndDuck(tId, duckAssetId)), false))) | |
490 | 477 | then throw(((("Your duck " + duckAssetId) + " is not registered at tournament ") + toString(tId))) | |
491 | 478 | else { | |
492 | 479 | let bestResultKey = keyBestResultByTourAndDuck(tId, duckAssetId) | |
493 | 480 | let duckBest = valueOrElse(getInteger(bestResultKey), 0) | |
494 | 481 | if ((duckBest == 0)) | |
495 | 482 | then throw("Your duck got zero score") | |
496 | 483 | else { | |
497 | 484 | let awardedKey = keyIsAwardedByTourAndDuck(tId, duckAssetId) | |
498 | 485 | if (valueOrElse(getBoolean(awardedKey), false)) | |
499 | 486 | then throw(((("Your duck " + duckAssetId) + " is already awarded at tournament ") + toString(tId))) | |
500 | 487 | else { | |
501 | 488 | let sumScoresKey = keySumScoresByTour(tId) | |
502 | 489 | let sumScores = valueOrElse(getInteger(sumScoresKey), 0) | |
503 | 490 | let leaders = dynamic[tDynamicLeaders] | |
504 | 491 | let leadersList = if (if ((leaders == "")) | |
505 | 492 | then true | |
506 | 493 | else (leaders == " ")) | |
507 | 494 | then nil | |
508 | 495 | else split_4C(leaders, ",") | |
509 | 496 | let numLeaders = size(leadersList) | |
510 | 497 | if ((numLeaders == 0)) | |
511 | 498 | then throw(("No leaders at tournament " + toString(tId))) | |
512 | 499 | else { | |
513 | 500 | let numGrands = parseIntValue(static[tStaticNumGrands]) | |
514 | 501 | let winResult = parseIntValue(dynamic[tDynamicWinResult]) | |
515 | 502 | let sumLeaderScores = if ((numLeaders > numGrands)) | |
516 | 503 | then 0 | |
517 | 504 | else if (containsElement(leadersList, duckAssetId)) | |
518 | 505 | then throw("As one of winners, you will be awarded by admins") | |
519 | 506 | else (numLeaders * winResult) | |
520 | 507 | let yourAmount = min([fraction(duckBest, awardFunds, (sumScores - sumLeaderScores)), unpaidFunds]) | |
521 | 508 | let newUnpaidAmount = (unpaidFunds - yourAmount) | |
522 | 509 | let updatedDynamicData = dynamicData("ARCHIVED", dynamic[tDynamicLeaders], winResult, registrations, paidAttempts) | |
523 | 510 | let archiveAction = if ((0 >= newUnpaidAmount)) | |
524 | 511 | then [StringEntry(keyTourDynamicDataById(tId), updatedDynamicData)] | |
525 | 512 | else nil | |
526 | 513 | let assetId = if ((size(static) > tStaticAsset)) | |
527 | 514 | then fromBase58String(static[tStaticAsset]) | |
528 | 515 | else wlgAssetId | |
529 | 516 | let loc = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
530 | 517 | let breakActions = if (if ((loc[locIdxType] == "T")) | |
531 | 518 | then (getTourData(this, parseIntValue(loc[locIdxContinent]))[idxDynamic][tDynamicStatus] == "PROCESSING") | |
532 | 519 | else false) | |
533 | 520 | then invoke(stakingContract, "breakAttemptCallback", nil, nil) | |
534 | 521 | else unit | |
535 | 522 | $Tuple2(([ScriptTransfer(i.caller, yourAmount, assetId), BooleanEntry(awardedKey, true), IntegerEntry(unpaidKey, newUnpaidAmount)] ++ archiveAction), breakActions) | |
536 | 523 | } | |
537 | 524 | } | |
538 | 525 | } | |
539 | 526 | } | |
540 | 527 | } | |
541 | 528 | } | |
542 | 529 | else throw("Strict value is not equal to itself.") | |
543 | 530 | } | |
544 | 531 | ||
545 | 532 |
github/deemru/w8io/169f3d6 133.00 ms ◑