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:BgI2CAISBAoCCAESAwoBARIAEgASBAoCCAESBQoDCAEBEgMKAQESABIDCgEIEgASAwoBARIDCgEBQAAITUlMTElPTjYAgIDpg7HeFgAJREFZTUlMTElTAIC4mSkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQRhZGRyCQCsAgICGGFjcmVzU3Rha2VkQW1vdW50QnlVc2VyXwUEYWRkcgEaa2V5QWNyZXNMb2NrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNMb2NrZWRBbW91bnRCeVVzZXJfBQRhZGRyARdrZXlBY3Jlc0xvY2tlZEV0YUJ5VXNlcgEEYWRkcgkArAICAhVhY3Jlc0xvY2tlZEV0YUJ5VXNlcl8FBGFkZHIAE2FjcmVzU3Rha2VkVG90YWxLZXkCFmFjcmVzU3Rha2VkQW1vdW50VG90YWwACnhwTmV3U0xhbmQAwJaxAgAPREFJTFlSRVNCWVBJRUNFAID40gEAFVVTRFQyQUNSRVNfTVVMVElQTElFUgAKARprZXlJc0F3YXJkZWRCeVByb21vQW5kVXNlcgIHcHJvbW9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GECJGkDCQBnAgUCJGkFAiRzBQIkYQkBCnNpbmdsZURyYXcCBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECFExpc3Qgc2l6ZSBleGNlZWRzIDIwCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAkAlAoCCQDMCAIJAQtEZWxldGVFbnRyeQEFCWZpbmlzaEtleQkAzAgCCQELU3RyaW5nRW50cnkCCQEUa2V5UHJvbW8yTWFwRm9yUm91bmQBCQBkAgUHcm91bmRJZAABCAUFZHJhd3MCXzMJAMwIAgkBDEludGVnZXJFbnRyeQIJAR5rZXlUaWNrZXRzVG90YWxCeVByb21vQW5kUm91bmQCAAIJAGQCBQdyb3VuZElkAAEIBQVkcmF3cwJfMQUDbmlsCAUFZHJhd3MCXzQAvv6RLw==", "height": 2861091, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Amj5RL6rhLAdkb3chBndRjcga93XYgq4KYd4mNSSQF2D Next: BcjVGK9XNUNfKa5FCwowKVrUrKFVDTcprMyhoLo5JKto Diff:
Old | New | Differences | |
---|---|---|---|
28 | 28 | func keyTicketsTotalByPromo (promoId) = ("%s%d__ticketsTotalByPromo__" + toString(promoId)) | |
29 | 29 | ||
30 | 30 | ||
31 | + | func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__") | |
32 | + | ||
33 | + | ||
31 | 34 | let chain = take(drop(this.bytes, 1), 1) | |
32 | 35 | ||
33 | 36 | let usdtAssetId = match chain { | |
50 | 53 | ||
51 | 54 | let promo2MapKey = "promo2Map" | |
52 | 55 | ||
56 | + | func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId)) | |
57 | + | ||
58 | + | ||
53 | 59 | let SEP = "__" | |
54 | 60 | ||
55 | 61 | let MULT6 = 1000000 | |
56 | 62 | ||
57 | 63 | 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] | |
58 | 66 | ||
59 | 67 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
60 | 68 | ||
102 | 110 | ||
103 | 111 | let IdxEffTotal = 0 | |
104 | 112 | ||
113 | + | let randomDelay = 2 | |
114 | + | ||
115 | + | func keyCommit (address) = ("finishBlockFor_" + address) | |
116 | + | ||
117 | + | ||
105 | 118 | func keyResProportions () = "resTypesProportions" | |
106 | 119 | ||
107 | 120 | ||
122 | 135 | case _ => | |
123 | 136 | throw("fail to cast into (Int, Int)") | |
124 | 137 | } | |
138 | + | ||
139 | + | ||
140 | + | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
125 | 141 | ||
126 | 142 | ||
127 | 143 | func getVotingPower (userAddrStrOrEmpty) = { | |
162 | 178 | } | |
163 | 179 | ||
164 | 180 | ||
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 | + | ||
165 | 189 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
166 | 190 | ||
167 | 191 | 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" | |
185 | 209 | then 1700496000000 | |
186 | 210 | else throw("Unknown chain") | |
187 | 211 | } | |
212 | + | ||
213 | + | let promo2NumPrizesPerRound = [1, 3, 5, 20] | |
214 | + | ||
215 | + | let promo2AwardPerRound = [500000000, 200000000, 100000000, 20000000] | |
188 | 216 | ||
189 | 217 | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
190 | 218 | ||
481 | 509 | let acresAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
482 | 510 | let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO) | |
483 | 511 | let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0) | |
484 | - | let $ | |
512 | + | let $t01234912789 = if ((totalTikets == 0)) | |
485 | 513 | 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)) | |
487 | 515 | ||
488 | 516 | let ticketsCount = { | |
489 | 517 | let $l = split_51C(promo2Map, "_") | |
499 | 527 | ||
500 | 528 | $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) | |
501 | 529 | } | |
502 | - | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount)], ticketsCount) | |
530 | + | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount) | |
503 | 531 | } | |
504 | 532 | else $Tuple2(nil, totalTikets) | |
505 | - | let ticketsActions = $ | |
506 | - | let totalCount = $ | |
533 | + | let ticketsActions = $t01234912789._1 | |
534 | + | let totalCount = $t01234912789._2 | |
507 | 535 | let award = fraction(tickets, MIN_ACRES_AMOUNT_DURING_PROMO, totalCount) | |
508 | 536 | 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) | |
510 | 538 | } | |
511 | 539 | } | |
512 | 540 | } | |
516 | 544 | } | |
517 | 545 | ||
518 | 546 | ||
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 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MILLION6 = 100000000000000 | |
5 | 5 | ||
6 | 6 | let DAYMILLIS = 86400000 | |
7 | 7 | ||
8 | 8 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func keyAcresLockedAmountByUser (addr) = ("acresLockedAmountByUser_" + addr) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyAcresLockedEtaByUser (addr) = ("acresLockedEtaByUser_" + addr) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | let acresStakedTotalKey = "acresStakedAmountTotal" | |
18 | 18 | ||
19 | 19 | let xpNewSLand = 5000000 | |
20 | 20 | ||
21 | 21 | let DAILYRESBYPIECE = 3456000 | |
22 | 22 | ||
23 | 23 | let USDT2ACRES_MULTIPLIER = 10 | |
24 | 24 | ||
25 | 25 | func keyIsAwardedByPromoAndUser (promoId,addr) = makeString(["%s%d%s__isAwardedByPromoAndUser", toString(promoId), addr], "__") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func keyTicketsTotalByPromo (promoId) = ("%s%d__ticketsTotalByPromo__" + toString(promoId)) | |
29 | 29 | ||
30 | 30 | ||
31 | + | func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__") | |
32 | + | ||
33 | + | ||
31 | 34 | let chain = take(drop(this.bytes, 1), 1) | |
32 | 35 | ||
33 | 36 | let usdtAssetId = match chain { | |
34 | 37 | case _ => | |
35 | 38 | if ((base58'2W' == $match0)) | |
36 | 39 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
37 | 40 | else if ((base58'2T' == $match0)) | |
38 | 41 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
39 | 42 | else throw("Unknown chain") | |
40 | 43 | } | |
41 | 44 | ||
42 | 45 | let defaultRestAddressStr = match chain { | |
43 | 46 | case _ => | |
44 | 47 | if ((base58'2W' == $match0)) | |
45 | 48 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
46 | 49 | else if ((base58'2T' == $match0)) | |
47 | 50 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
48 | 51 | else throw("Unknown chain") | |
49 | 52 | } | |
50 | 53 | ||
51 | 54 | let promo2MapKey = "promo2Map" | |
52 | 55 | ||
56 | + | func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId)) | |
57 | + | ||
58 | + | ||
53 | 59 | let SEP = "__" | |
54 | 60 | ||
55 | 61 | let MULT6 = 1000000 | |
56 | 62 | ||
57 | 63 | 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] | |
58 | 66 | ||
59 | 67 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
60 | 68 | ||
61 | 69 | ||
62 | 70 | let IdxCfgStakingDapp = 1 | |
63 | 71 | ||
64 | 72 | let IdxCfgEconomyDapp = 2 | |
65 | 73 | ||
66 | 74 | let IdxCfgWlgDapp = 4 | |
67 | 75 | ||
68 | 76 | let IdxCfgAcresDapp = 8 | |
69 | 77 | ||
70 | 78 | func keyRestCfg () = "%s__restConfig" | |
71 | 79 | ||
72 | 80 | ||
73 | 81 | func keyRestAddress () = "%s__restAddr" | |
74 | 82 | ||
75 | 83 | ||
76 | 84 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
77 | 85 | ||
78 | 86 | ||
79 | 87 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
80 | 88 | ||
81 | 89 | ||
82 | 90 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
83 | 91 | ||
84 | 92 | let restCfg = readRestCfgOrFail(restContract) | |
85 | 93 | ||
86 | 94 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
87 | 95 | ||
88 | 96 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
89 | 97 | ||
90 | 98 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
91 | 99 | ||
92 | 100 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
93 | 101 | ||
94 | 102 | let acresIssuedAmountKey = "acresIssuedAmount" | |
95 | 103 | ||
96 | 104 | let acresAssetIdKey = "acresAssetId" | |
97 | 105 | ||
98 | 106 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
99 | 107 | ||
100 | 108 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
101 | 109 | ||
102 | 110 | ||
103 | 111 | let IdxEffTotal = 0 | |
104 | 112 | ||
113 | + | let randomDelay = 2 | |
114 | + | ||
115 | + | func keyCommit (address) = ("finishBlockFor_" + address) | |
116 | + | ||
117 | + | ||
105 | 118 | func keyResProportions () = "resTypesProportions" | |
106 | 119 | ||
107 | 120 | ||
108 | 121 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
109 | 122 | ||
110 | 123 | ||
111 | 124 | func asInt (v) = match v { | |
112 | 125 | case n: Int => | |
113 | 126 | n | |
114 | 127 | case _ => | |
115 | 128 | throw("fail to cast into Int") | |
116 | 129 | } | |
117 | 130 | ||
118 | 131 | ||
119 | 132 | func asTwoIntsTuple (val) = match val { | |
120 | 133 | case t2: (Int, Int) => | |
121 | 134 | t2 | |
122 | 135 | case _ => | |
123 | 136 | throw("fail to cast into (Int, Int)") | |
124 | 137 | } | |
138 | + | ||
139 | + | ||
140 | + | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
125 | 141 | ||
126 | 142 | ||
127 | 143 | func getVotingPower (userAddrStrOrEmpty) = { | |
128 | 144 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
129 | 145 | func adder (acc,item) = (acc + parseIntValue(item)) | |
130 | 146 | ||
131 | 147 | let totalPower = { | |
132 | 148 | let $l = props | |
133 | 149 | let $s = size($l) | |
134 | 150 | let $acc0 = 0 | |
135 | 151 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
136 | 152 | then $a | |
137 | 153 | else adder($a, $l[$i]) | |
138 | 154 | ||
139 | 155 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
140 | 156 | then $a | |
141 | 157 | else throw("List size exceeds 6") | |
142 | 158 | ||
143 | 159 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
144 | 160 | } | |
145 | 161 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
146 | 162 | [totalPower, usersPower] | |
147 | 163 | } | |
148 | 164 | ||
149 | 165 | ||
150 | 166 | func fixedPoint (val,decimals) = { | |
151 | 167 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
152 | 168 | let lowPart = toString((val % tenPow)) | |
153 | 169 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
154 | 170 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
155 | 171 | } | |
156 | 172 | ||
157 | 173 | ||
158 | 174 | func padL (val,len) = { | |
159 | 175 | let valS = toString(val) | |
160 | 176 | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
161 | 177 | (zeroes + valS) | |
162 | 178 | } | |
163 | 179 | ||
164 | 180 | ||
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 | + | ||
165 | 189 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
166 | 190 | ||
167 | 191 | 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" | |
168 | 192 | ||
169 | 193 | let PROMO1_AMOUNT = 4970178 | |
170 | 194 | ||
171 | 195 | let PROMO_2_START_TIMESTAMP = match chain { | |
172 | 196 | case _ => | |
173 | 197 | if ((base58'2W' == $match0)) | |
174 | 198 | then 1700524800000 | |
175 | 199 | else if ((base58'2T' == $match0)) | |
176 | 200 | then 1700420400000 | |
177 | 201 | else throw("Unknown chain") | |
178 | 202 | } | |
179 | 203 | ||
180 | 204 | let PROMO_2_END_TIMESTAMP = match chain { | |
181 | 205 | case _ => | |
182 | 206 | if ((base58'2W' == $match0)) | |
183 | 207 | then 1701043199999 | |
184 | 208 | else if ((base58'2T' == $match0)) | |
185 | 209 | then 1700496000000 | |
186 | 210 | else throw("Unknown chain") | |
187 | 211 | } | |
212 | + | ||
213 | + | let promo2NumPrizesPerRound = [1, 3, 5, 20] | |
214 | + | ||
215 | + | let promo2AwardPerRound = [500000000, 200000000, 100000000, 20000000] | |
188 | 216 | ||
189 | 217 | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
190 | 218 | ||
191 | 219 | ||
192 | 220 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
193 | 221 | ||
194 | 222 | ||
195 | 223 | func claimAcresInternal (addr,acresAmount,lastClaimTime) = { | |
196 | 224 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
197 | 225 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
198 | 226 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
199 | 227 | let gotUsdt = max([0, canGetUsdt]) | |
200 | 228 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
201 | 229 | } | |
202 | 230 | ||
203 | 231 | ||
204 | 232 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
205 | 233 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
206 | 234 | if ((0 > deltaTime)) | |
207 | 235 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
208 | 236 | else { | |
209 | 237 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
210 | 238 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
211 | 239 | let gotUsdt = if ((0 >= canGetUsdt)) | |
212 | 240 | then 0 | |
213 | 241 | else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
214 | 242 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
215 | 243 | } | |
216 | 244 | } | |
217 | 245 | ||
218 | 246 | ||
219 | 247 | func mergeLocked (oldAmount,oldETA,newAmount,newETA) = { | |
220 | 248 | let now = lastBlock.timestamp | |
221 | 249 | let dt1 = max([0, (oldETA - now)]) | |
222 | 250 | let dt2 = max([0, (newETA - now)]) | |
223 | 251 | let sum = (oldAmount + newAmount) | |
224 | 252 | let dt = if ((sum == 0)) | |
225 | 253 | then 0 | |
226 | 254 | else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum)) | |
227 | 255 | (now + dt) | |
228 | 256 | } | |
229 | 257 | ||
230 | 258 | ||
231 | 259 | @Callable(i) | |
232 | 260 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
233 | 261 | then throw("Permission denied") | |
234 | 262 | else if (isDefined(getBinary(acresAssetIdKey))) | |
235 | 263 | then throw("Already initialized") | |
236 | 264 | else { | |
237 | 265 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
238 | 266 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
239 | 267 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
240 | 268 | let assetId = calculateAssetId(issue) | |
241 | 269 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
242 | 270 | } | |
243 | 271 | ||
244 | 272 | ||
245 | 273 | ||
246 | 274 | @Callable(i) | |
247 | 275 | func unstakeAcres (amount) = { | |
248 | 276 | let prologResult = prolog() | |
249 | 277 | if ((prologResult == prologResult)) | |
250 | 278 | then if ((0 >= amount)) | |
251 | 279 | then throw("Amount should be positive") | |
252 | 280 | else { | |
253 | 281 | let address = toString(i.caller) | |
254 | 282 | if ((size(i.payments) != 0)) | |
255 | 283 | then throw("No payments required") | |
256 | 284 | else { | |
257 | 285 | let timeKey = keyAcresStakedTimeByUser(address) | |
258 | 286 | let amountKey = keyAcresStakedAmountByUser(address) | |
259 | 287 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
260 | 288 | if ((amount > oldAcresAmount)) | |
261 | 289 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
262 | 290 | else { | |
263 | 291 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
264 | 292 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
265 | 293 | let now = lastBlock.timestamp | |
266 | 294 | if (if ((now >= PROMO_2_START_TIMESTAMP)) | |
267 | 295 | then (PROMO_2_END_TIMESTAMP >= now) | |
268 | 296 | else false) | |
269 | 297 | then throw("You cannot unstake ACRES during Promo2") | |
270 | 298 | else { | |
271 | 299 | let unstakableAmount = if (isBlacklistedPromo1(address)) | |
272 | 300 | then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT) | |
273 | 301 | else (oldAcresAmount - lockedAmount) | |
274 | 302 | if (if ((lockedETA > now)) | |
275 | 303 | then (amount > unstakableAmount) | |
276 | 304 | else false) | |
277 | 305 | then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA))) | |
278 | 306 | else { | |
279 | 307 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
280 | 308 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
281 | 309 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
282 | 310 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
283 | 311 | } | |
284 | 312 | } | |
285 | 313 | } | |
286 | 314 | } | |
287 | 315 | } | |
288 | 316 | else throw("Strict value is not equal to itself.") | |
289 | 317 | } | |
290 | 318 | ||
291 | 319 | ||
292 | 320 | ||
293 | 321 | @Callable(i) | |
294 | 322 | func stakeAcres () = { | |
295 | 323 | let prologResult = prolog() | |
296 | 324 | if ((prologResult == prologResult)) | |
297 | 325 | then { | |
298 | 326 | let address = toString(i.caller) | |
299 | 327 | if ((size(i.payments) != 1)) | |
300 | 328 | then throw("exactly 1 payment must be attached") | |
301 | 329 | else { | |
302 | 330 | let pmt = i.payments[0] | |
303 | 331 | let amt = pmt.amount | |
304 | 332 | if (if (!(isDefined(pmt.assetId))) | |
305 | 333 | then true | |
306 | 334 | else (value(pmt.assetId) != acresAssetId)) | |
307 | 335 | then throw("ACRES payments only!") | |
308 | 336 | else { | |
309 | 337 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
310 | 338 | if ((wlgResult == wlgResult)) | |
311 | 339 | then { | |
312 | 340 | let now = lastBlock.timestamp | |
313 | 341 | if (if ((PROMO_2_START_TIMESTAMP > now)) | |
314 | 342 | then true | |
315 | 343 | else (now > PROMO_2_END_TIMESTAMP)) | |
316 | 344 | then { | |
317 | 345 | let timeKey = keyAcresStakedTimeByUser(address) | |
318 | 346 | let amountKey = keyAcresStakedAmountByUser(address) | |
319 | 347 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
320 | 348 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
321 | 349 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
322 | 350 | $Tuple2(((((if ((claimedAcres == 0)) | |
323 | 351 | then nil | |
324 | 352 | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
325 | 353 | } | |
326 | 354 | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
327 | 355 | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
328 | 356 | else { | |
329 | 357 | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
330 | 358 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
331 | 359 | let newMap2 = if (contains(promo2Map, address)) | |
332 | 360 | then { | |
333 | 361 | let parts = split_51C(promo2Map, address) | |
334 | 362 | let oldAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
335 | 363 | ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15)) | |
336 | 364 | } | |
337 | 365 | else { | |
338 | 366 | let finalPart = ((address + ":") + padL(amt, 14)) | |
339 | 367 | if ((promo2Map == "")) | |
340 | 368 | then finalPart | |
341 | 369 | else ((promo2Map + "_") + finalPart) | |
342 | 370 | } | |
343 | 371 | $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult)) | |
344 | 372 | } | |
345 | 373 | } | |
346 | 374 | else throw("Strict value is not equal to itself.") | |
347 | 375 | } | |
348 | 376 | } | |
349 | 377 | } | |
350 | 378 | else throw("Strict value is not equal to itself.") | |
351 | 379 | } | |
352 | 380 | ||
353 | 381 | ||
354 | 382 | ||
355 | 383 | @Callable(i) | |
356 | 384 | func buyAcres () = { | |
357 | 385 | let prologResult = prolog() | |
358 | 386 | if ((prologResult == prologResult)) | |
359 | 387 | then { | |
360 | 388 | let address = toString(i.caller) | |
361 | 389 | if ((size(i.payments) != 1)) | |
362 | 390 | then throw("exactly 1 payment must be attached") | |
363 | 391 | else { | |
364 | 392 | let pmt = i.payments[0] | |
365 | 393 | let amt = pmt.amount | |
366 | 394 | if (if (!(isDefined(pmt.assetId))) | |
367 | 395 | then true | |
368 | 396 | else (value(pmt.assetId) != usdtAssetId)) | |
369 | 397 | then throw("USDT payments only!") | |
370 | 398 | else if ((MULT6 > amt)) | |
371 | 399 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
372 | 400 | else { | |
373 | 401 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
374 | 402 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
375 | 403 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
376 | 404 | } | |
377 | 405 | } | |
378 | 406 | } | |
379 | 407 | else throw("Strict value is not equal to itself.") | |
380 | 408 | } | |
381 | 409 | ||
382 | 410 | ||
383 | 411 | ||
384 | 412 | @Callable(i) | |
385 | 413 | func sendAcres (addr,amount) = if ((i.caller != economyContract)) | |
386 | 414 | then throw("Permission denied") | |
387 | 415 | else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount) | |
388 | 416 | ||
389 | 417 | ||
390 | 418 | ||
391 | 419 | @Callable(i) | |
392 | 420 | func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this)) | |
393 | 421 | then (i.caller != restContract) | |
394 | 422 | else false) | |
395 | 423 | then throw("Permission denied") | |
396 | 424 | else { | |
397 | 425 | let now = lastBlock.timestamp | |
398 | 426 | let timeKey = keyAcresStakedTimeByUser(addr) | |
399 | 427 | let amountKey = keyAcresStakedAmountByUser(addr) | |
400 | 428 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
401 | 429 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
402 | 430 | let oldTime = valueOrElse(getInteger(timeKey), now) | |
403 | 431 | let etaKey = keyAcresLockedEtaByUser(addr) | |
404 | 432 | let lockedAmountKey = keyAcresLockedAmountByUser(addr) | |
405 | 433 | let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0) | |
406 | 434 | let oldLockedETA = valueOrElse(getInteger(etaKey), 0) | |
407 | 435 | let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS))) | |
408 | 436 | $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount) | |
409 | 437 | } | |
410 | 438 | ||
411 | 439 | ||
412 | 440 | ||
413 | 441 | @Callable(i) | |
414 | 442 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
415 | 443 | then throw("Permission denied") | |
416 | 444 | else { | |
417 | 445 | let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount) | |
418 | 446 | if ((0 > amountLeft)) | |
419 | 447 | then throw("Attempt to burn more ACRES, than exists") | |
420 | 448 | else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount) | |
421 | 449 | } | |
422 | 450 | ||
423 | 451 | ||
424 | 452 | ||
425 | 453 | @Callable(i) | |
426 | 454 | func claimAcres () = { | |
427 | 455 | let prologResult = prolog() | |
428 | 456 | if ((prologResult == prologResult)) | |
429 | 457 | then { | |
430 | 458 | let address = toString(i.caller) | |
431 | 459 | if ((size(i.payments) != 0)) | |
432 | 460 | then throw("No payments required") | |
433 | 461 | else { | |
434 | 462 | let timeKey = keyAcresStakedTimeByUser(address) | |
435 | 463 | let amountKey = keyAcresStakedAmountByUser(address) | |
436 | 464 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
437 | 465 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
438 | 466 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
439 | 467 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
440 | 468 | } | |
441 | 469 | } | |
442 | 470 | else throw("Strict value is not equal to itself.") | |
443 | 471 | } | |
444 | 472 | ||
445 | 473 | ||
446 | 474 | ||
447 | 475 | @Callable(i) | |
448 | 476 | func claimAcresREADONLY (address) = { | |
449 | 477 | let timeKey = keyAcresStakedTimeByUser(address) | |
450 | 478 | let amountKey = keyAcresStakedAmountByUser(address) | |
451 | 479 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
452 | 480 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
453 | 481 | let claimedAcres = claimAcresInternal(address, acresAmount, lastTime) | |
454 | 482 | $Tuple2(nil, [claimedAcres, lastTime]) | |
455 | 483 | } | |
456 | 484 | ||
457 | 485 | ||
458 | 486 | ||
459 | 487 | @Callable(i) | |
460 | 488 | func claimPromo2 () = { | |
461 | 489 | let prologResult = prolog() | |
462 | 490 | if ((prologResult == prologResult)) | |
463 | 491 | then { | |
464 | 492 | let address = toString(i.caller) | |
465 | 493 | if ((size(i.payments) != 0)) | |
466 | 494 | then throw("No payments required") | |
467 | 495 | else { | |
468 | 496 | let now = lastBlock.timestamp | |
469 | 497 | if ((PROMO_2_END_TIMESTAMP > now)) | |
470 | 498 | then throw("Promo 2 is not over yet") | |
471 | 499 | else { | |
472 | 500 | let awardedKey = keyIsAwardedByPromoAndUser(2, address) | |
473 | 501 | if (valueOrElse(getBoolean(awardedKey), false)) | |
474 | 502 | then throw((("Your wallet " + address) + " is already awarded in promo 2")) | |
475 | 503 | else { | |
476 | 504 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
477 | 505 | if (!(contains(promo2Map, address))) | |
478 | 506 | then throw("You are not participant of promo 2") | |
479 | 507 | else { | |
480 | 508 | let parts = split_51C(promo2Map, address) | |
481 | 509 | let acresAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
482 | 510 | let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO) | |
483 | 511 | let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0) | |
484 | - | let $ | |
512 | + | let $t01234912789 = if ((totalTikets == 0)) | |
485 | 513 | 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)) | |
487 | 515 | ||
488 | 516 | let ticketsCount = { | |
489 | 517 | let $l = split_51C(promo2Map, "_") | |
490 | 518 | let $s = size($l) | |
491 | 519 | let $acc0 = 0 | |
492 | 520 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
493 | 521 | then $a | |
494 | 522 | else countTickets($a, $l[$i]) | |
495 | 523 | ||
496 | 524 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
497 | 525 | then $a | |
498 | 526 | else throw("List size exceeds 50") | |
499 | 527 | ||
500 | 528 | $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) | |
501 | 529 | } | |
502 | - | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount)], ticketsCount) | |
530 | + | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount) | |
503 | 531 | } | |
504 | 532 | else $Tuple2(nil, totalTikets) | |
505 | - | let ticketsActions = $ | |
506 | - | let totalCount = $ | |
533 | + | let ticketsActions = $t01234912789._1 | |
534 | + | let totalCount = $t01234912789._2 | |
507 | 535 | let award = fraction(tickets, MIN_ACRES_AMOUNT_DURING_PROMO, totalCount) | |
508 | 536 | 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) | |
510 | 538 | } | |
511 | 539 | } | |
512 | 540 | } | |
513 | 541 | } | |
514 | 542 | } | |
515 | 543 | else throw("Strict value is not equal to itself.") | |
516 | 544 | } | |
517 | 545 | ||
518 | 546 | ||
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 ◑