tx · 9hbJ7nJv346QCa65WgNCAkwJcXjc8tHY95FusA95d4oR 3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T: -0.01000000 Waves 2023.06.07 16:01 [2612280] smart account 3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T > SELF 0.00000000 Waves
{ "type": 13, "id": "9hbJ7nJv346QCa65WgNCAkwJcXjc8tHY95FusA95d4oR", "fee": 1000000, "feeAssetId": null, "timestamp": 1686142943268, "version": 2, "chainId": 84, "sender": "3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T", "senderPublicKey": "97sWz4UZWijkagGprhucQHR7b7nN6FfojMELnzuFEyY1", "proofs": [ "f1hQihZrDUhcCGX7KGeRFTyMHye1MoTJqj1G3aAKJV91MMjEhkE11sLVip5fAEHCsDSUMn22MsUrn5YbomW8RN5" ], "script": "base64:BgIPCAISBQoDAREIEgASABIAFwEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAgFpA3N1bQQRYWNjZXB0YWJsZUFzc2V0SWQBICJEpueIVH1RKK5qV7oPafp24Q53N+2oR6tSH2lNlEJHBAFwCQCRAwIIBQFpCHBheW1lbnRzAAAEByRtYXRjaDAIBQFwB2Fzc2V0SWQJAGcCCAUBcAZhbW91bnQJAQpudW1Ub1dhdmVzAQUDc3VtAQttYXBJbnRUb1N0cgIFYWNjdW0EbmV4dAkAzAgCCQCkAwEFBG5leHQFBWFjY3VtAQttYXBTdHJUb0ludAIFYWNjdW0EbmV4dAkAzAgCCQENcGFyc2VJbnRWYWx1ZQEFBG5leHQFBWFjY3VtAQttYXBJbnRUb1N1bQIFYWNjdW0EbmV4dAkAZAIFBWFjY3VtBQRuZXh0AQxsaXN0SW50VG9TdW0BA2FycgoAAiRsBQNhcnIKAAIkcwkAkAMBBQIkbAoABSRhY2MwAAAKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBC21hcEludFRvU3VtAgUCJGEJAJED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BQFpBQxyYW5kb21OdW1iZXIJAMwIAgkBDEludGVnZXJFbnRyeQIJAQxMV19nZXRMb2dLZXkBBQFpBQ13aW5uaW5nQW1vdW50BQNuaWwJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBDExXX2dldEJldEtleQEFAWkJAMwIAgkBDEludGVnZXJFbnRyeQIJAQxMV19nZXRXb25LZXkBBQFpBQ13aW5uaW5nQW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEVTFdfZ2V0UmFuZG9tTnVtYmVyS2V5AQUBaQUMcmFuZG9tTnVtYmVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEMTFdfZ2V0TG9nS2V5AQUBaQUNd2lubmluZ0Ftb3VudAUDbmlsAH6uNNM=", "height": 2612280, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2ZWNKTRB5hDrnQAqY42kGUR9m2ELMg4Zm77boSRVva8a Next: CLEC5yPeYwdCBuzY48jHxuDmcPHUEHbNrJDfRX9EZgwN Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | func isPaymentOk (i,sum) = { | |
8 | 8 | let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
9 | 9 | let p = i.payments[0] | |
10 | - | if (if ((size(i.payments) == 0)) | |
11 | - | then true | |
12 | - | else (p.assetId != acceptableAssetId)) | |
13 | - | then throw("Payment not attached") | |
14 | - | else true | |
10 | + | match p.assetId { | |
11 | + | case _ => | |
12 | + | (p.amount >= numToWaves(sum)) | |
13 | + | } | |
15 | 14 | } | |
16 | 15 | ||
17 | 16 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func numToWaves (num) = (num * 100000000) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func isPaymentOk (i,sum) = { | |
8 | 8 | let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
9 | 9 | let p = i.payments[0] | |
10 | - | if (if ((size(i.payments) == 0)) | |
11 | - | then true | |
12 | - | else (p.assetId != acceptableAssetId)) | |
13 | - | then throw("Payment not attached") | |
14 | - | else true | |
10 | + | match p.assetId { | |
11 | + | case _ => | |
12 | + | (p.amount >= numToWaves(sum)) | |
13 | + | } | |
15 | 14 | } | |
16 | 15 | ||
17 | 16 | ||
18 | 17 | func mapIntToStr (accum,next) = toString(next) :: accum | |
19 | 18 | ||
20 | 19 | ||
21 | 20 | func mapStrToInt (accum,next) = parseIntValue(next) :: accum | |
22 | 21 | ||
23 | 22 | ||
24 | 23 | func mapIntToSum (accum,next) = (accum + next) | |
25 | 24 | ||
26 | 25 | ||
27 | 26 | func listIntToSum (arr) = { | |
28 | 27 | let $l = arr | |
29 | 28 | let $s = size($l) | |
30 | 29 | let $acc0 = 0 | |
31 | 30 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
32 | 31 | then $a | |
33 | 32 | else mapIntToSum($a, $l[$i]) | |
34 | 33 | ||
35 | 34 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
36 | 35 | then $a | |
37 | 36 | else throw("List size exceeds 100") | |
38 | 37 | ||
39 | 38 | $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($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
40 | 39 | } | |
41 | 40 | ||
42 | 41 | ||
43 | 42 | func listIntToListString (arr) = { | |
44 | 43 | let $l = arr | |
45 | 44 | let $s = size($l) | |
46 | 45 | let $acc0 = nil | |
47 | 46 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
48 | 47 | then $a | |
49 | 48 | else mapIntToStr($a, $l[$i]) | |
50 | 49 | ||
51 | 50 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
52 | 51 | then $a | |
53 | 52 | else throw("List size exceeds 100") | |
54 | 53 | ||
55 | 54 | $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($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
56 | 55 | } | |
57 | 56 | ||
58 | 57 | ||
59 | 58 | func listStringToListIng (arr) = { | |
60 | 59 | let $l = arr | |
61 | 60 | let $s = size($l) | |
62 | 61 | let $acc0 = nil | |
63 | 62 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
64 | 63 | then $a | |
65 | 64 | else mapStrToInt($a, $l[$i]) | |
66 | 65 | ||
67 | 66 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
68 | 67 | then $a | |
69 | 68 | else throw("List size exceeds 100") | |
70 | 69 | ||
71 | 70 | $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($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
72 | 71 | } | |
73 | 72 | ||
74 | 73 | ||
75 | 74 | func listStringCompressToString (arr) = makeString(arr, "|") | |
76 | 75 | ||
77 | 76 | ||
78 | 77 | func stringDecompressToListString (str) = split(str, "|") | |
79 | 78 | ||
80 | 79 | ||
81 | 80 | func listIntCompressToString (arr) = makeString(listIntToListString(arr), "|") | |
82 | 81 | ||
83 | 82 | ||
84 | 83 | func stringDecompressToListInt (arrStr) = listStringToListIng(split(arrStr, "|")) | |
85 | 84 | ||
86 | 85 | ||
87 | 86 | func LW_getBetKey (i) = ("bet_LuckyWheel_" + toString(i.caller)) | |
88 | 87 | ||
89 | 88 | ||
90 | 89 | func LW_getWonKey (i) = ("won_LuckyWheel_" + toString(i.caller)) | |
91 | 90 | ||
92 | 91 | ||
93 | 92 | func LW_getRandomNumberKey (i) = ("randomNumber_LuckyWheel_" + toString(i.caller)) | |
94 | 93 | ||
95 | 94 | ||
96 | 95 | func LW_getLogKey (i) = ((("log_LuckyWheel_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
97 | 96 | ||
98 | 97 | ||
99 | 98 | func LW_whatUserWon (value) = match value { | |
100 | 99 | case _ => | |
101 | 100 | if ((1 == $match0)) | |
102 | 101 | then numToWaves(2) | |
103 | 102 | else if ((3 == $match0)) | |
104 | 103 | then numToWaves(1) | |
105 | 104 | else if ((7 == $match0)) | |
106 | 105 | then numToWaves(6) | |
107 | 106 | else if ((9 == $match0)) | |
108 | 107 | then numToWaves(1) | |
109 | 108 | else 0 | |
110 | 109 | } | |
111 | 110 | ||
112 | 111 | ||
113 | 112 | func R_WinCalculator (randomNumber,betAmount,selectedNumberBets,betDirection) = { | |
114 | 113 | let RED_SECTORS = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
115 | 114 | if (if ((size(selectedNumberBets) == 1)) | |
116 | 115 | then (betDirection == "num") | |
117 | 116 | else false) | |
118 | 117 | then if ((selectedNumberBets[0] == randomNumber)) | |
119 | 118 | then (betAmount * 36) | |
120 | 119 | else 0 | |
121 | 120 | else if ((size(selectedNumberBets) == 2)) | |
122 | 121 | then if (containsElement(selectedNumberBets, randomNumber)) | |
123 | 122 | then (betAmount * 18) | |
124 | 123 | else 0 | |
125 | 124 | else if ((size(selectedNumberBets) == 3)) | |
126 | 125 | then if (containsElement(selectedNumberBets, randomNumber)) | |
127 | 126 | then (betAmount * 12) | |
128 | 127 | else 0 | |
129 | 128 | else if ((size(selectedNumberBets) == 4)) | |
130 | 129 | then if (containsElement(selectedNumberBets, randomNumber)) | |
131 | 130 | then (betAmount * 9) | |
132 | 131 | else 0 | |
133 | 132 | else if ((size(selectedNumberBets) == 12)) | |
134 | 133 | then if (containsElement(selectedNumberBets, randomNumber)) | |
135 | 134 | then (betAmount * 3) | |
136 | 135 | else 0 | |
137 | 136 | else if ((betDirection == "red")) | |
138 | 137 | then if (containsElement(RED_SECTORS, randomNumber)) | |
139 | 138 | then (betAmount * 2) | |
140 | 139 | else 0 | |
141 | 140 | else if ((betDirection == "black")) | |
142 | 141 | then if (if (!(containsElement(RED_SECTORS, randomNumber))) | |
143 | 142 | then (randomNumber != 0) | |
144 | 143 | else false) | |
145 | 144 | then (betAmount * 2) | |
146 | 145 | else 0 | |
147 | 146 | else if ((betDirection == "odd")) | |
148 | 147 | then if (((randomNumber % 2) != 0)) | |
149 | 148 | then (betAmount * 2) | |
150 | 149 | else 0 | |
151 | 150 | else if ((betDirection == "even")) | |
152 | 151 | then if (((randomNumber % 2) == 0)) | |
153 | 152 | then (betAmount * 2) | |
154 | 153 | else 0 | |
155 | 154 | else if ((size(selectedNumberBets) == 18)) | |
156 | 155 | then if (containsElement(selectedNumberBets, randomNumber)) | |
157 | 156 | then (betAmount * 2) | |
158 | 157 | else 0 | |
159 | 158 | else 0 | |
160 | 159 | } | |
161 | 160 | ||
162 | 161 | ||
163 | 162 | func R_getBetKey (i) = ("bet_Roulette_" + toString(i.caller)) | |
164 | 163 | ||
165 | 164 | ||
166 | 165 | func R_getBetAmountKey (i) = ("betAmount_Roulette_" + toString(i.caller)) | |
167 | 166 | ||
168 | 167 | ||
169 | 168 | func R_getSelectedNumbersKey (i) = ("selectedNumbers_Roulette_" + toString(i.caller)) | |
170 | 169 | ||
171 | 170 | ||
172 | 171 | func R_getDirectionKey (i) = ("direction_Roulette_" + toString(i.caller)) | |
173 | 172 | ||
174 | 173 | ||
175 | 174 | func R_getLogKey (i) = ((("log_Roulette_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
176 | 175 | ||
177 | 176 | ||
178 | 177 | @Callable(i) | |
179 | 178 | func Roulette_commit (betAmount,selectedNumberBets,betDirection) = if (!(isPaymentOk(i, betAmount))) | |
180 | 179 | then throw("Wrong payment amount or asset") | |
181 | 180 | else [IntegerEntry(R_getBetKey(i), (height + 1)), IntegerEntry(R_getBetAmountKey(i), betAmount), StringEntry(R_getSelectedNumbersKey(i), listIntCompressToString(selectedNumberBets)), StringEntry(R_getDirectionKey(i), betDirection)] | |
182 | 181 | ||
183 | 182 | ||
184 | 183 | ||
185 | 184 | @Callable(i) | |
186 | 185 | func Roulette_reveal () = { | |
187 | 186 | let commitHeight = valueOrErrorMessage(getIntegerValue(R_getBetKey(i)), "Bet not found") | |
188 | 187 | let betAmount = valueOrErrorMessage(getIntegerValue(R_getBetAmountKey(i)), "Bet amount not found") | |
189 | 188 | let selectedNumbersStr = valueOrErrorMessage(getStringValue(R_getSelectedNumbersKey(i)), "Selected numbers not found") | |
190 | 189 | let direction = valueOrErrorMessage(getStringValue(R_getDirectionKey(i)), "Direction not found") | |
191 | 190 | let selectedNumbers = stringDecompressToListInt(selectedNumbersStr) | |
192 | 191 | if ((commitHeight > height)) | |
193 | 192 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
194 | 193 | else { | |
195 | 194 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
196 | 195 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
197 | 196 | let randomHash = sha256(value(vrf)) | |
198 | 197 | let randomNumber = (toInt(randomHash, 16) % 37) | |
199 | 198 | let winningAmount = R_WinCalculator(randomNumber, betAmount, selectedNumbers, direction) | |
200 | 199 | if ((winningAmount > 0)) | |
201 | 200 | then [DeleteEntry(R_getBetKey(i)), DeleteEntry(R_getBetAmountKey(i)), DeleteEntry(R_getSelectedNumbersKey(i)), DeleteEntry(R_getDirectionKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(R_getLogKey(i), winningAmount)] | |
202 | 201 | else [DeleteEntry(R_getBetKey(i)), DeleteEntry(R_getBetAmountKey(i)), DeleteEntry(R_getSelectedNumbersKey(i)), DeleteEntry(R_getDirectionKey(i)), IntegerEntry(R_getLogKey(i), winningAmount)] | |
203 | 202 | } | |
204 | 203 | } | |
205 | 204 | ||
206 | 205 | ||
207 | 206 | ||
208 | 207 | @Callable(i) | |
209 | 208 | func LuckyWheel_commit () = if (!(isPaymentOk(i, 1))) | |
210 | 209 | then throw("Wrong payment amount or asset") | |
211 | 210 | else [IntegerEntry(LW_getBetKey(i), (height + 1)), DeleteEntry(LW_getRandomNumberKey(i)), DeleteEntry(LW_getWonKey(i))] | |
212 | 211 | ||
213 | 212 | ||
214 | 213 | ||
215 | 214 | @Callable(i) | |
216 | 215 | func LuckyWheel_reveal () = { | |
217 | 216 | let commitHeight = valueOrErrorMessage(getIntegerValue(LW_getBetKey(i)), "Bet not found") | |
218 | 217 | if ((commitHeight > height)) | |
219 | 218 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
220 | 219 | else { | |
221 | 220 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
222 | 221 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
223 | 222 | let randomHash = sha256(value(vrf)) | |
224 | 223 | let randomNumber = (toInt(randomHash, 16) % 12) | |
225 | 224 | let winningAmount = LW_whatUserWon(randomNumber) | |
226 | 225 | if ((winningAmount > 0)) | |
227 | 226 | then [DeleteEntry(LW_getBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), IntegerEntry(LW_getLogKey(i), winningAmount)] | |
228 | 227 | else [DeleteEntry(LW_getBetKey(i)), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), IntegerEntry(LW_getLogKey(i), winningAmount)] | |
229 | 228 | } | |
230 | 229 | } | |
231 | 230 | ||
232 | 231 |
github/deemru/w8io/026f985 53.70 ms ◑