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