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