tx · 22w5MMJe7WqQSHYtBDWv9Km2ZDReRBtBgjvmNtn7rd3v 3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE: -0.05000000 Waves 2019.11.25 22:57 [781245] smart account 3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE > SELF 0.00000000 Waves
{ "type": 13, "id": "22w5MMJe7WqQSHYtBDWv9Km2ZDReRBtBgjvmNtn7rd3v", "fee": 5000000, "feeAssetId": null, "timestamp": 1574711760401, "version": 1, "sender": "3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE", "senderPublicKey": "FEmBffz5oKcY5pLrHbwcj8jxovWVvTYCeNRzNT6uHBJc", "proofs": [ "58WUMkYqw5TWviZ1rMwsEjbQhrakwd8EgiqEco2nfsDs4KBBHLk2mX1mf5SCjQDoTVz7N8gsKokhoyHhy9GbKotr" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAALQAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQgAAA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RSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA9HQU1FU0NPVU5URVJLRVkFAAAACm5ld0dhbWVOdW0JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABmdhbWVJZAUAAAALZ2FtZURhdGFTdHIFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAA5XQUxMRVRXQVZFU0JFVAkAAGsAAAADCAUAAAAHcGF5bWVudAAAAAZhbW91bnQFAAAAC0ZFRVdBVkVTQkVUAAAAAAAAAABkBQAAAARXQkVUCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADFdBTExFVE1DQUZFRQkAAGsAAAADCAUAAAAHcGF5bWVudAAAAAZhbW91bnQFAAAACUZFRU1DQUZFRQAAAAAAAAAAZAUAAAAEV0JFVAUAAAADbmlsAAAAAK7AbOM=", "chainId": 84, "height": 781245, "spentComplexity": 0 } View: original | compacted Prev: 3d5Jjt1EhmSYsvb6AitDX5wMZEEYMTikNTLY7CyMWCbx Next: 4u8SthytCmgUaTxiiUaunF8JfHxkHaDxVPXTPwPskzm8 Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | let BETMAX = (20000000 * WAVELET) | |
31 | 31 | ||
32 | - | func validateBets (bets,pos) = { | |
33 | - | let bet = bets[pos] | |
34 | - | throw(bet) | |
32 | + | let TSTRAIGHT = 1 | |
33 | + | ||
34 | + | let TSPLIT = 2 | |
35 | + | ||
36 | + | let TSTREET = 3 | |
37 | + | ||
38 | + | let TCORNER = 4 | |
39 | + | ||
40 | + | let TLINE = 5 | |
41 | + | ||
42 | + | let TCOLUMN = 6 | |
43 | + | ||
44 | + | let TDOZEN = 7 | |
45 | + | ||
46 | + | let TRED = 8 | |
47 | + | ||
48 | + | let TBLACK = 9 | |
49 | + | ||
50 | + | let TODD = 10 | |
51 | + | ||
52 | + | let TEVEN = 11 | |
53 | + | ||
54 | + | let T1TO18 = 12 | |
55 | + | ||
56 | + | let T19TO36 = 13 | |
57 | + | ||
58 | + | let HORIZONTAL = 1 | |
59 | + | ||
60 | + | let VERTICAL = 2 | |
61 | + | ||
62 | + | let payout = 0 | |
63 | + | ||
64 | + | func is0to36 (num) = if (if ((num >= 0)) | |
65 | + | then (37 > num) | |
66 | + | else false) | |
67 | + | then true | |
68 | + | else throw("Invalid range, try between 0 and 36. Game aborted!") | |
69 | + | ||
70 | + | ||
71 | + | func isSplit (num1,num2,direction) = if ((direction == HORIZONTAL)) | |
72 | + | then if (if (if (if (if ((num1 > 0)) | |
73 | + | then (34 > num1) | |
74 | + | else false) | |
75 | + | then true | |
76 | + | else if ((num1 == 0)) | |
77 | + | then (num2 == 1) | |
78 | + | else false) | |
79 | + | then true | |
80 | + | else if ((num1 == 0)) | |
81 | + | then (num2 == 2) | |
82 | + | else false) | |
83 | + | then true | |
84 | + | else if ((num1 == 0)) | |
85 | + | then (num2 == 3) | |
86 | + | else false) | |
87 | + | then true | |
88 | + | else throw("Invalid hotizontal split move. Game aborted!") | |
89 | + | else if ((direction == VERTICAL)) | |
90 | + | 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)) | |
91 | + | then true | |
92 | + | else (num1 == 2)) | |
93 | + | then true | |
94 | + | else (num1 == 4)) | |
95 | + | then true | |
96 | + | else (num1 == 5)) | |
97 | + | then true | |
98 | + | else (num1 == 7)) | |
99 | + | then true | |
100 | + | else (num1 == 8)) | |
101 | + | then true | |
102 | + | else (num1 == 10)) | |
103 | + | then true | |
104 | + | else (num1 == 11)) | |
105 | + | then true | |
106 | + | else (num1 == 13)) | |
107 | + | then true | |
108 | + | else (num1 == 14)) | |
109 | + | then true | |
110 | + | else (num1 == 16)) | |
111 | + | then true | |
112 | + | else (num1 == 17)) | |
113 | + | then true | |
114 | + | else (num1 == 19)) | |
115 | + | then true | |
116 | + | else (num1 == 20)) | |
117 | + | then true | |
118 | + | else (num1 == 22)) | |
119 | + | then true | |
120 | + | else (num1 == 23)) | |
121 | + | then true | |
122 | + | else (num1 == 25)) | |
123 | + | then true | |
124 | + | else (num1 == 26)) | |
125 | + | then true | |
126 | + | else (num1 == 28)) | |
127 | + | then true | |
128 | + | else (num1 == 29)) | |
129 | + | then true | |
130 | + | else (num1 == 31)) | |
131 | + | then true | |
132 | + | else (num1 == 32)) | |
133 | + | then true | |
134 | + | else (num1 == 34)) | |
135 | + | then true | |
136 | + | else (num1 == 35)) | |
137 | + | then true | |
138 | + | else throw("Invalid vertical split move. Game aborted!") | |
139 | + | else throw("Invalid split move. Game aborted!") | |
140 | + | ||
141 | + | ||
142 | + | func isStreet (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1)) | |
143 | + | then true | |
144 | + | else (num1 == 4)) | |
145 | + | then true | |
146 | + | else (num1 == 7)) | |
147 | + | then true | |
148 | + | else (num1 == 10)) | |
149 | + | then true | |
150 | + | else (num1 == 13)) | |
151 | + | then true | |
152 | + | else (num1 == 16)) | |
153 | + | then true | |
154 | + | else (num1 == 19)) | |
155 | + | then true | |
156 | + | else (num1 == 22)) | |
157 | + | then true | |
158 | + | else (num1 == 25)) | |
159 | + | then true | |
160 | + | else (num1 == 28)) | |
161 | + | then true | |
162 | + | else (num1 == 31)) | |
163 | + | then true | |
164 | + | else (num1 == 34)) | |
165 | + | then true | |
166 | + | else if ((num1 == 0)) | |
167 | + | then (num2 == 1) | |
168 | + | else false) | |
169 | + | then true | |
170 | + | else if ((num1 == 0)) | |
171 | + | then (num2 == 3) | |
172 | + | else false) | |
173 | + | then true | |
174 | + | else throw("Invalid street move. Game aborted!") | |
175 | + | ||
176 | + | ||
177 | + | 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)) | |
178 | + | then true | |
179 | + | else (num1 == 2)) | |
180 | + | then true | |
181 | + | else (num1 == 4)) | |
182 | + | then true | |
183 | + | else (num1 == 5)) | |
184 | + | then true | |
185 | + | else (num1 == 7)) | |
186 | + | then true | |
187 | + | else (num1 == 8)) | |
188 | + | then true | |
189 | + | else (num1 == 10)) | |
190 | + | then true | |
191 | + | else (num1 == 11)) | |
192 | + | then true | |
193 | + | else (num1 == 13)) | |
194 | + | then true | |
195 | + | else (num1 == 14)) | |
196 | + | then true | |
197 | + | else (num1 == 16)) | |
198 | + | then true | |
199 | + | else (num1 == 17)) | |
200 | + | then true | |
201 | + | else (num1 == 19)) | |
202 | + | then true | |
203 | + | else (num1 == 20)) | |
204 | + | then true | |
205 | + | else (num1 == 22)) | |
206 | + | then true | |
207 | + | else (num1 == 23)) | |
208 | + | then true | |
209 | + | else (num1 == 25)) | |
210 | + | then true | |
211 | + | else (num1 == 26)) | |
212 | + | then true | |
213 | + | else (num1 == 28)) | |
214 | + | then true | |
215 | + | else (num1 == 29)) | |
216 | + | then true | |
217 | + | else (num1 == 31)) | |
218 | + | then true | |
219 | + | else (num1 == 32)) | |
220 | + | then true | |
221 | + | else if ((num1 == 0)) | |
222 | + | then (num2 == 1) | |
223 | + | else false) | |
224 | + | then true | |
225 | + | else throw("Invalid corner move. Game aborted!") | |
226 | + | ||
227 | + | ||
228 | + | func isLine (num) = if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
229 | + | then true | |
230 | + | else (num == 4)) | |
231 | + | then true | |
232 | + | else (num == 7)) | |
233 | + | then true | |
234 | + | else (num == 10)) | |
235 | + | then true | |
236 | + | else (num == 13)) | |
237 | + | then true | |
238 | + | else (num == 16)) | |
239 | + | then true | |
240 | + | else (num == 19)) | |
241 | + | then true | |
242 | + | else (num == 22)) | |
243 | + | then true | |
244 | + | else (num == 25)) | |
245 | + | then true | |
246 | + | else (num == 28)) | |
247 | + | then true | |
248 | + | else (num == 31)) | |
249 | + | then true | |
250 | + | else throw("Invalid line move. Game aborted!") | |
251 | + | ||
252 | + | ||
253 | + | func isColumn (num,column) = if ((column == 1)) | |
254 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
255 | + | then true | |
256 | + | else (num == 4)) | |
257 | + | then true | |
258 | + | else (num == 7)) | |
259 | + | then true | |
260 | + | else (num == 10)) | |
261 | + | then true | |
262 | + | else (num == 13)) | |
263 | + | then true | |
264 | + | else (num == 16)) | |
265 | + | then true | |
266 | + | else (num == 19)) | |
267 | + | then true | |
268 | + | else (num == 22)) | |
269 | + | then true | |
270 | + | else (num == 25)) | |
271 | + | then true | |
272 | + | else (num == 28)) | |
273 | + | then true | |
274 | + | else (num == 31)) | |
275 | + | then true | |
276 | + | else (num == 34)) | |
277 | + | then true | |
278 | + | else throw("Invalid column 1 move. Game aborted!") | |
279 | + | else if ((column == 2)) | |
280 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 2)) | |
281 | + | then true | |
282 | + | else (num == 5)) | |
283 | + | then true | |
284 | + | else (num == 8)) | |
285 | + | then true | |
286 | + | else (num == 11)) | |
287 | + | then true | |
288 | + | else (num == 14)) | |
289 | + | then true | |
290 | + | else (num == 17)) | |
291 | + | then true | |
292 | + | else (num == 20)) | |
293 | + | then true | |
294 | + | else (num == 23)) | |
295 | + | then true | |
296 | + | else (num == 26)) | |
297 | + | then true | |
298 | + | else (num == 29)) | |
299 | + | then true | |
300 | + | else (num == 32)) | |
301 | + | then true | |
302 | + | else (num == 35)) | |
303 | + | then true | |
304 | + | else throw("Invalid column 2 move. Game aborted!") | |
305 | + | else if ((column == 3)) | |
306 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 3)) | |
307 | + | then true | |
308 | + | else (num == 6)) | |
309 | + | then true | |
310 | + | else (num == 9)) | |
311 | + | then true | |
312 | + | else (num == 12)) | |
313 | + | then true | |
314 | + | else (num == 15)) | |
315 | + | then true | |
316 | + | else (num == 18)) | |
317 | + | then true | |
318 | + | else (num == 21)) | |
319 | + | then true | |
320 | + | else (num == 24)) | |
321 | + | then true | |
322 | + | else (num == 27)) | |
323 | + | then true | |
324 | + | else (num == 30)) | |
325 | + | then true | |
326 | + | else (num == 33)) | |
327 | + | then true | |
328 | + | else (num == 36)) | |
329 | + | then true | |
330 | + | else throw("Invalid column 3 move. Game aborted!") | |
331 | + | else throw("Invalid column move. Game aborted!") | |
332 | + | ||
333 | + | ||
334 | + | func isDozen (num,dozen) = if ((dozen == 1)) | |
335 | + | then if (if ((num > 0)) | |
336 | + | then (13 > num) | |
337 | + | else false) | |
338 | + | then true | |
339 | + | else throw("Invalid dozen 1 move. Game aborted!") | |
340 | + | else if ((dozen == 2)) | |
341 | + | then if (if ((num > 12)) | |
342 | + | then (25 > num) | |
343 | + | else false) | |
344 | + | then true | |
345 | + | else throw("Invalid dozen 2 move. Game aborted!") | |
346 | + | else if ((dozen == 3)) | |
347 | + | then if (if ((num > 24)) | |
348 | + | then (37 > num) | |
349 | + | else false) | |
350 | + | then true | |
351 | + | else throw("Invalid dozen 3 move. Game aborted!") | |
352 | + | else throw("Invalid dozen move. Game aborted!") | |
353 | + | ||
354 | + | ||
355 | + | func isRed (num) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
356 | + | then true | |
357 | + | else (num == 3)) | |
358 | + | then true | |
359 | + | else (num == 5)) | |
360 | + | then true | |
361 | + | else (num == 7)) | |
362 | + | then true | |
363 | + | else (num == 9)) | |
364 | + | then true | |
365 | + | else (num == 12)) | |
366 | + | then true | |
367 | + | else (num == 14)) | |
368 | + | then true | |
369 | + | else (num == 16)) | |
370 | + | then true | |
371 | + | else (num == 18)) | |
372 | + | then true | |
373 | + | else (num == 19)) | |
374 | + | then true | |
375 | + | else (num == 21)) | |
376 | + | then true | |
377 | + | else (num == 23)) | |
378 | + | then true | |
379 | + | else (num == 25)) | |
380 | + | then true | |
381 | + | else (num == 27)) | |
382 | + | then true | |
383 | + | else (num == 30)) | |
384 | + | then true | |
385 | + | else (num == 32)) | |
386 | + | then true | |
387 | + | else (num == 34)) | |
388 | + | then true | |
389 | + | else (num == 36)) | |
390 | + | then true | |
391 | + | else throw("Invalid color, expected red color, try again. Game aborted!") | |
392 | + | ||
393 | + | ||
394 | + | func isBlack (num) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num == 2)) | |
395 | + | then true | |
396 | + | else (num == 4)) | |
397 | + | then true | |
398 | + | else (num == 6)) | |
399 | + | then true | |
400 | + | else (num == 8)) | |
401 | + | then true | |
402 | + | else (num == 10)) | |
403 | + | then true | |
404 | + | else (num == 11)) | |
405 | + | then true | |
406 | + | else (num == 13)) | |
407 | + | then true | |
408 | + | else (num == 15)) | |
409 | + | then true | |
410 | + | else (num == 17)) | |
411 | + | then true | |
412 | + | else (num == 20)) | |
413 | + | then true | |
414 | + | else (num == 22)) | |
415 | + | then true | |
416 | + | else (num == 24)) | |
417 | + | then true | |
418 | + | else (num == 26)) | |
419 | + | then true | |
420 | + | else (num == 28)) | |
421 | + | then true | |
422 | + | else (num == 29)) | |
423 | + | then true | |
424 | + | else (num == 31)) | |
425 | + | then true | |
426 | + | else (num == 33)) | |
427 | + | then true | |
428 | + | else (num == 35)) | |
429 | + | then true | |
430 | + | else throw("Invalid color, expected black color, try again. Game aborted!") | |
431 | + | ||
432 | + | ||
433 | + | func isOdd (num) = if (((num % 2) != 0)) | |
434 | + | then true | |
435 | + | else throw("Invalid move, number is not odd. Game aborted!") | |
436 | + | ||
437 | + | ||
438 | + | func isEven (num) = if (((num % 2) == 0)) | |
439 | + | then true | |
440 | + | else throw("Invalid move, number is not even. Game aborted!") | |
441 | + | ||
442 | + | ||
443 | + | func is1to18 (num) = if (if ((num > 0)) | |
444 | + | then (19 > num) | |
445 | + | else false) | |
446 | + | then true | |
447 | + | else throw("Invalid range for 1to18, try between 1 and 18. Game aborted!") | |
448 | + | ||
449 | + | ||
450 | + | func is19to36 (num) = if (if ((num > 18)) | |
451 | + | then (37 > num) | |
452 | + | else false) | |
453 | + | then true | |
454 | + | else throw("Invalid range for 19to36, try between 1 and 18. Game aborted!") | |
455 | + | ||
456 | + | ||
457 | + | func validateBet (bet) = { | |
458 | + | let betContents = split(bet, "_") | |
459 | + | let betType = parseIntValue(betContents[0]) | |
460 | + | let betAmount = parseIntValue(betContents[1]) | |
461 | + | let betNum1 = parseIntValue(betContents[2]) | |
462 | + | let betNum2 = parseIntValue(betContents[3]) | |
463 | + | let betNum3 = parseIntValue(betContents[4]) | |
464 | + | if (is0to36(betNum1)) | |
465 | + | then if ((betType == TSPLIT)) | |
466 | + | then isSplit(betNum1, betNum2, betNum3) | |
467 | + | else if ((betType == TSTREET)) | |
468 | + | then isStreet(betNum1, betNum2) | |
469 | + | else if ((betType == TCOLUMN)) | |
470 | + | then isCorner(betNum1, betNum2) | |
471 | + | else if ((betType == TLINE)) | |
472 | + | then isLine(betNum1) | |
473 | + | else if ((betType == TCOLUMN)) | |
474 | + | then isColumn(betNum1, betNum2) | |
475 | + | else if ((betType == TDOZEN)) | |
476 | + | then isDozen(betNum1, betNum2) | |
477 | + | else if ((betType == TRED)) | |
478 | + | then isRed(betNum1) | |
479 | + | else if ((betType == TBLACK)) | |
480 | + | then isBlack(betNum1) | |
481 | + | else if ((betType == TODD)) | |
482 | + | then isOdd(betNum1) | |
483 | + | else if ((betType == TEVEN)) | |
484 | + | then isEven(betNum1) | |
485 | + | else if ((betType == T1TO18)) | |
486 | + | then is1to18(betNum1) | |
487 | + | else if ((betType == T19TO36)) | |
488 | + | then is19to36(betNum1) | |
489 | + | else throw("Invalid bet type, Game aborted!") | |
490 | + | else throw("Invalid bet, Game aborted!") | |
491 | + | } | |
492 | + | ||
493 | + | ||
494 | + | func IncrementGameNum () = { | |
495 | + | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
496 | + | case num: Int => | |
497 | + | num | |
498 | + | case _ => | |
499 | + | 0 | |
500 | + | } | |
501 | + | (gameNum + 1) | |
35 | 502 | } | |
36 | 503 | ||
37 | 504 | ||
38 | 505 | @Callable(i) | |
39 | - | func playRoullete (bets) = { | |
40 | - | let betsList = split(bets, "|") | |
41 | - | throw(toString(size(betsList))) | |
506 | + | func playRoulette (bets) = { | |
507 | + | let gameId = toBase58String(i.transactionId) | |
508 | + | let payment = extract(i.payment) | |
509 | + | let feeAssetId = isDefined(i.feeAssetId) | |
510 | + | let gameIdUsed = isDefined(getString(this, gameId)) | |
511 | + | let playerBalance = wavesBalance(i.caller) | |
512 | + | let betList = split(bets, "|") | |
513 | + | if ((payment.assetId != WBET)) | |
514 | + | then throw("Payment should be in WBET. Game aborted.") | |
515 | + | else if ((1000000 > playerBalance)) | |
516 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
517 | + | else if (feeAssetId) | |
518 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
519 | + | else if (gameIdUsed) | |
520 | + | then throw("Passed gameId had been used before. Game aborted.") | |
521 | + | else if ((1 > size(betList))) | |
522 | + | then throw("No valid bets. Game aborted.") | |
523 | + | else { | |
524 | + | let newGameNum = IncrementGameNum() | |
525 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
526 | + | let gameDataStr = ((STATESUBMITTED + "-") + bets) | |
527 | + | ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction(payment.amount, FEEWAVESBET, 100), WBET), ScriptTransfer(WALLETMCAFEE, fraction(payment.amount, FEEMCAFEE, 100), WBET)])) | |
528 | + | } | |
42 | 529 | } | |
43 | 530 | ||
44 | 531 |
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 | - | func validateBets (bets,pos) = { | |
33 | - | let bet = bets[pos] | |
34 | - | throw(bet) | |
32 | + | let TSTRAIGHT = 1 | |
33 | + | ||
34 | + | let TSPLIT = 2 | |
35 | + | ||
36 | + | let TSTREET = 3 | |
37 | + | ||
38 | + | let TCORNER = 4 | |
39 | + | ||
40 | + | let TLINE = 5 | |
41 | + | ||
42 | + | let TCOLUMN = 6 | |
43 | + | ||
44 | + | let TDOZEN = 7 | |
45 | + | ||
46 | + | let TRED = 8 | |
47 | + | ||
48 | + | let TBLACK = 9 | |
49 | + | ||
50 | + | let TODD = 10 | |
51 | + | ||
52 | + | let TEVEN = 11 | |
53 | + | ||
54 | + | let T1TO18 = 12 | |
55 | + | ||
56 | + | let T19TO36 = 13 | |
57 | + | ||
58 | + | let HORIZONTAL = 1 | |
59 | + | ||
60 | + | let VERTICAL = 2 | |
61 | + | ||
62 | + | let payout = 0 | |
63 | + | ||
64 | + | func is0to36 (num) = if (if ((num >= 0)) | |
65 | + | then (37 > num) | |
66 | + | else false) | |
67 | + | then true | |
68 | + | else throw("Invalid range, try between 0 and 36. Game aborted!") | |
69 | + | ||
70 | + | ||
71 | + | func isSplit (num1,num2,direction) = if ((direction == HORIZONTAL)) | |
72 | + | then if (if (if (if (if ((num1 > 0)) | |
73 | + | then (34 > num1) | |
74 | + | else false) | |
75 | + | then true | |
76 | + | else if ((num1 == 0)) | |
77 | + | then (num2 == 1) | |
78 | + | else false) | |
79 | + | then true | |
80 | + | else if ((num1 == 0)) | |
81 | + | then (num2 == 2) | |
82 | + | else false) | |
83 | + | then true | |
84 | + | else if ((num1 == 0)) | |
85 | + | then (num2 == 3) | |
86 | + | else false) | |
87 | + | then true | |
88 | + | else throw("Invalid hotizontal split move. Game aborted!") | |
89 | + | else if ((direction == VERTICAL)) | |
90 | + | 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)) | |
91 | + | then true | |
92 | + | else (num1 == 2)) | |
93 | + | then true | |
94 | + | else (num1 == 4)) | |
95 | + | then true | |
96 | + | else (num1 == 5)) | |
97 | + | then true | |
98 | + | else (num1 == 7)) | |
99 | + | then true | |
100 | + | else (num1 == 8)) | |
101 | + | then true | |
102 | + | else (num1 == 10)) | |
103 | + | then true | |
104 | + | else (num1 == 11)) | |
105 | + | then true | |
106 | + | else (num1 == 13)) | |
107 | + | then true | |
108 | + | else (num1 == 14)) | |
109 | + | then true | |
110 | + | else (num1 == 16)) | |
111 | + | then true | |
112 | + | else (num1 == 17)) | |
113 | + | then true | |
114 | + | else (num1 == 19)) | |
115 | + | then true | |
116 | + | else (num1 == 20)) | |
117 | + | then true | |
118 | + | else (num1 == 22)) | |
119 | + | then true | |
120 | + | else (num1 == 23)) | |
121 | + | then true | |
122 | + | else (num1 == 25)) | |
123 | + | then true | |
124 | + | else (num1 == 26)) | |
125 | + | then true | |
126 | + | else (num1 == 28)) | |
127 | + | then true | |
128 | + | else (num1 == 29)) | |
129 | + | then true | |
130 | + | else (num1 == 31)) | |
131 | + | then true | |
132 | + | else (num1 == 32)) | |
133 | + | then true | |
134 | + | else (num1 == 34)) | |
135 | + | then true | |
136 | + | else (num1 == 35)) | |
137 | + | then true | |
138 | + | else throw("Invalid vertical split move. Game aborted!") | |
139 | + | else throw("Invalid split move. Game aborted!") | |
140 | + | ||
141 | + | ||
142 | + | func isStreet (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1)) | |
143 | + | then true | |
144 | + | else (num1 == 4)) | |
145 | + | then true | |
146 | + | else (num1 == 7)) | |
147 | + | then true | |
148 | + | else (num1 == 10)) | |
149 | + | then true | |
150 | + | else (num1 == 13)) | |
151 | + | then true | |
152 | + | else (num1 == 16)) | |
153 | + | then true | |
154 | + | else (num1 == 19)) | |
155 | + | then true | |
156 | + | else (num1 == 22)) | |
157 | + | then true | |
158 | + | else (num1 == 25)) | |
159 | + | then true | |
160 | + | else (num1 == 28)) | |
161 | + | then true | |
162 | + | else (num1 == 31)) | |
163 | + | then true | |
164 | + | else (num1 == 34)) | |
165 | + | then true | |
166 | + | else if ((num1 == 0)) | |
167 | + | then (num2 == 1) | |
168 | + | else false) | |
169 | + | then true | |
170 | + | else if ((num1 == 0)) | |
171 | + | then (num2 == 3) | |
172 | + | else false) | |
173 | + | then true | |
174 | + | else throw("Invalid street move. Game aborted!") | |
175 | + | ||
176 | + | ||
177 | + | 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)) | |
178 | + | then true | |
179 | + | else (num1 == 2)) | |
180 | + | then true | |
181 | + | else (num1 == 4)) | |
182 | + | then true | |
183 | + | else (num1 == 5)) | |
184 | + | then true | |
185 | + | else (num1 == 7)) | |
186 | + | then true | |
187 | + | else (num1 == 8)) | |
188 | + | then true | |
189 | + | else (num1 == 10)) | |
190 | + | then true | |
191 | + | else (num1 == 11)) | |
192 | + | then true | |
193 | + | else (num1 == 13)) | |
194 | + | then true | |
195 | + | else (num1 == 14)) | |
196 | + | then true | |
197 | + | else (num1 == 16)) | |
198 | + | then true | |
199 | + | else (num1 == 17)) | |
200 | + | then true | |
201 | + | else (num1 == 19)) | |
202 | + | then true | |
203 | + | else (num1 == 20)) | |
204 | + | then true | |
205 | + | else (num1 == 22)) | |
206 | + | then true | |
207 | + | else (num1 == 23)) | |
208 | + | then true | |
209 | + | else (num1 == 25)) | |
210 | + | then true | |
211 | + | else (num1 == 26)) | |
212 | + | then true | |
213 | + | else (num1 == 28)) | |
214 | + | then true | |
215 | + | else (num1 == 29)) | |
216 | + | then true | |
217 | + | else (num1 == 31)) | |
218 | + | then true | |
219 | + | else (num1 == 32)) | |
220 | + | then true | |
221 | + | else if ((num1 == 0)) | |
222 | + | then (num2 == 1) | |
223 | + | else false) | |
224 | + | then true | |
225 | + | else throw("Invalid corner move. Game aborted!") | |
226 | + | ||
227 | + | ||
228 | + | func isLine (num) = if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
229 | + | then true | |
230 | + | else (num == 4)) | |
231 | + | then true | |
232 | + | else (num == 7)) | |
233 | + | then true | |
234 | + | else (num == 10)) | |
235 | + | then true | |
236 | + | else (num == 13)) | |
237 | + | then true | |
238 | + | else (num == 16)) | |
239 | + | then true | |
240 | + | else (num == 19)) | |
241 | + | then true | |
242 | + | else (num == 22)) | |
243 | + | then true | |
244 | + | else (num == 25)) | |
245 | + | then true | |
246 | + | else (num == 28)) | |
247 | + | then true | |
248 | + | else (num == 31)) | |
249 | + | then true | |
250 | + | else throw("Invalid line move. Game aborted!") | |
251 | + | ||
252 | + | ||
253 | + | func isColumn (num,column) = if ((column == 1)) | |
254 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
255 | + | then true | |
256 | + | else (num == 4)) | |
257 | + | then true | |
258 | + | else (num == 7)) | |
259 | + | then true | |
260 | + | else (num == 10)) | |
261 | + | then true | |
262 | + | else (num == 13)) | |
263 | + | then true | |
264 | + | else (num == 16)) | |
265 | + | then true | |
266 | + | else (num == 19)) | |
267 | + | then true | |
268 | + | else (num == 22)) | |
269 | + | then true | |
270 | + | else (num == 25)) | |
271 | + | then true | |
272 | + | else (num == 28)) | |
273 | + | then true | |
274 | + | else (num == 31)) | |
275 | + | then true | |
276 | + | else (num == 34)) | |
277 | + | then true | |
278 | + | else throw("Invalid column 1 move. Game aborted!") | |
279 | + | else if ((column == 2)) | |
280 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 2)) | |
281 | + | then true | |
282 | + | else (num == 5)) | |
283 | + | then true | |
284 | + | else (num == 8)) | |
285 | + | then true | |
286 | + | else (num == 11)) | |
287 | + | then true | |
288 | + | else (num == 14)) | |
289 | + | then true | |
290 | + | else (num == 17)) | |
291 | + | then true | |
292 | + | else (num == 20)) | |
293 | + | then true | |
294 | + | else (num == 23)) | |
295 | + | then true | |
296 | + | else (num == 26)) | |
297 | + | then true | |
298 | + | else (num == 29)) | |
299 | + | then true | |
300 | + | else (num == 32)) | |
301 | + | then true | |
302 | + | else (num == 35)) | |
303 | + | then true | |
304 | + | else throw("Invalid column 2 move. Game aborted!") | |
305 | + | else if ((column == 3)) | |
306 | + | then if (if (if (if (if (if (if (if (if (if (if (if ((num == 3)) | |
307 | + | then true | |
308 | + | else (num == 6)) | |
309 | + | then true | |
310 | + | else (num == 9)) | |
311 | + | then true | |
312 | + | else (num == 12)) | |
313 | + | then true | |
314 | + | else (num == 15)) | |
315 | + | then true | |
316 | + | else (num == 18)) | |
317 | + | then true | |
318 | + | else (num == 21)) | |
319 | + | then true | |
320 | + | else (num == 24)) | |
321 | + | then true | |
322 | + | else (num == 27)) | |
323 | + | then true | |
324 | + | else (num == 30)) | |
325 | + | then true | |
326 | + | else (num == 33)) | |
327 | + | then true | |
328 | + | else (num == 36)) | |
329 | + | then true | |
330 | + | else throw("Invalid column 3 move. Game aborted!") | |
331 | + | else throw("Invalid column move. Game aborted!") | |
332 | + | ||
333 | + | ||
334 | + | func isDozen (num,dozen) = if ((dozen == 1)) | |
335 | + | then if (if ((num > 0)) | |
336 | + | then (13 > num) | |
337 | + | else false) | |
338 | + | then true | |
339 | + | else throw("Invalid dozen 1 move. Game aborted!") | |
340 | + | else if ((dozen == 2)) | |
341 | + | then if (if ((num > 12)) | |
342 | + | then (25 > num) | |
343 | + | else false) | |
344 | + | then true | |
345 | + | else throw("Invalid dozen 2 move. Game aborted!") | |
346 | + | else if ((dozen == 3)) | |
347 | + | then if (if ((num > 24)) | |
348 | + | then (37 > num) | |
349 | + | else false) | |
350 | + | then true | |
351 | + | else throw("Invalid dozen 3 move. Game aborted!") | |
352 | + | else throw("Invalid dozen move. Game aborted!") | |
353 | + | ||
354 | + | ||
355 | + | func isRed (num) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num == 1)) | |
356 | + | then true | |
357 | + | else (num == 3)) | |
358 | + | then true | |
359 | + | else (num == 5)) | |
360 | + | then true | |
361 | + | else (num == 7)) | |
362 | + | then true | |
363 | + | else (num == 9)) | |
364 | + | then true | |
365 | + | else (num == 12)) | |
366 | + | then true | |
367 | + | else (num == 14)) | |
368 | + | then true | |
369 | + | else (num == 16)) | |
370 | + | then true | |
371 | + | else (num == 18)) | |
372 | + | then true | |
373 | + | else (num == 19)) | |
374 | + | then true | |
375 | + | else (num == 21)) | |
376 | + | then true | |
377 | + | else (num == 23)) | |
378 | + | then true | |
379 | + | else (num == 25)) | |
380 | + | then true | |
381 | + | else (num == 27)) | |
382 | + | then true | |
383 | + | else (num == 30)) | |
384 | + | then true | |
385 | + | else (num == 32)) | |
386 | + | then true | |
387 | + | else (num == 34)) | |
388 | + | then true | |
389 | + | else (num == 36)) | |
390 | + | then true | |
391 | + | else throw("Invalid color, expected red color, try again. Game aborted!") | |
392 | + | ||
393 | + | ||
394 | + | func isBlack (num) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num == 2)) | |
395 | + | then true | |
396 | + | else (num == 4)) | |
397 | + | then true | |
398 | + | else (num == 6)) | |
399 | + | then true | |
400 | + | else (num == 8)) | |
401 | + | then true | |
402 | + | else (num == 10)) | |
403 | + | then true | |
404 | + | else (num == 11)) | |
405 | + | then true | |
406 | + | else (num == 13)) | |
407 | + | then true | |
408 | + | else (num == 15)) | |
409 | + | then true | |
410 | + | else (num == 17)) | |
411 | + | then true | |
412 | + | else (num == 20)) | |
413 | + | then true | |
414 | + | else (num == 22)) | |
415 | + | then true | |
416 | + | else (num == 24)) | |
417 | + | then true | |
418 | + | else (num == 26)) | |
419 | + | then true | |
420 | + | else (num == 28)) | |
421 | + | then true | |
422 | + | else (num == 29)) | |
423 | + | then true | |
424 | + | else (num == 31)) | |
425 | + | then true | |
426 | + | else (num == 33)) | |
427 | + | then true | |
428 | + | else (num == 35)) | |
429 | + | then true | |
430 | + | else throw("Invalid color, expected black color, try again. Game aborted!") | |
431 | + | ||
432 | + | ||
433 | + | func isOdd (num) = if (((num % 2) != 0)) | |
434 | + | then true | |
435 | + | else throw("Invalid move, number is not odd. Game aborted!") | |
436 | + | ||
437 | + | ||
438 | + | func isEven (num) = if (((num % 2) == 0)) | |
439 | + | then true | |
440 | + | else throw("Invalid move, number is not even. Game aborted!") | |
441 | + | ||
442 | + | ||
443 | + | func is1to18 (num) = if (if ((num > 0)) | |
444 | + | then (19 > num) | |
445 | + | else false) | |
446 | + | then true | |
447 | + | else throw("Invalid range for 1to18, try between 1 and 18. Game aborted!") | |
448 | + | ||
449 | + | ||
450 | + | func is19to36 (num) = if (if ((num > 18)) | |
451 | + | then (37 > num) | |
452 | + | else false) | |
453 | + | then true | |
454 | + | else throw("Invalid range for 19to36, try between 1 and 18. Game aborted!") | |
455 | + | ||
456 | + | ||
457 | + | func validateBet (bet) = { | |
458 | + | let betContents = split(bet, "_") | |
459 | + | let betType = parseIntValue(betContents[0]) | |
460 | + | let betAmount = parseIntValue(betContents[1]) | |
461 | + | let betNum1 = parseIntValue(betContents[2]) | |
462 | + | let betNum2 = parseIntValue(betContents[3]) | |
463 | + | let betNum3 = parseIntValue(betContents[4]) | |
464 | + | if (is0to36(betNum1)) | |
465 | + | then if ((betType == TSPLIT)) | |
466 | + | then isSplit(betNum1, betNum2, betNum3) | |
467 | + | else if ((betType == TSTREET)) | |
468 | + | then isStreet(betNum1, betNum2) | |
469 | + | else if ((betType == TCOLUMN)) | |
470 | + | then isCorner(betNum1, betNum2) | |
471 | + | else if ((betType == TLINE)) | |
472 | + | then isLine(betNum1) | |
473 | + | else if ((betType == TCOLUMN)) | |
474 | + | then isColumn(betNum1, betNum2) | |
475 | + | else if ((betType == TDOZEN)) | |
476 | + | then isDozen(betNum1, betNum2) | |
477 | + | else if ((betType == TRED)) | |
478 | + | then isRed(betNum1) | |
479 | + | else if ((betType == TBLACK)) | |
480 | + | then isBlack(betNum1) | |
481 | + | else if ((betType == TODD)) | |
482 | + | then isOdd(betNum1) | |
483 | + | else if ((betType == TEVEN)) | |
484 | + | then isEven(betNum1) | |
485 | + | else if ((betType == T1TO18)) | |
486 | + | then is1to18(betNum1) | |
487 | + | else if ((betType == T19TO36)) | |
488 | + | then is19to36(betNum1) | |
489 | + | else throw("Invalid bet type, Game aborted!") | |
490 | + | else throw("Invalid bet, Game aborted!") | |
491 | + | } | |
492 | + | ||
493 | + | ||
494 | + | func IncrementGameNum () = { | |
495 | + | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
496 | + | case num: Int => | |
497 | + | num | |
498 | + | case _ => | |
499 | + | 0 | |
500 | + | } | |
501 | + | (gameNum + 1) | |
35 | 502 | } | |
36 | 503 | ||
37 | 504 | ||
38 | 505 | @Callable(i) | |
39 | - | func playRoullete (bets) = { | |
40 | - | let betsList = split(bets, "|") | |
41 | - | throw(toString(size(betsList))) | |
506 | + | func playRoulette (bets) = { | |
507 | + | let gameId = toBase58String(i.transactionId) | |
508 | + | let payment = extract(i.payment) | |
509 | + | let feeAssetId = isDefined(i.feeAssetId) | |
510 | + | let gameIdUsed = isDefined(getString(this, gameId)) | |
511 | + | let playerBalance = wavesBalance(i.caller) | |
512 | + | let betList = split(bets, "|") | |
513 | + | if ((payment.assetId != WBET)) | |
514 | + | then throw("Payment should be in WBET. Game aborted.") | |
515 | + | else if ((1000000 > playerBalance)) | |
516 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
517 | + | else if (feeAssetId) | |
518 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
519 | + | else if (gameIdUsed) | |
520 | + | then throw("Passed gameId had been used before. Game aborted.") | |
521 | + | else if ((1 > size(betList))) | |
522 | + | then throw("No valid bets. Game aborted.") | |
523 | + | else { | |
524 | + | let newGameNum = IncrementGameNum() | |
525 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
526 | + | let gameDataStr = ((STATESUBMITTED + "-") + bets) | |
527 | + | ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, fraction(payment.amount, FEEWAVESBET, 100), WBET), ScriptTransfer(WALLETMCAFEE, fraction(payment.amount, FEEMCAFEE, 100), WBET)])) | |
528 | + | } | |
42 | 529 | } | |
43 | 530 | ||
44 | 531 |
github/deemru/w8io/026f985 44.47 ms ◑