tx · HZxnprgrbm15qZr5xP3z4uzPQYRSNquExtP9Zm8XJHTZ 3Mu8FKNn2fEuxsE5mVhCwDQ275Ygi3ejweU: -0.01400000 Waves 2019.10.26 01:15 [736228] smart account 3Mu8FKNn2fEuxsE5mVhCwDQ275Ygi3ejweU > SELF 0.00000000 Waves
{ "type": 13, "id": "HZxnprgrbm15qZr5xP3z4uzPQYRSNquExtP9Zm8XJHTZ", "fee": 1400000, "feeAssetId": null, "timestamp": 1572041785121, "version": 1, "sender": "3Mu8FKNn2fEuxsE5mVhCwDQ275Ygi3ejweU", "senderPublicKey": "6EzysHLfsAMmtxy8XtuFoQrCNTEkUdPSEzHYEwqpqSs3", "proofs": [ "3PpDM77aYdWMnkdXuX2qCZ5D1rYLNv7NBwfsWGmuJss8YFwi8ZdiJb7c4d5ane5eqiPJ4b9qaQ7qZGpXGkU336rf" ], "script": "base64:AAIDAAAAAAAAAA4IARIECgIICBIECgIIAgAAACgAAAAACVJTQVBVQkxJQwkAAlsAAAABAgAAAY9iYXNlNjQ6TUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFtT2xSQlRZRU8zSDdZOXJCbW9GUUZuNDM5MlB4MFF3MTNEc2RFaG56TUgyY2o2WTV5bVB1Q09MTU5lNXFyVXpRbDhvUkx6SUJ6RlZNWmx3VVlsMmJvc3JPSXhRYllGN1dWUVd2b1Z4RVQxWUlnRG0zTnp6T0xBNXVIN0NLTzBzbnNobU1GQ0RPWkVldzQxR2pLaDNQZ3grbmJBZ3VQOVpRUGZxU2FmRW1DM0NOLzR5RHNKcktyaVJuaVpKbzlqUy80TExzUkt3QjdIQVpIem9GOUxMN3RTWkgzaHRhTkd0YmRUa3haMVR6U1QzTWIyVlBTenNadlFEb2NYVVZPbUpPdTBvMjlhT1krR2tHL0c0UkNLMEZCV1FIRVV2QzUxVFJEUzVrOGphZDBPMU1vYmpRYzZiMThkK2Z1b1ZGZE5mWndHSCt1RnVkdFB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AAAMcGxheWVyQ2hvaWNlBQAAAAhyb2xsVHlwZQUAAAAOcGxheWVyUHViS2V5NTgFAAAABndpbkFtdAUAAAAHcmFuZFN0cgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAGZ2FtZUlkBQAAAA5uZXdHYW1lRGF0YVN0cgUAAAADbmlsAAAAAIWkHeE=", "chainId": 84, "height": 736228, "spentComplexity": 0 } View: original | compacted Prev: BcNExhjv9PepDaZPYvcQcJn9UaT3RSX1dr3MVZcSedxG Next: none Diff:
Old | New | Differences | |
---|---|---|---|
7 | 7 | ||
8 | 8 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | 9 | ||
10 | + | let WBET = base58'WAVES' | |
11 | + | ||
12 | + | let WALLETWAVESBET = Address(base58'3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX') | |
13 | + | ||
14 | + | let WALLETMCAFFE = Address(base58'') | |
15 | + | ||
16 | + | let WAVELET = ((100 * 1000) * 1000) | |
17 | + | ||
18 | + | let FEEWAVESBET = 4 | |
19 | + | ||
20 | + | let FEEMCAFEE = 2 | |
21 | + | ||
10 | 22 | let STATESUBMITTED = "SUBMITTED" | |
11 | 23 | ||
12 | 24 | let STATEWON = "WON" | |
13 | 25 | ||
14 | 26 | let STATELOST = "LOST" | |
27 | + | ||
28 | + | let ROLLUNDER = "UNDER" | |
29 | + | ||
30 | + | let ROLLOVER = "OVER" | |
31 | + | ||
32 | + | let BETMIN = (100 * WAVELET) | |
33 | + | ||
34 | + | let BETMAX = ((1000 * 100) * WAVELET) | |
35 | + | ||
36 | + | let PREDICTIONMIN = 4 | |
37 | + | ||
38 | + | let PREDICTIONMAX = 100 | |
15 | 39 | ||
16 | 40 | let IdxGameState = 0 | |
17 | 41 | ||
21 | 45 | ||
22 | 46 | let IdxPlayerPubKey58 = 3 | |
23 | 47 | ||
24 | - | let | |
48 | + | let IdxWinAmt = 4 | |
25 | 49 | ||
26 | - | let IdxWinAmt = 5 | |
27 | - | ||
28 | - | let IdxRandOrEmpty = 6 | |
50 | + | let IdxRandOrEmpty = 5 | |
29 | 51 | ||
30 | 52 | func IncrementGameNum () = { | |
31 | 53 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
48 | 70 | ||
49 | 71 | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
50 | 72 | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
51 | - | let balance = | |
73 | + | let balance = assetBalance(this, WBET) | |
52 | 74 | if ((newReservedAmount > balance)) | |
53 | 75 | then throw("Insufficient funds on Waves Rider account. Transaction was rejected for your safety.") | |
54 | 76 | else newReservedAmount | |
67 | 89 | } | |
68 | 90 | ||
69 | 91 | ||
70 | - | func FormatGameDataStr (gameState,playerChoice,playerType,playerPubKey58, | |
71 | - | let fullStateStr = | |
92 | + | func FormatGameDataStr (gameState,playerChoice,playerType,playerPubKey58,winAmt,randOrEmpty) = { | |
93 | + | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerChoice)) + "_") + FormatGameDataParam(playerType)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(winAmt))) | |
72 | 94 | if ((randOrEmpty == "")) | |
73 | 95 | then fullStateStr | |
74 | 96 | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
97 | 119 | func ParseGameRawDataStr (rawStateStr) = { | |
98 | 120 | let gameState = ParseNextAttribute(rawStateStr) | |
99 | 121 | let playerChoice = ParseNextAttribute(gameState[1]) | |
100 | - | let type = ParseNextAttribute(playerChoice[1]) | |
101 | - | let playerPubKey58 = ParseNextAttribute(type[1]) | |
102 | - | let startedHeight = ParseNextAttribute(playerPubKey58[1]) | |
103 | - | let winAmt = ParseNextAttribute(startedHeight[1]) | |
104 | - | [gameState[0], playerChoice[0], type[0], playerPubKey58[0], startedHeight[0], winAmt[0]] | |
122 | + | let rollType = ParseNextAttribute(playerChoice[1]) | |
123 | + | let playerPubKey58 = ParseNextAttribute(rollType[1]) | |
124 | + | let winAmt = ParseNextAttribute(playerPubKey58[1]) | |
125 | + | [gameState[0], playerChoice[0], rollType[0], playerPubKey58[0], winAmt[0]] | |
105 | 126 | } | |
106 | 127 | ||
107 | 128 | ||
151 | 172 | } | |
152 | 173 | ||
153 | 174 | ||
154 | - | func | |
155 | - | | |
156 | - | | |
157 | - | | |
158 | - | then | |
159 | - | else if ((prediction == | |
160 | - | then | |
161 | - | else if ((prediction == | |
162 | - | then | |
163 | - | else if ((prediction == | |
164 | - | then | |
165 | - | else if ((prediction == | |
166 | - | then | |
167 | - | else if ((prediction == | |
168 | - | then | |
169 | - | else if ((prediction == | |
170 | - | then | |
171 | - | else if ((prediction == | |
172 | - | then | |
173 | - | else if ((prediction == | |
174 | - | then | |
175 | - | else if ((prediction == | |
176 | - | then | |
177 | - | else if ((prediction == | |
178 | - | then | |
179 | - | else if ((prediction == | |
180 | - | then | |
181 | - | else if ((prediction == | |
182 | - | then | |
183 | - | else if ((prediction == | |
184 | - | then | |
185 | - | else if ((prediction == | |
186 | - | then | |
187 | - | else if ((prediction == | |
188 | - | then | |
189 | - | else if ((prediction == | |
190 | - | then | |
191 | - | else if ((prediction == | |
192 | - | then | |
193 | - | else if ((prediction == | |
194 | - | then | |
195 | - | else if ((prediction == | |
196 | - | then | |
197 | - | else if ((prediction == | |
198 | - | then | |
199 | - | else if ((prediction == | |
200 | - | then | |
201 | - | else if ((prediction == | |
202 | - | then | |
203 | - | else if ((prediction == | |
204 | - | then | |
205 | - | else if ((prediction == | |
206 | - | then | |
207 | - | else if ((prediction == | |
208 | - | then | |
209 | - | else if ((prediction == | |
210 | - | then | |
211 | - | else if ((prediction == | |
212 | - | then | |
213 | - | else if ((prediction == | |
214 | - | then | |
215 | - | else if ((prediction == | |
216 | - | then | |
217 | - | else if ((prediction == | |
218 | - | then | |
219 | - | else if ((prediction == | |
220 | - | then | |
221 | - | else if ((prediction == | |
222 | - | then | |
223 | - | else if ((prediction == | |
224 | - | then | |
225 | - | else if ((prediction == | |
226 | - | then | |
227 | - | else if ((prediction == | |
228 | - | then | |
229 | - | else if ((prediction == | |
175 | + | func Multiplier (prediction,rollType) = if ((rollType == ROLLUNDER)) | |
176 | + | then if ((prediction == 1)) | |
177 | + | then 9850000 | |
178 | + | else if ((prediction == 2)) | |
179 | + | then 4925000 | |
180 | + | else if ((prediction == 3)) | |
181 | + | then 3283330 | |
182 | + | else if ((prediction == 4)) | |
183 | + | then 2462500 | |
184 | + | else if ((prediction == 5)) | |
185 | + | then 1970000 | |
186 | + | else if ((prediction == 6)) | |
187 | + | then 1641660 | |
188 | + | else if ((prediction == 7)) | |
189 | + | then 1407140 | |
190 | + | else if ((prediction == 8)) | |
191 | + | then 1231250 | |
192 | + | else if ((prediction == 9)) | |
193 | + | then 1094440 | |
194 | + | else if ((prediction == 10)) | |
195 | + | then 985000 | |
196 | + | else if ((prediction == 11)) | |
197 | + | then 895450 | |
198 | + | else if ((prediction == 12)) | |
199 | + | then 820830 | |
200 | + | else if ((prediction == 13)) | |
201 | + | then 757690 | |
202 | + | else if ((prediction == 14)) | |
203 | + | then 703570 | |
204 | + | else if ((prediction == 15)) | |
205 | + | then 656660 | |
206 | + | else if ((prediction == 16)) | |
207 | + | then 615620 | |
208 | + | else if ((prediction == 17)) | |
209 | + | then 579410 | |
210 | + | else if ((prediction == 18)) | |
211 | + | then 547220 | |
212 | + | else if ((prediction == 19)) | |
213 | + | then 518420 | |
214 | + | else if ((prediction == 20)) | |
215 | + | then 492500 | |
216 | + | else if ((prediction == 21)) | |
217 | + | then 469040 | |
218 | + | else if ((prediction == 22)) | |
219 | + | then 447720 | |
220 | + | else if ((prediction == 23)) | |
221 | + | then 428260 | |
222 | + | else if ((prediction == 24)) | |
223 | + | then 410410 | |
224 | + | else if ((prediction == 25)) | |
225 | + | then 394000 | |
226 | + | else if ((prediction == 26)) | |
227 | + | then 378840 | |
228 | + | else if ((prediction == 27)) | |
229 | + | then 364810 | |
230 | + | else if ((prediction == 28)) | |
231 | + | then 351780 | |
232 | + | else if ((prediction == 29)) | |
233 | + | then 339650 | |
234 | + | else if ((prediction == 30)) | |
235 | + | then 328330 | |
236 | + | else if ((prediction == 31)) | |
237 | + | then 317740 | |
238 | + | else if ((prediction == 32)) | |
239 | + | then 307810 | |
240 | + | else if ((prediction == 33)) | |
241 | + | then 298480 | |
242 | + | else if ((prediction == 34)) | |
243 | + | then 289700 | |
244 | + | else if ((prediction == 35)) | |
245 | + | then 281420 | |
246 | + | else if ((prediction == 36)) | |
247 | + | then 273610 | |
248 | + | else if ((prediction == 37)) | |
249 | + | then 259210 | |
250 | + | else if ((prediction == 38)) | |
230 | 251 | then 259210 | |
231 | - | else if ((prediction == | |
232 | - | then | |
233 | - | else if ((prediction == | |
234 | - | then | |
235 | - | else if ((prediction == | |
236 | - | then | |
237 | - | else if ((prediction == | |
238 | - | then | |
239 | - | else if ((prediction == | |
240 | - | then | |
241 | - | else if ((prediction == | |
242 | - | then | |
243 | - | else if ((prediction == | |
244 | - | then | |
245 | - | else if ((prediction == | |
246 | - | then | |
247 | - | else if ((prediction == | |
248 | - | then | |
249 | - | else if ((prediction == | |
250 | - | then | |
251 | - | else if ((prediction == | |
252 | - | then | |
253 | - | else if ((prediction == | |
254 | - | then | |
255 | - | else if ((prediction == | |
256 | - | then | |
257 | - | else if ((prediction == | |
258 | - | then | |
259 | - | else if ((prediction == | |
260 | - | then | |
261 | - | else if ((prediction == | |
262 | - | then | |
263 | - | else if ((prediction == | |
264 | - | then | |
265 | - | else if ((prediction == | |
266 | - | then | |
267 | - | else if ((prediction == | |
268 | - | then | |
269 | - | else if ((prediction == | |
270 | - | then | |
271 | - | else if ((prediction == | |
272 | - | then | |
273 | - | else if ((prediction == | |
274 | - | then | |
275 | - | else if ((prediction == | |
276 | - | then | |
277 | - | else if ((prediction == | |
278 | - | then | |
279 | - | else if ((prediction == | |
280 | - | then | |
281 | - | else if ((prediction == | |
282 | - | then | |
283 | - | else if ((prediction == | |
284 | - | then | |
285 | - | else if ((prediction == | |
286 | - | then | |
287 | - | else if ((prediction == | |
288 | - | then | |
289 | - | else if ((prediction == | |
290 | - | then | |
291 | - | else if ((prediction == | |
292 | - | then | |
293 | - | else if ((prediction == | |
294 | - | then | |
295 | - | else if ((prediction == | |
296 | - | then | |
297 | - | else if ((prediction == | |
298 | - | then | |
299 | - | else if ((prediction == | |
300 | - | then | |
301 | - | else if ((prediction == | |
302 | - | then | |
303 | - | else if ((prediction == | |
304 | - | then | |
305 | - | else if ((prediction == | |
306 | - | then | |
307 | - | else if ((prediction == | |
308 | - | then | |
309 | - | else if ((prediction == | |
310 | - | then | |
311 | - | else if ((prediction == | |
312 | - | then | |
313 | - | else if ((prediction == | |
314 | - | then | |
315 | - | else if ((prediction == | |
316 | - | then | |
317 | - | else if ((prediction == | |
318 | - | then | |
319 | - | else if ((prediction == | |
320 | - | then | |
321 | - | else if ((prediction == | |
322 | - | then | |
323 | - | else if ((prediction == | |
324 | - | then | |
325 | - | else if ((prediction == | |
326 | - | then | |
327 | - | else if ((prediction == | |
328 | - | then | |
329 | - | else if ((prediction == | |
330 | - | then | |
331 | - | else if ((prediction == | |
332 | - | then | |
333 | - | else if ((prediction == | |
334 | - | then | |
335 | - | else if ((prediction == | |
336 | - | then | |
337 | - | else if ((prediction == | |
338 | - | then | |
339 | - | else if ((prediction == | |
340 | - | then | |
341 | - | else if ((prediction == | |
342 | - | then | |
343 | - | else if ((prediction == | |
344 | - | then | |
345 | - | else if ((prediction == | |
252 | + | else if ((prediction == 39)) | |
253 | + | then 252560 | |
254 | + | else if ((prediction == 40)) | |
255 | + | then 246250 | |
256 | + | else if ((prediction == 41)) | |
257 | + | then 240240 | |
258 | + | else if ((prediction == 42)) | |
259 | + | then 234520 | |
260 | + | else if ((prediction == 43)) | |
261 | + | then 229060 | |
262 | + | else if ((prediction == 44)) | |
263 | + | then 223860 | |
264 | + | else if ((prediction == 45)) | |
265 | + | then 218880 | |
266 | + | else if ((prediction == 46)) | |
267 | + | then 214130 | |
268 | + | else if ((prediction == 47)) | |
269 | + | then 209570 | |
270 | + | else if ((prediction == 48)) | |
271 | + | then 205200 | |
272 | + | else if ((prediction == 49)) | |
273 | + | then 201020 | |
274 | + | else if ((prediction == 50)) | |
275 | + | then 197000 | |
276 | + | else if ((prediction == 51)) | |
277 | + | then 193130 | |
278 | + | else if ((prediction == 52)) | |
279 | + | then 189420 | |
280 | + | else if ((prediction == 53)) | |
281 | + | then 185840 | |
282 | + | else if ((prediction == 54)) | |
283 | + | then 182400 | |
284 | + | else if ((prediction == 55)) | |
285 | + | then 179090 | |
286 | + | else if ((prediction == 56)) | |
287 | + | then 175890 | |
288 | + | else if ((prediction == 57)) | |
289 | + | then 172800 | |
290 | + | else if ((prediction == 58)) | |
291 | + | then 169820 | |
292 | + | else if ((prediction == 59)) | |
293 | + | then 166940 | |
294 | + | else if ((prediction == 60)) | |
295 | + | then 164160 | |
296 | + | else if ((prediction == 61)) | |
297 | + | then 161470 | |
298 | + | else if ((prediction == 62)) | |
299 | + | then 158870 | |
300 | + | else if ((prediction == 63)) | |
301 | + | then 156340 | |
302 | + | else if ((prediction == 64)) | |
303 | + | then 153900 | |
304 | + | else if ((prediction == 65)) | |
305 | + | then 151530 | |
306 | + | else if ((prediction == 66)) | |
307 | + | then 149240 | |
308 | + | else if ((prediction == 67)) | |
309 | + | then 147010 | |
310 | + | else if ((prediction == 68)) | |
311 | + | then 144850 | |
312 | + | else if ((prediction == 69)) | |
313 | + | then 142750 | |
314 | + | else if ((prediction == 70)) | |
315 | + | then 140710 | |
316 | + | else if ((prediction == 71)) | |
317 | + | then 138730 | |
318 | + | else if ((prediction == 72)) | |
319 | + | then 136800 | |
320 | + | else if ((prediction == 73)) | |
321 | + | then 134930 | |
322 | + | else if ((prediction == 74)) | |
323 | + | then 133100 | |
324 | + | else if ((prediction == 75)) | |
325 | + | then 131330 | |
326 | + | else if ((prediction == 76)) | |
327 | + | then 129600 | |
328 | + | else if ((prediction == 77)) | |
329 | + | then 127920 | |
330 | + | else if ((prediction == 78)) | |
331 | + | then 126280 | |
332 | + | else if ((prediction == 79)) | |
333 | + | then 124680 | |
334 | + | else if ((prediction == 80)) | |
335 | + | then 123120 | |
336 | + | else if ((prediction == 81)) | |
337 | + | then 121600 | |
338 | + | else if ((prediction == 82)) | |
339 | + | then 120120 | |
340 | + | else if ((prediction == 83)) | |
341 | + | then 118670 | |
342 | + | else if ((prediction == 84)) | |
343 | + | then 117260 | |
344 | + | else if ((prediction == 85)) | |
345 | + | then 115880 | |
346 | + | else if ((prediction == 86)) | |
347 | + | then 114530 | |
348 | + | else if ((prediction == 87)) | |
349 | + | then 113210 | |
350 | + | else if ((prediction == 88)) | |
351 | + | then 111930 | |
352 | + | else if ((prediction == 89)) | |
353 | + | then 110670 | |
354 | + | else if ((prediction == 90)) | |
355 | + | then 109440 | |
356 | + | else if ((prediction == 91)) | |
357 | + | then 108240 | |
358 | + | else if ((prediction == 92)) | |
359 | + | then 107060 | |
360 | + | else if ((prediction == 93)) | |
361 | + | then 105910 | |
362 | + | else if ((prediction == 94)) | |
363 | + | then 104780 | |
364 | + | else if ((prediction == 95)) | |
365 | + | then 103680 | |
366 | + | else if ((prediction == 96)) | |
346 | 367 | then 103680 | |
347 | - | else if ((prediction == 96)) | |
348 | - | then 103680 | |
368 | + | else 100000 | |
369 | + | else if ((rollType == ROLLOVER)) | |
370 | + | then if ((prediction == 4)) | |
371 | + | then 103680 | |
372 | + | else if ((prediction == 5)) | |
373 | + | then 103680 | |
374 | + | else if ((prediction == 6)) | |
375 | + | then 104780 | |
376 | + | else if ((prediction == 7)) | |
377 | + | then 105910 | |
378 | + | else if ((prediction == 8)) | |
379 | + | then 107060 | |
380 | + | else if ((prediction == 9)) | |
381 | + | then 108240 | |
382 | + | else if ((prediction == 10)) | |
383 | + | then 109440 | |
384 | + | else if ((prediction == 11)) | |
385 | + | then 110670 | |
386 | + | else if ((prediction == 12)) | |
387 | + | then 111930 | |
388 | + | else if ((prediction == 13)) | |
389 | + | then 113210 | |
390 | + | else if ((prediction == 14)) | |
391 | + | then 114530 | |
392 | + | else if ((prediction == 15)) | |
393 | + | then 115880 | |
394 | + | else if ((prediction == 16)) | |
395 | + | then 117260 | |
396 | + | else if ((prediction == 17)) | |
397 | + | then 118670 | |
398 | + | else if ((prediction == 18)) | |
399 | + | then 120120 | |
400 | + | else if ((prediction == 19)) | |
401 | + | then 121600 | |
402 | + | else if ((prediction == 20)) | |
403 | + | then 123120 | |
404 | + | else if ((prediction == 21)) | |
405 | + | then 124680 | |
406 | + | else if ((prediction == 22)) | |
407 | + | then 126280 | |
408 | + | else if ((prediction == 23)) | |
409 | + | then 127920 | |
410 | + | else if ((prediction == 24)) | |
411 | + | then 129600 | |
412 | + | else if ((prediction == 25)) | |
413 | + | then 131330 | |
414 | + | else if ((prediction == 26)) | |
415 | + | then 133100 | |
416 | + | else if ((prediction == 27)) | |
417 | + | then 134930 | |
418 | + | else if ((prediction == 28)) | |
419 | + | then 136800 | |
420 | + | else if ((prediction == 29)) | |
421 | + | then 138730 | |
422 | + | else if ((prediction == 30)) | |
423 | + | then 140710 | |
424 | + | else if ((prediction == 31)) | |
425 | + | then 142750 | |
426 | + | else if ((prediction == 32)) | |
427 | + | then 144850 | |
428 | + | else if ((prediction == 33)) | |
429 | + | then 147010 | |
430 | + | else if ((prediction == 34)) | |
431 | + | then 149240 | |
432 | + | else if ((prediction == 35)) | |
433 | + | then 151530 | |
434 | + | else if ((prediction == 36)) | |
435 | + | then 153900 | |
436 | + | else if ((prediction == 37)) | |
437 | + | then 156340 | |
438 | + | else if ((prediction == 38)) | |
439 | + | then 158870 | |
440 | + | else if ((prediction == 39)) | |
441 | + | then 161470 | |
442 | + | else if ((prediction == 40)) | |
443 | + | then 164160 | |
444 | + | else if ((prediction == 41)) | |
445 | + | then 166940 | |
446 | + | else if ((prediction == 42)) | |
447 | + | then 169820 | |
448 | + | else if ((prediction == 43)) | |
449 | + | then 172800 | |
450 | + | else if ((prediction == 44)) | |
451 | + | then 175890 | |
452 | + | else if ((prediction == 45)) | |
453 | + | then 179090 | |
454 | + | else if ((prediction == 46)) | |
455 | + | then 185840 | |
456 | + | else if ((prediction == 47)) | |
457 | + | then 185840 | |
458 | + | else if ((prediction == 48)) | |
459 | + | then 189420 | |
460 | + | else if ((prediction == 49)) | |
461 | + | then 193130 | |
462 | + | else if ((prediction == 50)) | |
463 | + | then 197000 | |
464 | + | else if ((prediction == 51)) | |
465 | + | then 201020 | |
466 | + | else if ((prediction == 52)) | |
467 | + | then 205200 | |
468 | + | else if ((prediction == 53)) | |
469 | + | then 209570 | |
470 | + | else if ((prediction == 54)) | |
471 | + | then 214130 | |
472 | + | else if ((prediction == 55)) | |
473 | + | then 218880 | |
474 | + | else if ((prediction == 56)) | |
475 | + | then 223860 | |
476 | + | else if ((prediction == 57)) | |
477 | + | then 229060 | |
478 | + | else if ((prediction == 58)) | |
479 | + | then 234520 | |
480 | + | else if ((prediction == 59)) | |
481 | + | then 240240 | |
482 | + | else if ((prediction == 60)) | |
483 | + | then 246250 | |
484 | + | else if ((prediction == 61)) | |
485 | + | then 252560 | |
486 | + | else if ((prediction == 62)) | |
487 | + | then 259210 | |
488 | + | else if ((prediction == 63)) | |
489 | + | then 259210 | |
490 | + | else if ((prediction == 64)) | |
491 | + | then 273610 | |
492 | + | else if ((prediction == 65)) | |
493 | + | then 281420 | |
494 | + | else if ((prediction == 66)) | |
495 | + | then 289700 | |
496 | + | else if ((prediction == 67)) | |
497 | + | then 298480 | |
498 | + | else if ((prediction == 68)) | |
499 | + | then 307810 | |
500 | + | else if ((prediction == 69)) | |
501 | + | then 317740 | |
502 | + | else if ((prediction == 70)) | |
503 | + | then 328330 | |
504 | + | else if ((prediction == 71)) | |
505 | + | then 339650 | |
506 | + | else if ((prediction == 72)) | |
507 | + | then 351780 | |
508 | + | else if ((prediction == 73)) | |
509 | + | then 364810 | |
510 | + | else if ((prediction == 74)) | |
511 | + | then 378840 | |
512 | + | else if ((prediction == 75)) | |
513 | + | then 394000 | |
514 | + | else if ((prediction == 76)) | |
515 | + | then 410410 | |
516 | + | else if ((prediction == 77)) | |
517 | + | then 428260 | |
518 | + | else if ((prediction == 78)) | |
519 | + | then 447720 | |
520 | + | else if ((prediction == 79)) | |
521 | + | then 469040 | |
522 | + | else if ((prediction == 80)) | |
523 | + | then 492500 | |
524 | + | else if ((prediction == 81)) | |
525 | + | then 518420 | |
526 | + | else if ((prediction == 82)) | |
527 | + | then 547220 | |
528 | + | else if ((prediction == 83)) | |
529 | + | then 579410 | |
530 | + | else if ((prediction == 84)) | |
531 | + | then 615620 | |
532 | + | else if ((prediction == 85)) | |
533 | + | then 656660 | |
534 | + | else if ((prediction == 86)) | |
535 | + | then 703570 | |
536 | + | else if ((prediction == 87)) | |
537 | + | then 757690 | |
538 | + | else if ((prediction == 88)) | |
539 | + | then 820830 | |
540 | + | else if ((prediction == 89)) | |
541 | + | then 895450 | |
542 | + | else if ((prediction == 90)) | |
543 | + | then 985000 | |
544 | + | else if ((prediction == 91)) | |
545 | + | then 1094440 | |
546 | + | else if ((prediction == 92)) | |
547 | + | then 1231250 | |
548 | + | else if ((prediction == 93)) | |
549 | + | then 1407140 | |
550 | + | else if ((prediction == 94)) | |
551 | + | then 1641660 | |
552 | + | else if ((prediction == 95)) | |
553 | + | then 1970000 | |
554 | + | else if ((prediction == 96)) | |
555 | + | then 2462500 | |
556 | + | else if ((prediction == 97)) | |
557 | + | then 3283330 | |
558 | + | else if ((prediction == 98)) | |
559 | + | then 4925000 | |
560 | + | else if ((prediction == 99)) | |
561 | + | then 9850000 | |
349 | 562 | else 100000 | |
350 | - | else if ((type == "Over")) | |
351 | - | then if ((prediction == 4)) | |
352 | - | then 103680 | |
353 | - | else if ((prediction == 5)) | |
354 | - | then 103680 | |
355 | - | else if ((prediction == 6)) | |
356 | - | then 104780 | |
357 | - | else if ((prediction == 7)) | |
358 | - | then 105910 | |
359 | - | else if ((prediction == 8)) | |
360 | - | then 107060 | |
361 | - | else if ((prediction == 9)) | |
362 | - | then 108240 | |
363 | - | else if ((prediction == 10)) | |
364 | - | then 109440 | |
365 | - | else if ((prediction == 11)) | |
366 | - | then 110670 | |
367 | - | else if ((prediction == 12)) | |
368 | - | then 111930 | |
369 | - | else if ((prediction == 13)) | |
370 | - | then 113210 | |
371 | - | else if ((prediction == 14)) | |
372 | - | then 114530 | |
373 | - | else if ((prediction == 15)) | |
374 | - | then 115880 | |
375 | - | else if ((prediction == 16)) | |
376 | - | then 117260 | |
377 | - | else if ((prediction == 17)) | |
378 | - | then 118670 | |
379 | - | else if ((prediction == 18)) | |
380 | - | then 120120 | |
381 | - | else if ((prediction == 19)) | |
382 | - | then 121600 | |
383 | - | else if ((prediction == 20)) | |
384 | - | then 123120 | |
385 | - | else if ((prediction == 21)) | |
386 | - | then 124680 | |
387 | - | else if ((prediction == 22)) | |
388 | - | then 126280 | |
389 | - | else if ((prediction == 23)) | |
390 | - | then 127920 | |
391 | - | else if ((prediction == 24)) | |
392 | - | then 129600 | |
393 | - | else if ((prediction == 25)) | |
394 | - | then 131330 | |
395 | - | else if ((prediction == 26)) | |
396 | - | then 133100 | |
397 | - | else if ((prediction == 27)) | |
398 | - | then 134930 | |
399 | - | else if ((prediction == 28)) | |
400 | - | then 136800 | |
401 | - | else if ((prediction == 29)) | |
402 | - | then 138730 | |
403 | - | else if ((prediction == 30)) | |
404 | - | then 140710 | |
405 | - | else if ((prediction == 31)) | |
406 | - | then 142750 | |
407 | - | else if ((prediction == 32)) | |
408 | - | then 144850 | |
409 | - | else if ((prediction == 33)) | |
410 | - | then 147010 | |
411 | - | else if ((prediction == 34)) | |
412 | - | then 149240 | |
413 | - | else if ((prediction == 35)) | |
414 | - | then 151530 | |
415 | - | else if ((prediction == 36)) | |
416 | - | then 153900 | |
417 | - | else if ((prediction == 37)) | |
418 | - | then 156340 | |
419 | - | else if ((prediction == 38)) | |
420 | - | then 158870 | |
421 | - | else if ((prediction == 39)) | |
422 | - | then 161470 | |
423 | - | else if ((prediction == 40)) | |
424 | - | then 164160 | |
425 | - | else if ((prediction == 41)) | |
426 | - | then 166940 | |
427 | - | else if ((prediction == 42)) | |
428 | - | then 169820 | |
429 | - | else if ((prediction == 43)) | |
430 | - | then 172800 | |
431 | - | else if ((prediction == 44)) | |
432 | - | then 175890 | |
433 | - | else if ((prediction == 45)) | |
434 | - | then 179090 | |
435 | - | else if ((prediction == 46)) | |
436 | - | then 185840 | |
437 | - | else if ((prediction == 47)) | |
438 | - | then 185840 | |
439 | - | else if ((prediction == 48)) | |
440 | - | then 189420 | |
441 | - | else if ((prediction == 49)) | |
442 | - | then 193130 | |
443 | - | else if ((prediction == 50)) | |
444 | - | then 197000 | |
445 | - | else if ((prediction == 51)) | |
446 | - | then 201020 | |
447 | - | else if ((prediction == 52)) | |
448 | - | then 205200 | |
449 | - | else if ((prediction == 53)) | |
450 | - | then 209570 | |
451 | - | else if ((prediction == 54)) | |
452 | - | then 214130 | |
453 | - | else if ((prediction == 55)) | |
454 | - | then 218880 | |
455 | - | else if ((prediction == 56)) | |
456 | - | then 223860 | |
457 | - | else if ((prediction == 57)) | |
458 | - | then 229060 | |
459 | - | else if ((prediction == 58)) | |
460 | - | then 234520 | |
461 | - | else if ((prediction == 59)) | |
462 | - | then 240240 | |
463 | - | else if ((prediction == 60)) | |
464 | - | then 246250 | |
465 | - | else if ((prediction == 61)) | |
466 | - | then 252560 | |
467 | - | else if ((prediction == 62)) | |
468 | - | then 259210 | |
469 | - | else if ((prediction == 63)) | |
470 | - | then 259210 | |
471 | - | else if ((prediction == 64)) | |
472 | - | then 273610 | |
473 | - | else if ((prediction == 65)) | |
474 | - | then 281420 | |
475 | - | else if ((prediction == 66)) | |
476 | - | then 289700 | |
477 | - | else if ((prediction == 67)) | |
478 | - | then 298480 | |
479 | - | else if ((prediction == 68)) | |
480 | - | then 307810 | |
481 | - | else if ((prediction == 69)) | |
482 | - | then 317740 | |
483 | - | else if ((prediction == 70)) | |
484 | - | then 328330 | |
485 | - | else if ((prediction == 71)) | |
486 | - | then 339650 | |
487 | - | else if ((prediction == 72)) | |
488 | - | then 351780 | |
489 | - | else if ((prediction == 73)) | |
490 | - | then 364810 | |
491 | - | else if ((prediction == 74)) | |
492 | - | then 378840 | |
493 | - | else if ((prediction == 75)) | |
494 | - | then 394000 | |
495 | - | else if ((prediction == 76)) | |
496 | - | then 410410 | |
497 | - | else if ((prediction == 77)) | |
498 | - | then 428260 | |
499 | - | else if ((prediction == 78)) | |
500 | - | then 447720 | |
501 | - | else if ((prediction == 79)) | |
502 | - | then 469040 | |
503 | - | else if ((prediction == 80)) | |
504 | - | then 492500 | |
505 | - | else if ((prediction == 81)) | |
506 | - | then 518420 | |
507 | - | else if ((prediction == 82)) | |
508 | - | then 547220 | |
509 | - | else if ((prediction == 83)) | |
510 | - | then 579410 | |
511 | - | else if ((prediction == 84)) | |
512 | - | then 615620 | |
513 | - | else if ((prediction == 85)) | |
514 | - | then 656660 | |
515 | - | else if ((prediction == 86)) | |
516 | - | then 703570 | |
517 | - | else if ((prediction == 87)) | |
518 | - | then 757690 | |
519 | - | else if ((prediction == 88)) | |
520 | - | then 820830 | |
521 | - | else if ((prediction == 89)) | |
522 | - | then 895450 | |
523 | - | else if ((prediction == 90)) | |
524 | - | then 985000 | |
525 | - | else if ((prediction == 91)) | |
526 | - | then 1094440 | |
527 | - | else if ((prediction == 92)) | |
528 | - | then 1231250 | |
529 | - | else if ((prediction == 93)) | |
530 | - | then 1407140 | |
531 | - | else if ((prediction == 94)) | |
532 | - | then 1641660 | |
533 | - | else if ((prediction == 95)) | |
534 | - | then 1970000 | |
535 | - | else if ((prediction == 96)) | |
536 | - | then 2462500 | |
537 | - | else if ((prediction == 97)) | |
538 | - | then 3283330 | |
539 | - | else if ((prediction == 98)) | |
540 | - | then 4925000 | |
541 | - | else if ((prediction == 99)) | |
542 | - | then 9850000 | |
543 | - | else 100000 | |
544 | - | else 100000 | |
545 | - | } | |
563 | + | else 100000 | |
546 | 564 | ||
547 | 565 | ||
548 | - | func diceWin (type,prediction,number) = if ((type == | |
566 | + | func diceWin (type,prediction,number) = if ((type == ROLLUNDER)) | |
549 | 567 | then if ((prediction >= number)) | |
550 | 568 | then true | |
551 | 569 | else false | |
552 | - | else if ((type == | |
570 | + | else if ((type == ROLLOVER)) | |
553 | 571 | then if ((number >= prediction)) | |
554 | 572 | then true | |
555 | 573 | else false | |
556 | 574 | else false | |
557 | 575 | ||
558 | 576 | ||
577 | + | func ValidateBetAndDefineWinAmt (amount,prediction,rollType) = if (if ((BETMIN > amount)) | |
578 | + | then true | |
579 | + | else (amount > BETMAX)) | |
580 | + | then throw(((("Bet amount is not in range: minBet=" + toString((BETMIN / 100000000))) + " maxBet=") + toString((BETMAX / 100000000)))) | |
581 | + | else if (if ((rollType != ROLLUNDER)) | |
582 | + | then (rollType != ROLLOVER) | |
583 | + | else false) | |
584 | + | then throw("Invalid Roll type, try with OVER or UNDER") | |
585 | + | else if (if ((PREDICTIONMIN > prediction)) | |
586 | + | then true | |
587 | + | else (prediction > PREDICTIONMAX)) | |
588 | + | then throw(((("Prediction is out of the condition: " + toString(PREDICTIONMIN)) + " <= predction <= ") + toString(PREDICTIONMAX))) | |
589 | + | else { | |
590 | + | let multi = Multiplier(prediction, rollType) | |
591 | + | ((((amount * multi) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
592 | + | } | |
593 | + | ||
594 | + | ||
559 | 595 | @Callable(i) | |
560 | - | func playDice ( | |
561 | - | let | |
596 | + | func playDice (rollType,prediction) = { | |
597 | + | let predInt = parseIntValue(prediction) | |
562 | 598 | let gameId = toBase58String(i.transactionId) | |
563 | 599 | let payment = extract(i.payment) | |
564 | - | let multi = getMultiplier(type, prediction) | |
565 | - | let winAmt = (((payment.amount * multi) / 100000) * (95 / 100)) | |
566 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
567 | - | if (false) | |
600 | + | let feeAssetId = isDefined(i.feeAssetId) | |
601 | + | let multi = Multiplier(predInt, rollType) | |
602 | + | let winAmt = ValidateBetAndDefineWinAmt(payment.amount, predInt, rollType) | |
603 | + | let playerBalance = wavesBalance(i.caller) | |
604 | + | let gameIdUsed = isDefined(getString(this, gameId)) | |
605 | + | if ((payment.assetId != WBET)) | |
568 | 606 | then throw("Payment should be in Wavesbet") | |
569 | - | else if (txIdUsed) | |
570 | - | then throw("Passed txId had been used before. Game aborted.") | |
571 | - | else { | |
572 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
573 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, type, playerPubKey58, height, winAmt, "") | |
574 | - | ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil)) | |
575 | - | } | |
607 | + | else if ((100000 > playerBalance)) | |
608 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
609 | + | else if (feeAssetId) | |
610 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
611 | + | else if (gameIdUsed) | |
612 | + | then throw("Passed gameId had been used before. Game aborted.") | |
613 | + | else { | |
614 | + | let newGameNum = IncrementGameNum() | |
615 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
616 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, rollType, playerPubKey58, winAmt, "") | |
617 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, ((payment.amount * FEEWAVESBET) / 100), WBET), ScriptTransfer(this, 500000, unit)])) | |
618 | + | } | |
576 | 619 | } | |
577 | 620 | ||
578 | 621 | ||
582 | 625 | let gameDataList = ExtractGameDataList(gameId) | |
583 | 626 | let gameState = gameDataList[IdxGameState] | |
584 | 627 | let playerChoice = gameDataList[IdxPlayerChoice] | |
585 | - | let type = gameDataList[IdxType] | |
586 | - | let startedHeight = parseIntValue(gameDataList[IdxStartedHeight]) | |
628 | + | let rollType = gameDataList[IdxType] | |
587 | 629 | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
588 | 630 | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
589 | 631 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
632 | + | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
590 | 633 | if ((gameState != STATESUBMITTED)) | |
591 | 634 | then throw("Invalid game state for passed gameId") | |
592 | 635 | else { | |
593 | 636 | let rand = GenerateRandInt(gameId, rsaSig) | |
594 | 637 | let randStr = RandToStr(rand) | |
595 | - | if (diceWin( | |
638 | + | if (diceWin(rollType, parseIntValue(playerChoice), rand)) | |
596 | 639 | then { | |
597 | - | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, | |
640 | + | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, rollType, playerPubKey58, winAmt, randStr) | |
598 | 641 | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr) | |
599 | 642 | } | |
600 | 643 | else { | |
601 | - | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, | |
644 | + | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, rollType, playerPubKey58, winAmt, randStr) | |
602 | 645 | WriteSet([DataEntry(gameId, newGameDataStr)]) | |
603 | 646 | } | |
604 | 647 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmOlRBTYEO3H7Y9rBmoFQFn4392Px0Qw13DsdEhnzMH2cj6Y5ymPuCOLMNe5qrUzQl8oRLzIBzFVMZlwUYl2bosrOIxQbYF7WVQWvoVxET1YIgDm3NzzOLA5uH7CKO0snshmMFCDOZEew41GjKh3Pgx+nbAguP9ZQPfqSafEmC3CN/4yDsJrKriRniZJo9jS/4LLsRKwB7HAZHzoF9LL7tSZH3htaNGtbdTkxZ1TzST3Mb2VPSzsZvQDocXUVOmJOu0o29aOY+GkG/G4RCK0FBWQHEUvC51TRDS5k8jad0O1MobjQc6b18d+fuoVFdNfZwGH+uFudtPG3UJTf2mkzZQIDAQAB") | |
5 | 5 | ||
6 | 6 | let GAMESCOUNTERKEY = "$GAME_NUM" | |
7 | 7 | ||
8 | 8 | let RESERVATIONKEY = "$RESERVED_AMOUNT" | |
9 | 9 | ||
10 | + | let WBET = base58'WAVES' | |
11 | + | ||
12 | + | let WALLETWAVESBET = Address(base58'3N2tusqAtDctK8iSTXS6F9rimmftmSuwLUX') | |
13 | + | ||
14 | + | let WALLETMCAFFE = Address(base58'') | |
15 | + | ||
16 | + | let WAVELET = ((100 * 1000) * 1000) | |
17 | + | ||
18 | + | let FEEWAVESBET = 4 | |
19 | + | ||
20 | + | let FEEMCAFEE = 2 | |
21 | + | ||
10 | 22 | let STATESUBMITTED = "SUBMITTED" | |
11 | 23 | ||
12 | 24 | let STATEWON = "WON" | |
13 | 25 | ||
14 | 26 | let STATELOST = "LOST" | |
27 | + | ||
28 | + | let ROLLUNDER = "UNDER" | |
29 | + | ||
30 | + | let ROLLOVER = "OVER" | |
31 | + | ||
32 | + | let BETMIN = (100 * WAVELET) | |
33 | + | ||
34 | + | let BETMAX = ((1000 * 100) * WAVELET) | |
35 | + | ||
36 | + | let PREDICTIONMIN = 4 | |
37 | + | ||
38 | + | let PREDICTIONMAX = 100 | |
15 | 39 | ||
16 | 40 | let IdxGameState = 0 | |
17 | 41 | ||
18 | 42 | let IdxPlayerChoice = 1 | |
19 | 43 | ||
20 | 44 | let IdxType = 2 | |
21 | 45 | ||
22 | 46 | let IdxPlayerPubKey58 = 3 | |
23 | 47 | ||
24 | - | let | |
48 | + | let IdxWinAmt = 4 | |
25 | 49 | ||
26 | - | let IdxWinAmt = 5 | |
27 | - | ||
28 | - | let IdxRandOrEmpty = 6 | |
50 | + | let IdxRandOrEmpty = 5 | |
29 | 51 | ||
30 | 52 | func IncrementGameNum () = { | |
31 | 53 | let gameNum = match getInteger(this, GAMESCOUNTERKEY) { | |
32 | 54 | case num: Int => | |
33 | 55 | num | |
34 | 56 | case _ => | |
35 | 57 | 0 | |
36 | 58 | } | |
37 | 59 | (gameNum + 1) | |
38 | 60 | } | |
39 | 61 | ||
40 | 62 | ||
41 | 63 | func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) { | |
42 | 64 | case a: Int => | |
43 | 65 | a | |
44 | 66 | case _ => | |
45 | 67 | 0 | |
46 | 68 | } | |
47 | 69 | ||
48 | 70 | ||
49 | 71 | func ValidateAndIncreaseReservedAmt (winAmt) = { | |
50 | 72 | let newReservedAmount = (ExtractReservedAmt() + winAmt) | |
51 | - | let balance = | |
73 | + | let balance = assetBalance(this, WBET) | |
52 | 74 | if ((newReservedAmount > balance)) | |
53 | 75 | then throw("Insufficient funds on Waves Rider account. Transaction was rejected for your safety.") | |
54 | 76 | else newReservedAmount | |
55 | 77 | } | |
56 | 78 | ||
57 | 79 | ||
58 | 80 | func FormatGameDataParam (p) = { | |
59 | 81 | let s = size(p) | |
60 | 82 | if ((s == 0)) | |
61 | 83 | then throw("Parameter size must be greater then 0") | |
62 | 84 | else if ((s > 99)) | |
63 | 85 | then throw("Parameter size must be less then 100") | |
64 | 86 | else if ((10 > s)) | |
65 | 87 | then (("0" + toString(s)) + p) | |
66 | 88 | else (toString(s) + p) | |
67 | 89 | } | |
68 | 90 | ||
69 | 91 | ||
70 | - | func FormatGameDataStr (gameState,playerChoice,playerType,playerPubKey58, | |
71 | - | let fullStateStr = | |
92 | + | func FormatGameDataStr (gameState,playerChoice,playerType,playerPubKey58,winAmt,randOrEmpty) = { | |
93 | + | let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerChoice)) + "_") + FormatGameDataParam(playerType)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(winAmt))) | |
72 | 94 | if ((randOrEmpty == "")) | |
73 | 95 | then fullStateStr | |
74 | 96 | else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty)) | |
75 | 97 | } | |
76 | 98 | ||
77 | 99 | ||
78 | 100 | func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0)) | |
79 | 101 | then drop(remaining, 1) | |
80 | 102 | else remaining | |
81 | 103 | ||
82 | 104 | ||
83 | 105 | func ParseNextAttribute (remaining) = { | |
84 | 106 | let s = size(remaining) | |
85 | 107 | if ((s > 0)) | |
86 | 108 | then { | |
87 | 109 | let nn = parseIntValue(take(remaining, 2)) | |
88 | 110 | let v = take(drop(remaining, 2), nn) | |
89 | 111 | let tmpRemaining = drop(remaining, (nn + 2)) | |
90 | 112 | let remainingState = RemoveUnderscoreIfPresent(tmpRemaining) | |
91 | 113 | [v, remainingState] | |
92 | 114 | } | |
93 | 115 | else throw("Empty string was passed into parseNextAttribute func") | |
94 | 116 | } | |
95 | 117 | ||
96 | 118 | ||
97 | 119 | func ParseGameRawDataStr (rawStateStr) = { | |
98 | 120 | let gameState = ParseNextAttribute(rawStateStr) | |
99 | 121 | let playerChoice = ParseNextAttribute(gameState[1]) | |
100 | - | let type = ParseNextAttribute(playerChoice[1]) | |
101 | - | let playerPubKey58 = ParseNextAttribute(type[1]) | |
102 | - | let startedHeight = ParseNextAttribute(playerPubKey58[1]) | |
103 | - | let winAmt = ParseNextAttribute(startedHeight[1]) | |
104 | - | [gameState[0], playerChoice[0], type[0], playerPubKey58[0], startedHeight[0], winAmt[0]] | |
122 | + | let rollType = ParseNextAttribute(playerChoice[1]) | |
123 | + | let playerPubKey58 = ParseNextAttribute(rollType[1]) | |
124 | + | let winAmt = ParseNextAttribute(playerPubKey58[1]) | |
125 | + | [gameState[0], playerChoice[0], rollType[0], playerPubKey58[0], winAmt[0]] | |
105 | 126 | } | |
106 | 127 | ||
107 | 128 | ||
108 | 129 | func ExtractGameDataList (gameId) = { | |
109 | 130 | let rawDataStr = match getString(this, gameId) { | |
110 | 131 | case str: String => | |
111 | 132 | str | |
112 | 133 | case _ => | |
113 | 134 | throw(("Couldn't find game by " + gameId)) | |
114 | 135 | } | |
115 | 136 | ParseGameRawDataStr(rawDataStr) | |
116 | 137 | } | |
117 | 138 | ||
118 | 139 | ||
119 | 140 | func DecreaseReservedAmt (gameId,winAmt) = { | |
120 | 141 | let newReservedAmount = (ExtractReservedAmt() - winAmt) | |
121 | 142 | if ((0 > newReservedAmount)) | |
122 | 143 | then throw("Invalid Dice Roller account state - reserved amount is less than 0") | |
123 | 144 | else DataEntry(RESERVATIONKEY, newReservedAmount) | |
124 | 145 | } | |
125 | 146 | ||
126 | 147 | ||
127 | 148 | func GenerateRandInt (gameId,rsaSign) = { | |
128 | 149 | let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
129 | 150 | if (rsaSigValid) | |
130 | 151 | then { | |
131 | 152 | let rand = (toInt(sha256(rsaSign)) % 100) | |
132 | 153 | if ((0 > rand)) | |
133 | 154 | then ((-1 * rand) + 1) | |
134 | 155 | else (rand + 1) | |
135 | 156 | } | |
136 | 157 | else throw("Invalid RSA signature") | |
137 | 158 | } | |
138 | 159 | ||
139 | 160 | ||
140 | 161 | func RandToStr (r) = if (if ((r >= 1)) | |
141 | 162 | then (100 >= r) | |
142 | 163 | else false) | |
143 | 164 | then toString(r) | |
144 | 165 | else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r))) | |
145 | 166 | ||
146 | 167 | ||
147 | 168 | func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr) = { | |
148 | 169 | let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')] | |
149 | 170 | let writeDicePlay = WriteSet([DataEntry("Game Id", gameId), DataEntry("Player Address", toString(playerAddress))]) | |
150 | 171 | ScriptResult(writeDicePlay, TransferSet(tSetCommonData)) | |
151 | 172 | } | |
152 | 173 | ||
153 | 174 | ||
154 | - | func | |
155 | - | | |
156 | - | | |
157 | - | | |
158 | - | then | |
159 | - | else if ((prediction == | |
160 | - | then | |
161 | - | else if ((prediction == | |
162 | - | then | |
163 | - | else if ((prediction == | |
164 | - | then | |
165 | - | else if ((prediction == | |
166 | - | then | |
167 | - | else if ((prediction == | |
168 | - | then | |
169 | - | else if ((prediction == | |
170 | - | then | |
171 | - | else if ((prediction == | |
172 | - | then | |
173 | - | else if ((prediction == | |
174 | - | then | |
175 | - | else if ((prediction == | |
176 | - | then | |
177 | - | else if ((prediction == | |
178 | - | then | |
179 | - | else if ((prediction == | |
180 | - | then | |
181 | - | else if ((prediction == | |
182 | - | then | |
183 | - | else if ((prediction == | |
184 | - | then | |
185 | - | else if ((prediction == | |
186 | - | then | |
187 | - | else if ((prediction == | |
188 | - | then | |
189 | - | else if ((prediction == | |
190 | - | then | |
191 | - | else if ((prediction == | |
192 | - | then | |
193 | - | else if ((prediction == | |
194 | - | then | |
195 | - | else if ((prediction == | |
196 | - | then | |
197 | - | else if ((prediction == | |
198 | - | then | |
199 | - | else if ((prediction == | |
200 | - | then | |
201 | - | else if ((prediction == | |
202 | - | then | |
203 | - | else if ((prediction == | |
204 | - | then | |
205 | - | else if ((prediction == | |
206 | - | then | |
207 | - | else if ((prediction == | |
208 | - | then | |
209 | - | else if ((prediction == | |
210 | - | then | |
211 | - | else if ((prediction == | |
212 | - | then | |
213 | - | else if ((prediction == | |
214 | - | then | |
215 | - | else if ((prediction == | |
216 | - | then | |
217 | - | else if ((prediction == | |
218 | - | then | |
219 | - | else if ((prediction == | |
220 | - | then | |
221 | - | else if ((prediction == | |
222 | - | then | |
223 | - | else if ((prediction == | |
224 | - | then | |
225 | - | else if ((prediction == | |
226 | - | then | |
227 | - | else if ((prediction == | |
228 | - | then | |
229 | - | else if ((prediction == | |
175 | + | func Multiplier (prediction,rollType) = if ((rollType == ROLLUNDER)) | |
176 | + | then if ((prediction == 1)) | |
177 | + | then 9850000 | |
178 | + | else if ((prediction == 2)) | |
179 | + | then 4925000 | |
180 | + | else if ((prediction == 3)) | |
181 | + | then 3283330 | |
182 | + | else if ((prediction == 4)) | |
183 | + | then 2462500 | |
184 | + | else if ((prediction == 5)) | |
185 | + | then 1970000 | |
186 | + | else if ((prediction == 6)) | |
187 | + | then 1641660 | |
188 | + | else if ((prediction == 7)) | |
189 | + | then 1407140 | |
190 | + | else if ((prediction == 8)) | |
191 | + | then 1231250 | |
192 | + | else if ((prediction == 9)) | |
193 | + | then 1094440 | |
194 | + | else if ((prediction == 10)) | |
195 | + | then 985000 | |
196 | + | else if ((prediction == 11)) | |
197 | + | then 895450 | |
198 | + | else if ((prediction == 12)) | |
199 | + | then 820830 | |
200 | + | else if ((prediction == 13)) | |
201 | + | then 757690 | |
202 | + | else if ((prediction == 14)) | |
203 | + | then 703570 | |
204 | + | else if ((prediction == 15)) | |
205 | + | then 656660 | |
206 | + | else if ((prediction == 16)) | |
207 | + | then 615620 | |
208 | + | else if ((prediction == 17)) | |
209 | + | then 579410 | |
210 | + | else if ((prediction == 18)) | |
211 | + | then 547220 | |
212 | + | else if ((prediction == 19)) | |
213 | + | then 518420 | |
214 | + | else if ((prediction == 20)) | |
215 | + | then 492500 | |
216 | + | else if ((prediction == 21)) | |
217 | + | then 469040 | |
218 | + | else if ((prediction == 22)) | |
219 | + | then 447720 | |
220 | + | else if ((prediction == 23)) | |
221 | + | then 428260 | |
222 | + | else if ((prediction == 24)) | |
223 | + | then 410410 | |
224 | + | else if ((prediction == 25)) | |
225 | + | then 394000 | |
226 | + | else if ((prediction == 26)) | |
227 | + | then 378840 | |
228 | + | else if ((prediction == 27)) | |
229 | + | then 364810 | |
230 | + | else if ((prediction == 28)) | |
231 | + | then 351780 | |
232 | + | else if ((prediction == 29)) | |
233 | + | then 339650 | |
234 | + | else if ((prediction == 30)) | |
235 | + | then 328330 | |
236 | + | else if ((prediction == 31)) | |
237 | + | then 317740 | |
238 | + | else if ((prediction == 32)) | |
239 | + | then 307810 | |
240 | + | else if ((prediction == 33)) | |
241 | + | then 298480 | |
242 | + | else if ((prediction == 34)) | |
243 | + | then 289700 | |
244 | + | else if ((prediction == 35)) | |
245 | + | then 281420 | |
246 | + | else if ((prediction == 36)) | |
247 | + | then 273610 | |
248 | + | else if ((prediction == 37)) | |
249 | + | then 259210 | |
250 | + | else if ((prediction == 38)) | |
230 | 251 | then 259210 | |
231 | - | else if ((prediction == | |
232 | - | then | |
233 | - | else if ((prediction == | |
234 | - | then | |
235 | - | else if ((prediction == | |
236 | - | then | |
237 | - | else if ((prediction == | |
238 | - | then | |
239 | - | else if ((prediction == | |
240 | - | then | |
241 | - | else if ((prediction == | |
242 | - | then | |
243 | - | else if ((prediction == | |
244 | - | then | |
245 | - | else if ((prediction == | |
246 | - | then | |
247 | - | else if ((prediction == | |
248 | - | then | |
249 | - | else if ((prediction == | |
250 | - | then | |
251 | - | else if ((prediction == | |
252 | - | then | |
253 | - | else if ((prediction == | |
254 | - | then | |
255 | - | else if ((prediction == | |
256 | - | then | |
257 | - | else if ((prediction == | |
258 | - | then | |
259 | - | else if ((prediction == | |
260 | - | then | |
261 | - | else if ((prediction == | |
262 | - | then | |
263 | - | else if ((prediction == | |
264 | - | then | |
265 | - | else if ((prediction == | |
266 | - | then | |
267 | - | else if ((prediction == | |
268 | - | then | |
269 | - | else if ((prediction == | |
270 | - | then | |
271 | - | else if ((prediction == | |
272 | - | then | |
273 | - | else if ((prediction == | |
274 | - | then | |
275 | - | else if ((prediction == | |
276 | - | then | |
277 | - | else if ((prediction == | |
278 | - | then | |
279 | - | else if ((prediction == | |
280 | - | then | |
281 | - | else if ((prediction == | |
282 | - | then | |
283 | - | else if ((prediction == | |
284 | - | then | |
285 | - | else if ((prediction == | |
286 | - | then | |
287 | - | else if ((prediction == | |
288 | - | then | |
289 | - | else if ((prediction == | |
290 | - | then | |
291 | - | else if ((prediction == | |
292 | - | then | |
293 | - | else if ((prediction == | |
294 | - | then | |
295 | - | else if ((prediction == | |
296 | - | then | |
297 | - | else if ((prediction == | |
298 | - | then | |
299 | - | else if ((prediction == | |
300 | - | then | |
301 | - | else if ((prediction == | |
302 | - | then | |
303 | - | else if ((prediction == | |
304 | - | then | |
305 | - | else if ((prediction == | |
306 | - | then | |
307 | - | else if ((prediction == | |
308 | - | then | |
309 | - | else if ((prediction == | |
310 | - | then | |
311 | - | else if ((prediction == | |
312 | - | then | |
313 | - | else if ((prediction == | |
314 | - | then | |
315 | - | else if ((prediction == | |
316 | - | then | |
317 | - | else if ((prediction == | |
318 | - | then | |
319 | - | else if ((prediction == | |
320 | - | then | |
321 | - | else if ((prediction == | |
322 | - | then | |
323 | - | else if ((prediction == | |
324 | - | then | |
325 | - | else if ((prediction == | |
326 | - | then | |
327 | - | else if ((prediction == | |
328 | - | then | |
329 | - | else if ((prediction == | |
330 | - | then | |
331 | - | else if ((prediction == | |
332 | - | then | |
333 | - | else if ((prediction == | |
334 | - | then | |
335 | - | else if ((prediction == | |
336 | - | then | |
337 | - | else if ((prediction == | |
338 | - | then | |
339 | - | else if ((prediction == | |
340 | - | then | |
341 | - | else if ((prediction == | |
342 | - | then | |
343 | - | else if ((prediction == | |
344 | - | then | |
345 | - | else if ((prediction == | |
252 | + | else if ((prediction == 39)) | |
253 | + | then 252560 | |
254 | + | else if ((prediction == 40)) | |
255 | + | then 246250 | |
256 | + | else if ((prediction == 41)) | |
257 | + | then 240240 | |
258 | + | else if ((prediction == 42)) | |
259 | + | then 234520 | |
260 | + | else if ((prediction == 43)) | |
261 | + | then 229060 | |
262 | + | else if ((prediction == 44)) | |
263 | + | then 223860 | |
264 | + | else if ((prediction == 45)) | |
265 | + | then 218880 | |
266 | + | else if ((prediction == 46)) | |
267 | + | then 214130 | |
268 | + | else if ((prediction == 47)) | |
269 | + | then 209570 | |
270 | + | else if ((prediction == 48)) | |
271 | + | then 205200 | |
272 | + | else if ((prediction == 49)) | |
273 | + | then 201020 | |
274 | + | else if ((prediction == 50)) | |
275 | + | then 197000 | |
276 | + | else if ((prediction == 51)) | |
277 | + | then 193130 | |
278 | + | else if ((prediction == 52)) | |
279 | + | then 189420 | |
280 | + | else if ((prediction == 53)) | |
281 | + | then 185840 | |
282 | + | else if ((prediction == 54)) | |
283 | + | then 182400 | |
284 | + | else if ((prediction == 55)) | |
285 | + | then 179090 | |
286 | + | else if ((prediction == 56)) | |
287 | + | then 175890 | |
288 | + | else if ((prediction == 57)) | |
289 | + | then 172800 | |
290 | + | else if ((prediction == 58)) | |
291 | + | then 169820 | |
292 | + | else if ((prediction == 59)) | |
293 | + | then 166940 | |
294 | + | else if ((prediction == 60)) | |
295 | + | then 164160 | |
296 | + | else if ((prediction == 61)) | |
297 | + | then 161470 | |
298 | + | else if ((prediction == 62)) | |
299 | + | then 158870 | |
300 | + | else if ((prediction == 63)) | |
301 | + | then 156340 | |
302 | + | else if ((prediction == 64)) | |
303 | + | then 153900 | |
304 | + | else if ((prediction == 65)) | |
305 | + | then 151530 | |
306 | + | else if ((prediction == 66)) | |
307 | + | then 149240 | |
308 | + | else if ((prediction == 67)) | |
309 | + | then 147010 | |
310 | + | else if ((prediction == 68)) | |
311 | + | then 144850 | |
312 | + | else if ((prediction == 69)) | |
313 | + | then 142750 | |
314 | + | else if ((prediction == 70)) | |
315 | + | then 140710 | |
316 | + | else if ((prediction == 71)) | |
317 | + | then 138730 | |
318 | + | else if ((prediction == 72)) | |
319 | + | then 136800 | |
320 | + | else if ((prediction == 73)) | |
321 | + | then 134930 | |
322 | + | else if ((prediction == 74)) | |
323 | + | then 133100 | |
324 | + | else if ((prediction == 75)) | |
325 | + | then 131330 | |
326 | + | else if ((prediction == 76)) | |
327 | + | then 129600 | |
328 | + | else if ((prediction == 77)) | |
329 | + | then 127920 | |
330 | + | else if ((prediction == 78)) | |
331 | + | then 126280 | |
332 | + | else if ((prediction == 79)) | |
333 | + | then 124680 | |
334 | + | else if ((prediction == 80)) | |
335 | + | then 123120 | |
336 | + | else if ((prediction == 81)) | |
337 | + | then 121600 | |
338 | + | else if ((prediction == 82)) | |
339 | + | then 120120 | |
340 | + | else if ((prediction == 83)) | |
341 | + | then 118670 | |
342 | + | else if ((prediction == 84)) | |
343 | + | then 117260 | |
344 | + | else if ((prediction == 85)) | |
345 | + | then 115880 | |
346 | + | else if ((prediction == 86)) | |
347 | + | then 114530 | |
348 | + | else if ((prediction == 87)) | |
349 | + | then 113210 | |
350 | + | else if ((prediction == 88)) | |
351 | + | then 111930 | |
352 | + | else if ((prediction == 89)) | |
353 | + | then 110670 | |
354 | + | else if ((prediction == 90)) | |
355 | + | then 109440 | |
356 | + | else if ((prediction == 91)) | |
357 | + | then 108240 | |
358 | + | else if ((prediction == 92)) | |
359 | + | then 107060 | |
360 | + | else if ((prediction == 93)) | |
361 | + | then 105910 | |
362 | + | else if ((prediction == 94)) | |
363 | + | then 104780 | |
364 | + | else if ((prediction == 95)) | |
365 | + | then 103680 | |
366 | + | else if ((prediction == 96)) | |
346 | 367 | then 103680 | |
347 | - | else if ((prediction == 96)) | |
348 | - | then 103680 | |
368 | + | else 100000 | |
369 | + | else if ((rollType == ROLLOVER)) | |
370 | + | then if ((prediction == 4)) | |
371 | + | then 103680 | |
372 | + | else if ((prediction == 5)) | |
373 | + | then 103680 | |
374 | + | else if ((prediction == 6)) | |
375 | + | then 104780 | |
376 | + | else if ((prediction == 7)) | |
377 | + | then 105910 | |
378 | + | else if ((prediction == 8)) | |
379 | + | then 107060 | |
380 | + | else if ((prediction == 9)) | |
381 | + | then 108240 | |
382 | + | else if ((prediction == 10)) | |
383 | + | then 109440 | |
384 | + | else if ((prediction == 11)) | |
385 | + | then 110670 | |
386 | + | else if ((prediction == 12)) | |
387 | + | then 111930 | |
388 | + | else if ((prediction == 13)) | |
389 | + | then 113210 | |
390 | + | else if ((prediction == 14)) | |
391 | + | then 114530 | |
392 | + | else if ((prediction == 15)) | |
393 | + | then 115880 | |
394 | + | else if ((prediction == 16)) | |
395 | + | then 117260 | |
396 | + | else if ((prediction == 17)) | |
397 | + | then 118670 | |
398 | + | else if ((prediction == 18)) | |
399 | + | then 120120 | |
400 | + | else if ((prediction == 19)) | |
401 | + | then 121600 | |
402 | + | else if ((prediction == 20)) | |
403 | + | then 123120 | |
404 | + | else if ((prediction == 21)) | |
405 | + | then 124680 | |
406 | + | else if ((prediction == 22)) | |
407 | + | then 126280 | |
408 | + | else if ((prediction == 23)) | |
409 | + | then 127920 | |
410 | + | else if ((prediction == 24)) | |
411 | + | then 129600 | |
412 | + | else if ((prediction == 25)) | |
413 | + | then 131330 | |
414 | + | else if ((prediction == 26)) | |
415 | + | then 133100 | |
416 | + | else if ((prediction == 27)) | |
417 | + | then 134930 | |
418 | + | else if ((prediction == 28)) | |
419 | + | then 136800 | |
420 | + | else if ((prediction == 29)) | |
421 | + | then 138730 | |
422 | + | else if ((prediction == 30)) | |
423 | + | then 140710 | |
424 | + | else if ((prediction == 31)) | |
425 | + | then 142750 | |
426 | + | else if ((prediction == 32)) | |
427 | + | then 144850 | |
428 | + | else if ((prediction == 33)) | |
429 | + | then 147010 | |
430 | + | else if ((prediction == 34)) | |
431 | + | then 149240 | |
432 | + | else if ((prediction == 35)) | |
433 | + | then 151530 | |
434 | + | else if ((prediction == 36)) | |
435 | + | then 153900 | |
436 | + | else if ((prediction == 37)) | |
437 | + | then 156340 | |
438 | + | else if ((prediction == 38)) | |
439 | + | then 158870 | |
440 | + | else if ((prediction == 39)) | |
441 | + | then 161470 | |
442 | + | else if ((prediction == 40)) | |
443 | + | then 164160 | |
444 | + | else if ((prediction == 41)) | |
445 | + | then 166940 | |
446 | + | else if ((prediction == 42)) | |
447 | + | then 169820 | |
448 | + | else if ((prediction == 43)) | |
449 | + | then 172800 | |
450 | + | else if ((prediction == 44)) | |
451 | + | then 175890 | |
452 | + | else if ((prediction == 45)) | |
453 | + | then 179090 | |
454 | + | else if ((prediction == 46)) | |
455 | + | then 185840 | |
456 | + | else if ((prediction == 47)) | |
457 | + | then 185840 | |
458 | + | else if ((prediction == 48)) | |
459 | + | then 189420 | |
460 | + | else if ((prediction == 49)) | |
461 | + | then 193130 | |
462 | + | else if ((prediction == 50)) | |
463 | + | then 197000 | |
464 | + | else if ((prediction == 51)) | |
465 | + | then 201020 | |
466 | + | else if ((prediction == 52)) | |
467 | + | then 205200 | |
468 | + | else if ((prediction == 53)) | |
469 | + | then 209570 | |
470 | + | else if ((prediction == 54)) | |
471 | + | then 214130 | |
472 | + | else if ((prediction == 55)) | |
473 | + | then 218880 | |
474 | + | else if ((prediction == 56)) | |
475 | + | then 223860 | |
476 | + | else if ((prediction == 57)) | |
477 | + | then 229060 | |
478 | + | else if ((prediction == 58)) | |
479 | + | then 234520 | |
480 | + | else if ((prediction == 59)) | |
481 | + | then 240240 | |
482 | + | else if ((prediction == 60)) | |
483 | + | then 246250 | |
484 | + | else if ((prediction == 61)) | |
485 | + | then 252560 | |
486 | + | else if ((prediction == 62)) | |
487 | + | then 259210 | |
488 | + | else if ((prediction == 63)) | |
489 | + | then 259210 | |
490 | + | else if ((prediction == 64)) | |
491 | + | then 273610 | |
492 | + | else if ((prediction == 65)) | |
493 | + | then 281420 | |
494 | + | else if ((prediction == 66)) | |
495 | + | then 289700 | |
496 | + | else if ((prediction == 67)) | |
497 | + | then 298480 | |
498 | + | else if ((prediction == 68)) | |
499 | + | then 307810 | |
500 | + | else if ((prediction == 69)) | |
501 | + | then 317740 | |
502 | + | else if ((prediction == 70)) | |
503 | + | then 328330 | |
504 | + | else if ((prediction == 71)) | |
505 | + | then 339650 | |
506 | + | else if ((prediction == 72)) | |
507 | + | then 351780 | |
508 | + | else if ((prediction == 73)) | |
509 | + | then 364810 | |
510 | + | else if ((prediction == 74)) | |
511 | + | then 378840 | |
512 | + | else if ((prediction == 75)) | |
513 | + | then 394000 | |
514 | + | else if ((prediction == 76)) | |
515 | + | then 410410 | |
516 | + | else if ((prediction == 77)) | |
517 | + | then 428260 | |
518 | + | else if ((prediction == 78)) | |
519 | + | then 447720 | |
520 | + | else if ((prediction == 79)) | |
521 | + | then 469040 | |
522 | + | else if ((prediction == 80)) | |
523 | + | then 492500 | |
524 | + | else if ((prediction == 81)) | |
525 | + | then 518420 | |
526 | + | else if ((prediction == 82)) | |
527 | + | then 547220 | |
528 | + | else if ((prediction == 83)) | |
529 | + | then 579410 | |
530 | + | else if ((prediction == 84)) | |
531 | + | then 615620 | |
532 | + | else if ((prediction == 85)) | |
533 | + | then 656660 | |
534 | + | else if ((prediction == 86)) | |
535 | + | then 703570 | |
536 | + | else if ((prediction == 87)) | |
537 | + | then 757690 | |
538 | + | else if ((prediction == 88)) | |
539 | + | then 820830 | |
540 | + | else if ((prediction == 89)) | |
541 | + | then 895450 | |
542 | + | else if ((prediction == 90)) | |
543 | + | then 985000 | |
544 | + | else if ((prediction == 91)) | |
545 | + | then 1094440 | |
546 | + | else if ((prediction == 92)) | |
547 | + | then 1231250 | |
548 | + | else if ((prediction == 93)) | |
549 | + | then 1407140 | |
550 | + | else if ((prediction == 94)) | |
551 | + | then 1641660 | |
552 | + | else if ((prediction == 95)) | |
553 | + | then 1970000 | |
554 | + | else if ((prediction == 96)) | |
555 | + | then 2462500 | |
556 | + | else if ((prediction == 97)) | |
557 | + | then 3283330 | |
558 | + | else if ((prediction == 98)) | |
559 | + | then 4925000 | |
560 | + | else if ((prediction == 99)) | |
561 | + | then 9850000 | |
349 | 562 | else 100000 | |
350 | - | else if ((type == "Over")) | |
351 | - | then if ((prediction == 4)) | |
352 | - | then 103680 | |
353 | - | else if ((prediction == 5)) | |
354 | - | then 103680 | |
355 | - | else if ((prediction == 6)) | |
356 | - | then 104780 | |
357 | - | else if ((prediction == 7)) | |
358 | - | then 105910 | |
359 | - | else if ((prediction == 8)) | |
360 | - | then 107060 | |
361 | - | else if ((prediction == 9)) | |
362 | - | then 108240 | |
363 | - | else if ((prediction == 10)) | |
364 | - | then 109440 | |
365 | - | else if ((prediction == 11)) | |
366 | - | then 110670 | |
367 | - | else if ((prediction == 12)) | |
368 | - | then 111930 | |
369 | - | else if ((prediction == 13)) | |
370 | - | then 113210 | |
371 | - | else if ((prediction == 14)) | |
372 | - | then 114530 | |
373 | - | else if ((prediction == 15)) | |
374 | - | then 115880 | |
375 | - | else if ((prediction == 16)) | |
376 | - | then 117260 | |
377 | - | else if ((prediction == 17)) | |
378 | - | then 118670 | |
379 | - | else if ((prediction == 18)) | |
380 | - | then 120120 | |
381 | - | else if ((prediction == 19)) | |
382 | - | then 121600 | |
383 | - | else if ((prediction == 20)) | |
384 | - | then 123120 | |
385 | - | else if ((prediction == 21)) | |
386 | - | then 124680 | |
387 | - | else if ((prediction == 22)) | |
388 | - | then 126280 | |
389 | - | else if ((prediction == 23)) | |
390 | - | then 127920 | |
391 | - | else if ((prediction == 24)) | |
392 | - | then 129600 | |
393 | - | else if ((prediction == 25)) | |
394 | - | then 131330 | |
395 | - | else if ((prediction == 26)) | |
396 | - | then 133100 | |
397 | - | else if ((prediction == 27)) | |
398 | - | then 134930 | |
399 | - | else if ((prediction == 28)) | |
400 | - | then 136800 | |
401 | - | else if ((prediction == 29)) | |
402 | - | then 138730 | |
403 | - | else if ((prediction == 30)) | |
404 | - | then 140710 | |
405 | - | else if ((prediction == 31)) | |
406 | - | then 142750 | |
407 | - | else if ((prediction == 32)) | |
408 | - | then 144850 | |
409 | - | else if ((prediction == 33)) | |
410 | - | then 147010 | |
411 | - | else if ((prediction == 34)) | |
412 | - | then 149240 | |
413 | - | else if ((prediction == 35)) | |
414 | - | then 151530 | |
415 | - | else if ((prediction == 36)) | |
416 | - | then 153900 | |
417 | - | else if ((prediction == 37)) | |
418 | - | then 156340 | |
419 | - | else if ((prediction == 38)) | |
420 | - | then 158870 | |
421 | - | else if ((prediction == 39)) | |
422 | - | then 161470 | |
423 | - | else if ((prediction == 40)) | |
424 | - | then 164160 | |
425 | - | else if ((prediction == 41)) | |
426 | - | then 166940 | |
427 | - | else if ((prediction == 42)) | |
428 | - | then 169820 | |
429 | - | else if ((prediction == 43)) | |
430 | - | then 172800 | |
431 | - | else if ((prediction == 44)) | |
432 | - | then 175890 | |
433 | - | else if ((prediction == 45)) | |
434 | - | then 179090 | |
435 | - | else if ((prediction == 46)) | |
436 | - | then 185840 | |
437 | - | else if ((prediction == 47)) | |
438 | - | then 185840 | |
439 | - | else if ((prediction == 48)) | |
440 | - | then 189420 | |
441 | - | else if ((prediction == 49)) | |
442 | - | then 193130 | |
443 | - | else if ((prediction == 50)) | |
444 | - | then 197000 | |
445 | - | else if ((prediction == 51)) | |
446 | - | then 201020 | |
447 | - | else if ((prediction == 52)) | |
448 | - | then 205200 | |
449 | - | else if ((prediction == 53)) | |
450 | - | then 209570 | |
451 | - | else if ((prediction == 54)) | |
452 | - | then 214130 | |
453 | - | else if ((prediction == 55)) | |
454 | - | then 218880 | |
455 | - | else if ((prediction == 56)) | |
456 | - | then 223860 | |
457 | - | else if ((prediction == 57)) | |
458 | - | then 229060 | |
459 | - | else if ((prediction == 58)) | |
460 | - | then 234520 | |
461 | - | else if ((prediction == 59)) | |
462 | - | then 240240 | |
463 | - | else if ((prediction == 60)) | |
464 | - | then 246250 | |
465 | - | else if ((prediction == 61)) | |
466 | - | then 252560 | |
467 | - | else if ((prediction == 62)) | |
468 | - | then 259210 | |
469 | - | else if ((prediction == 63)) | |
470 | - | then 259210 | |
471 | - | else if ((prediction == 64)) | |
472 | - | then 273610 | |
473 | - | else if ((prediction == 65)) | |
474 | - | then 281420 | |
475 | - | else if ((prediction == 66)) | |
476 | - | then 289700 | |
477 | - | else if ((prediction == 67)) | |
478 | - | then 298480 | |
479 | - | else if ((prediction == 68)) | |
480 | - | then 307810 | |
481 | - | else if ((prediction == 69)) | |
482 | - | then 317740 | |
483 | - | else if ((prediction == 70)) | |
484 | - | then 328330 | |
485 | - | else if ((prediction == 71)) | |
486 | - | then 339650 | |
487 | - | else if ((prediction == 72)) | |
488 | - | then 351780 | |
489 | - | else if ((prediction == 73)) | |
490 | - | then 364810 | |
491 | - | else if ((prediction == 74)) | |
492 | - | then 378840 | |
493 | - | else if ((prediction == 75)) | |
494 | - | then 394000 | |
495 | - | else if ((prediction == 76)) | |
496 | - | then 410410 | |
497 | - | else if ((prediction == 77)) | |
498 | - | then 428260 | |
499 | - | else if ((prediction == 78)) | |
500 | - | then 447720 | |
501 | - | else if ((prediction == 79)) | |
502 | - | then 469040 | |
503 | - | else if ((prediction == 80)) | |
504 | - | then 492500 | |
505 | - | else if ((prediction == 81)) | |
506 | - | then 518420 | |
507 | - | else if ((prediction == 82)) | |
508 | - | then 547220 | |
509 | - | else if ((prediction == 83)) | |
510 | - | then 579410 | |
511 | - | else if ((prediction == 84)) | |
512 | - | then 615620 | |
513 | - | else if ((prediction == 85)) | |
514 | - | then 656660 | |
515 | - | else if ((prediction == 86)) | |
516 | - | then 703570 | |
517 | - | else if ((prediction == 87)) | |
518 | - | then 757690 | |
519 | - | else if ((prediction == 88)) | |
520 | - | then 820830 | |
521 | - | else if ((prediction == 89)) | |
522 | - | then 895450 | |
523 | - | else if ((prediction == 90)) | |
524 | - | then 985000 | |
525 | - | else if ((prediction == 91)) | |
526 | - | then 1094440 | |
527 | - | else if ((prediction == 92)) | |
528 | - | then 1231250 | |
529 | - | else if ((prediction == 93)) | |
530 | - | then 1407140 | |
531 | - | else if ((prediction == 94)) | |
532 | - | then 1641660 | |
533 | - | else if ((prediction == 95)) | |
534 | - | then 1970000 | |
535 | - | else if ((prediction == 96)) | |
536 | - | then 2462500 | |
537 | - | else if ((prediction == 97)) | |
538 | - | then 3283330 | |
539 | - | else if ((prediction == 98)) | |
540 | - | then 4925000 | |
541 | - | else if ((prediction == 99)) | |
542 | - | then 9850000 | |
543 | - | else 100000 | |
544 | - | else 100000 | |
545 | - | } | |
563 | + | else 100000 | |
546 | 564 | ||
547 | 565 | ||
548 | - | func diceWin (type,prediction,number) = if ((type == | |
566 | + | func diceWin (type,prediction,number) = if ((type == ROLLUNDER)) | |
549 | 567 | then if ((prediction >= number)) | |
550 | 568 | then true | |
551 | 569 | else false | |
552 | - | else if ((type == | |
570 | + | else if ((type == ROLLOVER)) | |
553 | 571 | then if ((number >= prediction)) | |
554 | 572 | then true | |
555 | 573 | else false | |
556 | 574 | else false | |
557 | 575 | ||
558 | 576 | ||
577 | + | func ValidateBetAndDefineWinAmt (amount,prediction,rollType) = if (if ((BETMIN > amount)) | |
578 | + | then true | |
579 | + | else (amount > BETMAX)) | |
580 | + | then throw(((("Bet amount is not in range: minBet=" + toString((BETMIN / 100000000))) + " maxBet=") + toString((BETMAX / 100000000)))) | |
581 | + | else if (if ((rollType != ROLLUNDER)) | |
582 | + | then (rollType != ROLLOVER) | |
583 | + | else false) | |
584 | + | then throw("Invalid Roll type, try with OVER or UNDER") | |
585 | + | else if (if ((PREDICTIONMIN > prediction)) | |
586 | + | then true | |
587 | + | else (prediction > PREDICTIONMAX)) | |
588 | + | then throw(((("Prediction is out of the condition: " + toString(PREDICTIONMIN)) + " <= predction <= ") + toString(PREDICTIONMAX))) | |
589 | + | else { | |
590 | + | let multi = Multiplier(prediction, rollType) | |
591 | + | ((((amount * multi) / 100000) * (100 - (FEEWAVESBET + FEEMCAFEE))) / 100) | |
592 | + | } | |
593 | + | ||
594 | + | ||
559 | 595 | @Callable(i) | |
560 | - | func playDice ( | |
561 | - | let | |
596 | + | func playDice (rollType,prediction) = { | |
597 | + | let predInt = parseIntValue(prediction) | |
562 | 598 | let gameId = toBase58String(i.transactionId) | |
563 | 599 | let payment = extract(i.payment) | |
564 | - | let multi = getMultiplier(type, prediction) | |
565 | - | let winAmt = (((payment.amount * multi) / 100000) * (95 / 100)) | |
566 | - | let txIdUsed = isDefined(getString(this, gameId)) | |
567 | - | if (false) | |
600 | + | let feeAssetId = isDefined(i.feeAssetId) | |
601 | + | let multi = Multiplier(predInt, rollType) | |
602 | + | let winAmt = ValidateBetAndDefineWinAmt(payment.amount, predInt, rollType) | |
603 | + | let playerBalance = wavesBalance(i.caller) | |
604 | + | let gameIdUsed = isDefined(getString(this, gameId)) | |
605 | + | if ((payment.assetId != WBET)) | |
568 | 606 | then throw("Payment should be in Wavesbet") | |
569 | - | else if (txIdUsed) | |
570 | - | then throw("Passed txId had been used before. Game aborted.") | |
571 | - | else { | |
572 | - | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
573 | - | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, type, playerPubKey58, height, winAmt, "") | |
574 | - | ScriptResult(WriteSet([DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet(nil)) | |
575 | - | } | |
607 | + | else if ((100000 > playerBalance)) | |
608 | + | then throw("There are not enough waves, it takes 0.01 Waves to bet. Game aborted.") | |
609 | + | else if (feeAssetId) | |
610 | + | then throw("Transaction's fee must be in Waves. Game aborted.") | |
611 | + | else if (gameIdUsed) | |
612 | + | then throw("Passed gameId had been used before. Game aborted.") | |
613 | + | else { | |
614 | + | let newGameNum = IncrementGameNum() | |
615 | + | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
616 | + | let gameDataStr = FormatGameDataStr(STATESUBMITTED, prediction, rollType, playerPubKey58, winAmt, "") | |
617 | + | ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(WALLETWAVESBET, ((payment.amount * FEEWAVESBET) / 100), WBET), ScriptTransfer(this, 500000, unit)])) | |
618 | + | } | |
576 | 619 | } | |
577 | 620 | ||
578 | 621 | ||
579 | 622 | ||
580 | 623 | @Callable(i) | |
581 | 624 | func withdraw (gameId,rsaSig) = { | |
582 | 625 | let gameDataList = ExtractGameDataList(gameId) | |
583 | 626 | let gameState = gameDataList[IdxGameState] | |
584 | 627 | let playerChoice = gameDataList[IdxPlayerChoice] | |
585 | - | let type = gameDataList[IdxType] | |
586 | - | let startedHeight = parseIntValue(gameDataList[IdxStartedHeight]) | |
628 | + | let rollType = gameDataList[IdxType] | |
587 | 629 | let winAmt = parseIntValue(gameDataList[IdxWinAmt]) | |
588 | 630 | let playerPubKey58 = gameDataList[IdxPlayerPubKey58] | |
589 | 631 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
632 | + | let decreasedReserves = DecreaseReservedAmt(gameId, winAmt) | |
590 | 633 | if ((gameState != STATESUBMITTED)) | |
591 | 634 | then throw("Invalid game state for passed gameId") | |
592 | 635 | else { | |
593 | 636 | let rand = GenerateRandInt(gameId, rsaSig) | |
594 | 637 | let randStr = RandToStr(rand) | |
595 | - | if (diceWin( | |
638 | + | if (diceWin(rollType, parseIntValue(playerChoice), rand)) | |
596 | 639 | then { | |
597 | - | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, | |
640 | + | let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, rollType, playerPubKey58, winAmt, randStr) | |
598 | 641 | WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr) | |
599 | 642 | } | |
600 | 643 | else { | |
601 | - | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, | |
644 | + | let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, rollType, playerPubKey58, winAmt, randStr) | |
602 | 645 | WriteSet([DataEntry(gameId, newGameDataStr)]) | |
603 | 646 | } | |
604 | 647 | } | |
605 | 648 | } | |
606 | 649 | ||
607 | 650 |
github/deemru/w8io/169f3d6 1928.04 ms ◑![]()