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