tx · BiAqJYPmp9pFTbnHbQA2uy7HfvbPEksrXca53mixpREP

3NA8CCJEpWACAN7uMTTGiVERNtc4dSSayyE:  -0.01500000 Waves

2019.07.19 23:21 [593240] smart account 3NA8CCJEpWACAN7uMTTGiVERNtc4dSSayyE > SELF 0.00000000 Waves

{ "type": 13, "id": "BiAqJYPmp9pFTbnHbQA2uy7HfvbPEksrXca53mixpREP", "fee": 1500000, "feeAssetId": null, "timestamp": 1563567730439, "version": 1, "sender": "3NA8CCJEpWACAN7uMTTGiVERNtc4dSSayyE", "senderPublicKey": "FgntDUgs7tdnp33MDzzH2k7CjvDsAxhC4r413RdQEF2F", "proofs": [ "ugkYb69SXgbSpBmdYtQtpbiqmhYikzzzZa9w6YYeATKiEv5NHQwQTBejzzE99T3ThpixAsqDUyHzWVVYwJsZ1i3" ], "script": "base64:AAIDAAAAAAAAAAAAAAAHAQAAAA5nZW5lcmF0ZU51bWJlcgAAAAMAAAADaW52AAAAA21heAAAAANtaW4EAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAAxXYXZlc0xvdHRvVjIJAQAAAAV0aHJvdwAAAAAEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sA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mFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAAD29wcG9uZW50QWRkcmVzcwUAAAAGcGF5b3V0CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAARjb2luBQAAAARyYW5kCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAZwYXlvdXQFAAAABnBheW91dAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAANpbnYAAAAGY2FsbGVyBQAAAAZwYXlvdXQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQFAAAAA25pbAAAAAIAAAADaW52AQAAAAhwbGF5RGljZQAAAAIAAAAEdHlwZQAAAApwcmVkaWN0aW9uCQEAAAAJc3RhcnREaWNlAAAAAwUAAAADaW52BQAAAAR0eXBlBQAAAApwcmVkaWN0aW9uAAAAA2ludgEAAAAMcGxheUNvaW5GbGlwAAAAAgAAAA9vcHBvbmVudEFkZHJlc3MAAAAMb3Bwb25lbnRNb3ZlCQEAAAANc3RhcnRDb2luRmxpcAAAAAMFAAAAA2ludgUAAAAPb3Bwb25lbnRBZGRyZXNzBQAAAAxvcHBvbmVudE1vdmUAAAAAL7fy7w==", "chainId": 84, "height": 593240, "spentComplexity": 0 } View: original | compacted Prev: HN8N5gG4aVdpWRUybhvAmwnbpgqFzqF3ZPdCe8ToBjYA Next: ektPCmSvLFhAbm5zYh3Xx5fEZQ2MiY5XfFzteY4xAvc Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func generateNumber (inv) = {
4+func generateNumber (inv,max,min) = {
55 let lastPlay = match getBinary(this, "lastPlay") {
66 case s: ByteVector =>
77 s
1010 case _ =>
1111 throw()
1212 }
13- let max = 99
14- let min = 1
1513 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1614 (((toInt(sha256(rand)) % 1000) % ((max - min) + 1)) + 1)
1715 }
427425 func startDice (inv,type,prediction) = {
428426 let playLimit = (wavesBalance(this) / 100)
429427 let payment = extract(inv.payment)
430- let wbet = assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')
431- if ((payment.assetId == wbet))
428+ if ((payment.assetId == assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')))
432429 then throw("Payment should be in Wavesbet")
433430 else if ((payment.amount > playLimit))
434431 then throw(("Payment should be less than " + toString(playLimit)))
435432 else {
436- let random = generateNumber(inv)
433+ let random = generateNumber(inv, 99, 1)
437434 let multi = getMultiplier(type, prediction)
438435 let win = diceWin(type, prediction, random)
439- let payout = dicePayout(win, payment.amount, multi)
440- let winTransfer = TransferSet([ScriptTransfer(inv.caller, payout, unit)])
436+ let payout = ((dicePayout(win, payment.amount, multi) * 95) / 100)
437+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, payout, base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')])
441438 let writeDicePlay = WriteSet([DataEntry("random number", random), DataEntry("win", win), DataEntry("payment", payment.amount), DataEntry("payout", payout)])
442439 if (win)
443440 then ScriptResult(writeDicePlay, winTransfer)
446443 }
447444
448445
446+func coinFlip (number) = if ((51 > number))
447+ then "head"
448+ else "tail"
449+
450+
451+func startCoinFlip (inv,opponentAddress,opponentMove) = {
452+ let payment = extract(inv.payment)
453+ if (if (!(isDefined(inv.payment)))
454+ then true
455+ else (payment.assetId == assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')))
456+ then throw("Payment should be in Wavesbet or Waves")
457+ else {
458+ let rand = generateNumber(inv, 100, 1)
459+ let rcoin = coinFlip(rand)
460+ let payout = (((payment.amount * 2) * 95) / 100)
461+ if ((rcoin == opponentMove))
462+ then ScriptResult(WriteSet([DataEntry("coin", rand), DataEntry("payout", payout), DataEntry("winner", opponentAddress)]), TransferSet([ScriptTransfer(Address(fromBase58String(opponentAddress)), payout, payment.assetId)]))
463+ else ScriptResult(WriteSet([DataEntry("coin", rand), DataEntry("payout", payout)]), TransferSet([ScriptTransfer(inv.caller, payout, payment.assetId)]))
464+ }
465+ }
466+
467+
449468 @Callable(inv)
450469 func playDice (type,prediction) = startDice(inv, type, prediction)
470+
471+
472+
473+@Callable(inv)
474+func playCoinFlip (opponentAddress,opponentMove) = startCoinFlip(inv, opponentAddress, opponentMove)
451475
452476
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func generateNumber (inv) = {
4+func generateNumber (inv,max,min) = {
55 let lastPlay = match getBinary(this, "lastPlay") {
66 case s: ByteVector =>
77 s
88 case a: Unit =>
99 base58'2ee4oFDYriWJ9EMeR'
1010 case _ =>
1111 throw()
1212 }
13- let max = 99
14- let min = 1
1513 let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height))
1614 (((toInt(sha256(rand)) % 1000) % ((max - min) + 1)) + 1)
1715 }
1816
1917
2018 func getMultiplier (type,prediction) = if ((type == 0))
2119 then if ((prediction == 1))
2220 then 9850000
2321 else if ((prediction == 2))
2422 then 4925000
2523 else if ((prediction == 3))
2624 then 3283330
2725 else if ((prediction == 4))
2826 then 2462500
2927 else if ((prediction == 5))
3028 then 1970000
3129 else if ((prediction == 6))
3230 then 1641660
3331 else if ((prediction == 7))
3432 then 1407140
3533 else if ((prediction == 8))
3634 then 1231250
3735 else if ((prediction == 9))
3836 then 1094440
3937 else if ((prediction == 10))
4038 then 985000
4139 else if ((prediction == 11))
4240 then 895450
4341 else if ((prediction == 12))
4442 then 820830
4543 else if ((prediction == 13))
4644 then 757690
4745 else if ((prediction == 14))
4846 then 703570
4947 else if ((prediction == 15))
5048 then 656660
5149 else if ((prediction == 16))
5250 then 615620
5351 else if ((prediction == 17))
5452 then 579410
5553 else if ((prediction == 18))
5654 then 547220
5755 else if ((prediction == 19))
5856 then 518420
5957 else if ((prediction == 20))
6058 then 492500
6159 else if ((prediction == 21))
6260 then 469040
6361 else if ((prediction == 22))
6462 then 447720
6563 else if ((prediction == 23))
6664 then 428260
6765 else if ((prediction == 24))
6866 then 410410
6967 else if ((prediction == 25))
7068 then 394000
7169 else if ((prediction == 26))
7270 then 378840
7371 else if ((prediction == 27))
7472 then 364810
7573 else if ((prediction == 28))
7674 then 351780
7775 else if ((prediction == 29))
7876 then 339650
7977 else if ((prediction == 30))
8078 then 328330
8179 else if ((prediction == 31))
8280 then 317740
8381 else if ((prediction == 32))
8482 then 307810
8583 else if ((prediction == 33))
8684 then 298480
8785 else if ((prediction == 34))
8886 then 289700
8987 else if ((prediction == 35))
9088 then 281420
9189 else if ((prediction == 36))
9290 then 273610
9391 else if ((prediction == 37))
9492 then 259210
9593 else if ((prediction == 38))
9694 then 259210
9795 else if ((prediction == 39))
9896 then 252560
9997 else if ((prediction == 40))
10098 then 246250
10199 else if ((prediction == 41))
102100 then 240240
103101 else if ((prediction == 42))
104102 then 234520
105103 else if ((prediction == 43))
106104 then 229060
107105 else if ((prediction == 44))
108106 then 223860
109107 else if ((prediction == 45))
110108 then 218880
111109 else if ((prediction == 46))
112110 then 214130
113111 else if ((prediction == 47))
114112 then 209570
115113 else if ((prediction == 48))
116114 then 205200
117115 else if ((prediction == 49))
118116 then 201020
119117 else if ((prediction == 50))
120118 then 197000
121119 else if ((prediction == 51))
122120 then 193130
123121 else if ((prediction == 52))
124122 then 189420
125123 else if ((prediction == 53))
126124 then 185840
127125 else if ((prediction == 54))
128126 then 182400
129127 else if ((prediction == 55))
130128 then 179090
131129 else if ((prediction == 56))
132130 then 175890
133131 else if ((prediction == 57))
134132 then 172800
135133 else if ((prediction == 58))
136134 then 169820
137135 else if ((prediction == 59))
138136 then 166940
139137 else if ((prediction == 60))
140138 then 164160
141139 else if ((prediction == 61))
142140 then 161470
143141 else if ((prediction == 62))
144142 then 158870
145143 else if ((prediction == 63))
146144 then 156340
147145 else if ((prediction == 64))
148146 then 153900
149147 else if ((prediction == 65))
150148 then 151530
151149 else if ((prediction == 66))
152150 then 149240
153151 else if ((prediction == 67))
154152 then 147010
155153 else if ((prediction == 68))
156154 then 144850
157155 else if ((prediction == 69))
158156 then 142750
159157 else if ((prediction == 70))
160158 then 140710
161159 else if ((prediction == 71))
162160 then 138730
163161 else if ((prediction == 72))
164162 then 136800
165163 else if ((prediction == 73))
166164 then 134930
167165 else if ((prediction == 74))
168166 then 133100
169167 else if ((prediction == 75))
170168 then 131330
171169 else if ((prediction == 76))
172170 then 129600
173171 else if ((prediction == 77))
174172 then 127920
175173 else if ((prediction == 78))
176174 then 126280
177175 else if ((prediction == 79))
178176 then 124680
179177 else if ((prediction == 80))
180178 then 123120
181179 else if ((prediction == 81))
182180 then 121600
183181 else if ((prediction == 82))
184182 then 120120
185183 else if ((prediction == 83))
186184 then 118670
187185 else if ((prediction == 84))
188186 then 117260
189187 else if ((prediction == 85))
190188 then 115880
191189 else if ((prediction == 86))
192190 then 114530
193191 else if ((prediction == 87))
194192 then 113210
195193 else if ((prediction == 88))
196194 then 111930
197195 else if ((prediction == 89))
198196 then 110670
199197 else if ((prediction == 90))
200198 then 109440
201199 else if ((prediction == 91))
202200 then 108240
203201 else if ((prediction == 92))
204202 then 107060
205203 else if ((prediction == 93))
206204 then 105910
207205 else if ((prediction == 94))
208206 then 104780
209207 else if ((prediction == 95))
210208 then 103680
211209 else if ((prediction == 96))
212210 then 103680
213211 else 100000
214212 else if ((type == 1))
215213 then if ((prediction == 4))
216214 then 103680
217215 else if ((prediction == 5))
218216 then 103680
219217 else if ((prediction == 6))
220218 then 104780
221219 else if ((prediction == 7))
222220 then 105910
223221 else if ((prediction == 8))
224222 then 107060
225223 else if ((prediction == 9))
226224 then 108240
227225 else if ((prediction == 10))
228226 then 109440
229227 else if ((prediction == 11))
230228 then 110670
231229 else if ((prediction == 12))
232230 then 111930
233231 else if ((prediction == 13))
234232 then 113210
235233 else if ((prediction == 14))
236234 then 114530
237235 else if ((prediction == 15))
238236 then 115880
239237 else if ((prediction == 16))
240238 then 117260
241239 else if ((prediction == 17))
242240 then 118670
243241 else if ((prediction == 18))
244242 then 120120
245243 else if ((prediction == 19))
246244 then 121600
247245 else if ((prediction == 20))
248246 then 123120
249247 else if ((prediction == 21))
250248 then 124680
251249 else if ((prediction == 22))
252250 then 126280
253251 else if ((prediction == 23))
254252 then 127920
255253 else if ((prediction == 24))
256254 then 129600
257255 else if ((prediction == 25))
258256 then 131330
259257 else if ((prediction == 26))
260258 then 133100
261259 else if ((prediction == 27))
262260 then 134930
263261 else if ((prediction == 28))
264262 then 136800
265263 else if ((prediction == 29))
266264 then 138730
267265 else if ((prediction == 30))
268266 then 140710
269267 else if ((prediction == 31))
270268 then 142750
271269 else if ((prediction == 32))
272270 then 144850
273271 else if ((prediction == 33))
274272 then 147010
275273 else if ((prediction == 34))
276274 then 149240
277275 else if ((prediction == 35))
278276 then 151530
279277 else if ((prediction == 36))
280278 then 153900
281279 else if ((prediction == 37))
282280 then 156340
283281 else if ((prediction == 38))
284282 then 158870
285283 else if ((prediction == 39))
286284 then 161470
287285 else if ((prediction == 40))
288286 then 164160
289287 else if ((prediction == 41))
290288 then 166940
291289 else if ((prediction == 42))
292290 then 169820
293291 else if ((prediction == 43))
294292 then 172800
295293 else if ((prediction == 44))
296294 then 175890
297295 else if ((prediction == 45))
298296 then 179090
299297 else if ((prediction == 46))
300298 then 185840
301299 else if ((prediction == 47))
302300 then 185840
303301 else if ((prediction == 48))
304302 then 189420
305303 else if ((prediction == 49))
306304 then 193130
307305 else if ((prediction == 50))
308306 then 197000
309307 else if ((prediction == 51))
310308 then 201020
311309 else if ((prediction == 52))
312310 then 205200
313311 else if ((prediction == 53))
314312 then 209570
315313 else if ((prediction == 54))
316314 then 214130
317315 else if ((prediction == 55))
318316 then 218880
319317 else if ((prediction == 56))
320318 then 223860
321319 else if ((prediction == 57))
322320 then 229060
323321 else if ((prediction == 58))
324322 then 234520
325323 else if ((prediction == 59))
326324 then 240240
327325 else if ((prediction == 60))
328326 then 246250
329327 else if ((prediction == 61))
330328 then 252560
331329 else if ((prediction == 62))
332330 then 259210
333331 else if ((prediction == 63))
334332 then 259210
335333 else if ((prediction == 64))
336334 then 273610
337335 else if ((prediction == 65))
338336 then 281420
339337 else if ((prediction == 66))
340338 then 289700
341339 else if ((prediction == 67))
342340 then 298480
343341 else if ((prediction == 68))
344342 then 307810
345343 else if ((prediction == 69))
346344 then 317740
347345 else if ((prediction == 70))
348346 then 328330
349347 else if ((prediction == 71))
350348 then 339650
351349 else if ((prediction == 72))
352350 then 351780
353351 else if ((prediction == 73))
354352 then 364810
355353 else if ((prediction == 74))
356354 then 378840
357355 else if ((prediction == 75))
358356 then 394000
359357 else if ((prediction == 76))
360358 then 410410
361359 else if ((prediction == 77))
362360 then 428260
363361 else if ((prediction == 78))
364362 then 447720
365363 else if ((prediction == 79))
366364 then 469040
367365 else if ((prediction == 80))
368366 then 492500
369367 else if ((prediction == 81))
370368 then 518420
371369 else if ((prediction == 82))
372370 then 547220
373371 else if ((prediction == 83))
374372 then 579410
375373 else if ((prediction == 84))
376374 then 615620
377375 else if ((prediction == 85))
378376 then 656660
379377 else if ((prediction == 86))
380378 then 703570
381379 else if ((prediction == 87))
382380 then 757690
383381 else if ((prediction == 88))
384382 then 820830
385383 else if ((prediction == 89))
386384 then 895450
387385 else if ((prediction == 90))
388386 then 985000
389387 else if ((prediction == 91))
390388 then 1094440
391389 else if ((prediction == 92))
392390 then 1231250
393391 else if ((prediction == 93))
394392 then 1407140
395393 else if ((prediction == 94))
396394 then 1641660
397395 else if ((prediction == 95))
398396 then 1970000
399397 else if ((prediction == 96))
400398 then 2462500
401399 else if ((prediction == 97))
402400 then 3283330
403401 else if ((prediction == 98))
404402 then 4925000
405403 else if ((prediction == 99))
406404 then 9850000
407405 else 100000
408406 else 100000
409407
410408
411409 func diceWin (type,prediction,number) = if ((type == 0))
412410 then if ((prediction >= number))
413411 then true
414412 else false
415413 else if ((type == 1))
416414 then if ((number >= prediction))
417415 then true
418416 else false
419417 else false
420418
421419
422420 func dicePayout (win,amount,mult) = if (win)
423421 then ((amount * mult) / 100000)
424422 else 0
425423
426424
427425 func startDice (inv,type,prediction) = {
428426 let playLimit = (wavesBalance(this) / 100)
429427 let payment = extract(inv.payment)
430- let wbet = assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')
431- if ((payment.assetId == wbet))
428+ if ((payment.assetId == assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')))
432429 then throw("Payment should be in Wavesbet")
433430 else if ((payment.amount > playLimit))
434431 then throw(("Payment should be less than " + toString(playLimit)))
435432 else {
436- let random = generateNumber(inv)
433+ let random = generateNumber(inv, 99, 1)
437434 let multi = getMultiplier(type, prediction)
438435 let win = diceWin(type, prediction, random)
439- let payout = dicePayout(win, payment.amount, multi)
440- let winTransfer = TransferSet([ScriptTransfer(inv.caller, payout, unit)])
436+ let payout = ((dicePayout(win, payment.amount, multi) * 95) / 100)
437+ let winTransfer = TransferSet([ScriptTransfer(inv.caller, payout, base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')])
441438 let writeDicePlay = WriteSet([DataEntry("random number", random), DataEntry("win", win), DataEntry("payment", payment.amount), DataEntry("payout", payout)])
442439 if (win)
443440 then ScriptResult(writeDicePlay, winTransfer)
444441 else ScriptResult(writeDicePlay, TransferSet(nil))
445442 }
446443 }
447444
448445
446+func coinFlip (number) = if ((51 > number))
447+ then "head"
448+ else "tail"
449+
450+
451+func startCoinFlip (inv,opponentAddress,opponentMove) = {
452+ let payment = extract(inv.payment)
453+ if (if (!(isDefined(inv.payment)))
454+ then true
455+ else (payment.assetId == assetInfo(base58'4vPcbA5yiwpWBVPALPGXus6fNdGEuYTpe4hAeSxM9Kj4')))
456+ then throw("Payment should be in Wavesbet or Waves")
457+ else {
458+ let rand = generateNumber(inv, 100, 1)
459+ let rcoin = coinFlip(rand)
460+ let payout = (((payment.amount * 2) * 95) / 100)
461+ if ((rcoin == opponentMove))
462+ then ScriptResult(WriteSet([DataEntry("coin", rand), DataEntry("payout", payout), DataEntry("winner", opponentAddress)]), TransferSet([ScriptTransfer(Address(fromBase58String(opponentAddress)), payout, payment.assetId)]))
463+ else ScriptResult(WriteSet([DataEntry("coin", rand), DataEntry("payout", payout)]), TransferSet([ScriptTransfer(inv.caller, payout, payment.assetId)]))
464+ }
465+ }
466+
467+
449468 @Callable(inv)
450469 func playDice (type,prediction) = startDice(inv, type, prediction)
470+
471+
472+
473+@Callable(inv)
474+func playCoinFlip (opponentAddress,opponentMove) = startCoinFlip(inv, opponentAddress, opponentMove)
451475
452476

github/deemru/w8io/169f3d6 
143.59 ms