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