tx · HAdZhQHXcBuMTHcxmdENfNqj7mCTa62UsPb7xTBDSExr 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX: -0.01000000 Waves 2023.06.09 12:10 [2614936] smart account 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX > SELF 0.00000000 Waves
{ "type": 13, "id": "HAdZhQHXcBuMTHcxmdENfNqj7mCTa62UsPb7xTBDSExr", "fee": 1000000, "feeAssetId": null, "timestamp": 1686301874552, "version": 2, "chainId": 84, "sender": "3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX", "senderPublicKey": "5iiNX4Sz3qZzcerumQLc1y7u9TH2X46jDV4f9Xivtmtv", "proofs": [ "37NJXTB8sujXYm41qAxyTmwwp4ReByuTu8vRxzcYPWSx8K5w55nZr9UXUBGGKJHXw28XwCJiJLb6cYLuMpqQLra4" ], "script": "base64:BgIPCAISBQoDAREIEgASABIAGAEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAgFpA3N1bQQRYWNjZXB0YWJsZUFzc2V0SWQBBBOr2TMEAXAJAJEDAggFAWkIcGF5bWVudHMAAAMJAGcCCAUBcAZhbW91bnQJAQpudW1Ub1dhdmVzAQUDc3VtCQAAAggFAXAHYXNzZXRJZAUEdW5pdAcBC21hcEludFRvU3RyAgVhY2N1bQRuZXh0CQDMCAIJAKQDAQUEbmV4dAUFYWNjdW0BC21hcFN0clRvSW50AgVhY2N1bQRuZXh0CQDMCAIJAQ1wYXJzZUludFZhbHVlAQUEbmV4dAUFYWNjdW0BC21hcEludFRvU3VtAgVhY2N1bQRuZXh0CQBkAgUFYWNjdW0FBG5leHQBDGxpc3RJbnRUb1N1bQEDYXJyCgACJGwFA2FycgoAAiRzCQCQAwEFAiRsCgAFJGFjYzAAAAoBBSRmMF8xAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQELbWFwSW50VG9TdW0CBQIkYQkAkQMCBQIkbAUCJGkKAQUk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WwAeN5wPA==", "height": 2614936, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7X3s7MCHqwL7NQ9qUZGLnHDksg4TpvCWJig9o9qma95A Next: GjcSFpQG3FCdCnCL8Avd5k5jxkLcW2nVKmYPSbgT5eQG Diff:
Old | New | Differences | |
---|---|---|---|
197 | 197 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
198 | 198 | else { | |
199 | 199 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
200 | + | let revealBlockMin1 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 10)), "unexcpected error") | |
200 | 201 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
202 | + | let vrfMin1 = valueOrErrorMessage(revealBlockMin1.vrf, "unexcpected error") | |
201 | 203 | let randomHash = sha256(value(vrf)) | |
202 | - | let randomNumber = (toInt(randomHash, 16) % 37) | |
204 | + | let randomHashMin1 = sha256(value(vrfMin1)) | |
205 | + | let hash = (toInt(randomHash, 16) - (toInt(randomHashMin1, 16) * toInt(randomHash, 16))) | |
206 | + | let randomNumber = (hash % 37) | |
203 | 207 | let winningAmount = numToWaves(R_WinCalculator(randomNumber, betAmount, selectedNumbers, direction)) | |
204 | 208 | let logStr = ((((((((("| commitHeight: " + toString(commitHeight)) + " | betAmount: ") + toString(betAmount)) + " | winningAmount: ") + toString(winningAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) + " | randomNumber: ") + toString(randomNumber)) | |
205 | 209 | let statusStr = ((((((((("| status: reveal | winningAmount: " + toString(winningAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) + " | randomNumber: ") + toString(randomNumber)) + " | betAmount: ") + toString(betAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) |
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 LW_getBetKey (i) = ("bet_LuckyWheel_" + toString(i.caller)) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func LW_getWonKey (i) = ("won_LuckyWheel_" + toString(i.caller)) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func LW_getRandomNumberKey (i) = ("randomNumber_LuckyWheel_" + toString(i.caller)) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func LW_getLogKey (i) = ((("log_LuckyWheel_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func LW_whatUserWon (value) = match value { | |
98 | 98 | case _ => | |
99 | 99 | if ((1 == $match0)) | |
100 | 100 | then numToWaves(2) | |
101 | 101 | else if ((3 == $match0)) | |
102 | 102 | then numToWaves(1) | |
103 | 103 | else if ((7 == $match0)) | |
104 | 104 | then numToWaves(6) | |
105 | 105 | else if ((9 == $match0)) | |
106 | 106 | then numToWaves(1) | |
107 | 107 | else 0 | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func R_WinCalculator (randomNumber,betAmount,selectedNumberBets,betDirection) = { | |
112 | 112 | let RED_SECTORS = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
113 | 113 | if (if ((size(selectedNumberBets) == 1)) | |
114 | 114 | then (betDirection == "num") | |
115 | 115 | else false) | |
116 | 116 | then if ((selectedNumberBets[0] == randomNumber)) | |
117 | 117 | then (betAmount * 36) | |
118 | 118 | else 0 | |
119 | 119 | else if ((size(selectedNumberBets) == 2)) | |
120 | 120 | then if (containsElement(selectedNumberBets, randomNumber)) | |
121 | 121 | then (betAmount * 18) | |
122 | 122 | else 0 | |
123 | 123 | else if ((size(selectedNumberBets) == 3)) | |
124 | 124 | then if (containsElement(selectedNumberBets, randomNumber)) | |
125 | 125 | then (betAmount * 12) | |
126 | 126 | else 0 | |
127 | 127 | else if ((size(selectedNumberBets) == 4)) | |
128 | 128 | then if (containsElement(selectedNumberBets, randomNumber)) | |
129 | 129 | then (betAmount * 9) | |
130 | 130 | else 0 | |
131 | 131 | else if ((size(selectedNumberBets) == 12)) | |
132 | 132 | then if (containsElement(selectedNumberBets, randomNumber)) | |
133 | 133 | then (betAmount * 3) | |
134 | 134 | else 0 | |
135 | 135 | else if ((betDirection == "red")) | |
136 | 136 | then if (containsElement(RED_SECTORS, randomNumber)) | |
137 | 137 | then (betAmount * 2) | |
138 | 138 | else 0 | |
139 | 139 | else if ((betDirection == "black")) | |
140 | 140 | then if (if (!(containsElement(RED_SECTORS, randomNumber))) | |
141 | 141 | then (randomNumber != 0) | |
142 | 142 | else false) | |
143 | 143 | then (betAmount * 2) | |
144 | 144 | else 0 | |
145 | 145 | else if ((betDirection == "odd")) | |
146 | 146 | then if (((randomNumber % 2) != 0)) | |
147 | 147 | then (betAmount * 2) | |
148 | 148 | else 0 | |
149 | 149 | else if ((betDirection == "even")) | |
150 | 150 | then if (((randomNumber % 2) == 0)) | |
151 | 151 | then (betAmount * 2) | |
152 | 152 | else 0 | |
153 | 153 | else if ((size(selectedNumberBets) == 18)) | |
154 | 154 | then if (containsElement(selectedNumberBets, randomNumber)) | |
155 | 155 | then (betAmount * 2) | |
156 | 156 | else 0 | |
157 | 157 | else 0 | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func R_getBetKey (i) = ("bet_Roulette_" + toString(i.caller)) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func R_getBetAmountKey (i) = ("betAmount_Roulette_" + toString(i.caller)) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func R_getSelectedNumbersKey (i) = ("selectedNumbers_Roulette_" + toString(i.caller)) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func R_getDirectionKey (i) = ("direction_Roulette_" + toString(i.caller)) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func R_getLogKey (i) = ((("log_Roulette_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func R_getStatusKey (i) = ("status_Roulette_" + toString(i.caller)) | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | @Callable(i) | |
180 | 180 | func Roulette_commit (betAmount,selectedNumberBets,betDirection) = { | |
181 | 181 | let p = i.payments[0] | |
182 | 182 | if (!(isPaymentOk(i, betAmount))) | |
183 | 183 | then throw("Wrong payment amount or asset!") | |
184 | 184 | 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)))] | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | ||
189 | 189 | @Callable(i) | |
190 | 190 | func Roulette_reveal () = { | |
191 | 191 | let commitHeight = valueOrErrorMessage(getIntegerValue(R_getBetKey(i)), "Bet not found") | |
192 | 192 | let betAmount = valueOrErrorMessage(getIntegerValue(R_getBetAmountKey(i)), "Bet amount not found") | |
193 | 193 | let selectedNumbersStr = valueOrErrorMessage(getStringValue(R_getSelectedNumbersKey(i)), "Selected numbers not found") | |
194 | 194 | let direction = valueOrErrorMessage(getStringValue(R_getDirectionKey(i)), "Direction not found") | |
195 | 195 | let selectedNumbers = stringDecompressToListInt(selectedNumbersStr) | |
196 | 196 | if ((commitHeight > height)) | |
197 | 197 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
198 | 198 | else { | |
199 | 199 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
200 | + | let revealBlockMin1 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 10)), "unexcpected error") | |
200 | 201 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
202 | + | let vrfMin1 = valueOrErrorMessage(revealBlockMin1.vrf, "unexcpected error") | |
201 | 203 | let randomHash = sha256(value(vrf)) | |
202 | - | let randomNumber = (toInt(randomHash, 16) % 37) | |
204 | + | let randomHashMin1 = sha256(value(vrfMin1)) | |
205 | + | let hash = (toInt(randomHash, 16) - (toInt(randomHashMin1, 16) * toInt(randomHash, 16))) | |
206 | + | let randomNumber = (hash % 37) | |
203 | 207 | let winningAmount = numToWaves(R_WinCalculator(randomNumber, betAmount, selectedNumbers, direction)) | |
204 | 208 | let logStr = ((((((((("| commitHeight: " + toString(commitHeight)) + " | betAmount: ") + toString(betAmount)) + " | winningAmount: ") + toString(winningAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) + " | randomNumber: ") + toString(randomNumber)) | |
205 | 209 | let statusStr = ((((((((("| status: reveal | winningAmount: " + toString(winningAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) + " | randomNumber: ") + toString(randomNumber)) + " | betAmount: ") + toString(betAmount)) + " | selectedNumbers: ") + listIntCompressToString(selectedNumbers)) | |
206 | 210 | if ((winningAmount > 0)) | |
207 | 211 | 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)] | |
208 | 212 | 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)] | |
209 | 213 | } | |
210 | 214 | } | |
211 | 215 | ||
212 | 216 | ||
213 | 217 | ||
214 | 218 | @Callable(i) | |
215 | 219 | func LuckyWheel_commit () = if (!(isPaymentOk(i, 1))) | |
216 | 220 | then throw("Wrong payment amount or asset") | |
217 | 221 | else [IntegerEntry(LW_getBetKey(i), (height + 1)), DeleteEntry(LW_getRandomNumberKey(i)), DeleteEntry(LW_getWonKey(i))] | |
218 | 222 | ||
219 | 223 | ||
220 | 224 | ||
221 | 225 | @Callable(i) | |
222 | 226 | func LuckyWheel_reveal () = { | |
223 | 227 | let commitHeight = valueOrErrorMessage(getIntegerValue(LW_getBetKey(i)), "Bet not found") | |
224 | 228 | if ((commitHeight > height)) | |
225 | 229 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
226 | 230 | else { | |
227 | 231 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
228 | 232 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
229 | 233 | let randomHash = sha256(value(vrf)) | |
230 | 234 | let randomNumber = (toInt(randomHash, 16) % 12) | |
231 | 235 | let winningAmount = LW_whatUserWon(randomNumber) | |
232 | 236 | let logStr = ((((((("| caller: " + toString(i.caller)) + " | winningAmount: ") + toString(winningAmount)) + " | randomNumber: ") + toString(randomNumber)) + " | commitHeight: ") + toString(commitHeight)) | |
233 | 237 | if ((winningAmount > 0)) | |
234 | 238 | then [DeleteEntry(LW_getBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), StringEntry(LW_getLogKey(i), logStr)] | |
235 | 239 | else [DeleteEntry(LW_getBetKey(i)), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), StringEntry(LW_getLogKey(i), logStr)] | |
236 | 240 | } | |
237 | 241 | } | |
238 | 242 | ||
239 | 243 |
github/deemru/w8io/026f985 61.21 ms ◑