tx · 2n2W1esMCudU9czcvYterovpXA7NP4RjDPP8pxrJgj7Z 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg: -0.02000000 Waves 2023.12.17 19:52 [2890971] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves
{ "type": 13, "id": "2n2W1esMCudU9czcvYterovpXA7NP4RjDPP8pxrJgj7Z", "fee": 2000000, "feeAssetId": null, "timestamp": 1702831992983, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "2QGip2pUkWo2qgE3UEH1dRZ4gPsdPfsTY1jrRr5vGfqF755UVSR6jgtKzSgBdyRpKeCEeStoPTz9jXpb13mCY7F2" ], "script": "base64:BgI7CAISBAoCCAESAwoBARIAEgASBAoCCAESBQoDCAEBEgMKAQESABIDCgEIEgASAwoBCBIDCgEBEgMKAQFCAAhNSUxMSU9ONgCAgOmDsd4WAAlEQVlNSUxMSVMAgLiZKQEaa2V5QWNyZXNTdGFrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNTdGFrZWRBbW91bnRCeVVzZXJfBQRhZGRyARprZXlBY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcgEEYWRkcgkArAICAhhhY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcl8FBGFkZHIBF2tleUFjcmVzTG9ja2VkRXRhQnlVc2VyAQRhZGRyCQCsAgICFWFjcmVzTG9ja2VkRXRhQnlVc2VyXwUEYWRkcgATYWNyZXNTdGFrZWRUb3RhbEtleQIWYWNyZXNTdGFrZWRBbW91bnRUb3RhbAAKeHBOZXdTTGFuZADAlrECAA9EQUlMWVJFU0JZUElFQ0UAgPjSAQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoBGmtleUlzQXdhcmRlZEJ5UHJvbW9BbmRVc2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50cnkCCQEea2V5VGlja2V0c1RvdGFsQnlQcm9tb0FuZFJvdW5kAgADCQBkAgUHcm91bmRJZAABCAUFZHJhd3MCXzEFA25pbAgFBWRyYXdzAl80ABq2ZMs=", "height": 2890971, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: KDZbuaYuM5yQNSeet7Nq97R8X9KckCCFTc8fBaf6Nv1 Next: B7rSLVnk7Tbfvz5SN81iVfcCjqekinxBH9Ydt7E7EkEp Diff:
Old | New | Differences | |
---|---|---|---|
56 | 56 | func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId)) | |
57 | 57 | ||
58 | 58 | ||
59 | + | func keyPromo3MapForRound (roundId) = ("promo3MapForRound__" + toString(roundId)) | |
60 | + | ||
61 | + | ||
59 | 62 | let SEP = "__" | |
60 | 63 | ||
61 | 64 | let MULT6 = 1000000 | |
62 | 65 | ||
63 | 66 | let MULT8 = 100000000 | |
64 | 67 | ||
65 | - | let | |
68 | + | let ITER6 = [0, 1, 2, 3, 4, 5] | |
66 | 69 | ||
67 | 70 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
68 | 71 | ||
212 | 215 | ||
213 | 216 | let PROMO_2_DISTRIBUTION_FUND = 1000000000 | |
214 | 217 | ||
215 | - | let | |
218 | + | let promo3NumPrizesPerRound = [1, 5] | |
216 | 219 | ||
217 | - | let | |
220 | + | let promo3AwardPerRound = [500000000, 100000000] | |
218 | 221 | ||
219 | 222 | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
220 | 223 | ||
513 | 516 | let acresAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
514 | 517 | let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO) | |
515 | 518 | let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0) | |
516 | - | let $ | |
519 | + | let $t01254712987 = if ((totalTikets == 0)) | |
517 | 520 | then { | |
518 | 521 | func countTickets (acc,el) = (acc + (parseIntValue(split(el, ":")[1]) / MIN_ACRES_AMOUNT_DURING_PROMO)) | |
519 | 522 | ||
534 | 537 | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount) | |
535 | 538 | } | |
536 | 539 | else $Tuple2(nil, totalTikets) | |
537 | - | let ticketsActions = $ | |
538 | - | let totalCount = $ | |
540 | + | let ticketsActions = $t01254712987._1 | |
541 | + | let totalCount = $t01254712987._2 | |
539 | 542 | let award = fraction(PROMO_2_DISTRIBUTION_FUND, tickets, totalCount) | |
540 | 543 | let stakeResult = invoke(this, "sendLockedAcres", [address, award, 30], nil) | |
541 | 544 | $Tuple2(((ticketsActions :+ BooleanEntry(awardedKey, true)) :+ StringEntry(keyPromo2MapForRound(1), promo2Map)), stakeResult) | |
550 | 553 | ||
551 | 554 | ||
552 | 555 | @Callable(i) | |
553 | - | func commitForPromo2Round (roundId) = if ((i.caller != this)) | |
556 | + | func initPromo3 (promo3Map) = if ((i.caller != this)) | |
557 | + | then throw("Permission denied") | |
558 | + | else { | |
559 | + | func countTickets (acc,el) = (acc + parseIntValue(split(el, ":")[1])) | |
560 | + | ||
561 | + | let ticketsTotal = { | |
562 | + | let $l = split_51C(promo3Map, "_") | |
563 | + | let $s = size($l) | |
564 | + | let $acc0 = 0 | |
565 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
566 | + | then $a | |
567 | + | else countTickets($a, $l[$i]) | |
568 | + | ||
569 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
570 | + | then $a | |
571 | + | else throw("List size exceeds 20") | |
572 | + | ||
573 | + | $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) | |
574 | + | } | |
575 | + | $Tuple2([IntegerEntry(keyTicketsTotalByPromoAndRound(3, 1), ticketsTotal), StringEntry(keyPromo3MapForRound(1), promo3Map)], ticketsTotal) | |
576 | + | } | |
577 | + | ||
578 | + | ||
579 | + | ||
580 | + | @Callable(i) | |
581 | + | func commitForPromo3Round (roundId) = if ((i.caller != this)) | |
554 | 582 | then throw("Permission denied") | |
555 | 583 | else if (if ((1 > roundId)) | |
556 | 584 | then true | |
557 | - | else (roundId > | |
585 | + | else (roundId > 2)) | |
558 | 586 | then throw(("Invalid roundId: " + toString(roundId))) | |
559 | 587 | else { | |
560 | 588 | let finishBlock = (height + randomDelay) | |
561 | - | $Tuple2([IntegerEntry(keyCommit((" | |
589 | + | $Tuple2([IntegerEntry(keyCommit(("3_" + toString(roundId))), finishBlock)], finishBlock) | |
562 | 590 | } | |
563 | 591 | ||
564 | 592 | ||
565 | 593 | ||
566 | 594 | @Callable(i) | |
567 | - | func | |
595 | + | func drawPromo3Round (roundId) = if ((i.caller != this)) | |
568 | 596 | then throw("Permission denied") | |
569 | 597 | else if (if ((1 > roundId)) | |
570 | 598 | then true | |
571 | - | else (roundId > | |
599 | + | else (roundId > 2)) | |
572 | 600 | then throw(("Invalid roundId: " + toString(roundId))) | |
573 | 601 | else { | |
574 | - | let finishKey = keyCommit((" | |
575 | - | let finishBlock = valueOrErrorMessage(getInteger(finishKey), (("You have to | |
602 | + | let finishKey = keyCommit(("3_" + toString(roundId))) | |
603 | + | let finishBlock = valueOrErrorMessage(getInteger(finishKey), (("You have to commitForPromo3Round(" + toString(roundId)) + ") first!")) | |
576 | 604 | if ((finishBlock > height)) | |
577 | 605 | then throw((((("Random number is not ready yet, wait until height = " + toString(finishBlock)) + " (current height = ") + toString(height)) + ")")) | |
578 | 606 | else { | |
579 | - | let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound( | |
607 | + | let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound(3, roundId)), 0) | |
580 | 608 | if ((maxValue == 0)) | |
581 | - | then throw("No tickets to draw | |
609 | + | then throw("No tickets to draw") | |
582 | 610 | else { | |
583 | 611 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
584 | 612 | let salt = i.transactionId | |
585 | - | let | |
586 | - | func singleDraw (ac,j) = if ((j >= | |
613 | + | let promo3Map = valueOrElse(getString(keyPromo3MapForRound(roundId)), "") | |
614 | + | func singleDraw (ac,j) = if ((j >= promo3NumPrizesPerRound[(roundId - 1)])) | |
587 | 615 | then ac | |
588 | 616 | else { | |
589 | 617 | let rand = getRandomNumber(ac._1, ac._2, entropy) | |
590 | - | let | |
618 | + | let promo3List = if ((ac._3 == "")) | |
591 | 619 | then nil | |
592 | 620 | else split_51C(ac._3, "_") | |
593 | 621 | func countTickets (acc,el) = { | |
594 | 622 | let parts = split(el, ":") | |
595 | 623 | let addr = parts[0] | |
596 | - | let tickets = | |
624 | + | let tickets = parseIntValue(parts[1]) | |
597 | 625 | let newTotal = (acc._1 + tickets) | |
598 | 626 | if (if ((acc._3 == "")) | |
599 | 627 | then (newTotal > rand) | |
603 | 631 | } | |
604 | 632 | ||
605 | 633 | let r = { | |
606 | - | let $l = | |
634 | + | let $l = promo3List | |
607 | 635 | let $s = size($l) | |
608 | 636 | let $acc0 = $Tuple3(0, 0, "") | |
609 | 637 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
612 | 640 | ||
613 | 641 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
614 | 642 | then $a | |
615 | - | else throw("List size exceeds | |
643 | + | else throw("List size exceeds 20") | |
616 | 644 | ||
617 | - | $f0_2 | |
645 | + | $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) | |
618 | 646 | } | |
619 | 647 | let winner = r._3 | |
620 | 648 | if ((winner == "")) | |
622 | 650 | else { | |
623 | 651 | let mapParts = split_51C(ac._3, winner) | |
624 | 652 | let newMap = if ((mapParts[0] == "")) | |
625 | - | then drop(mapParts[1], 16) | |
626 | - | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 15)) | |
627 | - | let stakeResult = invoke(this, "sendLockedAcres", [winner, promo2AwardPerRound[(roundId - 1)], 30], nil) | |
628 | - | $Tuple4((ac._1 - r._2), fromBase58String(getStringValue(stakingContract, keyLastTxIdByUser(winner))), newMap, (ac._4 :+ stakeResult)) | |
653 | + | then drop(mapParts[1], 4) | |
654 | + | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 3)) | |
655 | + | let stakeResult = invoke(this, "sendLockedAcres", [winner, promo3AwardPerRound[(roundId - 1)], 30], nil) | |
656 | + | let newSalt = fromBase58String(valueOrElse(getString(stakingContract, keyLastTxIdByUser(winner)), "DEFAULT")) | |
657 | + | $Tuple4((ac._1 - r._2), newSalt, newMap, (ac._4 :+ stakeResult)) | |
629 | 658 | } | |
630 | 659 | } | |
631 | 660 | ||
632 | 661 | let draws = { | |
633 | - | let $l = | |
662 | + | let $l = ITER6 | |
634 | 663 | let $s = size($l) | |
635 | - | let $acc0 = $Tuple4(maxValue, i.transactionId, | |
664 | + | let $acc0 = $Tuple4(maxValue, i.transactionId, promo3Map, nil) | |
636 | 665 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
637 | 666 | then $a | |
638 | 667 | else singleDraw($a, $l[$i]) | |
639 | 668 | ||
640 | 669 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
641 | 670 | then $a | |
642 | - | else throw("List size exceeds | |
671 | + | else throw("List size exceeds 6") | |
643 | 672 | ||
644 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($ | |
673 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
645 | 674 | } | |
646 | - | $Tuple2([DeleteEntry(finishKey), StringEntry( | |
675 | + | $Tuple2([DeleteEntry(finishKey), StringEntry(keyPromo3MapForRound((roundId + 1)), draws._3), IntegerEntry(keyTicketsTotalByPromoAndRound(3, (roundId + 1)), draws._1)], draws._4) | |
647 | 676 | } | |
648 | 677 | } | |
649 | 678 | } |
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 | 31 | func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | let chain = take(drop(this.bytes, 1), 1) | |
35 | 35 | ||
36 | 36 | let usdtAssetId = match chain { | |
37 | 37 | case _ => | |
38 | 38 | if ((base58'2W' == $match0)) | |
39 | 39 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
40 | 40 | else if ((base58'2T' == $match0)) | |
41 | 41 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
42 | 42 | else throw("Unknown chain") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | let defaultRestAddressStr = match chain { | |
46 | 46 | case _ => | |
47 | 47 | if ((base58'2W' == $match0)) | |
48 | 48 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
49 | 49 | else if ((base58'2T' == $match0)) | |
50 | 50 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
51 | 51 | else throw("Unknown chain") | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | let promo2MapKey = "promo2Map" | |
55 | 55 | ||
56 | 56 | func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId)) | |
57 | 57 | ||
58 | 58 | ||
59 | + | func keyPromo3MapForRound (roundId) = ("promo3MapForRound__" + toString(roundId)) | |
60 | + | ||
61 | + | ||
59 | 62 | let SEP = "__" | |
60 | 63 | ||
61 | 64 | let MULT6 = 1000000 | |
62 | 65 | ||
63 | 66 | let MULT8 = 100000000 | |
64 | 67 | ||
65 | - | let | |
68 | + | let ITER6 = [0, 1, 2, 3, 4, 5] | |
66 | 69 | ||
67 | 70 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
68 | 71 | ||
69 | 72 | ||
70 | 73 | let IdxCfgStakingDapp = 1 | |
71 | 74 | ||
72 | 75 | let IdxCfgEconomyDapp = 2 | |
73 | 76 | ||
74 | 77 | let IdxCfgWlgDapp = 4 | |
75 | 78 | ||
76 | 79 | let IdxCfgAcresDapp = 8 | |
77 | 80 | ||
78 | 81 | func keyRestCfg () = "%s__restConfig" | |
79 | 82 | ||
80 | 83 | ||
81 | 84 | func keyRestAddress () = "%s__restAddr" | |
82 | 85 | ||
83 | 86 | ||
84 | 87 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
85 | 88 | ||
86 | 89 | ||
87 | 90 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
88 | 91 | ||
89 | 92 | ||
90 | 93 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
91 | 94 | ||
92 | 95 | let restCfg = readRestCfgOrFail(restContract) | |
93 | 96 | ||
94 | 97 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
95 | 98 | ||
96 | 99 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
97 | 100 | ||
98 | 101 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
99 | 102 | ||
100 | 103 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
101 | 104 | ||
102 | 105 | let acresIssuedAmountKey = "acresIssuedAmount" | |
103 | 106 | ||
104 | 107 | let acresAssetIdKey = "acresAssetId" | |
105 | 108 | ||
106 | 109 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
107 | 110 | ||
108 | 111 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
109 | 112 | ||
110 | 113 | ||
111 | 114 | let IdxEffTotal = 0 | |
112 | 115 | ||
113 | 116 | let randomDelay = 2 | |
114 | 117 | ||
115 | 118 | func keyCommit (address) = ("finishBlockFor_" + address) | |
116 | 119 | ||
117 | 120 | ||
118 | 121 | func keyResProportions () = "resTypesProportions" | |
119 | 122 | ||
120 | 123 | ||
121 | 124 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
122 | 125 | ||
123 | 126 | ||
124 | 127 | func asInt (v) = match v { | |
125 | 128 | case n: Int => | |
126 | 129 | n | |
127 | 130 | case _ => | |
128 | 131 | throw("fail to cast into Int") | |
129 | 132 | } | |
130 | 133 | ||
131 | 134 | ||
132 | 135 | func asTwoIntsTuple (val) = match val { | |
133 | 136 | case t2: (Int, Int) => | |
134 | 137 | t2 | |
135 | 138 | case _ => | |
136 | 139 | throw("fail to cast into (Int, Int)") | |
137 | 140 | } | |
138 | 141 | ||
139 | 142 | ||
140 | 143 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
141 | 144 | ||
142 | 145 | ||
143 | 146 | func getVotingPower (userAddrStrOrEmpty) = { | |
144 | 147 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
145 | 148 | func adder (acc,item) = (acc + parseIntValue(item)) | |
146 | 149 | ||
147 | 150 | let totalPower = { | |
148 | 151 | let $l = props | |
149 | 152 | let $s = size($l) | |
150 | 153 | let $acc0 = 0 | |
151 | 154 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
152 | 155 | then $a | |
153 | 156 | else adder($a, $l[$i]) | |
154 | 157 | ||
155 | 158 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
156 | 159 | then $a | |
157 | 160 | else throw("List size exceeds 6") | |
158 | 161 | ||
159 | 162 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
160 | 163 | } | |
161 | 164 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
162 | 165 | [totalPower, usersPower] | |
163 | 166 | } | |
164 | 167 | ||
165 | 168 | ||
166 | 169 | func fixedPoint (val,decimals) = { | |
167 | 170 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
168 | 171 | let lowPart = toString((val % tenPow)) | |
169 | 172 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
170 | 173 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
171 | 174 | } | |
172 | 175 | ||
173 | 176 | ||
174 | 177 | func padL (val,len) = { | |
175 | 178 | let valS = toString(val) | |
176 | 179 | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
177 | 180 | (zeroes + valS) | |
178 | 181 | } | |
179 | 182 | ||
180 | 183 | ||
181 | 184 | func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue)) | |
182 | 185 | then throw("maxValue should be > 0") | |
183 | 186 | else { | |
184 | 187 | let randomHash = sha256((salt + entropy)) | |
185 | 188 | (toInt(randomHash) % maxValue) | |
186 | 189 | } | |
187 | 190 | ||
188 | 191 | ||
189 | 192 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
190 | 193 | ||
191 | 194 | 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" | |
192 | 195 | ||
193 | 196 | let PROMO1_AMOUNT = 4970178 | |
194 | 197 | ||
195 | 198 | let PROMO_2_START_TIMESTAMP = match chain { | |
196 | 199 | case _ => | |
197 | 200 | if ((base58'2W' == $match0)) | |
198 | 201 | then 1700524800000 | |
199 | 202 | else if ((base58'2T' == $match0)) | |
200 | 203 | then 1700420400000 | |
201 | 204 | else throw("Unknown chain") | |
202 | 205 | } | |
203 | 206 | ||
204 | 207 | let PROMO_2_END_TIMESTAMP = match chain { | |
205 | 208 | case _ => | |
206 | 209 | if ((base58'2W' == $match0)) | |
207 | 210 | then 1701043199999 | |
208 | 211 | else if ((base58'2T' == $match0)) | |
209 | 212 | then 1700496000000 | |
210 | 213 | else throw("Unknown chain") | |
211 | 214 | } | |
212 | 215 | ||
213 | 216 | let PROMO_2_DISTRIBUTION_FUND = 1000000000 | |
214 | 217 | ||
215 | - | let | |
218 | + | let promo3NumPrizesPerRound = [1, 5] | |
216 | 219 | ||
217 | - | let | |
220 | + | let promo3AwardPerRound = [500000000, 100000000] | |
218 | 221 | ||
219 | 222 | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
220 | 223 | ||
221 | 224 | ||
222 | 225 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
223 | 226 | ||
224 | 227 | ||
225 | 228 | func claimAcresInternal (addr,acresAmount,lastClaimTime) = { | |
226 | 229 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
227 | 230 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
228 | 231 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
229 | 232 | let gotUsdt = max([0, canGetUsdt]) | |
230 | 233 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
231 | 234 | } | |
232 | 235 | ||
233 | 236 | ||
234 | 237 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
235 | 238 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
236 | 239 | if ((0 > deltaTime)) | |
237 | 240 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
238 | 241 | else { | |
239 | 242 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
240 | 243 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
241 | 244 | let gotUsdt = if ((0 >= canGetUsdt)) | |
242 | 245 | then 0 | |
243 | 246 | else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
244 | 247 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
245 | 248 | } | |
246 | 249 | } | |
247 | 250 | ||
248 | 251 | ||
249 | 252 | func mergeLocked (oldAmount,oldETA,newAmount,newETA) = { | |
250 | 253 | let now = lastBlock.timestamp | |
251 | 254 | let dt1 = max([0, (oldETA - now)]) | |
252 | 255 | let dt2 = max([0, (newETA - now)]) | |
253 | 256 | let sum = (oldAmount + newAmount) | |
254 | 257 | let dt = if ((sum == 0)) | |
255 | 258 | then 0 | |
256 | 259 | else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum)) | |
257 | 260 | (now + dt) | |
258 | 261 | } | |
259 | 262 | ||
260 | 263 | ||
261 | 264 | @Callable(i) | |
262 | 265 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
263 | 266 | then throw("Permission denied") | |
264 | 267 | else if (isDefined(getBinary(acresAssetIdKey))) | |
265 | 268 | then throw("Already initialized") | |
266 | 269 | else { | |
267 | 270 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
268 | 271 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
269 | 272 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
270 | 273 | let assetId = calculateAssetId(issue) | |
271 | 274 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
272 | 275 | } | |
273 | 276 | ||
274 | 277 | ||
275 | 278 | ||
276 | 279 | @Callable(i) | |
277 | 280 | func unstakeAcres (amount) = { | |
278 | 281 | let prologResult = prolog() | |
279 | 282 | if ((prologResult == prologResult)) | |
280 | 283 | then if ((0 >= amount)) | |
281 | 284 | then throw("Amount should be positive") | |
282 | 285 | else { | |
283 | 286 | let address = toString(i.caller) | |
284 | 287 | if ((size(i.payments) != 0)) | |
285 | 288 | then throw("No payments required") | |
286 | 289 | else { | |
287 | 290 | let timeKey = keyAcresStakedTimeByUser(address) | |
288 | 291 | let amountKey = keyAcresStakedAmountByUser(address) | |
289 | 292 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
290 | 293 | if ((amount > oldAcresAmount)) | |
291 | 294 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
292 | 295 | else { | |
293 | 296 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
294 | 297 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
295 | 298 | let now = lastBlock.timestamp | |
296 | 299 | if (if ((now >= PROMO_2_START_TIMESTAMP)) | |
297 | 300 | then (PROMO_2_END_TIMESTAMP >= now) | |
298 | 301 | else false) | |
299 | 302 | then throw("You cannot unstake ACRES during Promo2") | |
300 | 303 | else { | |
301 | 304 | let unstakableAmount = if (isBlacklistedPromo1(address)) | |
302 | 305 | then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT) | |
303 | 306 | else (oldAcresAmount - lockedAmount) | |
304 | 307 | if (if ((lockedETA > now)) | |
305 | 308 | then (amount > unstakableAmount) | |
306 | 309 | else false) | |
307 | 310 | then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA))) | |
308 | 311 | else { | |
309 | 312 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
310 | 313 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
311 | 314 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
312 | 315 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
313 | 316 | } | |
314 | 317 | } | |
315 | 318 | } | |
316 | 319 | } | |
317 | 320 | } | |
318 | 321 | else throw("Strict value is not equal to itself.") | |
319 | 322 | } | |
320 | 323 | ||
321 | 324 | ||
322 | 325 | ||
323 | 326 | @Callable(i) | |
324 | 327 | func stakeAcres () = { | |
325 | 328 | let prologResult = prolog() | |
326 | 329 | if ((prologResult == prologResult)) | |
327 | 330 | then { | |
328 | 331 | let address = toString(i.caller) | |
329 | 332 | if ((size(i.payments) != 1)) | |
330 | 333 | then throw("exactly 1 payment must be attached") | |
331 | 334 | else { | |
332 | 335 | let pmt = i.payments[0] | |
333 | 336 | let amt = pmt.amount | |
334 | 337 | if (if (!(isDefined(pmt.assetId))) | |
335 | 338 | then true | |
336 | 339 | else (value(pmt.assetId) != acresAssetId)) | |
337 | 340 | then throw("ACRES payments only!") | |
338 | 341 | else { | |
339 | 342 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
340 | 343 | if ((wlgResult == wlgResult)) | |
341 | 344 | then { | |
342 | 345 | let now = lastBlock.timestamp | |
343 | 346 | if (if ((PROMO_2_START_TIMESTAMP > now)) | |
344 | 347 | then true | |
345 | 348 | else (now > PROMO_2_END_TIMESTAMP)) | |
346 | 349 | then { | |
347 | 350 | let timeKey = keyAcresStakedTimeByUser(address) | |
348 | 351 | let amountKey = keyAcresStakedAmountByUser(address) | |
349 | 352 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
350 | 353 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
351 | 354 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
352 | 355 | $Tuple2(((((if ((claimedAcres == 0)) | |
353 | 356 | then nil | |
354 | 357 | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
355 | 358 | } | |
356 | 359 | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
357 | 360 | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
358 | 361 | else { | |
359 | 362 | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
360 | 363 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
361 | 364 | let newMap2 = if (contains(promo2Map, address)) | |
362 | 365 | then { | |
363 | 366 | let parts = split_51C(promo2Map, address) | |
364 | 367 | let oldAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
365 | 368 | ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15)) | |
366 | 369 | } | |
367 | 370 | else { | |
368 | 371 | let finalPart = ((address + ":") + padL(amt, 14)) | |
369 | 372 | if ((promo2Map == "")) | |
370 | 373 | then finalPart | |
371 | 374 | else ((promo2Map + "_") + finalPart) | |
372 | 375 | } | |
373 | 376 | $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult)) | |
374 | 377 | } | |
375 | 378 | } | |
376 | 379 | else throw("Strict value is not equal to itself.") | |
377 | 380 | } | |
378 | 381 | } | |
379 | 382 | } | |
380 | 383 | else throw("Strict value is not equal to itself.") | |
381 | 384 | } | |
382 | 385 | ||
383 | 386 | ||
384 | 387 | ||
385 | 388 | @Callable(i) | |
386 | 389 | func buyAcres () = { | |
387 | 390 | let prologResult = prolog() | |
388 | 391 | if ((prologResult == prologResult)) | |
389 | 392 | then { | |
390 | 393 | let address = toString(i.caller) | |
391 | 394 | if ((size(i.payments) != 1)) | |
392 | 395 | then throw("exactly 1 payment must be attached") | |
393 | 396 | else { | |
394 | 397 | let pmt = i.payments[0] | |
395 | 398 | let amt = pmt.amount | |
396 | 399 | if (if (!(isDefined(pmt.assetId))) | |
397 | 400 | then true | |
398 | 401 | else (value(pmt.assetId) != usdtAssetId)) | |
399 | 402 | then throw("USDT payments only!") | |
400 | 403 | else if ((MULT6 > amt)) | |
401 | 404 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
402 | 405 | else { | |
403 | 406 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
404 | 407 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
405 | 408 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
406 | 409 | } | |
407 | 410 | } | |
408 | 411 | } | |
409 | 412 | else throw("Strict value is not equal to itself.") | |
410 | 413 | } | |
411 | 414 | ||
412 | 415 | ||
413 | 416 | ||
414 | 417 | @Callable(i) | |
415 | 418 | func sendAcres (addr,amount) = if ((i.caller != economyContract)) | |
416 | 419 | then throw("Permission denied") | |
417 | 420 | else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount) | |
418 | 421 | ||
419 | 422 | ||
420 | 423 | ||
421 | 424 | @Callable(i) | |
422 | 425 | func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this)) | |
423 | 426 | then (i.caller != restContract) | |
424 | 427 | else false) | |
425 | 428 | then throw("Permission denied") | |
426 | 429 | else { | |
427 | 430 | let now = lastBlock.timestamp | |
428 | 431 | let timeKey = keyAcresStakedTimeByUser(addr) | |
429 | 432 | let amountKey = keyAcresStakedAmountByUser(addr) | |
430 | 433 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
431 | 434 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
432 | 435 | let timeAction = if (isDefined(getInteger(timeKey))) | |
433 | 436 | then nil | |
434 | 437 | else [IntegerEntry(timeKey, now)] | |
435 | 438 | let etaKey = keyAcresLockedEtaByUser(addr) | |
436 | 439 | let lockedAmountKey = keyAcresLockedAmountByUser(addr) | |
437 | 440 | let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0) | |
438 | 441 | let oldLockedETA = valueOrElse(getInteger(etaKey), 0) | |
439 | 442 | let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS))) | |
440 | 443 | $Tuple2(((((timeAction :+ IntegerEntry(amountKey, (oldAcresAmount + amount))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amount))) :+ IntegerEntry(etaKey, mergedETA)) :+ IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))), amount) | |
441 | 444 | } | |
442 | 445 | ||
443 | 446 | ||
444 | 447 | ||
445 | 448 | @Callable(i) | |
446 | 449 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
447 | 450 | then throw("Permission denied") | |
448 | 451 | else { | |
449 | 452 | let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount) | |
450 | 453 | if ((0 > amountLeft)) | |
451 | 454 | then throw("Attempt to burn more ACRES, than exists") | |
452 | 455 | else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount) | |
453 | 456 | } | |
454 | 457 | ||
455 | 458 | ||
456 | 459 | ||
457 | 460 | @Callable(i) | |
458 | 461 | func claimAcres () = { | |
459 | 462 | let prologResult = prolog() | |
460 | 463 | if ((prologResult == prologResult)) | |
461 | 464 | then { | |
462 | 465 | let address = toString(i.caller) | |
463 | 466 | if ((size(i.payments) != 0)) | |
464 | 467 | then throw("No payments required") | |
465 | 468 | else { | |
466 | 469 | let timeKey = keyAcresStakedTimeByUser(address) | |
467 | 470 | let amountKey = keyAcresStakedAmountByUser(address) | |
468 | 471 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
469 | 472 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
470 | 473 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
471 | 474 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
472 | 475 | } | |
473 | 476 | } | |
474 | 477 | else throw("Strict value is not equal to itself.") | |
475 | 478 | } | |
476 | 479 | ||
477 | 480 | ||
478 | 481 | ||
479 | 482 | @Callable(i) | |
480 | 483 | func claimAcresREADONLY (address) = { | |
481 | 484 | let timeKey = keyAcresStakedTimeByUser(address) | |
482 | 485 | let amountKey = keyAcresStakedAmountByUser(address) | |
483 | 486 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
484 | 487 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
485 | 488 | let claimedAcres = claimAcresInternal(address, acresAmount, lastTime) | |
486 | 489 | $Tuple2(nil, [claimedAcres, lastTime]) | |
487 | 490 | } | |
488 | 491 | ||
489 | 492 | ||
490 | 493 | ||
491 | 494 | @Callable(i) | |
492 | 495 | func claimPromo2 () = { | |
493 | 496 | let prologResult = prolog() | |
494 | 497 | if ((prologResult == prologResult)) | |
495 | 498 | then { | |
496 | 499 | let address = toString(i.caller) | |
497 | 500 | if ((size(i.payments) != 0)) | |
498 | 501 | then throw("No payments required") | |
499 | 502 | else { | |
500 | 503 | let now = lastBlock.timestamp | |
501 | 504 | if ((PROMO_2_END_TIMESTAMP > now)) | |
502 | 505 | then throw("Promo 2 is not over yet") | |
503 | 506 | else { | |
504 | 507 | let awardedKey = keyIsAwardedByPromoAndUser(2, address) | |
505 | 508 | if (valueOrElse(getBoolean(awardedKey), false)) | |
506 | 509 | then throw((("Your wallet " + address) + " is already awarded in promo 2")) | |
507 | 510 | else { | |
508 | 511 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
509 | 512 | if (!(contains(promo2Map, address))) | |
510 | 513 | then throw("You are not participant of promo 2") | |
511 | 514 | else { | |
512 | 515 | let parts = split_51C(promo2Map, address) | |
513 | 516 | let acresAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
514 | 517 | let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO) | |
515 | 518 | let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0) | |
516 | - | let $ | |
519 | + | let $t01254712987 = if ((totalTikets == 0)) | |
517 | 520 | then { | |
518 | 521 | func countTickets (acc,el) = (acc + (parseIntValue(split(el, ":")[1]) / MIN_ACRES_AMOUNT_DURING_PROMO)) | |
519 | 522 | ||
520 | 523 | let ticketsCount = { | |
521 | 524 | let $l = split_51C(promo2Map, "_") | |
522 | 525 | let $s = size($l) | |
523 | 526 | let $acc0 = 0 | |
524 | 527 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
525 | 528 | then $a | |
526 | 529 | else countTickets($a, $l[$i]) | |
527 | 530 | ||
528 | 531 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
529 | 532 | then $a | |
530 | 533 | else throw("List size exceeds 50") | |
531 | 534 | ||
532 | 535 | $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) | |
533 | 536 | } | |
534 | 537 | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount) | |
535 | 538 | } | |
536 | 539 | else $Tuple2(nil, totalTikets) | |
537 | - | let ticketsActions = $ | |
538 | - | let totalCount = $ | |
540 | + | let ticketsActions = $t01254712987._1 | |
541 | + | let totalCount = $t01254712987._2 | |
539 | 542 | let award = fraction(PROMO_2_DISTRIBUTION_FUND, tickets, totalCount) | |
540 | 543 | let stakeResult = invoke(this, "sendLockedAcres", [address, award, 30], nil) | |
541 | 544 | $Tuple2(((ticketsActions :+ BooleanEntry(awardedKey, true)) :+ StringEntry(keyPromo2MapForRound(1), promo2Map)), stakeResult) | |
542 | 545 | } | |
543 | 546 | } | |
544 | 547 | } | |
545 | 548 | } | |
546 | 549 | } | |
547 | 550 | else throw("Strict value is not equal to itself.") | |
548 | 551 | } | |
549 | 552 | ||
550 | 553 | ||
551 | 554 | ||
552 | 555 | @Callable(i) | |
553 | - | func commitForPromo2Round (roundId) = if ((i.caller != this)) | |
556 | + | func initPromo3 (promo3Map) = if ((i.caller != this)) | |
557 | + | then throw("Permission denied") | |
558 | + | else { | |
559 | + | func countTickets (acc,el) = (acc + parseIntValue(split(el, ":")[1])) | |
560 | + | ||
561 | + | let ticketsTotal = { | |
562 | + | let $l = split_51C(promo3Map, "_") | |
563 | + | let $s = size($l) | |
564 | + | let $acc0 = 0 | |
565 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
566 | + | then $a | |
567 | + | else countTickets($a, $l[$i]) | |
568 | + | ||
569 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
570 | + | then $a | |
571 | + | else throw("List size exceeds 20") | |
572 | + | ||
573 | + | $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) | |
574 | + | } | |
575 | + | $Tuple2([IntegerEntry(keyTicketsTotalByPromoAndRound(3, 1), ticketsTotal), StringEntry(keyPromo3MapForRound(1), promo3Map)], ticketsTotal) | |
576 | + | } | |
577 | + | ||
578 | + | ||
579 | + | ||
580 | + | @Callable(i) | |
581 | + | func commitForPromo3Round (roundId) = if ((i.caller != this)) | |
554 | 582 | then throw("Permission denied") | |
555 | 583 | else if (if ((1 > roundId)) | |
556 | 584 | then true | |
557 | - | else (roundId > | |
585 | + | else (roundId > 2)) | |
558 | 586 | then throw(("Invalid roundId: " + toString(roundId))) | |
559 | 587 | else { | |
560 | 588 | let finishBlock = (height + randomDelay) | |
561 | - | $Tuple2([IntegerEntry(keyCommit((" | |
589 | + | $Tuple2([IntegerEntry(keyCommit(("3_" + toString(roundId))), finishBlock)], finishBlock) | |
562 | 590 | } | |
563 | 591 | ||
564 | 592 | ||
565 | 593 | ||
566 | 594 | @Callable(i) | |
567 | - | func | |
595 | + | func drawPromo3Round (roundId) = if ((i.caller != this)) | |
568 | 596 | then throw("Permission denied") | |
569 | 597 | else if (if ((1 > roundId)) | |
570 | 598 | then true | |
571 | - | else (roundId > | |
599 | + | else (roundId > 2)) | |
572 | 600 | then throw(("Invalid roundId: " + toString(roundId))) | |
573 | 601 | else { | |
574 | - | let finishKey = keyCommit((" | |
575 | - | let finishBlock = valueOrErrorMessage(getInteger(finishKey), (("You have to | |
602 | + | let finishKey = keyCommit(("3_" + toString(roundId))) | |
603 | + | let finishBlock = valueOrErrorMessage(getInteger(finishKey), (("You have to commitForPromo3Round(" + toString(roundId)) + ") first!")) | |
576 | 604 | if ((finishBlock > height)) | |
577 | 605 | then throw((((("Random number is not ready yet, wait until height = " + toString(finishBlock)) + " (current height = ") + toString(height)) + ")")) | |
578 | 606 | else { | |
579 | - | let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound( | |
607 | + | let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound(3, roundId)), 0) | |
580 | 608 | if ((maxValue == 0)) | |
581 | - | then throw("No tickets to draw | |
609 | + | then throw("No tickets to draw") | |
582 | 610 | else { | |
583 | 611 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
584 | 612 | let salt = i.transactionId | |
585 | - | let | |
586 | - | func singleDraw (ac,j) = if ((j >= | |
613 | + | let promo3Map = valueOrElse(getString(keyPromo3MapForRound(roundId)), "") | |
614 | + | func singleDraw (ac,j) = if ((j >= promo3NumPrizesPerRound[(roundId - 1)])) | |
587 | 615 | then ac | |
588 | 616 | else { | |
589 | 617 | let rand = getRandomNumber(ac._1, ac._2, entropy) | |
590 | - | let | |
618 | + | let promo3List = if ((ac._3 == "")) | |
591 | 619 | then nil | |
592 | 620 | else split_51C(ac._3, "_") | |
593 | 621 | func countTickets (acc,el) = { | |
594 | 622 | let parts = split(el, ":") | |
595 | 623 | let addr = parts[0] | |
596 | - | let tickets = | |
624 | + | let tickets = parseIntValue(parts[1]) | |
597 | 625 | let newTotal = (acc._1 + tickets) | |
598 | 626 | if (if ((acc._3 == "")) | |
599 | 627 | then (newTotal > rand) | |
600 | 628 | else false) | |
601 | 629 | then $Tuple3(newTotal, tickets, addr) | |
602 | 630 | else $Tuple3(newTotal, acc._2, acc._3) | |
603 | 631 | } | |
604 | 632 | ||
605 | 633 | let r = { | |
606 | - | let $l = | |
634 | + | let $l = promo3List | |
607 | 635 | let $s = size($l) | |
608 | 636 | let $acc0 = $Tuple3(0, 0, "") | |
609 | 637 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
610 | 638 | then $a | |
611 | 639 | else countTickets($a, $l[$i]) | |
612 | 640 | ||
613 | 641 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
614 | 642 | then $a | |
615 | - | else throw("List size exceeds | |
643 | + | else throw("List size exceeds 20") | |
616 | 644 | ||
617 | - | $f0_2 | |
645 | + | $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) | |
618 | 646 | } | |
619 | 647 | let winner = r._3 | |
620 | 648 | if ((winner == "")) | |
621 | 649 | then ac | |
622 | 650 | else { | |
623 | 651 | let mapParts = split_51C(ac._3, winner) | |
624 | 652 | let newMap = if ((mapParts[0] == "")) | |
625 | - | then drop(mapParts[1], 16) | |
626 | - | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 15)) | |
627 | - | let stakeResult = invoke(this, "sendLockedAcres", [winner, promo2AwardPerRound[(roundId - 1)], 30], nil) | |
628 | - | $Tuple4((ac._1 - r._2), fromBase58String(getStringValue(stakingContract, keyLastTxIdByUser(winner))), newMap, (ac._4 :+ stakeResult)) | |
653 | + | then drop(mapParts[1], 4) | |
654 | + | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 3)) | |
655 | + | let stakeResult = invoke(this, "sendLockedAcres", [winner, promo3AwardPerRound[(roundId - 1)], 30], nil) | |
656 | + | let newSalt = fromBase58String(valueOrElse(getString(stakingContract, keyLastTxIdByUser(winner)), "DEFAULT")) | |
657 | + | $Tuple4((ac._1 - r._2), newSalt, newMap, (ac._4 :+ stakeResult)) | |
629 | 658 | } | |
630 | 659 | } | |
631 | 660 | ||
632 | 661 | let draws = { | |
633 | - | let $l = | |
662 | + | let $l = ITER6 | |
634 | 663 | let $s = size($l) | |
635 | - | let $acc0 = $Tuple4(maxValue, i.transactionId, | |
664 | + | let $acc0 = $Tuple4(maxValue, i.transactionId, promo3Map, nil) | |
636 | 665 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
637 | 666 | then $a | |
638 | 667 | else singleDraw($a, $l[$i]) | |
639 | 668 | ||
640 | 669 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
641 | 670 | then $a | |
642 | - | else throw("List size exceeds | |
671 | + | else throw("List size exceeds 6") | |
643 | 672 | ||
644 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($ | |
673 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
645 | 674 | } | |
646 | - | $Tuple2([DeleteEntry(finishKey), StringEntry( | |
675 | + | $Tuple2([DeleteEntry(finishKey), StringEntry(keyPromo3MapForRound((roundId + 1)), draws._3), IntegerEntry(keyTicketsTotalByPromoAndRound(3, (roundId + 1)), draws._1)], draws._4) | |
647 | 676 | } | |
648 | 677 | } | |
649 | 678 | } | |
650 | 679 | ||
651 | 680 |
github/deemru/w8io/169f3d6 106.61 ms ◑