tx · 6HkRXcagHDDX8LcCyv2sVnNKLp41GRsgMUEUU8K7XeKE

3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg:  -0.01900000 Waves

2023.11.27 03:32 [2861091] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves

{ "type": 13, "id": "6HkRXcagHDDX8LcCyv2sVnNKLp41GRsgMUEUU8K7XeKE", "fee": 1900000, "feeAssetId": null, "timestamp": 1701045227755, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "4LP2TbrB8KoRtRoa9CxBVVBb7vSMHfHMNzeSdZseyN1BM6X3fysUR1EdRKs1YMyBNAdVUNzzkyv2i18cx6vkRmzc" ], "script": "base64:BgI2CAISBAoCCAESAwoBARIAEgASBAoCCAESBQoDCAEBEgMKAQESABIDCgEIEgASAwoBARIDCgEBQAAITUlMTElPTjYAgIDpg7HeFgAJREFZTUlMTElTAIC4mSkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQRhZGRyCQCsAgICGGFjcmVzU3Rha2VkQW1vdW50QnlVc2VyXwUEYWRkcgEaa2V5QWNyZXNMb2NrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNMb2NrZWRBbW91bnRCeVVzZXJfBQRhZGRyARdrZXlBY3Jlc0xvY2tlZEV0YUJ5VXNlcgEEYWRkcgkArAICAhVhY3Jlc0xvY2tlZEV0YUJ5VXNlcl8FBGFkZHIAE2FjcmVzU3Rha2VkVG90YWxLZXkCFmFjcmVzU3Rha2VkQW1vdW50VG90YWwACnhwTmV3U0xhbmQAwJaxAgAPREFJTFlSRVNCWVBJRUNFAID40gEAFVVTRFQyQUNSRVNfTVVMVElQTElFUgAKARprZXlJc0F3YXJkZWRCeVByb21vQW5kVXNlcgIHcHJvbW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JGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBCnNpbmdsZURyYXcCBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECFExpc3Qgc2l6ZSBleGNlZWRzIDIwCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAkAlAoCCQDMCAIJAQtEZWxldGVFbnRyeQEFCWZpbmlzaEtleQkAzAgCCQELU3RyaW5nRW50cnkCCQEUa2V5UHJvbW8yTWFwRm9yUm91bmQBCQBkAgUHcm91bmRJZAABCAUFZHJhd3MCXzMJAMwIAgkBDEludGVnZXJFbnRyeQIJAR5rZXlUaWNrZXRzVG90YWxCeVByb21vQW5kUm91bmQCAAIJAGQCBQdyb3VuZElkAAEIBQVkcmF3cwJfMQUDbmlsCAUFZHJhd3MCXzQAvv6RLw==", "height": 2861091, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Amj5RL6rhLAdkb3chBndRjcga93XYgq4KYd4mNSSQF2D Next: BcjVGK9XNUNfKa5FCwowKVrUrKFVDTcprMyhoLo5JKto Diff:
OldNewDifferences
2828 func keyTicketsTotalByPromo (promoId) = ("%s%d__ticketsTotalByPromo__" + toString(promoId))
2929
3030
31+func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__")
32+
33+
3134 let chain = take(drop(this.bytes, 1), 1)
3235
3336 let usdtAssetId = match chain {
5053
5154 let promo2MapKey = "promo2Map"
5255
56+func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId))
57+
58+
5359 let SEP = "__"
5460
5561 let MULT6 = 1000000
5662
5763 let MULT8 = 100000000
64+
65+let ITER20 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
5866
5967 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
6068
102110
103111 let IdxEffTotal = 0
104112
113+let randomDelay = 2
114+
115+func keyCommit (address) = ("finishBlockFor_" + address)
116+
117+
105118 func keyResProportions () = "resTypesProportions"
106119
107120
122135 case _ =>
123136 throw("fail to cast into (Int, Int)")
124137 }
138+
139+
140+func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
125141
126142
127143 func getVotingPower (userAddrStrOrEmpty) = {
162178 }
163179
164180
181+func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue))
182+ then throw("maxValue should be > 0")
183+ else {
184+ let randomHash = sha256((salt + entropy))
185+ (toInt(randomHash) % maxValue)
186+ }
187+
188+
165189 let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000
166190
167191 let BLACKLISTED1 = "3P2NGX4Q5nge1MCauwQW5aqYLdkccSGj1Ep_3P2xFAHW9yhyNohYozWd4HFhEXZu3bsNSoR_3P2yKaZ2gvn9Xe5tti81a7P9LZhHgjvToV9_3P37zQ3cf2ecu55RmJqEiGSivdzN9avt3m9_3P4az6dtzsvGCWFAxa94UdevKzXyEwxEiFG_3P4kZU6X3TTLFcSUe55JSy8BySqitcPgMBz_3P5hCxBEh3NgNizZhNBreyBSqtbhJYLkKPD_3P7HLvucy11yxyMJUwjzXFHHKMEDwi1EwfC_3P8JuaqH9PTQAv8D5HBGgQfKauLTYt2NQft_3P9gTDB4rtDEVbpX3asU63H4Zinh2EnTmZE_3P9iN3qrtfJicUVy7amZeVsetVD3vUMk8be_3PCa2BsAa6JBLirszQfV5r9fJrujfhwtwfP_3PD3i4XN8KtygcFx4ry5M7UGqdfH8VYvtRT_3PDEMnnJNc2kx9cPEmvVvhXUr8SvhANKhsa_3PDGE9tKQizaeZFeDDq5aYSv89nwYbfirpZ_3PDMKQTCrUPZECVXEJJ8m1sHtutSu1naSf1_3PGh2Qu6Yvx8GTCRRVNvBUVZLdaidYSaxo5_3PKkmAtbSK5D2hQdo1RfEg8eXyMbDcRUc92_3PLMnbxzssP8W8E8XjJ1RLBBg8UZL8Cz3P2_3PMuxo4PCAox9s4a7R1eszh4iqqu8gS7jHv_3PNrMtEQChw87WZU1JAJ7aGHykCa8TjnDNK_3PPuBXfWoBy3EEory7c7vgi9Usjka7o5tBj_3PQwyeyEhT4Y6aGAL6tg73aQWJtV1zRt3nR_3PRGDShuMGb84MJtTJvtTg8qDfswkYWcm3e"
185209 then 1700496000000
186210 else throw("Unknown chain")
187211 }
212+
213+let promo2NumPrizesPerRound = [1, 3, 5, 20]
214+
215+let promo2AwardPerRound = [500000000, 200000000, 100000000, 20000000]
188216
189217 func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr)
190218
481509 let acresAmount = parseIntValue(take(drop(parts[1], 1), 14))
482510 let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO)
483511 let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0)
484- let $t01207712417 = if ((totalTikets == 0))
512+ let $t01234912789 = if ((totalTikets == 0))
485513 then {
486- func countTickets (acc,el) = (acc + parseIntValue(split(el, ":")[1]))
514+ func countTickets (acc,el) = (acc + (parseIntValue(split(el, ":")[1]) / MIN_ACRES_AMOUNT_DURING_PROMO))
487515
488516 let ticketsCount = {
489517 let $l = split_51C(promo2Map, "_")
499527
500528 $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
501529 }
502- $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount)], ticketsCount)
530+ $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount)
503531 }
504532 else $Tuple2(nil, totalTikets)
505- let ticketsActions = $t01207712417._1
506- let totalCount = $t01207712417._2
533+ let ticketsActions = $t01234912789._1
534+ let totalCount = $t01234912789._2
507535 let award = fraction(tickets, MIN_ACRES_AMOUNT_DURING_PROMO, totalCount)
508536 let stakeResult = invoke(this, "sendLockedAcres", [address, award, 30], nil)
509- $Tuple2((ticketsActions :+ BooleanEntry(awardedKey, true)), stakeResult)
537+ $Tuple2(((ticketsActions :+ BooleanEntry(awardedKey, true)) :+ StringEntry(keyPromo2MapForRound(1), promo2Map)), stakeResult)
510538 }
511539 }
512540 }
516544 }
517545
518546
547+
548+@Callable(i)
549+func commitForPromo2Round (roundId) = if ((i.caller != this))
550+ then throw("Permission denied")
551+ else if (if ((1 > roundId))
552+ then true
553+ else (roundId > 4))
554+ then throw(("Invalid roundId: " + toString(roundId)))
555+ else {
556+ let finishBlock = (height + randomDelay)
557+ $Tuple2([IntegerEntry(keyCommit(("2_" + toString(roundId))), finishBlock)], finishBlock)
558+ }
559+
560+
561+
562+@Callable(i)
563+func drawPromo2Round (roundId) = if ((i.caller != this))
564+ then throw("Permission denied")
565+ else if (if ((1 > roundId))
566+ then true
567+ else (roundId > 4))
568+ then throw(("Invalid roundId: " + toString(roundId)))
569+ else {
570+ let finishKey = keyCommit(("2_" + toString(roundId)))
571+ let finishBlock = valueOrErrorMessage(getInteger(finishKey), "You have to commitForPromo2Round(roundId) first!")
572+ if ((finishBlock > height))
573+ then throw(("Random number is not ready yet, wait until height = " + toString(finishBlock)))
574+ else {
575+ let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound(2, roundId)), 0)
576+ if ((maxValue == 0))
577+ then throw("Please call claimPromo2() at least once")
578+ else {
579+ let entropy = value(value(blockInfoByHeight(finishBlock)).vrf)
580+ let salt = i.transactionId
581+ let promo2Map = valueOrElse(getString(keyPromo2MapForRound(roundId)), "")
582+ func singleDraw (ac,j) = if ((j > promo2NumPrizesPerRound[(roundId - 1)]))
583+ then ac
584+ else {
585+ let rand = getRandomNumber(ac._1, ac._2, entropy)
586+ let promo2List = if ((ac._3 == ""))
587+ then nil
588+ else split_51C(ac._3, "_")
589+ func countTickets (acc,el) = {
590+ let parts = split(el, ":")
591+ let addr = parts[0]
592+ let tickets = (parseIntValue(parts[1]) / MIN_ACRES_AMOUNT_DURING_PROMO)
593+ let newTotal = (acc._1 + tickets)
594+ if (if ((acc._3 == ""))
595+ then (newTotal > rand)
596+ else false)
597+ then $Tuple3(newTotal, tickets, addr)
598+ else $Tuple3(newTotal, acc._2, acc._3)
599+ }
600+
601+ let r = {
602+ let $l = promo2List
603+ let $s = size($l)
604+ let $acc0 = $Tuple3(0, 0, "")
605+ func $f0_1 ($a,$i) = if (($i >= $s))
606+ then $a
607+ else countTickets($a, $l[$i])
608+
609+ func $f0_2 ($a,$i) = if (($i >= $s))
610+ then $a
611+ else throw("List size exceeds 50")
612+
613+ $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
614+ }
615+ let winner = r._3
616+ if ((winner == ""))
617+ then throw("no winner")
618+ else {
619+ let mapParts = split_51C(ac._3, winner)
620+ let newMap = (mapParts[0] + drop(mapParts[1], 15))
621+ let stakeResult = invoke(this, "sendLockedAcres", [winner, promo2AwardPerRound[(roundId - 1)], 30], nil)
622+ $Tuple4((ac._1 - r._2), fromBase58String(getStringValue(stakingContract, keyLastTxIdByUser(winner))), newMap, (ac._4 :+ stakeResult))
623+ }
624+ }
625+
626+ let draws = {
627+ let $l = ITER20
628+ let $s = size($l)
629+ let $acc0 = $Tuple4(maxValue, i.transactionId, promo2Map, nil)
630+ func $f0_1 ($a,$i) = if (($i >= $s))
631+ then $a
632+ else singleDraw($a, $l[$i])
633+
634+ func $f0_2 ($a,$i) = if (($i >= $s))
635+ then $a
636+ else throw("List size exceeds 20")
637+
638+ $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)
639+ }
640+ $Tuple2([DeleteEntry(finishKey), StringEntry(keyPromo2MapForRound((roundId + 1)), draws._3), IntegerEntry(keyTicketsTotalByPromoAndRound(2, (roundId + 1)), draws._1)], draws._4)
641+ }
642+ }
643+ }
644+
645+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MILLION6 = 100000000000000
55
66 let DAYMILLIS = 86400000
77
88 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
99
1010
1111 func keyAcresLockedAmountByUser (addr) = ("acresLockedAmountByUser_" + addr)
1212
1313
1414 func keyAcresLockedEtaByUser (addr) = ("acresLockedEtaByUser_" + addr)
1515
1616
1717 let acresStakedTotalKey = "acresStakedAmountTotal"
1818
1919 let xpNewSLand = 5000000
2020
2121 let DAILYRESBYPIECE = 3456000
2222
2323 let USDT2ACRES_MULTIPLIER = 10
2424
2525 func keyIsAwardedByPromoAndUser (promoId,addr) = makeString(["%s%d%s__isAwardedByPromoAndUser", toString(promoId), addr], "__")
2626
2727
2828 func keyTicketsTotalByPromo (promoId) = ("%s%d__ticketsTotalByPromo__" + toString(promoId))
2929
3030
31+func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__")
32+
33+
3134 let chain = take(drop(this.bytes, 1), 1)
3235
3336 let usdtAssetId = match chain {
3437 case _ =>
3538 if ((base58'2W' == $match0))
3639 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
3740 else if ((base58'2T' == $match0))
3841 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
3942 else throw("Unknown chain")
4043 }
4144
4245 let defaultRestAddressStr = match chain {
4346 case _ =>
4447 if ((base58'2W' == $match0))
4548 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
4649 else if ((base58'2T' == $match0))
4750 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
4851 else throw("Unknown chain")
4952 }
5053
5154 let promo2MapKey = "promo2Map"
5255
56+func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId))
57+
58+
5359 let SEP = "__"
5460
5561 let MULT6 = 1000000
5662
5763 let MULT8 = 100000000
64+
65+let ITER20 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
5866
5967 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
6068
6169
6270 let IdxCfgStakingDapp = 1
6371
6472 let IdxCfgEconomyDapp = 2
6573
6674 let IdxCfgWlgDapp = 4
6775
6876 let IdxCfgAcresDapp = 8
6977
7078 func keyRestCfg () = "%s__restConfig"
7179
7280
7381 func keyRestAddress () = "%s__restAddr"
7482
7583
7684 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
7785
7886
7987 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
8088
8189
8290 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
8391
8492 let restCfg = readRestCfgOrFail(restContract)
8593
8694 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
8795
8896 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
8997
9098 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
9199
92100 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
93101
94102 let acresIssuedAmountKey = "acresIssuedAmount"
95103
96104 let acresAssetIdKey = "acresAssetId"
97105
98106 let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet")
99107
100108 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
101109
102110
103111 let IdxEffTotal = 0
104112
113+let randomDelay = 2
114+
115+func keyCommit (address) = ("finishBlockFor_" + address)
116+
117+
105118 func keyResProportions () = "resTypesProportions"
106119
107120
108121 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
109122
110123
111124 func asInt (v) = match v {
112125 case n: Int =>
113126 n
114127 case _ =>
115128 throw("fail to cast into Int")
116129 }
117130
118131
119132 func asTwoIntsTuple (val) = match val {
120133 case t2: (Int, Int) =>
121134 t2
122135 case _ =>
123136 throw("fail to cast into (Int, Int)")
124137 }
138+
139+
140+func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
125141
126142
127143 func getVotingPower (userAddrStrOrEmpty) = {
128144 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
129145 func adder (acc,item) = (acc + parseIntValue(item))
130146
131147 let totalPower = {
132148 let $l = props
133149 let $s = size($l)
134150 let $acc0 = 0
135151 func $f0_1 ($a,$i) = if (($i >= $s))
136152 then $a
137153 else adder($a, $l[$i])
138154
139155 func $f0_2 ($a,$i) = if (($i >= $s))
140156 then $a
141157 else throw("List size exceeds 6")
142158
143159 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
144160 }
145161 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
146162 [totalPower, usersPower]
147163 }
148164
149165
150166 func fixedPoint (val,decimals) = {
151167 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
152168 let lowPart = toString((val % tenPow))
153169 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
154170 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
155171 }
156172
157173
158174 func padL (val,len) = {
159175 let valS = toString(val)
160176 let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1)
161177 (zeroes + valS)
162178 }
163179
164180
181+func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue))
182+ then throw("maxValue should be > 0")
183+ else {
184+ let randomHash = sha256((salt + entropy))
185+ (toInt(randomHash) % maxValue)
186+ }
187+
188+
165189 let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000
166190
167191 let BLACKLISTED1 = "3P2NGX4Q5nge1MCauwQW5aqYLdkccSGj1Ep_3P2xFAHW9yhyNohYozWd4HFhEXZu3bsNSoR_3P2yKaZ2gvn9Xe5tti81a7P9LZhHgjvToV9_3P37zQ3cf2ecu55RmJqEiGSivdzN9avt3m9_3P4az6dtzsvGCWFAxa94UdevKzXyEwxEiFG_3P4kZU6X3TTLFcSUe55JSy8BySqitcPgMBz_3P5hCxBEh3NgNizZhNBreyBSqtbhJYLkKPD_3P7HLvucy11yxyMJUwjzXFHHKMEDwi1EwfC_3P8JuaqH9PTQAv8D5HBGgQfKauLTYt2NQft_3P9gTDB4rtDEVbpX3asU63H4Zinh2EnTmZE_3P9iN3qrtfJicUVy7amZeVsetVD3vUMk8be_3PCa2BsAa6JBLirszQfV5r9fJrujfhwtwfP_3PD3i4XN8KtygcFx4ry5M7UGqdfH8VYvtRT_3PDEMnnJNc2kx9cPEmvVvhXUr8SvhANKhsa_3PDGE9tKQizaeZFeDDq5aYSv89nwYbfirpZ_3PDMKQTCrUPZECVXEJJ8m1sHtutSu1naSf1_3PGh2Qu6Yvx8GTCRRVNvBUVZLdaidYSaxo5_3PKkmAtbSK5D2hQdo1RfEg8eXyMbDcRUc92_3PLMnbxzssP8W8E8XjJ1RLBBg8UZL8Cz3P2_3PMuxo4PCAox9s4a7R1eszh4iqqu8gS7jHv_3PNrMtEQChw87WZU1JAJ7aGHykCa8TjnDNK_3PPuBXfWoBy3EEory7c7vgi9Usjka7o5tBj_3PQwyeyEhT4Y6aGAL6tg73aQWJtV1zRt3nR_3PRGDShuMGb84MJtTJvtTg8qDfswkYWcm3e"
168192
169193 let PROMO1_AMOUNT = 4970178
170194
171195 let PROMO_2_START_TIMESTAMP = match chain {
172196 case _ =>
173197 if ((base58'2W' == $match0))
174198 then 1700524800000
175199 else if ((base58'2T' == $match0))
176200 then 1700420400000
177201 else throw("Unknown chain")
178202 }
179203
180204 let PROMO_2_END_TIMESTAMP = match chain {
181205 case _ =>
182206 if ((base58'2W' == $match0))
183207 then 1701043199999
184208 else if ((base58'2T' == $match0))
185209 then 1700496000000
186210 else throw("Unknown chain")
187211 }
212+
213+let promo2NumPrizesPerRound = [1, 3, 5, 20]
214+
215+let promo2AwardPerRound = [500000000, 200000000, 100000000, 20000000]
188216
189217 func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr)
190218
191219
192220 func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
193221
194222
195223 func claimAcresInternal (addr,acresAmount,lastClaimTime) = {
196224 let deltaTime = (lastBlock.timestamp - lastClaimTime)
197225 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
198226 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
199227 let gotUsdt = max([0, canGetUsdt])
200228 (gotUsdt * USDT2ACRES_MULTIPLIER)
201229 }
202230
203231
204232 func claimInternal (addr,acresAmount,lastClaimTime) = {
205233 let deltaTime = (lastBlock.timestamp - lastClaimTime)
206234 if ((0 > deltaTime))
207235 then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp)))
208236 else {
209237 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
210238 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
211239 let gotUsdt = if ((0 >= canGetUsdt))
212240 then 0
213241 else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1
214242 (gotUsdt * USDT2ACRES_MULTIPLIER)
215243 }
216244 }
217245
218246
219247 func mergeLocked (oldAmount,oldETA,newAmount,newETA) = {
220248 let now = lastBlock.timestamp
221249 let dt1 = max([0, (oldETA - now)])
222250 let dt2 = max([0, (newETA - now)])
223251 let sum = (oldAmount + newAmount)
224252 let dt = if ((sum == 0))
225253 then 0
226254 else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum))
227255 (now + dt)
228256 }
229257
230258
231259 @Callable(i)
232260 func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this))
233261 then throw("Permission denied")
234262 else if (isDefined(getBinary(acresAssetIdKey)))
235263 then throw("Already initialized")
236264 else {
237265 let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces)
238266 let issuedAmount = (MILLION6 - (nftAcres * MULT8))
239267 let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0)
240268 let assetId = calculateAssetId(issue)
241269 [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)]
242270 }
243271
244272
245273
246274 @Callable(i)
247275 func unstakeAcres (amount) = {
248276 let prologResult = prolog()
249277 if ((prologResult == prologResult))
250278 then if ((0 >= amount))
251279 then throw("Amount should be positive")
252280 else {
253281 let address = toString(i.caller)
254282 if ((size(i.payments) != 0))
255283 then throw("No payments required")
256284 else {
257285 let timeKey = keyAcresStakedTimeByUser(address)
258286 let amountKey = keyAcresStakedAmountByUser(address)
259287 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
260288 if ((amount > oldAcresAmount))
261289 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
262290 else {
263291 let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0)
264292 let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0)
265293 let now = lastBlock.timestamp
266294 if (if ((now >= PROMO_2_START_TIMESTAMP))
267295 then (PROMO_2_END_TIMESTAMP >= now)
268296 else false)
269297 then throw("You cannot unstake ACRES during Promo2")
270298 else {
271299 let unstakableAmount = if (isBlacklistedPromo1(address))
272300 then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT)
273301 else (oldAcresAmount - lockedAmount)
274302 if (if ((lockedETA > now))
275303 then (amount > unstakableAmount)
276304 else false)
277305 then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA)))
278306 else {
279307 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
280308 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
281309 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
282310 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult))
283311 }
284312 }
285313 }
286314 }
287315 }
288316 else throw("Strict value is not equal to itself.")
289317 }
290318
291319
292320
293321 @Callable(i)
294322 func stakeAcres () = {
295323 let prologResult = prolog()
296324 if ((prologResult == prologResult))
297325 then {
298326 let address = toString(i.caller)
299327 if ((size(i.payments) != 1))
300328 then throw("exactly 1 payment must be attached")
301329 else {
302330 let pmt = i.payments[0]
303331 let amt = pmt.amount
304332 if (if (!(isDefined(pmt.assetId)))
305333 then true
306334 else (value(pmt.assetId) != acresAssetId))
307335 then throw("ACRES payments only!")
308336 else {
309337 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
310338 if ((wlgResult == wlgResult))
311339 then {
312340 let now = lastBlock.timestamp
313341 if (if ((PROMO_2_START_TIMESTAMP > now))
314342 then true
315343 else (now > PROMO_2_END_TIMESTAMP))
316344 then {
317345 let timeKey = keyAcresStakedTimeByUser(address)
318346 let amountKey = keyAcresStakedAmountByUser(address)
319347 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
320348 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
321349 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
322350 $Tuple2(((((if ((claimedAcres == 0))
323351 then nil
324352 else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
325353 }
326354 else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
327355 then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
328356 else {
329357 let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
330358 let promo2Map = valueOrElse(getString(promo2MapKey), "")
331359 let newMap2 = if (contains(promo2Map, address))
332360 then {
333361 let parts = split_51C(promo2Map, address)
334362 let oldAmount = parseIntValue(take(drop(parts[1], 1), 14))
335363 ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15))
336364 }
337365 else {
338366 let finalPart = ((address + ":") + padL(amt, 14))
339367 if ((promo2Map == ""))
340368 then finalPart
341369 else ((promo2Map + "_") + finalPart)
342370 }
343371 $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult))
344372 }
345373 }
346374 else throw("Strict value is not equal to itself.")
347375 }
348376 }
349377 }
350378 else throw("Strict value is not equal to itself.")
351379 }
352380
353381
354382
355383 @Callable(i)
356384 func buyAcres () = {
357385 let prologResult = prolog()
358386 if ((prologResult == prologResult))
359387 then {
360388 let address = toString(i.caller)
361389 if ((size(i.payments) != 1))
362390 then throw("exactly 1 payment must be attached")
363391 else {
364392 let pmt = i.payments[0]
365393 let amt = pmt.amount
366394 if (if (!(isDefined(pmt.assetId)))
367395 then true
368396 else (value(pmt.assetId) != usdtAssetId))
369397 then throw("USDT payments only!")
370398 else if ((MULT6 > amt))
371399 then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
372400 else {
373401 let acresAmount = (amt * USDT2ACRES_MULTIPLIER)
374402 let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil))
375403 $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult))
376404 }
377405 }
378406 }
379407 else throw("Strict value is not equal to itself.")
380408 }
381409
382410
383411
384412 @Callable(i)
385413 func sendAcres (addr,amount) = if ((i.caller != economyContract))
386414 then throw("Permission denied")
387415 else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount)
388416
389417
390418
391419 @Callable(i)
392420 func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this))
393421 then (i.caller != restContract)
394422 else false)
395423 then throw("Permission denied")
396424 else {
397425 let now = lastBlock.timestamp
398426 let timeKey = keyAcresStakedTimeByUser(addr)
399427 let amountKey = keyAcresStakedAmountByUser(addr)
400428 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
401429 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
402430 let oldTime = valueOrElse(getInteger(timeKey), now)
403431 let etaKey = keyAcresLockedEtaByUser(addr)
404432 let lockedAmountKey = keyAcresLockedAmountByUser(addr)
405433 let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0)
406434 let oldLockedETA = valueOrElse(getInteger(etaKey), 0)
407435 let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS)))
408436 $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount)
409437 }
410438
411439
412440
413441 @Callable(i)
414442 func burnAcres (amount) = if ((i.caller != stakingContract))
415443 then throw("Permission denied")
416444 else {
417445 let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount)
418446 if ((0 > amountLeft))
419447 then throw("Attempt to burn more ACRES, than exists")
420448 else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount)
421449 }
422450
423451
424452
425453 @Callable(i)
426454 func claimAcres () = {
427455 let prologResult = prolog()
428456 if ((prologResult == prologResult))
429457 then {
430458 let address = toString(i.caller)
431459 if ((size(i.payments) != 0))
432460 then throw("No payments required")
433461 else {
434462 let timeKey = keyAcresStakedTimeByUser(address)
435463 let amountKey = keyAcresStakedAmountByUser(address)
436464 let acresAmount = valueOrElse(getInteger(amountKey), 0)
437465 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
438466 let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0))
439467 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult))
440468 }
441469 }
442470 else throw("Strict value is not equal to itself.")
443471 }
444472
445473
446474
447475 @Callable(i)
448476 func claimAcresREADONLY (address) = {
449477 let timeKey = keyAcresStakedTimeByUser(address)
450478 let amountKey = keyAcresStakedAmountByUser(address)
451479 let acresAmount = valueOrElse(getInteger(amountKey), 0)
452480 let lastTime = valueOrElse(getInteger(timeKey), 0)
453481 let claimedAcres = claimAcresInternal(address, acresAmount, lastTime)
454482 $Tuple2(nil, [claimedAcres, lastTime])
455483 }
456484
457485
458486
459487 @Callable(i)
460488 func claimPromo2 () = {
461489 let prologResult = prolog()
462490 if ((prologResult == prologResult))
463491 then {
464492 let address = toString(i.caller)
465493 if ((size(i.payments) != 0))
466494 then throw("No payments required")
467495 else {
468496 let now = lastBlock.timestamp
469497 if ((PROMO_2_END_TIMESTAMP > now))
470498 then throw("Promo 2 is not over yet")
471499 else {
472500 let awardedKey = keyIsAwardedByPromoAndUser(2, address)
473501 if (valueOrElse(getBoolean(awardedKey), false))
474502 then throw((("Your wallet " + address) + " is already awarded in promo 2"))
475503 else {
476504 let promo2Map = valueOrElse(getString(promo2MapKey), "")
477505 if (!(contains(promo2Map, address)))
478506 then throw("You are not participant of promo 2")
479507 else {
480508 let parts = split_51C(promo2Map, address)
481509 let acresAmount = parseIntValue(take(drop(parts[1], 1), 14))
482510 let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO)
483511 let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0)
484- let $t01207712417 = if ((totalTikets == 0))
512+ let $t01234912789 = if ((totalTikets == 0))
485513 then {
486- func countTickets (acc,el) = (acc + parseIntValue(split(el, ":")[1]))
514+ func countTickets (acc,el) = (acc + (parseIntValue(split(el, ":")[1]) / MIN_ACRES_AMOUNT_DURING_PROMO))
487515
488516 let ticketsCount = {
489517 let $l = split_51C(promo2Map, "_")
490518 let $s = size($l)
491519 let $acc0 = 0
492520 func $f0_1 ($a,$i) = if (($i >= $s))
493521 then $a
494522 else countTickets($a, $l[$i])
495523
496524 func $f0_2 ($a,$i) = if (($i >= $s))
497525 then $a
498526 else throw("List size exceeds 50")
499527
500528 $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
501529 }
502- $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount)], ticketsCount)
530+ $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount)
503531 }
504532 else $Tuple2(nil, totalTikets)
505- let ticketsActions = $t01207712417._1
506- let totalCount = $t01207712417._2
533+ let ticketsActions = $t01234912789._1
534+ let totalCount = $t01234912789._2
507535 let award = fraction(tickets, MIN_ACRES_AMOUNT_DURING_PROMO, totalCount)
508536 let stakeResult = invoke(this, "sendLockedAcres", [address, award, 30], nil)
509- $Tuple2((ticketsActions :+ BooleanEntry(awardedKey, true)), stakeResult)
537+ $Tuple2(((ticketsActions :+ BooleanEntry(awardedKey, true)) :+ StringEntry(keyPromo2MapForRound(1), promo2Map)), stakeResult)
510538 }
511539 }
512540 }
513541 }
514542 }
515543 else throw("Strict value is not equal to itself.")
516544 }
517545
518546
547+
548+@Callable(i)
549+func commitForPromo2Round (roundId) = if ((i.caller != this))
550+ then throw("Permission denied")
551+ else if (if ((1 > roundId))
552+ then true
553+ else (roundId > 4))
554+ then throw(("Invalid roundId: " + toString(roundId)))
555+ else {
556+ let finishBlock = (height + randomDelay)
557+ $Tuple2([IntegerEntry(keyCommit(("2_" + toString(roundId))), finishBlock)], finishBlock)
558+ }
559+
560+
561+
562+@Callable(i)
563+func drawPromo2Round (roundId) = if ((i.caller != this))
564+ then throw("Permission denied")
565+ else if (if ((1 > roundId))
566+ then true
567+ else (roundId > 4))
568+ then throw(("Invalid roundId: " + toString(roundId)))
569+ else {
570+ let finishKey = keyCommit(("2_" + toString(roundId)))
571+ let finishBlock = valueOrErrorMessage(getInteger(finishKey), "You have to commitForPromo2Round(roundId) first!")
572+ if ((finishBlock > height))
573+ then throw(("Random number is not ready yet, wait until height = " + toString(finishBlock)))
574+ else {
575+ let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound(2, roundId)), 0)
576+ if ((maxValue == 0))
577+ then throw("Please call claimPromo2() at least once")
578+ else {
579+ let entropy = value(value(blockInfoByHeight(finishBlock)).vrf)
580+ let salt = i.transactionId
581+ let promo2Map = valueOrElse(getString(keyPromo2MapForRound(roundId)), "")
582+ func singleDraw (ac,j) = if ((j > promo2NumPrizesPerRound[(roundId - 1)]))
583+ then ac
584+ else {
585+ let rand = getRandomNumber(ac._1, ac._2, entropy)
586+ let promo2List = if ((ac._3 == ""))
587+ then nil
588+ else split_51C(ac._3, "_")
589+ func countTickets (acc,el) = {
590+ let parts = split(el, ":")
591+ let addr = parts[0]
592+ let tickets = (parseIntValue(parts[1]) / MIN_ACRES_AMOUNT_DURING_PROMO)
593+ let newTotal = (acc._1 + tickets)
594+ if (if ((acc._3 == ""))
595+ then (newTotal > rand)
596+ else false)
597+ then $Tuple3(newTotal, tickets, addr)
598+ else $Tuple3(newTotal, acc._2, acc._3)
599+ }
600+
601+ let r = {
602+ let $l = promo2List
603+ let $s = size($l)
604+ let $acc0 = $Tuple3(0, 0, "")
605+ func $f0_1 ($a,$i) = if (($i >= $s))
606+ then $a
607+ else countTickets($a, $l[$i])
608+
609+ func $f0_2 ($a,$i) = if (($i >= $s))
610+ then $a
611+ else throw("List size exceeds 50")
612+
613+ $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($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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
614+ }
615+ let winner = r._3
616+ if ((winner == ""))
617+ then throw("no winner")
618+ else {
619+ let mapParts = split_51C(ac._3, winner)
620+ let newMap = (mapParts[0] + drop(mapParts[1], 15))
621+ let stakeResult = invoke(this, "sendLockedAcres", [winner, promo2AwardPerRound[(roundId - 1)], 30], nil)
622+ $Tuple4((ac._1 - r._2), fromBase58String(getStringValue(stakingContract, keyLastTxIdByUser(winner))), newMap, (ac._4 :+ stakeResult))
623+ }
624+ }
625+
626+ let draws = {
627+ let $l = ITER20
628+ let $s = size($l)
629+ let $acc0 = $Tuple4(maxValue, i.transactionId, promo2Map, nil)
630+ func $f0_1 ($a,$i) = if (($i >= $s))
631+ then $a
632+ else singleDraw($a, $l[$i])
633+
634+ func $f0_2 ($a,$i) = if (($i >= $s))
635+ then $a
636+ else throw("List size exceeds 20")
637+
638+ $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)
639+ }
640+ $Tuple2([DeleteEntry(finishKey), StringEntry(keyPromo2MapForRound((roundId + 1)), draws._3), IntegerEntry(keyTicketsTotalByPromoAndRound(2, (roundId + 1)), draws._1)], draws._4)
641+ }
642+ }
643+ }
644+
645+

github/deemru/w8io/169f3d6 
82.84 ms