tx · 8znXH3vAPR5TEhLq3AkvhBmjdWmi8WXsLPArmL9Hvd2c 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX: -0.01000000 Waves 2023.06.11 18:20 [2618183] smart account 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX > SELF 0.00000000 Waves
{ "type": 13, "id": "8znXH3vAPR5TEhLq3AkvhBmjdWmi8WXsLPArmL9Hvd2c", "fee": 1000000, "feeAssetId": null, "timestamp": 1686496897777, "version": 2, "chainId": 84, "sender": "3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX", "senderPublicKey": "5iiNX4Sz3qZzcerumQLc1y7u9TH2X46jDV4f9Xivtmtv", "proofs": [ "25X2884FvUX1s3W7MZ3GRXFNnHcFAdoK7qxenkqJjRZayCLBKVqsRZzRV2PJPw3okEXtWTmnGnSkac9eSdmveKqB" ], "script": "base64:BgIHCAISAwoBARoBCm51bVRvV2F2ZXMBA251bQkAaAIFA251bQCAwtcvAQtpc1BheW1lbnRPawIBaQNzdW0EEWFjY2VwdGFibGVBc3NldElkAQQTq9kzBAFwCQCRAwIIBQFpCHBheW1lbnRzAAADCQBnAggFAXAGYW1vdW50CQEKbnVtVG9XYXZlcwEFA3N1bQkAAAIIBQFwB2Fzc2V0SWQFBHVuaXQHAQttYXBJbnRUb1N0cgIFYWNjdW0EbmV4dAkAzAgCCQCkAwEFBG5leHQFBWFjY3VtAQttYXBTdHJUb0ludAIFYWNjdW0EbmV4dAkAzAgCCQENcGFyc2VJbnRWYWx1ZQEFBG5leHQFBWFjY3VtAQttYXBJbnRUb1N1bQIFYWNjdW0EbmV4dAkAZAIFBWFjY3VtBQRuZXh0AQxsaXN0SW50VG9TdW0BA2FycgoAAiRsBQNhcnIKAAIkcwkAkAMBBQIkbAoABSRhY2MwAAAKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBC21hcEludFRvU3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRh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3JNZXNzYWdlAggFC3JldmVhbEJsb2NrA3ZyZgIRdW5leGNwZWN0ZWQgZXJyb3IEC3JhbmRvbUhhc2g1CQD3AwEJAQV2YWx1ZQEFA3ZyZgQCbjEJAGoCCQCyCQIFCnJhbmRvbUhhc2gAEAAlBAJuMgkAagIJALIJAgULcmFuZG9tSGFzaDIAEAAlBAJuMwkAagIJALIJAgULcmFuZG9tSGFzaDMAEAAlBAJuNAkAagIJALIJAgULcmFuZG9tSGFzaDQAEAAlBAJuNQkAagIJALIJAgULcmFuZG9tSGFzaDQAEAAlAwkAZgIFAm4xABIJAAIBCQCsAgICA3wxKwkApAMBBQJuMQMJAGYCBQJuMgASCQACAQkArAICAgN8MisJAKQDAQUCbjIDCQBmAgUCbjMAEgkAAgEJAKwCAgIDfDMrCQCkAwEFAm4zAwkAZgIFAm40ABIJAAIBCQCsAgICA3w0KwkApAMBBQJuNAkAAgEJAKwCAgIDfDUrCQCkAwEFAm41AL/Afu0=", "height": 2618183, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5SE4XMrwfyohNm6huEm3rWjCasYPwW7zscgFdVcsmgci Next: 7P8jGVY2u9iHPQTb6Sgbk7UF4XkBtXW238PvN4h4Up43 Diff:
Old | New | Differences | |
---|---|---|---|
206 | 206 | let vrf5 = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
207 | 207 | let randomHash5 = sha256(value(vrf)) | |
208 | 208 | let n1 = (toInt(randomHash, 16) % 37) | |
209 | - | let n2 = (toInt(randomHash2, | |
210 | - | let n3 = (toInt(randomHash3, | |
211 | - | let n4 = (toInt(randomHash4, | |
212 | - | let n5 = (toInt(randomHash4, | |
209 | + | let n2 = (toInt(randomHash2, 16) % 37) | |
210 | + | let n3 = (toInt(randomHash3, 16) % 37) | |
211 | + | let n4 = (toInt(randomHash4, 16) % 37) | |
212 | + | let n5 = (toInt(randomHash4, 16) % 37) | |
213 | 213 | if ((n1 > 18)) | |
214 | 214 | then throw(("|1+" + toString(n1))) | |
215 | 215 | else if ((n2 > 18)) |
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 | 196 | let revealBlock2 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 333)), "unexcpected error") | |
197 | 197 | let vrf2 = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
198 | 198 | let randomHash2 = sha256(value(vrf)) | |
199 | 199 | let revealBlock3 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 666)), "unexcpected error") | |
200 | 200 | let vrf3 = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
201 | 201 | let randomHash3 = sha256(value(vrf)) | |
202 | 202 | let revealBlock4 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 777)), "unexcpected error") | |
203 | 203 | let vrf4 = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
204 | 204 | let randomHash4 = sha256(value(vrf)) | |
205 | 205 | let revealBlock5 = valueOrErrorMessage(blockInfoByHeight((commitHeight - 999)), "unexcpected error") | |
206 | 206 | let vrf5 = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
207 | 207 | let randomHash5 = sha256(value(vrf)) | |
208 | 208 | let n1 = (toInt(randomHash, 16) % 37) | |
209 | - | let n2 = (toInt(randomHash2, | |
210 | - | let n3 = (toInt(randomHash3, | |
211 | - | let n4 = (toInt(randomHash4, | |
212 | - | let n5 = (toInt(randomHash4, | |
209 | + | let n2 = (toInt(randomHash2, 16) % 37) | |
210 | + | let n3 = (toInt(randomHash3, 16) % 37) | |
211 | + | let n4 = (toInt(randomHash4, 16) % 37) | |
212 | + | let n5 = (toInt(randomHash4, 16) % 37) | |
213 | 213 | if ((n1 > 18)) | |
214 | 214 | then throw(("|1+" + toString(n1))) | |
215 | 215 | else if ((n2 > 18)) | |
216 | 216 | then throw(("|2+" + toString(n2))) | |
217 | 217 | else if ((n3 > 18)) | |
218 | 218 | then throw(("|3+" + toString(n3))) | |
219 | 219 | else if ((n4 > 18)) | |
220 | 220 | then throw(("|4+" + toString(n4))) | |
221 | 221 | else throw(("|5+" + toString(n5))) | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 |
github/deemru/w8io/026f985 39.84 ms ◑