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