tx · AciMgN56vqSTijC4Y9YntaHSGmdRViYxVGMn6E4DuX4D 3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE: -0.05000000 Waves 2019.11.27 07:29 [783198] smart account 3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE > SELF 0.00000000 Waves
{ "type": 13, "id": "AciMgN56vqSTijC4Y9YntaHSGmdRViYxVGMn6E4DuX4D", "fee": 5000000, "feeAssetId": null, "timestamp": 1574829013533, "version": 1, "sender": "3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE", "senderPublicKey": "FEmBffz5oKcY5pLrHbwcj8jxovWVvTYCeNRzNT6uHBJc", "proofs": [ "2YGVFdViQkQ7nBXtevCrwfmByPbPWXTuaLANfjKQPrjLQWUsT68qWrZFiZrJrYH8aT4Lv3LzvbpSxzMgJFJtkoaN" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAJwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQgAAAAAPR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QABkQAAAAIFAAAABGJldHMAAAAAAAAAAAACAAAAAAkBAAAAFHZhbGlkYXRlQmV0QW5kR2V0QW10AAAAAQMJAABnAAAAAgUAAAABcwAAAAAAAAAAAgkAAZEAAAACBQAAAARiZXRzAAAAAAAAAAABAgAAAAABAAAAEEluY3JlbWVudEdhbWVOdW0AAAAABAAAAAdnYW1lTnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAD0dBTUVTQ09VTlRFUktFWQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAANudW0FAAAAByRtYXRjaDAFAAAAA251bQAAAAAAAAAAAAkAAGQAAAACBQAAAAdnYW1lTnVtAAAAAAAAAAABAAAAAQAAAAFpAQAAAAxwbGF5Um91bGV0dGUAAAABAAAABGJldHMEAAAAB2JldExpc3QJAAS1AAAAAgUAAAAEYmV0cwIAAAABfAQAAAABdAkBAAAACmdldEJldHNBbXQAAAABBQAAAAdiZXRMaXN0CQAAAgAAAAEJAAGkAAAAAQUAAAABdAAAAAAZBPKz", "chainId": 84, "height": 783198, "spentComplexity": 0 } View: original | compacted Prev: 3vyJGUgUmtvAMrko5Pf7Wt6mpJfhTtQG2jDP1xotTh5k Next: EtBy7VhwofvS1nhhXBHBUsx9sxELsry2EwfWEH9uhpjc Diff:
Old | New | Differences | |
---|---|---|---|
325 | 325 | ||
326 | 326 | func getBetsAmt (bets) = { | |
327 | 327 | let s = size(bets) | |
328 | - | | |
328 | + | (validateBetAndGetAmt(if ((s >= 1)) | |
329 | 329 | then bets[0] | |
330 | - | else "") + validateBetAndGetAmt(if (( | |
330 | + | else "") + validateBetAndGetAmt(if ((s >= 2)) | |
331 | 331 | then bets[1] | |
332 | 332 | else "")) | |
333 | - | a | |
334 | 333 | } | |
335 | 334 | ||
336 | 335 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB") | |
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | 8 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | 9 | ||
10 | 10 | let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw' | |
11 | 11 | ||
12 | 12 | let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8') | |
13 | 13 | ||
14 | 14 | let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8') | |
15 | 15 | ||
16 | 16 | let WAVELET = 100000000 | |
17 | 17 | ||
18 | 18 | let FEEWAVESBET = 4 | |
19 | 19 | ||
20 | 20 | let FEEMCAFEE = 2 | |
21 | 21 | ||
22 | 22 | let STATESUBMITTED = "SUBMITTED" | |
23 | 23 | ||
24 | 24 | let STATEWON = "WON" | |
25 | 25 | ||
26 | 26 | let STATELOST = "LOST" | |
27 | 27 | ||
28 | 28 | let BETMIN = (1 * WAVELET) | |
29 | 29 | ||
30 | 30 | let BETMAX = (20000000 * WAVELET) | |
31 | 31 | ||
32 | 32 | let TSTRAIGHT = 1 | |
33 | 33 | ||
34 | 34 | let TSPLIT = 2 | |
35 | 35 | ||
36 | 36 | let TSTREET = 3 | |
37 | 37 | ||
38 | 38 | let TCORNER = 4 | |
39 | 39 | ||
40 | 40 | let TLINE = 5 | |
41 | 41 | ||
42 | 42 | let TCOLUMN = 6 | |
43 | 43 | ||
44 | 44 | let TDOZEN = 7 | |
45 | 45 | ||
46 | 46 | let TRED = 8 | |
47 | 47 | ||
48 | 48 | let TBLACK = 9 | |
49 | 49 | ||
50 | 50 | let TODD = 10 | |
51 | 51 | ||
52 | 52 | let TEVEN = 11 | |
53 | 53 | ||
54 | 54 | let T1TO18 = 12 | |
55 | 55 | ||
56 | 56 | let T19TO36 = 13 | |
57 | 57 | ||
58 | 58 | let HORIZONTAL = 1 | |
59 | 59 | ||
60 | 60 | let VERTICAL = 2 | |
61 | 61 | ||
62 | 62 | func is0to36 (num) = if (if ((num >= 0)) | |
63 | 63 | then (37 > num) | |
64 | 64 | else false) | |
65 | 65 | then true | |
66 | 66 | else throw("Invalid range, try between 0 and 36. Game aborted!") | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func isSplit (num1,num2,direction) = if ((direction == HORIZONTAL)) | |
70 | 70 | then if (if (if (if (if ((num1 > 0)) | |
71 | 71 | then (34 > num1) | |
72 | 72 | else false) | |
73 | 73 | then true | |
74 | 74 | else if ((num1 == 0)) | |
75 | 75 | then (num2 == 1) | |
76 | 76 | else false) | |
77 | 77 | then true | |
78 | 78 | else if ((num1 == 0)) | |
79 | 79 | then (num2 == 2) | |
80 | 80 | else false) | |
81 | 81 | then true | |
82 | 82 | else if ((num1 == 0)) | |
83 | 83 | then (num2 == 3) | |
84 | 84 | else false) | |
85 | 85 | then true | |
86 | 86 | else throw("Invalid split hotizontal move. Game aborted!") | |
87 | 87 | else if ((direction == VERTICAL)) | |
88 | 88 | then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1)) | |
89 | 89 | then true | |
90 | 90 | else (num1 == 2)) | |
91 | 91 | then true | |
92 | 92 | else (num1 == 4)) | |
93 | 93 | then true | |
94 | 94 | else (num1 == 5)) | |
95 | 95 | then true | |
96 | 96 | else (num1 == 7)) | |
97 | 97 | then true | |
98 | 98 | else (num1 == 8)) | |
99 | 99 | then true | |
100 | 100 | else (num1 == 10)) | |
101 | 101 | then true | |
102 | 102 | else (num1 == 11)) | |
103 | 103 | then true | |
104 | 104 | else (num1 == 13)) | |
105 | 105 | then true | |
106 | 106 | else (num1 == 14)) | |
107 | 107 | then true | |
108 | 108 | else (num1 == 16)) | |
109 | 109 | then true | |
110 | 110 | else (num1 == 17)) | |
111 | 111 | then true | |
112 | 112 | else (num1 == 19)) | |
113 | 113 | then true | |
114 | 114 | else (num1 == 20)) | |
115 | 115 | then true | |
116 | 116 | else (num1 == 22)) | |
117 | 117 | then true | |
118 | 118 | else (num1 == 23)) | |
119 | 119 | then true | |
120 | 120 | else (num1 == 25)) | |
121 | 121 | then true | |
122 | 122 | else (num1 == 26)) | |
123 | 123 | then true | |
124 | 124 | else (num1 == 28)) | |
125 | 125 | then true | |
126 | 126 | else (num1 == 29)) | |
127 | 127 | then true | |
128 | 128 | else (num1 == 31)) | |
129 | 129 | then true | |
130 | 130 | else (num1 == 32)) | |
131 | 131 | then true | |
132 | 132 | else (num1 == 34)) | |
133 | 133 | then true | |
134 | 134 | else (num1 == 35)) | |
135 | 135 | then true | |
136 | 136 | else throw("Invalid split vertical move. Game aborted!") | |
137 | 137 | else throw("Invalid split move. Game aborted!") | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func isStreet (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1)) | |
141 | 141 | then true | |
142 | 142 | else (num1 == 4)) | |
143 | 143 | then true | |
144 | 144 | else (num1 == 7)) | |
145 | 145 | then true | |
146 | 146 | else (num1 == 10)) | |
147 | 147 | then true | |
148 | 148 | else (num1 == 13)) | |
149 | 149 | then true | |
150 | 150 | else (num1 == 16)) | |
151 | 151 | then true | |
152 | 152 | else (num1 == 19)) | |
153 | 153 | then true | |
154 | 154 | else (num1 == 22)) | |
155 | 155 | then true | |
156 | 156 | else (num1 == 25)) | |
157 | 157 | then true | |
158 | 158 | else (num1 == 28)) | |
159 | 159 | then true | |
160 | 160 | else (num1 == 31)) | |
161 | 161 | then true | |
162 | 162 | else (num1 == 34)) | |
163 | 163 | then true | |
164 | 164 | else if ((num1 == 0)) | |
165 | 165 | then (num2 == 1) | |
166 | 166 | else false) | |
167 | 167 | then true | |
168 | 168 | else if ((num1 == 0)) | |
169 | 169 | then (num2 == 3) | |
170 | 170 | else false) | |
171 | 171 | then true | |
172 | 172 | else throw("Invalid street move. Game aborted!") | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func isCorner (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1)) | |
176 | 176 | then true | |
177 | 177 | else (num1 == 2)) | |
178 | 178 | then true | |
179 | 179 | else (num1 == 4)) | |
180 | 180 | then true | |
181 | 181 | else (num1 == 5)) | |
182 | 182 | then true | |
183 | 183 | else (num1 == 7)) | |
184 | 184 | then true | |
185 | 185 | else (num1 == 8)) | |
186 | 186 | then true | |
187 | 187 | else (num1 == 10)) | |
188 | 188 | then true | |
189 | 189 | else (num1 == 11)) | |
190 | 190 | then true | |
191 | 191 | else (num1 == 13)) | |
192 | 192 | then true | |
193 | 193 | else (num1 == 14)) | |
194 | 194 | then true | |
195 | 195 | else (num1 == 16)) | |
196 | 196 | then true | |
197 | 197 | else (num1 == 17)) | |
198 | 198 | then true | |
199 | 199 | else (num1 == 19)) | |
200 | 200 | then true | |
201 | 201 | else (num1 == 20)) | |
202 | 202 | then true | |
203 | 203 | else (num1 == 22)) | |
204 | 204 | then true | |
205 | 205 | else (num1 == 23)) | |
206 | 206 | then true | |
207 | 207 | else (num1 == 25)) | |
208 | 208 | then true | |
209 | 209 | else (num1 == 26)) | |
210 | 210 | then true | |
211 | 211 | else (num1 == 28)) | |
212 | 212 | then true | |
213 | 213 | else (num1 == 29)) | |
214 | 214 | then true | |
215 | 215 | else (num1 == 31)) | |
216 | 216 | then true | |
217 | 217 | else (num1 == 32)) | |
218 | 218 | then true | |
219 | 219 | else if ((num1 == 0)) | |
220 | 220 | then (num2 == 1) | |
221 | 221 | else false) | |
222 | 222 | then true | |
223 | 223 | else throw("Invalid corner move. Game aborted!") | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func isLine (num) = if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
227 | 227 | then true | |
228 | 228 | else (num == 4)) | |
229 | 229 | then true | |
230 | 230 | else (num == 7)) | |
231 | 231 | then true | |
232 | 232 | else (num == 10)) | |
233 | 233 | then true | |
234 | 234 | else (num == 13)) | |
235 | 235 | then true | |
236 | 236 | else (num == 16)) | |
237 | 237 | then true | |
238 | 238 | else (num == 19)) | |
239 | 239 | then true | |
240 | 240 | else (num == 22)) | |
241 | 241 | then true | |
242 | 242 | else (num == 25)) | |
243 | 243 | then true | |
244 | 244 | else (num == 28)) | |
245 | 245 | then true | |
246 | 246 | else (num == 31)) | |
247 | 247 | then true | |
248 | 248 | else throw("Invalid line move. Game aborted!") | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func isColumn (column) = if (if (if ((column == 1)) | |
252 | 252 | then true | |
253 | 253 | else (column == 2)) | |
254 | 254 | then true | |
255 | 255 | else (column == 3)) | |
256 | 256 | then true | |
257 | 257 | else throw("Invalid column move. Game aborted!") | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func isDozen (dozen) = if (if (if ((dozen == 1)) | |
261 | 261 | then true | |
262 | 262 | else (dozen == 2)) | |
263 | 263 | then true | |
264 | 264 | else (dozen == 3)) | |
265 | 265 | then true | |
266 | 266 | else throw("Invalid dozen move. Game aborted!") | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | func validateBetAndGetAmt (bet) = if ((size(bet) != 0)) | |
270 | 270 | then { | |
271 | 271 | let betContents = split(bet, "_") | |
272 | 272 | if ((size(betContents) == 5)) | |
273 | 273 | then { | |
274 | 274 | let betType = parseInt(betContents[0]) | |
275 | 275 | let betAmount = parseIntValue(betContents[1]) | |
276 | 276 | let betNum1 = parseIntValue(betContents[2]) | |
277 | 277 | let betNum2 = parseIntValue(betContents[3]) | |
278 | 278 | let betNum3 = parseIntValue(betContents[4]) | |
279 | 279 | if (is0to36(betNum1)) | |
280 | 280 | then if ((betType == TSTRAIGHT)) | |
281 | 281 | then betAmount | |
282 | 282 | else if ((betType == TSPLIT)) | |
283 | 283 | then if (isSplit(betNum1, betNum2, betNum3)) | |
284 | 284 | then betAmount | |
285 | 285 | else 0 | |
286 | 286 | else if ((betType == TSTREET)) | |
287 | 287 | then if (isStreet(betNum1, betNum2)) | |
288 | 288 | then betAmount | |
289 | 289 | else 0 | |
290 | 290 | else if ((betType == TCOLUMN)) | |
291 | 291 | then if (isCorner(betNum1, betNum2)) | |
292 | 292 | then betAmount | |
293 | 293 | else 0 | |
294 | 294 | else if ((betType == TLINE)) | |
295 | 295 | then if (isLine(betNum1)) | |
296 | 296 | then betAmount | |
297 | 297 | else 0 | |
298 | 298 | else if ((betType == TCOLUMN)) | |
299 | 299 | then if (isColumn(betNum1)) | |
300 | 300 | then betAmount | |
301 | 301 | else 0 | |
302 | 302 | else if ((betType == TDOZEN)) | |
303 | 303 | then if (isDozen(betNum1)) | |
304 | 304 | then betAmount | |
305 | 305 | else 0 | |
306 | 306 | else if ((betType == TRED)) | |
307 | 307 | then betAmount | |
308 | 308 | else if ((betType == TBLACK)) | |
309 | 309 | then betAmount | |
310 | 310 | else if ((betType == TODD)) | |
311 | 311 | then betAmount | |
312 | 312 | else if ((betType == TEVEN)) | |
313 | 313 | then betAmount | |
314 | 314 | else if ((betType == T1TO18)) | |
315 | 315 | then betAmount | |
316 | 316 | else if ((betType == T19TO36)) | |
317 | 317 | then betAmount | |
318 | 318 | else throw("Invalid bet type, Game aborted!") | |
319 | 319 | else throw("Invalid bet range, Game aborted!") | |
320 | 320 | } | |
321 | 321 | else throw("Invalid bet structure, Game aborted!") | |
322 | 322 | } | |
323 | 323 | else 0 | |
324 | 324 | ||
325 | 325 | ||
326 | 326 | func getBetsAmt (bets) = { | |
327 | 327 | let s = size(bets) | |
328 | - | | |
328 | + | (validateBetAndGetAmt(if ((s >= 1)) | |
329 | 329 | then bets[0] | |
330 | - | else "") + validateBetAndGetAmt(if (( | |
330 | + | else "") + validateBetAndGetAmt(if ((s >= 2)) | |
331 | 331 | then bets[1] | |
332 | 332 | else "")) | |
333 | - | a | |
334 | 333 | } | |
335 | 334 | ||
336 | 335 | ||
337 | 336 | func IncrementGameNum () = { | |
338 | 337 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
339 | 338 | case num: Int => | |
340 | 339 | num | |
341 | 340 | case _ => | |
342 | 341 | 0 | |
343 | 342 | } | |
344 | 343 | (gameNum + 1) | |
345 | 344 | } | |
346 | 345 | ||
347 | 346 | ||
348 | 347 | @Callable(i) | |
349 | 348 | func playRoulette (bets) = { | |
350 | 349 | let betList = split(bets, "|") | |
351 | 350 | let t = getBetsAmt(betList) | |
352 | 351 | throw(toString(t)) | |
353 | 352 | } | |
354 | 353 | ||
355 | 354 |
github/deemru/w8io/169f3d6 66.26 ms ◑