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