tx · HbwkggK8xBTiNUEQKhKgj61Zy4gwQinpgyZA59CgUreQ

3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt:  -0.01500000 Waves

2022.11.28 03:02 [2336208] smart account 3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt > SELF 0.00000000 Waves

{ "type": 13, "id": "HbwkggK8xBTiNUEQKhKgj61Zy4gwQinpgyZA59CgUreQ", "fee": 1500000, "feeAssetId": null, "timestamp": 1669593732682, "version": 1, "sender": "3MtC32eAy42jhwnHpfYCbUj11iUkXDQdYpt", "senderPublicKey": "3xUNfrYKuaZmnMzb6e9tKC4azGnvWZyLzeKdUgAeFFpV", "proofs": [ "4umkdgsLdQVKKmFBdrUzKAMq5Z4LCGZiedDKaWbWrZiDfrtEHXU1awrpZJ8P1sCLwkmzEkMLtvbC9ganA6df4SQo" ], "script": "base64:BgIeCAISAwoBCBIDCgEIEgcKBQEICAEBEgMKAQESABIALgABUwICX18AAlMyAgE6AANERUMAwIQ9AAlTQ0hFRFVMRUQCCVNDSEVEVUxFRAAGUExBWUVEAgZQTEFZRUQBA2FicwEBdgMJAGYCAAAFAXYJAGgCAP///////////wEFAXYFAXYBDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJAKwCAgkArAICCQCsAgIJAKUIAQUHYWRkcmVzcwIBLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBDGdldFN0ck9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJAKwCAgkArAICCQCsAgIJAKUIAQUHYWRkcmVzcwIBLgUDa2V5Ag8gaXMgbm90IGRlZmluZWQBBmdldEludAMHYWRkcmVzcwNrZXkHZGVmYXVsdAkBC3ZhbHVlT3JFbHNlAgkAmggCBQdhZGRyZXNzBQNrZXkFB2RlZmF1bHQBBmdldFN0c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GYxXzECCQEFJGYxXzECCQEFJGYxXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoACwFpAS13aW5uaW5qYUdvbGRlbkhvdXIxMDBVc2RuUHJpemVGdW5kQ2xhaW1SZXdhcmQABAZwbGF5ZXIIBQFpBmNhbGxlcgQJcGxheWVyU3RyCQClCAEFBnBsYXllcgQIcm91bmROdW0JAQxnZXRJbnRPckZhaWwCBQR0aGlzCQEVa2V5R29sZGVuSG91clJvdW5kTnVtAAQJcGxheWVyS0VZCQETa2V5R29sZGVuSG91clBsYXllcgIFCHJvdW5kTnVtBQlwbGF5ZXJTdHIEBGRhdGEJALUJAgkBDGdldFN0ck9yRmFpbAIFBHRoaXMFCXBsYXllcktFWQUBUwQGd2luQW10CQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUEZGF0YQABBAZzdGF0dXMJAJEDAgUEZGF0YQACAwkAZwIAAAUGd2luQW10CQACAQIQTm90aGluZyB0byBjbGFpbQMJAAACBQZzdGF0dXMFCUdIQ0xBSU1FRAkAAgECD0FscmVhZHkgY2xhaW1lZAkAzAgCCQELU3RyaW5nRW50cnkCBQlwbGF5ZXJLRVkJARRkYXRhR29sZGVuSG91clBsYXllcgIFBndpbkFtdAUJR0hDTEFJTUVECQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFBnBsYXllcgUGd2luQW10BQZ1c2RuSWQFA25pbADWvsxr", "chainId": 84, "height": 2336208, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BCSS5SkYe66Y6EVqMM5Hf6gNtvGx5EaLmDBNeSV5nMVB Next: 8mvMxFsP2K11JTTbawxX5bVekMn32juCsGX9iyzxfbQk Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let S = "__"
5+
6+let S2 = ":"
57
68 let DEC = 1000000
79
810 let SCHEDULED = "SCHEDULED"
911
1012 let PLAYED = "PLAYED"
13+
14+func abs (v) = if ((0 > v))
15+ then (-1 * v)
16+ else v
17+
1118
1219 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (((toString(address) + ".") + key) + " is not defined"))
1320
2229
2330
2431 func keyCfgPriceAssetId () = "%s%s__cfg__priceAsset"
32+
33+
34+func keyCfgAdmin () = "%s%s__cfg__admin"
2535
2636
2737 let usdnId = fromBase58String(getStr(this, keyCfgPriceAssetId(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ"))
6878 func isMe (i) = if ((this != i.caller))
6979 then throw("not allowed")
7080 else true
81+
82+
83+func isAdmin (i) = {
84+ let adminAddress = addressFromStringValue(getStrOrFail(this, keyCfgAdmin()))
85+ if ((adminAddress != i.caller))
86+ then throw("not allowed")
87+ else true
88+ }
7189
7290
7391 func calcRisks (round,pmt) = if ((round == 1))
166184 }
167185
168186
187+let GHCLAIMED = "CLAIMED"
188+
189+let GHPENDING = "PENDING"
190+
191+func keyGoldenHourStart (roundNum) = ("%s%d__goldenHourStart__" + toString(roundNum))
192+
193+
194+func keyGoldenHourEnd (roundNum) = ("%s%d__goldenHourEnd__" + toString(roundNum))
195+
196+
197+func keyGoldenHourRandomOn (roundNum) = ("%s%d__goldenHourRandomOn__" + toString(roundNum))
198+
199+
200+func keyGoldenHourRoundNum () = "%s__goldenHourRoundNum"
201+
202+
203+func keyGoldenHourTicketOwner (roundNum,ticketNum) = makeString(["%s%d%d__goldenHourTicketOwner", toString(roundNum), toString(ticketNum)], S)
204+
205+
206+func keyGoldenHourAllTickets (roundNum) = ("%s%d__goldenHourAllTickets__" + toString(roundNum))
207+
208+
209+func keyGoldenHourPlayerNum (roundNum) = makeString(["%s%d__goldenHourPlayerNum", toString(roundNum)], S)
210+
211+
212+func keyGoldenHourPlayer (roundNum,player) = makeString(["%s%d%s__goldenHourPlayer", toString(roundNum), player], S)
213+
214+
215+func dataGoldenHourPlayer (amt,status) = makeString(["%d%s", toString(amt), status], S)
216+
217+
218+func generateGoldenHourTickets (player,pmt) = {
219+ let roundNum = getInt(this, keyGoldenHourRoundNum(), 0)
220+ let roundStart = getInt(this, keyGoldenHourStart(roundNum), 0)
221+ let roundEnd = getInt(this, keyGoldenHourEnd(roundNum), 0)
222+ if (if ((roundStart > height))
223+ then true
224+ else (height >= roundEnd))
225+ then nil
226+ else {
227+ let ticketCost = 5000000
228+ let ticketsIdxs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
229+ let ticketsTmp = (pmt / ticketCost)
230+ let ticketsCount = if ((ticketsTmp > size(ticketsIdxs)))
231+ then size(ticketsIdxs)
232+ else ticketsTmp
233+ let lastTicketNumKey = keyGoldenHourPlayerNum(roundNum)
234+ let lastTicketNum = getInt(this, lastTicketNumKey, 0)
235+ let lastTicketNumNew = (lastTicketNum + ticketsCount)
236+ func genTickets (genData,next) = {
237+ let ticketNum = (lastTicketNum + next)
238+ let entries = genData._1
239+ let ticketsAll = genData._2
240+ if ((ticketNum >= lastTicketNumNew))
241+ then genData
242+ else $Tuple2((entries :+ StringEntry(keyGoldenHourTicketOwner(roundNum, ticketNum), player)), makeString_2C([ticketsAll, toString(ticketNum), S2], ""))
243+ }
244+
245+ let data = {
246+ let $l = ticketsIdxs
247+ let $s = size($l)
248+ let $acc0 = $Tuple2(nil, "")
249+ func $f0_1 ($a,$i) = if (($i >= $s))
250+ then $a
251+ else genTickets($a, $l[$i])
252+
253+ func $f0_2 ($a,$i) = if (($i >= $s))
254+ then $a
255+ else throw("List size exceeds 20")
256+
257+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
258+ }
259+ let slot2userEntries = data._1
260+ let allTicketsTail = data._2
261+ let allTicketsKey = keyGoldenHourAllTickets(roundNum)
262+ let allTickets = getStr(this, allTicketsKey, "")
263+ (((slot2userEntries :+ IntegerEntry(lastTicketNumKey, lastTicketNumNew)) :+ StringEntry(keyGoldenHourPlayer(roundNum, player), dataGoldenHourPlayer(0, GHPENDING))) :+ StringEntry(allTicketsKey, (allTickets + allTicketsTail)))
264+ }
265+ }
266+
267+
169268 @Callable(i)
170269 func init (priceAssetId) = {
171270 let checks = [isMe(i)]
199298 then fraction(teamCap, DEC, teamTkn)
200299 else DEC
201300 let teamTknForUser = fraction(pmtAmt, DEC, price)
202-[IntegerEntry(keyTeamCap(teamCode), (teamCap + pmtAmt)), IntegerEntry(keyTeamTkn(teamCode), (teamTkn + teamTknForUser)), updateUserShareInTeam(user, teamCode, teamTknForUser, pmtAmt), updateTeamRiskOnBuy(teamCode, pmtAmt)]
301+ ([IntegerEntry(keyTeamCap(teamCode), (teamCap + pmtAmt)), IntegerEntry(keyTeamTkn(teamCode), (teamTkn + teamTknForUser)), updateUserShareInTeam(user, teamCode, teamTknForUser, pmtAmt), updateTeamRiskOnBuy(teamCode, pmtAmt)] ++ generateGoldenHourTickets(user, pmtAmt))
203302 }
204303 }
205304 }
219318 let awayTeamRound = readTeamRnd(awayTeamCode)
220319 if ((status != SCHEDULED))
221320 then throw("Match is not in SCHEDULED status")
222- else if ((homeTeamRound != round))
223- then throw(((("Home team's round doesn't match passed round: " + toString(round)) + " != ") + toString(homeTeamRound)))
224- else if ((awayTeamRound != round))
225- then throw(((("Away team's round doesn't match passed round: " + toString(round)) + " != ") + toString(awayTeamRound)))
226- else ((((updateBothTeamsStats(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals) ++ updateTeamsCapsAndRisks(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals)) :+ StringEntry(key, dataMatch(data, homeTeamGoals, awayTeamGoals))) :+ updateTeamRnd(homeTeamCode)) :+ updateTeamRnd(awayTeamCode))
321+ else if (((time + (((2 * 60) * 60) * 1000)) > lastBlock.timestamp))
322+ then throw("Wait 2h after match start before score update")
323+ else if ((homeTeamRound != round))
324+ then throw(((("Home team's round doesn't match passed round: " + toString(round)) + " != ") + toString(homeTeamRound)))
325+ else if ((awayTeamRound != round))
326+ then throw(((("Away team's round doesn't match passed round: " + toString(round)) + " != ") + toString(awayTeamRound)))
327+ else ((((updateBothTeamsStats(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals) ++ updateTeamsCapsAndRisks(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals)) :+ StringEntry(key, dataMatch(data, homeTeamGoals, awayTeamGoals))) :+ updateTeamRnd(homeTeamCode)) :+ updateTeamRnd(awayTeamCode))
227328 }
228329 else throw("Strict value is not equal to itself.")
330+ }
331+
332+
333+
334+@Callable(i)
335+func winninjaGoldenHour100UsdnPrizeFundSchedule (blockStart) = {
336+ let durationBlocks = 60
337+ let checks = [isAdmin(i)]
338+ if ((checks == checks))
339+ then {
340+ let pmt = i.payments[0]
341+ if ((pmt.assetId != usdnId))
342+ then throw("only usdn is supported")
343+ else if ((pmt.amount != (100 * DEC)))
344+ then throw("100 usdn must be attached")
345+ else {
346+ let roundNum = (getInt(this, keyGoldenHourRoundNum(), -1) + 1)
347+ let prevEnd = getInt(this, keyGoldenHourEnd(roundNum), 0)
348+ if (((60 * 12) >= (height - prevEnd)))
349+ then throw("min duration between golden hours is 12h")
350+ else if ((height >= blockStart))
351+ then throw("blockStart is in the past")
352+ else {
353+ let blockEnd = (blockStart + durationBlocks)
354+ let randomOn = (blockEnd + 5)
355+[IntegerEntry(keyGoldenHourRoundNum(), roundNum), IntegerEntry(keyGoldenHourStart(roundNum), blockStart), IntegerEntry(keyGoldenHourEnd(roundNum), blockEnd), IntegerEntry(keyGoldenHourRandomOn(roundNum), randomOn)]
356+ }
357+ }
358+ }
359+ else throw("Strict value is not equal to itself.")
360+ }
361+
362+
363+
364+@Callable(i)
365+func winninjaGoldenHour100UsdnPrizeFundGenerateRandom () = {
366+ let winAmtMain = 50000000
367+ let winAmtSecond = 5000000
368+ let roundNum = getIntOrFail(this, keyGoldenHourRoundNum())
369+ let randomOnHeight = getIntOrFail(this, keyGoldenHourRandomOn(roundNum))
370+ if ((randomOnHeight > height))
371+ then throw((("wait " + toString(randomOnHeight)) + " to generate random"))
372+ else {
373+ let randHeight = (randomOnHeight - 2)
374+ let randHeightStr = toString(randHeight)
375+ let blockInfo = valueOrErrorMessage(blockInfoByHeight(randHeight), ("couldn't find block " + randHeightStr))
376+ let vrf = valueOrErrorMessage(blockInfo.vrf, (("block " + randHeightStr) + " doesn't support vrf"))
377+ let seed = sha256(vrf)
378+ let ticketsCount = getIntOrFail(this, keyGoldenHourPlayerNum(roundNum))
379+ let allTickets = getStrOrFail(this, keyGoldenHourAllTickets(roundNum))
380+ let randCount = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
381+ func genRands (winnersMap,nextRandOffset) = {
382+ let winnersList = winnersMap._1
383+ let amountsList = winnersMap._2
384+ let allTicketsList = winnersMap._3
385+ let randIdx = (abs(toInt(drop(seed, nextRandOffset))) % (ticketsCount - nextRandOffset))
386+ let winTicketNum = parseIntValue(allTicketsList[randIdx])
387+ let allTicketsListNew = removeByIndex(allTicketsList, randIdx)
388+ let winner = getStrOrFail(this, keyGoldenHourTicketOwner(roundNum, winTicketNum))
389+ if ((size(winnersList) == 0))
390+ then $Tuple3([winner], [winAmtMain], allTicketsListNew)
391+ else {
392+ let idxOpt = indexOf(winnersList, winner)
393+ if (!(isDefined(idxOpt)))
394+ then $Tuple3((winnersList :+ winner), (amountsList :+ winAmtSecond), allTicketsListNew)
395+ else {
396+ let idx = value(idxOpt)
397+ let amtNew = (amountsList[idx] + winAmtSecond)
398+ let winnersListNew = (removeByIndex(winnersList, idx) :+ winner)
399+ let amountsListNew = (removeByIndex(amountsList, idx) :+ amtNew)
400+ $Tuple3(winnersListNew, amountsListNew, allTicketsListNew)
401+ }
402+ }
403+ }
404+
405+ let randResults = {
406+ let $l = randCount
407+ let $s = size($l)
408+ let $acc0 = $Tuple3(nil, nil, split_51C(allTickets, S2))
409+ func $f0_1 ($a,$i) = if (($i >= $s))
410+ then $a
411+ else genRands($a, $l[$i])
412+
413+ func $f0_2 ($a,$i) = if (($i >= $s))
414+ then $a
415+ else throw("List size exceeds 11")
416+
417+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11)
418+ }
419+ let winnersListRes = randResults._1
420+ let amountsListRes = randResults._2
421+ func forEachWinner (entries,nextIdx) = if ((nextIdx > size(winnersListRes)))
422+ then {
423+ let winner = winnersListRes[nextIdx]
424+ let amt = amountsListRes[nextIdx]
425+ (entries :+ StringEntry(keyGoldenHourPlayer(roundNum, winner), dataGoldenHourPlayer(amt, GHPENDING)))
426+ }
427+ else entries
428+
429+ let $l = randCount
430+ let $s = size($l)
431+ let $acc0 = nil
432+ func $f1_1 ($a,$i) = if (($i >= $s))
433+ then $a
434+ else forEachWinner($a, $l[$i])
435+
436+ func $f1_2 ($a,$i) = if (($i >= $s))
437+ then $a
438+ else throw("List size exceeds 11")
439+
440+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11)
441+ }
442+ }
443+
444+
445+
446+@Callable(i)
447+func winninjaGoldenHour100UsdnPrizeFundClaimReward () = {
448+ let player = i.caller
449+ let playerStr = toString(player)
450+ let roundNum = getIntOrFail(this, keyGoldenHourRoundNum())
451+ let playerKEY = keyGoldenHourPlayer(roundNum, playerStr)
452+ let data = split(getStrOrFail(this, playerKEY), S)
453+ let winAmt = parseIntValue(data[1])
454+ let status = data[2]
455+ if ((0 >= winAmt))
456+ then throw("Nothing to claim")
457+ else if ((status == GHCLAIMED))
458+ then throw("Already claimed")
459+ else [StringEntry(playerKEY, dataGoldenHourPlayer(winAmt, GHCLAIMED)), ScriptTransfer(player, winAmt, usdnId)]
229460 }
230461
231462
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let S = "__"
5+
6+let S2 = ":"
57
68 let DEC = 1000000
79
810 let SCHEDULED = "SCHEDULED"
911
1012 let PLAYED = "PLAYED"
13+
14+func abs (v) = if ((0 > v))
15+ then (-1 * v)
16+ else v
17+
1118
1219 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (((toString(address) + ".") + key) + " is not defined"))
1320
1421
1522 func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((toString(address) + ".") + key) + " is not defined"))
1623
1724
1825 func getInt (address,key,default) = valueOrElse(getInteger(address, key), default)
1926
2027
2128 func getStr (address,key,default) = valueOrElse(getString(address, key), default)
2229
2330
2431 func keyCfgPriceAssetId () = "%s%s__cfg__priceAsset"
32+
33+
34+func keyCfgAdmin () = "%s%s__cfg__admin"
2535
2636
2737 let usdnId = fromBase58String(getStr(this, keyCfgPriceAssetId(), "HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ"))
2838
2939 func keyTeamCap (teamCode) = makeString(["%s%s__teamCapitalization", teamCode], S)
3040
3141
3242 func keyTeamTkn (teamCode) = makeString(["%s%s__teamTokens", teamCode], S)
3343
3444
3545 func keyTeamRnd (teamCode) = makeString(["%s%s__teamRound", teamCode], S)
3646
3747
3848 func keyTeamRisks (teamCode) = makeString(["%s%s__teamRisks", teamCode], S)
3949
4050
4151 func keyTeamSchedule (teamCode) = makeString(["%s%s__teamSchedule", teamCode], S)
4252
4353
4454 func keyTeamStats (teamCode) = makeString(["%s%s__teamStats", teamCode], S)
4555
4656
4757 func keyUserTeam (user,teamCode) = makeString(["%s%s%s__userTeam", teamCode, user], S)
4858
4959
5060 func keyMatch (round,homeTeamCode,awayTeamCode) = makeString(["%s%d%s%s__match", toString(round), homeTeamCode, awayTeamCode], S)
5161
5262
5363 func dataTeamRisks (risk1,risk2,risk3,risk4) = makeString(["%d%d%d%d", risk1, risk2, risk3, risk4], S)
5464
5565
5666 func dataMatch (data,homeTeamGoals,awayTeamGoals) = makeString(["%d%d%s%d%d", data[1], data[2], PLAYED, toString(homeTeamGoals), toString(awayTeamGoals)], S)
5767
5868
5969 func readTeamRnd (teamCode) = getInt(this, keyTeamRnd(teamCode), 1)
6070
6171
6272 func updateTeamRnd (teamCode) = {
6373 let r = readTeamRnd(teamCode)
6474 IntegerEntry(keyTeamRnd(teamCode), (r + 1))
6575 }
6676
6777
6878 func isMe (i) = if ((this != i.caller))
6979 then throw("not allowed")
7080 else true
81+
82+
83+func isAdmin (i) = {
84+ let adminAddress = addressFromStringValue(getStrOrFail(this, keyCfgAdmin()))
85+ if ((adminAddress != i.caller))
86+ then throw("not allowed")
87+ else true
88+ }
7189
7290
7391 func calcRisks (round,pmt) = if ((round == 1))
7492 then $Tuple4((pmt / 3), (pmt / 3), (pmt / 3), 0)
7593 else if ((round == 2))
7694 then $Tuple4(0, (pmt / 2), (pmt / 2), 0)
7795 else if ((round == 3))
7896 then $Tuple4(0, 0, pmt, 0)
7997 else $Tuple4(0, 0, 0, pmt)
8098
8199
82100 func updateTeamRiskOnBuy (teamCode,pmt) = {
83101 let risksKey = keyTeamRisks(teamCode)
84102 let risksStr = getStr(this, risksKey, dataTeamRisks("0", "0", "0", "0"))
85103 let risksDat = split(risksStr, S)
86104 let teamRound = readTeamRnd(teamCode)
87105 let plusRisk = calcRisks(teamRound, pmt)
88106 let risk1 = toString((parseIntValue(risksDat[1]) + plusRisk._1))
89107 let risk2 = toString((parseIntValue(risksDat[2]) + plusRisk._2))
90108 let risk3 = toString((parseIntValue(risksDat[3]) + plusRisk._3))
91109 let risk4 = toString((parseIntValue(risksDat[4]) + plusRisk._4))
92110 StringEntry(risksKey, dataTeamRisks(risk1, risk2, risk3, risk4))
93111 }
94112
95113
96114 func updateUserShareInTeam (userAddress,teamCode,teamTknDiff,pmt) = {
97115 let key = keyUserTeam(userAddress, teamCode)
98116 let data = split(getStr(this, key, "%d%d__0__0"), S)
99117 let teamTknAmtNew = toString((parseIntValue(data[1]) + teamTknDiff))
100118 let investUsdnNew = toString((parseIntValue(data[2]) + pmt))
101119 StringEntry(key, makeString(["%d%d", teamTknAmtNew, investUsdnNew], S))
102120 }
103121
104122
105123 func dataTeamStats (gameNum,wins,draws,loses,goalsFor,goalsAgainst,points) = makeString(["%d%d%d%d%d%d%d", toString(gameNum), toString(wins), toString(draws), toString(loses), toString(goalsFor), toString(goalsAgainst), toString(points)], S)
106124
107125
108126 func updateSingleTeamStats (teamCode,teamDiff) = {
109127 let key = keyTeamStats(teamCode)
110128 let data = split(getStr(this, key, dataTeamStats(0, 0, 0, 0, 0, 0, 0)), S)
111129 StringEntry(key, dataTeamStats((parseIntValue(data[1]) + teamDiff._1), (parseIntValue(data[2]) + teamDiff._2), (parseIntValue(data[3]) + teamDiff._3), (parseIntValue(data[4]) + teamDiff._4), (parseIntValue(data[5]) + teamDiff._5), (parseIntValue(data[6]) + teamDiff._6), (parseIntValue(data[7]) + teamDiff._7)))
112130 }
113131
114132
115133 func updateBothTeamsStats (homeTeamCode,awayTeamCode,homeTeamGoals,awayTeamGoals) = {
116134 let statsArray = if ((homeTeamGoals > awayTeamGoals))
117135 then [$Tuple7(1, 1, 0, 0, homeTeamGoals, awayTeamGoals, 3), $Tuple7(1, 0, 0, 1, awayTeamGoals, homeTeamGoals, 0)]
118136 else if ((awayTeamGoals > homeTeamGoals))
119137 then [$Tuple7(1, 0, 0, 1, homeTeamGoals, awayTeamGoals, 0), $Tuple7(1, 1, 0, 0, awayTeamGoals, homeTeamGoals, 3)]
120138 else [$Tuple7(1, 0, 1, 0, homeTeamGoals, awayTeamGoals, 1), $Tuple7(1, 0, 1, 0, awayTeamGoals, homeTeamGoals, 1)]
121139 let homeTeamDiff = statsArray[0]
122140 let awayTeamDiff = statsArray[1]
123141 [updateSingleTeamStats(homeTeamCode, homeTeamDiff), updateSingleTeamStats(awayTeamCode, awayTeamDiff)]
124142 }
125143
126144
127145 func updateTeamsCapsAndRisks (homeTeamCode,awayTeamCode,homeTeamGoals,awayTeamGoals) = {
128146 let homeTeamRound = readTeamRnd(homeTeamCode)
129147 let awayTeamRound = readTeamRnd(awayTeamCode)
130148 if ((homeTeamRound != awayTeamRound))
131149 then throw("Teams rounds are not equals")
132150 else {
133151 let homeRisksKey = keyTeamRisks(homeTeamCode)
134152 let homeRisksDat = split(getStr(this, homeRisksKey, dataTeamRisks("0", "0", "0", "0")), S)
135153 let awayRisksKey = keyTeamRisks(awayTeamCode)
136154 let awayRisksDat = split(getStr(this, awayRisksKey, dataTeamRisks("0", "0", "0", "0")), S)
137155 let homeRisk = parseIntValue(homeRisksDat[homeTeamRound])
138156 let awayRisk = parseIntValue(awayRisksDat[awayTeamRound])
139157 let homeCapKey = keyTeamCap(homeTeamCode)
140158 let homeCap = getIntOrFail(this, homeCapKey)
141159 let awayCapKey = keyTeamCap(awayTeamCode)
142160 let awayCap = getIntOrFail(this, awayCapKey)
143161 let diff = if ((homeTeamGoals > awayTeamGoals))
144162 then [$Tuple2((homeRisk + awayRisk), awayRisk), $Tuple2(0, -(awayRisk))]
145163 else if ((awayTeamGoals > homeTeamGoals))
146164 then [$Tuple2(0, -(homeRisk)), $Tuple2((homeRisk + awayRisk), homeRisk)]
147165 else [$Tuple2(homeRisk, 0), $Tuple2(awayRisk, 0)]
148166 let homeDiff = diff[0]
149167 let awayDiff = diff[1]
150168 func refreshTeamRiskOnMatchPlayed (data,round,risk4diff) = {
151169 let risk1 = if ((1 == round))
152170 then "0"
153171 else data[1]
154172 let risk2 = if ((2 == round))
155173 then "0"
156174 else data[2]
157175 let risk3 = if ((3 == round))
158176 then "0"
159177 else data[3]
160178 let risk4 = toString((parseIntValue(data[4]) + risk4diff))
161179 dataTeamRisks(risk1, risk2, risk3, risk4)
162180 }
163181
164182 [StringEntry(homeRisksKey, refreshTeamRiskOnMatchPlayed(homeRisksDat, homeTeamRound, homeDiff._1)), StringEntry(awayRisksKey, refreshTeamRiskOnMatchPlayed(awayRisksDat, awayTeamRound, awayDiff._1)), IntegerEntry(homeCapKey, (homeCap + homeDiff._2)), IntegerEntry(awayCapKey, (awayCap + awayDiff._2))]
165183 }
166184 }
167185
168186
187+let GHCLAIMED = "CLAIMED"
188+
189+let GHPENDING = "PENDING"
190+
191+func keyGoldenHourStart (roundNum) = ("%s%d__goldenHourStart__" + toString(roundNum))
192+
193+
194+func keyGoldenHourEnd (roundNum) = ("%s%d__goldenHourEnd__" + toString(roundNum))
195+
196+
197+func keyGoldenHourRandomOn (roundNum) = ("%s%d__goldenHourRandomOn__" + toString(roundNum))
198+
199+
200+func keyGoldenHourRoundNum () = "%s__goldenHourRoundNum"
201+
202+
203+func keyGoldenHourTicketOwner (roundNum,ticketNum) = makeString(["%s%d%d__goldenHourTicketOwner", toString(roundNum), toString(ticketNum)], S)
204+
205+
206+func keyGoldenHourAllTickets (roundNum) = ("%s%d__goldenHourAllTickets__" + toString(roundNum))
207+
208+
209+func keyGoldenHourPlayerNum (roundNum) = makeString(["%s%d__goldenHourPlayerNum", toString(roundNum)], S)
210+
211+
212+func keyGoldenHourPlayer (roundNum,player) = makeString(["%s%d%s__goldenHourPlayer", toString(roundNum), player], S)
213+
214+
215+func dataGoldenHourPlayer (amt,status) = makeString(["%d%s", toString(amt), status], S)
216+
217+
218+func generateGoldenHourTickets (player,pmt) = {
219+ let roundNum = getInt(this, keyGoldenHourRoundNum(), 0)
220+ let roundStart = getInt(this, keyGoldenHourStart(roundNum), 0)
221+ let roundEnd = getInt(this, keyGoldenHourEnd(roundNum), 0)
222+ if (if ((roundStart > height))
223+ then true
224+ else (height >= roundEnd))
225+ then nil
226+ else {
227+ let ticketCost = 5000000
228+ let ticketsIdxs = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
229+ let ticketsTmp = (pmt / ticketCost)
230+ let ticketsCount = if ((ticketsTmp > size(ticketsIdxs)))
231+ then size(ticketsIdxs)
232+ else ticketsTmp
233+ let lastTicketNumKey = keyGoldenHourPlayerNum(roundNum)
234+ let lastTicketNum = getInt(this, lastTicketNumKey, 0)
235+ let lastTicketNumNew = (lastTicketNum + ticketsCount)
236+ func genTickets (genData,next) = {
237+ let ticketNum = (lastTicketNum + next)
238+ let entries = genData._1
239+ let ticketsAll = genData._2
240+ if ((ticketNum >= lastTicketNumNew))
241+ then genData
242+ else $Tuple2((entries :+ StringEntry(keyGoldenHourTicketOwner(roundNum, ticketNum), player)), makeString_2C([ticketsAll, toString(ticketNum), S2], ""))
243+ }
244+
245+ let data = {
246+ let $l = ticketsIdxs
247+ let $s = size($l)
248+ let $acc0 = $Tuple2(nil, "")
249+ func $f0_1 ($a,$i) = if (($i >= $s))
250+ then $a
251+ else genTickets($a, $l[$i])
252+
253+ func $f0_2 ($a,$i) = if (($i >= $s))
254+ then $a
255+ else throw("List size exceeds 20")
256+
257+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
258+ }
259+ let slot2userEntries = data._1
260+ let allTicketsTail = data._2
261+ let allTicketsKey = keyGoldenHourAllTickets(roundNum)
262+ let allTickets = getStr(this, allTicketsKey, "")
263+ (((slot2userEntries :+ IntegerEntry(lastTicketNumKey, lastTicketNumNew)) :+ StringEntry(keyGoldenHourPlayer(roundNum, player), dataGoldenHourPlayer(0, GHPENDING))) :+ StringEntry(allTicketsKey, (allTickets + allTicketsTail)))
264+ }
265+ }
266+
267+
169268 @Callable(i)
170269 func init (priceAssetId) = {
171270 let checks = [isMe(i)]
172271 if ((checks == checks))
173272 then [StringEntry(keyCfgPriceAssetId(), priceAssetId)]
174273 else throw("Strict value is not equal to itself.")
175274 }
176275
177276
178277
179278 @Callable(i)
180279 func buyTeam (teamCode) = {
181280 let user = toString(i.caller)
182281 let pmt = i.payments[0]
183282 let pmtAmt = pmt.amount
184283 let pmtAssetId = pmt.assetId
185284 if ((size(i.payments) != 1))
186285 then throw("1 payment is expected")
187286 else if ((pmtAssetId != usdnId))
188287 then throw("invalid payment asset id")
189288 else {
190289 let teamSchedule = getStrOrFail(this, keyTeamSchedule(teamCode))
191290 let round = readTeamRnd(teamCode)
192291 let matchTimestamp = parseIntValue(split(teamSchedule, S)[round])
193292 if ((((10 * 60) * 1000) > (matchTimestamp - lastBlock.timestamp)))
194293 then throw("Impossible to buy share - match is in progress. Please wait score finalization")
195294 else {
196295 let teamCap = getIntOrFail(this, keyTeamCap(teamCode))
197296 let teamTkn = getIntOrFail(this, keyTeamTkn(teamCode))
198297 let price = if ((teamTkn != 0))
199298 then fraction(teamCap, DEC, teamTkn)
200299 else DEC
201300 let teamTknForUser = fraction(pmtAmt, DEC, price)
202-[IntegerEntry(keyTeamCap(teamCode), (teamCap + pmtAmt)), IntegerEntry(keyTeamTkn(teamCode), (teamTkn + teamTknForUser)), updateUserShareInTeam(user, teamCode, teamTknForUser, pmtAmt), updateTeamRiskOnBuy(teamCode, pmtAmt)]
301+ ([IntegerEntry(keyTeamCap(teamCode), (teamCap + pmtAmt)), IntegerEntry(keyTeamTkn(teamCode), (teamTkn + teamTknForUser)), updateUserShareInTeam(user, teamCode, teamTknForUser, pmtAmt), updateTeamRiskOnBuy(teamCode, pmtAmt)] ++ generateGoldenHourTickets(user, pmtAmt))
203302 }
204303 }
205304 }
206305
207306
208307
209308 @Callable(i)
210309 func score (round,homeTeamCode,awayTeamCode,homeTeamGoals,awayTeamGoals) = {
211310 let checks = [isMe(i)]
212311 if ((checks == checks))
213312 then {
214313 let key = keyMatch(round, homeTeamCode, awayTeamCode)
215314 let data = split(getStrOrFail(this, key), S)
216315 let time = parseIntValue(data[2])
217316 let status = data[3]
218317 let homeTeamRound = readTeamRnd(homeTeamCode)
219318 let awayTeamRound = readTeamRnd(awayTeamCode)
220319 if ((status != SCHEDULED))
221320 then throw("Match is not in SCHEDULED status")
222- else if ((homeTeamRound != round))
223- then throw(((("Home team's round doesn't match passed round: " + toString(round)) + " != ") + toString(homeTeamRound)))
224- else if ((awayTeamRound != round))
225- then throw(((("Away team's round doesn't match passed round: " + toString(round)) + " != ") + toString(awayTeamRound)))
226- else ((((updateBothTeamsStats(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals) ++ updateTeamsCapsAndRisks(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals)) :+ StringEntry(key, dataMatch(data, homeTeamGoals, awayTeamGoals))) :+ updateTeamRnd(homeTeamCode)) :+ updateTeamRnd(awayTeamCode))
321+ else if (((time + (((2 * 60) * 60) * 1000)) > lastBlock.timestamp))
322+ then throw("Wait 2h after match start before score update")
323+ else if ((homeTeamRound != round))
324+ then throw(((("Home team's round doesn't match passed round: " + toString(round)) + " != ") + toString(homeTeamRound)))
325+ else if ((awayTeamRound != round))
326+ then throw(((("Away team's round doesn't match passed round: " + toString(round)) + " != ") + toString(awayTeamRound)))
327+ else ((((updateBothTeamsStats(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals) ++ updateTeamsCapsAndRisks(homeTeamCode, awayTeamCode, homeTeamGoals, awayTeamGoals)) :+ StringEntry(key, dataMatch(data, homeTeamGoals, awayTeamGoals))) :+ updateTeamRnd(homeTeamCode)) :+ updateTeamRnd(awayTeamCode))
227328 }
228329 else throw("Strict value is not equal to itself.")
330+ }
331+
332+
333+
334+@Callable(i)
335+func winninjaGoldenHour100UsdnPrizeFundSchedule (blockStart) = {
336+ let durationBlocks = 60
337+ let checks = [isAdmin(i)]
338+ if ((checks == checks))
339+ then {
340+ let pmt = i.payments[0]
341+ if ((pmt.assetId != usdnId))
342+ then throw("only usdn is supported")
343+ else if ((pmt.amount != (100 * DEC)))
344+ then throw("100 usdn must be attached")
345+ else {
346+ let roundNum = (getInt(this, keyGoldenHourRoundNum(), -1) + 1)
347+ let prevEnd = getInt(this, keyGoldenHourEnd(roundNum), 0)
348+ if (((60 * 12) >= (height - prevEnd)))
349+ then throw("min duration between golden hours is 12h")
350+ else if ((height >= blockStart))
351+ then throw("blockStart is in the past")
352+ else {
353+ let blockEnd = (blockStart + durationBlocks)
354+ let randomOn = (blockEnd + 5)
355+[IntegerEntry(keyGoldenHourRoundNum(), roundNum), IntegerEntry(keyGoldenHourStart(roundNum), blockStart), IntegerEntry(keyGoldenHourEnd(roundNum), blockEnd), IntegerEntry(keyGoldenHourRandomOn(roundNum), randomOn)]
356+ }
357+ }
358+ }
359+ else throw("Strict value is not equal to itself.")
360+ }
361+
362+
363+
364+@Callable(i)
365+func winninjaGoldenHour100UsdnPrizeFundGenerateRandom () = {
366+ let winAmtMain = 50000000
367+ let winAmtSecond = 5000000
368+ let roundNum = getIntOrFail(this, keyGoldenHourRoundNum())
369+ let randomOnHeight = getIntOrFail(this, keyGoldenHourRandomOn(roundNum))
370+ if ((randomOnHeight > height))
371+ then throw((("wait " + toString(randomOnHeight)) + " to generate random"))
372+ else {
373+ let randHeight = (randomOnHeight - 2)
374+ let randHeightStr = toString(randHeight)
375+ let blockInfo = valueOrErrorMessage(blockInfoByHeight(randHeight), ("couldn't find block " + randHeightStr))
376+ let vrf = valueOrErrorMessage(blockInfo.vrf, (("block " + randHeightStr) + " doesn't support vrf"))
377+ let seed = sha256(vrf)
378+ let ticketsCount = getIntOrFail(this, keyGoldenHourPlayerNum(roundNum))
379+ let allTickets = getStrOrFail(this, keyGoldenHourAllTickets(roundNum))
380+ let randCount = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
381+ func genRands (winnersMap,nextRandOffset) = {
382+ let winnersList = winnersMap._1
383+ let amountsList = winnersMap._2
384+ let allTicketsList = winnersMap._3
385+ let randIdx = (abs(toInt(drop(seed, nextRandOffset))) % (ticketsCount - nextRandOffset))
386+ let winTicketNum = parseIntValue(allTicketsList[randIdx])
387+ let allTicketsListNew = removeByIndex(allTicketsList, randIdx)
388+ let winner = getStrOrFail(this, keyGoldenHourTicketOwner(roundNum, winTicketNum))
389+ if ((size(winnersList) == 0))
390+ then $Tuple3([winner], [winAmtMain], allTicketsListNew)
391+ else {
392+ let idxOpt = indexOf(winnersList, winner)
393+ if (!(isDefined(idxOpt)))
394+ then $Tuple3((winnersList :+ winner), (amountsList :+ winAmtSecond), allTicketsListNew)
395+ else {
396+ let idx = value(idxOpt)
397+ let amtNew = (amountsList[idx] + winAmtSecond)
398+ let winnersListNew = (removeByIndex(winnersList, idx) :+ winner)
399+ let amountsListNew = (removeByIndex(amountsList, idx) :+ amtNew)
400+ $Tuple3(winnersListNew, amountsListNew, allTicketsListNew)
401+ }
402+ }
403+ }
404+
405+ let randResults = {
406+ let $l = randCount
407+ let $s = size($l)
408+ let $acc0 = $Tuple3(nil, nil, split_51C(allTickets, S2))
409+ func $f0_1 ($a,$i) = if (($i >= $s))
410+ then $a
411+ else genRands($a, $l[$i])
412+
413+ func $f0_2 ($a,$i) = if (($i >= $s))
414+ then $a
415+ else throw("List size exceeds 11")
416+
417+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11)
418+ }
419+ let winnersListRes = randResults._1
420+ let amountsListRes = randResults._2
421+ func forEachWinner (entries,nextIdx) = if ((nextIdx > size(winnersListRes)))
422+ then {
423+ let winner = winnersListRes[nextIdx]
424+ let amt = amountsListRes[nextIdx]
425+ (entries :+ StringEntry(keyGoldenHourPlayer(roundNum, winner), dataGoldenHourPlayer(amt, GHPENDING)))
426+ }
427+ else entries
428+
429+ let $l = randCount
430+ let $s = size($l)
431+ let $acc0 = nil
432+ func $f1_1 ($a,$i) = if (($i >= $s))
433+ then $a
434+ else forEachWinner($a, $l[$i])
435+
436+ func $f1_2 ($a,$i) = if (($i >= $s))
437+ then $a
438+ else throw("List size exceeds 11")
439+
440+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11)
441+ }
442+ }
443+
444+
445+
446+@Callable(i)
447+func winninjaGoldenHour100UsdnPrizeFundClaimReward () = {
448+ let player = i.caller
449+ let playerStr = toString(player)
450+ let roundNum = getIntOrFail(this, keyGoldenHourRoundNum())
451+ let playerKEY = keyGoldenHourPlayer(roundNum, playerStr)
452+ let data = split(getStrOrFail(this, playerKEY), S)
453+ let winAmt = parseIntValue(data[1])
454+ let status = data[2]
455+ if ((0 >= winAmt))
456+ then throw("Nothing to claim")
457+ else if ((status == GHCLAIMED))
458+ then throw("Already claimed")
459+ else [StringEntry(playerKEY, dataGoldenHourPlayer(winAmt, GHCLAIMED)), ScriptTransfer(player, winAmt, usdnId)]
229460 }
230461
231462

github/deemru/w8io/026f985 
59.49 ms