tx · F27yAiaHSH5tnsQ8YLAqS7BMGvW84uD4cqqa89eKKBTb

3MvJWcUyYDnGGBzyyG9fUeTPNgPLZwTxCU5:  -0.05000000 Waves

2021.08.22 19:57 [1669805] smart account 3MvJWcUyYDnGGBzyyG9fUeTPNgPLZwTxCU5 > SELF 0.00000000 Waves

{ "type": 13, "id": "F27yAiaHSH5tnsQ8YLAqS7BMGvW84uD4cqqa89eKKBTb", "fee": 5000000, "feeAssetId": null, "timestamp": 1629651455932, "version": 2, "chainId": 84, "sender": "3MvJWcUyYDnGGBzyyG9fUeTPNgPLZwTxCU5", "senderPublicKey": "AciE2BLEYe3xEBxS3DZwkVDTNJaqNE1BJ1pp3T3oqQ5b", "proofs": [ "35EGmdcnHdMhjq5EKRXaGWVKhuTmUn4BpBLXWbwqvi2kmdA782TffNF2Ak5i1tvE9FE8nAg484bWQBiEqUmpxL85" ], "script": "base64:AAIFAAAAAAAAACMIAhIGCgQBAQEBEgMKAQESAwoBARIAEgMKAQgSBAoCCAgSAAAAADYAAAAAEGluY3ViYXRvckFkZHJlc3MBAAAAGgFULtWM0cQB59XpAM7NQCSesRQHNOlezyuqAAAAAA5icmVlZGVyQWRkcmVzcwEAAAAaAVQu1YzRxAHn1ekAzs1AJJ6xFAc06V7PK6oAAAAAC2VnZ3NBc3NldElkAQAAACAlAmXM9wRoyL4BWZF45VhaOGYUE61KTEq3/gUXSBcWgwAAAAAIbWFrZXJGZWUAAAAAAAAAAAEAAAAACHRha2VyRmVlAAAAAAAAAAACAAAAAAVTTE9UUwAAAAAAAAAACgAAAAAHV0FJVElORwAAAAAAAAAABQAAAAAMc3RlcER1cmF0aW9uAAAAAAAAAAADAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAB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EVnZ3MAAAABBQAAAAZnYW1lSWQFAAAAC2VnZ3NBc3NldElkBQAAAANuaWwJAAACAAAAAQIAAAAhWW91IGxvc2UgYW5kIGRvbid0IGhhdmUgYW55IHByaXplAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnktGQ7", "height": 1669805, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9GHzTEVAAP8LxEj9yKCm6kXgndD3oJN6zdRaR2e4zuUA Next: 8GafgDeEZY45YWTkwquSpnwouP4H4dCw1nU1A97bcNQc Diff:
OldNewDifferences
44 let incubatorAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
55
66 let breederAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
7-
8-let farmingAddress = base58'3NBznG19rEYUAcnukTRTtwJHBVKQLbobVdC'
97
108 let eggsAssetId = base58'3VUCuh9dWqe54SdzzNUkXhFXpc8UQynnJVh42B7MjNzN'
119
5149 }
5250
5351
54-func getPlayerCurrentGameKey (address) = ("currentGame_" + address)
52+func getPlayerCurrentGameKey (playerAddress) = ("currentGame_" + playerAddress)
5553
5654
57-func getPlayerCurrentGame (address) = tryGetInteger(getPlayerCurrentGameKey(address))
55+func getPlayerCurrentGame (playerAddress) = tryGetInteger(getPlayerCurrentGameKey(playerAddress))
5856
5957
60-func getSlotKey (slot) = ("slot_" + toString(slot))
58+func getSlotKey (slot) = ("slot" + toString(slot))
6159
6260
6361 func getSlot (slot) = tryGetInteger(getSlotKey(slot))
6462
6563
66-func getMakerKey (gameId) = (("game_" + toString(gameId)) + "_maker")
64+func getPlayerRoleKey (gameId,playerAddress) = ((("game" + toString(gameId)) + "_") + playerAddress)
65+
66+
67+func getPlayerRole (gameId,playerAddress) = tryGetString(getPlayerRoleKey(gameId, playerAddress))
68+
69+
70+func getMakerKey (gameId) = (("game" + toString(gameId)) + "_maker")
6771
6872
6973 func getMaker (gameId) = tryGetString(getMakerKey(gameId))
7074
7175
72-func getTakerKey (gameId) = (("game_" + toString(gameId)) + "_taker")
76+func getTakerKey (gameId) = (("game" + toString(gameId)) + "_taker")
7377
7478
7579 func getTaker (gameId) = tryGetString(getTakerKey(gameId))
7680
7781
78-func getBetEggsKey (gameId) = (("game_" + toString(gameId)) + "_betEggs")
82+func getBetEggsKey (gameId) = (("game" + toString(gameId)) + "_betEggs")
7983
8084
8185 func getBetEggs (gameId) = tryGetInteger(getBetEggsKey(gameId))
8286
8387
84-func getWaitingExpirationHeightKey (gameId) = (("game_" + toString(gameId)) + "_waitingExpirationHeight")
88+func getWaitingExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_waitingExpirationHeight")
8589
8690
8791 func getWaitingExpirationHeight (gameId) = tryGetInteger(getWaitingExpirationHeightKey(gameId))
8892
8993
90-func getExpirationHeightKey (gameId) = (("game_" + toString(gameId)) + "_expirationHeight")
94+func getExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_expirationHeight")
9195
9296
9397 func getExpirationHeight (gameId) = tryGetInteger(getExpirationHeightKey(gameId))
9498
9599
96-func getRarityRangeKey (gameId,rangePosition) = ((("game_" + toString(gameId)) + "_rarityRange_") + rangePosition)
100+func getRarityRangeKey (gameId,rangePosition) = ((("game" + toString(gameId)) + "_rarityRange_") + rangePosition)
97101
98102
99103 func getRarityRange (gameId,rangePosition) = tryGetInteger(getRarityRangeKey(gameId, rangePosition))
100104
101105
102-func getStepKey (gameId) = (("game_" + toString(gameId)) + "_step")
106+func getStepKey (gameId) = (("game" + toString(gameId)) + "_step")
103107
104108
105109 func getStep (gameId) = tryGetInteger(getStepKey(gameId))
106110
107111
108-func getRarityKey (gameId,playerRole,rangePosition) = (((((("game_" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity")
112+func getRarityKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity")
109113
110114
111115 func getRarity (gameId,playerRole,rangePosition) = tryGetInteger(getRarityKey(gameId, playerRole, rangePosition))
112116
113117
114-func getCommitKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_commit")
118+func getCommitKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_commit")
115119
116120
117121 func getCommit (gameId,playerRole) = tryGetString(getCommitKey(gameId, playerRole))
118122
119123
120-func getDuckOrderKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_duckOrder")
124+func getDuckOrderKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_duckOrder")
121125
122126
123127 func getDuckOrder (gameId,playerRole) = tryGetString(getDuckOrderKey(gameId, playerRole))
124128
125129
126-func getPrizeSentKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_prizeSent")
130+func getPrizeSentKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_prizeSent")
127131
128132
129133 func getPrizeSent (gameId,playerRole) = tryGetBoolean(getPrizeSentKey(gameId, playerRole))
136140 else 0
137141
138142
139-func getWinner (gameId) = {
140- let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",")
141- let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",")
142- let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0])
143- let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1])
144- let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2])
145- let takerRarity1 = getRarity(gameId, "taker", makerDuckOrder[0])
146- let takerRarity2 = getRarity(gameId, "taker", makerDuckOrder[1])
147- let takerRarity3 = getRarity(gameId, "taker", makerDuckOrder[2])
148- let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3))
149- if ((makerScore > 0))
150- then "maker"
151- else if ((0 > makerScore))
152- then "taker"
153- else "draw"
143+func isSymbolA (accumulated,sym) = if ((sym == "A"))
144+ then (accumulated + 1)
145+ else (accumulated + 0)
146+
147+
148+func isSymbolB (accumulated,sym) = if ((sym == "B"))
149+ then (accumulated + 1)
150+ else (accumulated + 0)
151+
152+
153+func isSymbolC (accumulated,sym) = if ((sym == "C"))
154+ then (accumulated + 1)
155+ else (accumulated + 0)
156+
157+
158+func isSymbolD (accumulated,sym) = if ((sym == "D"))
159+ then (accumulated + 1)
160+ else (accumulated + 0)
161+
162+
163+func isSymbolE (accumulated,sym) = if ((sym == "E"))
164+ then (accumulated + 1)
165+ else (accumulated + 0)
166+
167+
168+func isSymbolF (accumulated,sym) = if ((sym == "F"))
169+ then (accumulated + 1)
170+ else (accumulated + 0)
171+
172+
173+func isSymbolG (accumulated,sym) = if ((sym == "G"))
174+ then (accumulated + 1)
175+ else (accumulated + 0)
176+
177+
178+func isSymbolH (accumulated,sym) = if ((sym == "H"))
179+ then (accumulated + 1)
180+ else (accumulated + 0)
181+
182+
183+func getAmountOrClear (amount) = if (contains(amount, "0"))
184+ then ""
185+ else amount
186+
187+
188+func getGen (assetName) = {
189+ let genotype = split(dropRight(drop(assetName, 5), 3), "")
190+ (((((((getAmountOrClear((toString({
191+ let $list52865317 = genotype
192+ let $size52865317 = size($list52865317)
193+ let $acc052865317 = 0
194+ if (($size52865317 == 0))
195+ then $acc052865317
196+ else {
197+ let $acc152865317 = isSymbolA($acc052865317, $list52865317[0])
198+ if (($size52865317 == 1))
199+ then $acc152865317
200+ else {
201+ let $acc252865317 = isSymbolA($acc152865317, $list52865317[1])
202+ if (($size52865317 == 2))
203+ then $acc252865317
204+ else {
205+ let $acc352865317 = isSymbolA($acc252865317, $list52865317[2])
206+ if (($size52865317 == 3))
207+ then $acc352865317
208+ else {
209+ let $acc452865317 = isSymbolA($acc352865317, $list52865317[3])
210+ if (($size52865317 == 4))
211+ then $acc452865317
212+ else {
213+ let $acc552865317 = isSymbolA($acc452865317, $list52865317[4])
214+ if (($size52865317 == 5))
215+ then $acc552865317
216+ else {
217+ let $acc652865317 = isSymbolA($acc552865317, $list52865317[5])
218+ if (($size52865317 == 6))
219+ then $acc652865317
220+ else {
221+ let $acc752865317 = isSymbolA($acc652865317, $list52865317[6])
222+ if (($size52865317 == 7))
223+ then $acc752865317
224+ else {
225+ let $acc852865317 = isSymbolA($acc752865317, $list52865317[7])
226+ if (($size52865317 == 8))
227+ then $acc852865317
228+ else {
229+ let $acc952865317 = isSymbolA($acc852865317, $list52865317[8])
230+ throw("List size exceed 8")
231+ }
232+ }
233+ }
234+ }
235+ }
236+ }
237+ }
238+ }
239+ }
240+ }) + "A")) + getAmountOrClear((toString({
241+ let $list53545385 = genotype
242+ let $size53545385 = size($list53545385)
243+ let $acc053545385 = 0
244+ if (($size53545385 == 0))
245+ then $acc053545385
246+ else {
247+ let $acc153545385 = isSymbolB($acc053545385, $list53545385[0])
248+ if (($size53545385 == 1))
249+ then $acc153545385
250+ else {
251+ let $acc253545385 = isSymbolB($acc153545385, $list53545385[1])
252+ if (($size53545385 == 2))
253+ then $acc253545385
254+ else {
255+ let $acc353545385 = isSymbolB($acc253545385, $list53545385[2])
256+ if (($size53545385 == 3))
257+ then $acc353545385
258+ else {
259+ let $acc453545385 = isSymbolB($acc353545385, $list53545385[3])
260+ if (($size53545385 == 4))
261+ then $acc453545385
262+ else {
263+ let $acc553545385 = isSymbolB($acc453545385, $list53545385[4])
264+ if (($size53545385 == 5))
265+ then $acc553545385
266+ else {
267+ let $acc653545385 = isSymbolB($acc553545385, $list53545385[5])
268+ if (($size53545385 == 6))
269+ then $acc653545385
270+ else {
271+ let $acc753545385 = isSymbolB($acc653545385, $list53545385[6])
272+ if (($size53545385 == 7))
273+ then $acc753545385
274+ else {
275+ let $acc853545385 = isSymbolB($acc753545385, $list53545385[7])
276+ if (($size53545385 == 8))
277+ then $acc853545385
278+ else {
279+ let $acc953545385 = isSymbolB($acc853545385, $list53545385[8])
280+ throw("List size exceed 8")
281+ }
282+ }
283+ }
284+ }
285+ }
286+ }
287+ }
288+ }
289+ }
290+ }) + "B"))) + getAmountOrClear((toString({
291+ let $list54225453 = genotype
292+ let $size54225453 = size($list54225453)
293+ let $acc054225453 = 0
294+ if (($size54225453 == 0))
295+ then $acc054225453
296+ else {
297+ let $acc154225453 = isSymbolC($acc054225453, $list54225453[0])
298+ if (($size54225453 == 1))
299+ then $acc154225453
300+ else {
301+ let $acc254225453 = isSymbolC($acc154225453, $list54225453[1])
302+ if (($size54225453 == 2))
303+ then $acc254225453
304+ else {
305+ let $acc354225453 = isSymbolC($acc254225453, $list54225453[2])
306+ if (($size54225453 == 3))
307+ then $acc354225453
308+ else {
309+ let $acc454225453 = isSymbolC($acc354225453, $list54225453[3])
310+ if (($size54225453 == 4))
311+ then $acc454225453
312+ else {
313+ let $acc554225453 = isSymbolC($acc454225453, $list54225453[4])
314+ if (($size54225453 == 5))
315+ then $acc554225453
316+ else {
317+ let $acc654225453 = isSymbolC($acc554225453, $list54225453[5])
318+ if (($size54225453 == 6))
319+ then $acc654225453
320+ else {
321+ let $acc754225453 = isSymbolC($acc654225453, $list54225453[6])
322+ if (($size54225453 == 7))
323+ then $acc754225453
324+ else {
325+ let $acc854225453 = isSymbolC($acc754225453, $list54225453[7])
326+ if (($size54225453 == 8))
327+ then $acc854225453
328+ else {
329+ let $acc954225453 = isSymbolC($acc854225453, $list54225453[8])
330+ throw("List size exceed 8")
331+ }
332+ }
333+ }
334+ }
335+ }
336+ }
337+ }
338+ }
339+ }
340+ }) + "C"))) + getAmountOrClear((toString({
341+ let $list54925523 = genotype
342+ let $size54925523 = size($list54925523)
343+ let $acc054925523 = 0
344+ if (($size54925523 == 0))
345+ then $acc054925523
346+ else {
347+ let $acc154925523 = isSymbolD($acc054925523, $list54925523[0])
348+ if (($size54925523 == 1))
349+ then $acc154925523
350+ else {
351+ let $acc254925523 = isSymbolD($acc154925523, $list54925523[1])
352+ if (($size54925523 == 2))
353+ then $acc254925523
354+ else {
355+ let $acc354925523 = isSymbolD($acc254925523, $list54925523[2])
356+ if (($size54925523 == 3))
357+ then $acc354925523
358+ else {
359+ let $acc454925523 = isSymbolD($acc354925523, $list54925523[3])
360+ if (($size54925523 == 4))
361+ then $acc454925523
362+ else {
363+ let $acc554925523 = isSymbolD($acc454925523, $list54925523[4])
364+ if (($size54925523 == 5))
365+ then $acc554925523
366+ else {
367+ let $acc654925523 = isSymbolD($acc554925523, $list54925523[5])
368+ if (($size54925523 == 6))
369+ then $acc654925523
370+ else {
371+ let $acc754925523 = isSymbolD($acc654925523, $list54925523[6])
372+ if (($size54925523 == 7))
373+ then $acc754925523
374+ else {
375+ let $acc854925523 = isSymbolD($acc754925523, $list54925523[7])
376+ if (($size54925523 == 8))
377+ then $acc854925523
378+ else {
379+ let $acc954925523 = isSymbolD($acc854925523, $list54925523[8])
380+ throw("List size exceed 8")
381+ }
382+ }
383+ }
384+ }
385+ }
386+ }
387+ }
388+ }
389+ }
390+ }) + "D"))) + getAmountOrClear((toString({
391+ let $list55605591 = genotype
392+ let $size55605591 = size($list55605591)
393+ let $acc055605591 = 0
394+ if (($size55605591 == 0))
395+ then $acc055605591
396+ else {
397+ let $acc155605591 = isSymbolE($acc055605591, $list55605591[0])
398+ if (($size55605591 == 1))
399+ then $acc155605591
400+ else {
401+ let $acc255605591 = isSymbolE($acc155605591, $list55605591[1])
402+ if (($size55605591 == 2))
403+ then $acc255605591
404+ else {
405+ let $acc355605591 = isSymbolE($acc255605591, $list55605591[2])
406+ if (($size55605591 == 3))
407+ then $acc355605591
408+ else {
409+ let $acc455605591 = isSymbolE($acc355605591, $list55605591[3])
410+ if (($size55605591 == 4))
411+ then $acc455605591
412+ else {
413+ let $acc555605591 = isSymbolE($acc455605591, $list55605591[4])
414+ if (($size55605591 == 5))
415+ then $acc555605591
416+ else {
417+ let $acc655605591 = isSymbolE($acc555605591, $list55605591[5])
418+ if (($size55605591 == 6))
419+ then $acc655605591
420+ else {
421+ let $acc755605591 = isSymbolE($acc655605591, $list55605591[6])
422+ if (($size55605591 == 7))
423+ then $acc755605591
424+ else {
425+ let $acc855605591 = isSymbolE($acc755605591, $list55605591[7])
426+ if (($size55605591 == 8))
427+ then $acc855605591
428+ else {
429+ let $acc955605591 = isSymbolE($acc855605591, $list55605591[8])
430+ throw("List size exceed 8")
431+ }
432+ }
433+ }
434+ }
435+ }
436+ }
437+ }
438+ }
439+ }
440+ }) + "E"))) + getAmountOrClear((toString({
441+ let $list56285659 = genotype
442+ let $size56285659 = size($list56285659)
443+ let $acc056285659 = 0
444+ if (($size56285659 == 0))
445+ then $acc056285659
446+ else {
447+ let $acc156285659 = isSymbolF($acc056285659, $list56285659[0])
448+ if (($size56285659 == 1))
449+ then $acc156285659
450+ else {
451+ let $acc256285659 = isSymbolF($acc156285659, $list56285659[1])
452+ if (($size56285659 == 2))
453+ then $acc256285659
454+ else {
455+ let $acc356285659 = isSymbolF($acc256285659, $list56285659[2])
456+ if (($size56285659 == 3))
457+ then $acc356285659
458+ else {
459+ let $acc456285659 = isSymbolF($acc356285659, $list56285659[3])
460+ if (($size56285659 == 4))
461+ then $acc456285659
462+ else {
463+ let $acc556285659 = isSymbolF($acc456285659, $list56285659[4])
464+ if (($size56285659 == 5))
465+ then $acc556285659
466+ else {
467+ let $acc656285659 = isSymbolF($acc556285659, $list56285659[5])
468+ if (($size56285659 == 6))
469+ then $acc656285659
470+ else {
471+ let $acc756285659 = isSymbolF($acc656285659, $list56285659[6])
472+ if (($size56285659 == 7))
473+ then $acc756285659
474+ else {
475+ let $acc856285659 = isSymbolF($acc756285659, $list56285659[7])
476+ if (($size56285659 == 8))
477+ then $acc856285659
478+ else {
479+ let $acc956285659 = isSymbolF($acc856285659, $list56285659[8])
480+ throw("List size exceed 8")
481+ }
482+ }
483+ }
484+ }
485+ }
486+ }
487+ }
488+ }
489+ }
490+ }) + "F"))) + getAmountOrClear((toString({
491+ let $list56985729 = genotype
492+ let $size56985729 = size($list56985729)
493+ let $acc056985729 = 0
494+ if (($size56985729 == 0))
495+ then $acc056985729
496+ else {
497+ let $acc156985729 = isSymbolG($acc056985729, $list56985729[0])
498+ if (($size56985729 == 1))
499+ then $acc156985729
500+ else {
501+ let $acc256985729 = isSymbolG($acc156985729, $list56985729[1])
502+ if (($size56985729 == 2))
503+ then $acc256985729
504+ else {
505+ let $acc356985729 = isSymbolG($acc256985729, $list56985729[2])
506+ if (($size56985729 == 3))
507+ then $acc356985729
508+ else {
509+ let $acc456985729 = isSymbolG($acc356985729, $list56985729[3])
510+ if (($size56985729 == 4))
511+ then $acc456985729
512+ else {
513+ let $acc556985729 = isSymbolG($acc456985729, $list56985729[4])
514+ if (($size56985729 == 5))
515+ then $acc556985729
516+ else {
517+ let $acc656985729 = isSymbolG($acc556985729, $list56985729[5])
518+ if (($size56985729 == 6))
519+ then $acc656985729
520+ else {
521+ let $acc756985729 = isSymbolG($acc656985729, $list56985729[6])
522+ if (($size56985729 == 7))
523+ then $acc756985729
524+ else {
525+ let $acc856985729 = isSymbolG($acc756985729, $list56985729[7])
526+ if (($size56985729 == 8))
527+ then $acc856985729
528+ else {
529+ let $acc956985729 = isSymbolG($acc856985729, $list56985729[8])
530+ throw("List size exceed 8")
531+ }
532+ }
533+ }
534+ }
535+ }
536+ }
537+ }
538+ }
539+ }
540+ }) + "G"))) + getAmountOrClear((toString({
541+ let $list57665797 = genotype
542+ let $size57665797 = size($list57665797)
543+ let $acc057665797 = 0
544+ if (($size57665797 == 0))
545+ then $acc057665797
546+ else {
547+ let $acc157665797 = isSymbolH($acc057665797, $list57665797[0])
548+ if (($size57665797 == 1))
549+ then $acc157665797
550+ else {
551+ let $acc257665797 = isSymbolH($acc157665797, $list57665797[1])
552+ if (($size57665797 == 2))
553+ then $acc257665797
554+ else {
555+ let $acc357665797 = isSymbolH($acc257665797, $list57665797[2])
556+ if (($size57665797 == 3))
557+ then $acc357665797
558+ else {
559+ let $acc457665797 = isSymbolH($acc357665797, $list57665797[3])
560+ if (($size57665797 == 4))
561+ then $acc457665797
562+ else {
563+ let $acc557665797 = isSymbolH($acc457665797, $list57665797[4])
564+ if (($size57665797 == 5))
565+ then $acc557665797
566+ else {
567+ let $acc657665797 = isSymbolH($acc557665797, $list57665797[5])
568+ if (($size57665797 == 6))
569+ then $acc657665797
570+ else {
571+ let $acc757665797 = isSymbolH($acc657665797, $list57665797[6])
572+ if (($size57665797 == 7))
573+ then $acc757665797
574+ else {
575+ let $acc857665797 = isSymbolH($acc757665797, $list57665797[7])
576+ if (($size57665797 == 8))
577+ then $acc857665797
578+ else {
579+ let $acc957665797 = isSymbolH($acc857665797, $list57665797[8])
580+ throw("List size exceed 8")
581+ }
582+ }
583+ }
584+ }
585+ }
586+ }
587+ }
588+ }
589+ }
590+ }) + "H")))
154591 }
155592
156593
157-func getWinnerExpired (gameStep) = if (if (if ((gameStep == 0))
158- then true
159- else (gameStep == 3))
160- then true
161- else (gameStep == 5))
162- then "maker"
163- else if (if (if ((gameStep == 1))
164- then true
165- else (gameStep == 2))
166- then true
167- else (gameStep == 4))
168- then "taker"
169- else "draw"
594+func getAssetOrigin (generation) = if ((generation == "G"))
595+ then incubatorAddress
596+ else breederAddress
170597
171598
172-func sendPrize (gameId,playerAddress,playerRole,winner) = {
173- let makerAddress = getMaker(gameId)
174- let takerAddress = getTaker(gameId)
175- if (getPrizeSent(gameId, playerRole))
176- then throw("You have already got the prize")
177- else if ((winner == playerRole))
178- then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, (getBetEggs(gameId) * 2), eggsAssetId)]
179- else if ((winner == "draw"))
180- then if ((playerRole == "maker"))
181- then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, getBetEggs(gameId), eggsAssetId)]
182- else [IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, getBetEggs(gameId), eggsAssetId)]
183- else throw("You lose and don't have any prize")
599+func getAssetRarity (assetId) = if (if ((value(assetInfo(assetId)).issuer == Address(breederAddress)))
600+ then true
601+ else (value(assetInfo(assetId)).issuer == Address(incubatorAddress)))
602+ then {
603+ let assetName = value(assetInfo(assetId)).name
604+ let generation = take(takeRight(assetName, 2), 1)
605+ let gen = ((getGen(assetName) + "-") + generation)
606+ let quantity = getIntegerValue(Address(getAssetOrigin(generation)), (("stats_" + gen) + "_quantity"))
607+ let power = pow((10000 / quantity), 4, 5, 1, 2, FLOOR)
608+ if ((power > 0))
609+ then power
610+ else 2
611+ }
612+ else throw("not valid NFT")
613+
614+
615+func getWinner (gameId) = {
616+ let gameStep = getStep(gameId)
617+ if ((6 > gameStep))
618+ then {
619+ let expirationHeight = getExpirationHeight(gameId)
620+ if ((expirationHeight == 0))
621+ then throw("Game is not started")
622+ else if ((expirationHeight > height))
623+ then throw("Game is not finished or expired")
624+ else if (((getStep(gameId) % 2) == 0))
625+ then "maker"
626+ else "taker"
627+ }
628+ else {
629+ let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",")
630+ let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",")
631+ let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0])
632+ let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1])
633+ let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2])
634+ let takerRarity1 = getRarity(gameId, "taker", makerDuckOrder[0])
635+ let takerRarity2 = getRarity(gameId, "taker", makerDuckOrder[1])
636+ let takerRarity3 = getRarity(gameId, "taker", makerDuckOrder[2])
637+ let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3))
638+ if ((makerScore > 0))
639+ then "maker"
640+ else if ((0 > makerScore))
641+ then "taker"
642+ else "draw"
643+ }
184644 }
185645
186646
219679 then throw("The medium duck must be better than the worst one")
220680 else if ((rarityRangeMedium >= rarityRangeBest))
221681 then throw("The best duck must be better than the medium one")
222- else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
682+ else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "maker"), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
223683 }
224684
225685
243703 then throw("Insufficient eggs amount")
244704 else if ((height >= getWaitingExpirationHeight(gameId)))
245705 then throw("This game is expired")
246- else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getTakerKey(gameId), callerAddress), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), IntegerEntry(getSlotKey(slot), 0)]
706+ else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getTakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "taker"), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), IntegerEntry(getSlotKey(slot), 0)]
247707 }
248708
249709
268728
269729
270730 @Callable(i)
271-func pickDucks (gameId) = {
731+func pickDucks () = {
272732 let callerAddress = toBase58String(i.caller.bytes)
733+ let gameId = getPlayerCurrentGame(callerAddress)
734+ let playerRole = getPlayerRole(gameId, callerAddress)
273735 let gameStep = getStep(gameId)
736+ let worstRarityRange = getRarityRange(gameId, "worst")
737+ let mediumRarityRange = getRarityRange(gameId, "meduim")
738+ let bestRarityRange = getRarityRange(gameId, "best")
274739 let worstDuckId = value(value(i.payments[0]).assetId)
275740 let mediumDuckId = value(value(i.payments[1]).assetId)
276741 let bestDuckId = value(value(i.payments[2]).assetId)
277- let worstRarityRange = getRarityRange(gameId, "worst")
278- let mediumRarityRange = getRarityRange(gameId, "meduim")
279- let bestRarityRange = getRarityRange(gameId, "best")
280- if (if ((value(assetInfo(worstDuckId)).issuer != Address(breederAddress)))
281- then (value(assetInfo(worstDuckId)).issuer != Address(incubatorAddress))
282- else false)
283- then throw("Invalid worstDuck NFT")
284- else if (if ((value(assetInfo(mediumDuckId)).issuer != Address(breederAddress)))
285- then (value(assetInfo(mediumDuckId)).issuer != Address(incubatorAddress))
286- else false)
287- then throw("Invalid mediumDuck NFT")
288- else if (if ((value(assetInfo(bestDuckId)).issuer != Address(breederAddress)))
289- then (value(assetInfo(bestDuckId)).issuer != Address(incubatorAddress))
742+ let worstRarity = getAssetRarity(worstDuckId)
743+ let mediumRarity = getAssetRarity(mediumDuckId)
744+ let bestRarity = getAssetRarity(bestDuckId)
745+ if ((gameId == 0))
746+ then throw("You don't have an active game")
747+ else if ((getExpirationHeight(gameId) == 0))
748+ then throw("Game is not started")
749+ else if (if ((gameStep == 0))
750+ then (playerRole != "taker")
290751 else false)
291- then throw("Invalid bestDuck NFT")
292- else if ((gameStep == 0))
293- then if ((callerAddress != getTaker(gameId)))
294- then throw("It is the taker's turn to pick now")
295- else {
296- let invokeWorstRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [worstDuckId], nil)
297- if ((invokeWorstRes == invokeWorstRes))
298- then {
299- let worstRarity = match invokeWorstRes {
300- case r: Int =>
301- r
302- case _ =>
303- throw("Incorrect invoke result")
304- }
305- let invokeMediumRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [mediumDuckId], nil)
306- if ((invokeMediumRes == invokeMediumRes))
307- then {
308- let mediumRarity = match invokeMediumRes {
309- case r: Int =>
310- r
311- case _ =>
312- throw("Incorrect invoke result")
313- }
314- let invokeBestRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [bestDuckId], nil)
315- if ((invokeBestRes == invokeBestRes))
316- then {
317- let bestRarity = match invokeWorstRes {
318- case r: Int =>
319- r
320- case _ =>
321- throw("Incorrect invoke result")
322- }
323- if (if ((worstRarity >= (worstRarityRange * 10)))
324- then true
325- else (((worstRarityRange - 1) * 10) > worstRarity))
326- then throw("Worst duck doesn't fit rarity range")
327- else if (if ((mediumRarity >= (mediumRarityRange * 10)))
328- then true
329- else (((mediumRarityRange - 1) * 10) > mediumRarity))
330- then throw("Medium duck doesn't fit rarity range")
331- else if (if (if (if ((bestRarityRange == 5))
332- then (40 > bestRarity)
333- else false)
334- then true
335- else (bestRarity >= (bestRarityRange * 10)))
336- then true
337- else (((bestRarityRange - 1) * 10) > bestRarity))
338- then throw("Best duck doesn't fit rarity range")
339- else [IntegerEntry(getRarityKey(gameId, "taker", "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, "taker", "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, "taker", "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
340- }
341- else throw("Strict value is not equal to itself.")
342- }
343- else throw("Strict value is not equal to itself.")
344- }
345- else throw("Strict value is not equal to itself.")
346- }
347- else if ((gameStep == 1))
348- then if ((callerAddress != getMaker(gameId)))
349- then throw("It is the maker's turn to pick now")
350- else {
351- let invokeWorstRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [worstDuckId], nil)
352- if ((invokeWorstRes == invokeWorstRes))
353- then {
354- let worstRarity = match invokeWorstRes {
355- case r: Int =>
356- r
357- case _ =>
358- throw("Incorrect invoke result")
359- }
360- let invokeMediumRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [mediumDuckId], nil)
361- if ((invokeMediumRes == invokeMediumRes))
362- then {
363- let mediumRarity = match invokeMediumRes {
364- case r: Int =>
365- r
366- case _ =>
367- throw("Incorrect invoke result")
368- }
369- let invokeBestRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [bestDuckId], nil)
370- if ((invokeBestRes == invokeBestRes))
371- then {
372- let bestRarity = match invokeWorstRes {
373- case r: Int =>
374- r
375- case _ =>
376- throw("Incorrect invoke result")
377- }
378- if (if ((worstRarity >= (worstRarityRange * 10)))
379- then true
380- else (((worstRarityRange - 1) * 10) > worstRarity))
381- then throw("Worst duck doesn't fit rarity range")
382- else if (if ((mediumRarity >= (mediumRarityRange * 10)))
383- then true
384- else (((mediumRarityRange - 1) * 10) > mediumRarity))
385- then throw("Medium duck doesn't fit rarity range")
386- else if (if (if (if ((bestRarityRange == 5))
387- then (40 > bestRarity)
388- else false)
389- then true
390- else (bestRarity >= (bestRarityRange * 10)))
391- then true
392- else (((bestRarityRange - 1) * 10) > bestRarity))
393- then throw("Best duck doesn't fit rarity range")
394- else [IntegerEntry(getRarityKey(gameId, "maker", "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, "maker", "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, "maker", "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
395- }
396- else throw("Strict value is not equal to itself.")
397- }
398- else throw("Strict value is not equal to itself.")
399- }
400- else throw("Strict value is not equal to itself.")
401- }
402- else throw("The worst duck has already been picked")
752+ then throw("It is the taker's turn to pick now")
753+ else if (if ((gameStep == 1))
754+ then (playerRole != "maker")
755+ else false)
756+ then throw("It is the maker's turn to pick now")
757+ else if ((gameStep > 1))
758+ then throw("Ducks have already been picked")
759+ else if (if ((worstRarity >= (worstRarityRange * 10)))
760+ then true
761+ else (((worstRarityRange - 1) * 10) > worstRarity))
762+ then throw("Worst duck doesn't fit rarity range")
763+ else if (if ((mediumRarity >= (mediumRarityRange * 10)))
764+ then true
765+ else (((mediumRarityRange - 1) * 10) > mediumRarity))
766+ then throw("Medium duck doesn't fit rarity range")
767+ else if (if (if (if ((bestRarityRange == 5))
768+ then (40 > bestRarity)
769+ else false)
770+ then true
771+ else (bestRarity >= (bestRarityRange * 10)))
772+ then true
773+ else (((bestRarityRange - 1) * 10) > bestRarity))
774+ then throw("Best duck doesn't fit rarity range")
775+ else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
403776 }
404777
405778
406779
407780 @Callable(i)
408-func commit (gameId,hash) = {
781+func commit (hash) = {
409782 let callerAddress = toBase58String(i.caller.bytes)
783+ let gameId = getPlayerCurrentGame(callerAddress)
784+ let playerRole = getPlayerRole(gameId, callerAddress)
410785 let gameStep = getStep(gameId)
411- if ((2 > gameStep))
412- then throw("Ducks hasn't been picked yet")
413- else if ((gameStep == 2))
414- then if ((callerAddress != getMaker(gameId)))
415- then throw("It is the maker's turn to commit now")
416- else [StringEntry(getCommitKey(gameId, "maker"), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
417- else if ((gameStep == 3))
418- then if ((callerAddress != getTaker(gameId)))
419- then throw("It is the taker's turn to commit now")
420- else [StringEntry(getCommitKey(gameId, "taker"), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
421- else throw("Commit is finished")
786+ if ((gameId == 0))
787+ then throw("You don't have an active game")
788+ else if ((2 > gameStep))
789+ then throw("Commit is not started")
790+ else if (if ((gameStep == 2))
791+ then (playerRole != "taker")
792+ else false)
793+ then throw("It is the taker's turn to pick now")
794+ else if (if ((gameStep == 3))
795+ then (playerRole != "maker")
796+ else false)
797+ then throw("It is the maker's turn to pick now")
798+ else if ((gameStep > 3))
799+ then throw("Commit is finished")
800+ else [StringEntry(getCommitKey(gameId, playerRole), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
422801 }
423802
424803
425804
426805 @Callable(i)
427-func reveal (gameId,duckOrder,salt) = {
806+func reveal (duckOrder,salt) = {
428807 let callerAddress = toBase58String(i.caller.bytes)
808+ let gameId = getPlayerCurrentGame(callerAddress)
809+ let playerRole = getPlayerRole(gameId, callerAddress)
429810 let gameStep = getStep(gameId)
430- if ((4 > gameStep))
431- then throw("Reveal is not started")
432- else if (if (if (if (if (if ((duckOrder != "worst,medium,best"))
433- then true
434- else (duckOrder != "worst,best,medium"))
435- then true
436- else (duckOrder != "medium,worst,best"))
437- then true
438- else (duckOrder != "medium,best,worst"))
439- then true
440- else (duckOrder != "best,worst,medium"))
441- then true
442- else (duckOrder != "best,medium,worst"))
443- then throw("Invalid duckOrder")
444- else if ((gameStep == 4))
445- then if ((callerAddress != getMaker(gameId)))
446- then throw("It is the maker's turn to reveal now")
447- else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, "maker")))
448- then throw("reveal data is not valid")
449- else [StringEntry(getDuckOrderKey(gameId, "maker"), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
450- else if ((gameStep == 5))
451- then if ((callerAddress != getTaker(gameId)))
452- then throw("It is the taker's turn to reveal now")
453- else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, "taker")))
454- then throw("reveal data is not valid")
455- else [StringEntry(getDuckOrderKey(gameId, "taker"), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
456- else throw("Reveal is finished")
811+ if ((gameId == 0))
812+ then throw("You don't have an active game")
813+ else if ((4 > gameStep))
814+ then throw("Reveal is not started")
815+ else if (if ((gameStep == 4))
816+ then (playerRole != "taker")
817+ else false)
818+ then throw("It is the taker's turn to pick now")
819+ else if (if ((gameStep == 5))
820+ then (playerRole != "maker")
821+ else false)
822+ then throw("It is the maker's turn to pick now")
823+ else if ((gameStep > 5))
824+ then throw("Reveal is finished")
825+ else if (if (if (if (if (if ((duckOrder != "worst,medium,best"))
826+ then true
827+ else (duckOrder != "worst,best,medium"))
828+ then true
829+ else (duckOrder != "medium,worst,best"))
830+ then true
831+ else (duckOrder != "medium,best,worst"))
832+ then true
833+ else (duckOrder != "best,worst,medium"))
834+ then true
835+ else (duckOrder != "best,medium,worst"))
836+ then throw("Reveal data is not valid")
837+ else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, playerRole)))
838+ then throw("Reveal doesn't match commit")
839+ else [StringEntry(getDuckOrderKey(gameId, playerRole), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
457840 }
458841
459842
460843
461844 @Callable(i)
462-func getPrize (gameId) = {
845+func getPrize () = {
463846 let callerAddress = toBase58String(i.caller.bytes)
464- let gameStep = getStep(gameId)
465- if ((gameStep != 6))
466- then throw("Game is not finished")
467- else if ((callerAddress == getMaker(gameId)))
468- then sendPrize(gameId, i.caller, "maker", getWinner(gameId))
469- else if ((callerAddress == getTaker(gameId)))
470- then sendPrize(gameId, i.caller, "taker", getWinner(gameId))
471- else throw("Invalid caller address")
472- }
473-
474-
475-
476-@Callable(i)
477-func getPrizeExpired (gameId) = {
478- let callerAddress = toBase58String(i.caller.bytes)
479- let gameStep = getStep(gameId)
480- if ((gameStep == 6))
481- then throw("Game is finished, call getPrize instead")
482- else if ((getExpirationHeight(gameId) > height))
483- then throw("Game is not expired")
484- else if ((callerAddress == getMaker(gameId)))
485- then sendPrize(gameId, i.caller, "maker", getWinnerExpired(gameStep))
486- else if ((callerAddress == getTaker(gameId)))
487- then sendPrize(gameId, i.caller, "taker", getWinnerExpired(gameStep))
488- else throw("Invalid caller address")
847+ let gameId = getPlayerCurrentGame(callerAddress)
848+ let playerRole = getPlayerRole(gameId, callerAddress)
849+ let makerAddress = getMaker(gameId)
850+ let takerAddress = getTaker(gameId)
851+ let winner = getWinner(gameId)
852+ if ((gameId == 0))
853+ then throw("You don't have an active game")
854+ else if (getPrizeSent(gameId, playerRole))
855+ then throw("You have already got the prize")
856+ else if ((winner == playerRole))
857+ then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
858+ else if ((winner == "draw"))
859+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
860+ else throw("You lose and don't have any prize")
489861 }
490862
491863
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let incubatorAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
55
66 let breederAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
7-
8-let farmingAddress = base58'3NBznG19rEYUAcnukTRTtwJHBVKQLbobVdC'
97
108 let eggsAssetId = base58'3VUCuh9dWqe54SdzzNUkXhFXpc8UQynnJVh42B7MjNzN'
119
1210 let makerFee = 1
1311
1412 let takerFee = 2
1513
1614 let SLOTS = 10
1715
1816 let WAITING = 5
1917
2018 let stepDuration = 3
2119
2220 func tryGetInteger (key) = match getInteger(this, key) {
2321 case b: Int =>
2422 b
2523 case _ =>
2624 0
2725 }
2826
2927
3028 func tryGetString (key) = match getString(this, key) {
3129 case a: String =>
3230 a
3331 case _ =>
3432 ""
3533 }
3634
3735
3836 func tryGetBoolean (key) = match getBoolean(this, key) {
3937 case b: Boolean =>
4038 b
4139 case _ =>
4240 false
4341 }
4442
4543
4644 func getNextGameId () = {
4745 let nextId = tryGetInteger("nextGameId")
4846 if ((nextId == 0))
4947 then 1
5048 else nextId
5149 }
5250
5351
54-func getPlayerCurrentGameKey (address) = ("currentGame_" + address)
52+func getPlayerCurrentGameKey (playerAddress) = ("currentGame_" + playerAddress)
5553
5654
57-func getPlayerCurrentGame (address) = tryGetInteger(getPlayerCurrentGameKey(address))
55+func getPlayerCurrentGame (playerAddress) = tryGetInteger(getPlayerCurrentGameKey(playerAddress))
5856
5957
60-func getSlotKey (slot) = ("slot_" + toString(slot))
58+func getSlotKey (slot) = ("slot" + toString(slot))
6159
6260
6361 func getSlot (slot) = tryGetInteger(getSlotKey(slot))
6462
6563
66-func getMakerKey (gameId) = (("game_" + toString(gameId)) + "_maker")
64+func getPlayerRoleKey (gameId,playerAddress) = ((("game" + toString(gameId)) + "_") + playerAddress)
65+
66+
67+func getPlayerRole (gameId,playerAddress) = tryGetString(getPlayerRoleKey(gameId, playerAddress))
68+
69+
70+func getMakerKey (gameId) = (("game" + toString(gameId)) + "_maker")
6771
6872
6973 func getMaker (gameId) = tryGetString(getMakerKey(gameId))
7074
7175
72-func getTakerKey (gameId) = (("game_" + toString(gameId)) + "_taker")
76+func getTakerKey (gameId) = (("game" + toString(gameId)) + "_taker")
7377
7478
7579 func getTaker (gameId) = tryGetString(getTakerKey(gameId))
7680
7781
78-func getBetEggsKey (gameId) = (("game_" + toString(gameId)) + "_betEggs")
82+func getBetEggsKey (gameId) = (("game" + toString(gameId)) + "_betEggs")
7983
8084
8185 func getBetEggs (gameId) = tryGetInteger(getBetEggsKey(gameId))
8286
8387
84-func getWaitingExpirationHeightKey (gameId) = (("game_" + toString(gameId)) + "_waitingExpirationHeight")
88+func getWaitingExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_waitingExpirationHeight")
8589
8690
8791 func getWaitingExpirationHeight (gameId) = tryGetInteger(getWaitingExpirationHeightKey(gameId))
8892
8993
90-func getExpirationHeightKey (gameId) = (("game_" + toString(gameId)) + "_expirationHeight")
94+func getExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_expirationHeight")
9195
9296
9397 func getExpirationHeight (gameId) = tryGetInteger(getExpirationHeightKey(gameId))
9498
9599
96-func getRarityRangeKey (gameId,rangePosition) = ((("game_" + toString(gameId)) + "_rarityRange_") + rangePosition)
100+func getRarityRangeKey (gameId,rangePosition) = ((("game" + toString(gameId)) + "_rarityRange_") + rangePosition)
97101
98102
99103 func getRarityRange (gameId,rangePosition) = tryGetInteger(getRarityRangeKey(gameId, rangePosition))
100104
101105
102-func getStepKey (gameId) = (("game_" + toString(gameId)) + "_step")
106+func getStepKey (gameId) = (("game" + toString(gameId)) + "_step")
103107
104108
105109 func getStep (gameId) = tryGetInteger(getStepKey(gameId))
106110
107111
108-func getRarityKey (gameId,playerRole,rangePosition) = (((((("game_" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity")
112+func getRarityKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity")
109113
110114
111115 func getRarity (gameId,playerRole,rangePosition) = tryGetInteger(getRarityKey(gameId, playerRole, rangePosition))
112116
113117
114-func getCommitKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_commit")
118+func getCommitKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_commit")
115119
116120
117121 func getCommit (gameId,playerRole) = tryGetString(getCommitKey(gameId, playerRole))
118122
119123
120-func getDuckOrderKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_duckOrder")
124+func getDuckOrderKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_duckOrder")
121125
122126
123127 func getDuckOrder (gameId,playerRole) = tryGetString(getDuckOrderKey(gameId, playerRole))
124128
125129
126-func getPrizeSentKey (gameId,playerRole) = (((("game_" + toString(gameId)) + "_") + playerRole) + "_prizeSent")
130+func getPrizeSentKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_prizeSent")
127131
128132
129133 func getPrizeSent (gameId,playerRole) = tryGetBoolean(getPrizeSentKey(gameId, playerRole))
130134
131135
132136 func getScore (a,b) = if ((a > b))
133137 then 1
134138 else if ((b > a))
135139 then -1
136140 else 0
137141
138142
139-func getWinner (gameId) = {
140- let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",")
141- let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",")
142- let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0])
143- let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1])
144- let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2])
145- let takerRarity1 = getRarity(gameId, "taker", makerDuckOrder[0])
146- let takerRarity2 = getRarity(gameId, "taker", makerDuckOrder[1])
147- let takerRarity3 = getRarity(gameId, "taker", makerDuckOrder[2])
148- let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3))
149- if ((makerScore > 0))
150- then "maker"
151- else if ((0 > makerScore))
152- then "taker"
153- else "draw"
143+func isSymbolA (accumulated,sym) = if ((sym == "A"))
144+ then (accumulated + 1)
145+ else (accumulated + 0)
146+
147+
148+func isSymbolB (accumulated,sym) = if ((sym == "B"))
149+ then (accumulated + 1)
150+ else (accumulated + 0)
151+
152+
153+func isSymbolC (accumulated,sym) = if ((sym == "C"))
154+ then (accumulated + 1)
155+ else (accumulated + 0)
156+
157+
158+func isSymbolD (accumulated,sym) = if ((sym == "D"))
159+ then (accumulated + 1)
160+ else (accumulated + 0)
161+
162+
163+func isSymbolE (accumulated,sym) = if ((sym == "E"))
164+ then (accumulated + 1)
165+ else (accumulated + 0)
166+
167+
168+func isSymbolF (accumulated,sym) = if ((sym == "F"))
169+ then (accumulated + 1)
170+ else (accumulated + 0)
171+
172+
173+func isSymbolG (accumulated,sym) = if ((sym == "G"))
174+ then (accumulated + 1)
175+ else (accumulated + 0)
176+
177+
178+func isSymbolH (accumulated,sym) = if ((sym == "H"))
179+ then (accumulated + 1)
180+ else (accumulated + 0)
181+
182+
183+func getAmountOrClear (amount) = if (contains(amount, "0"))
184+ then ""
185+ else amount
186+
187+
188+func getGen (assetName) = {
189+ let genotype = split(dropRight(drop(assetName, 5), 3), "")
190+ (((((((getAmountOrClear((toString({
191+ let $list52865317 = genotype
192+ let $size52865317 = size($list52865317)
193+ let $acc052865317 = 0
194+ if (($size52865317 == 0))
195+ then $acc052865317
196+ else {
197+ let $acc152865317 = isSymbolA($acc052865317, $list52865317[0])
198+ if (($size52865317 == 1))
199+ then $acc152865317
200+ else {
201+ let $acc252865317 = isSymbolA($acc152865317, $list52865317[1])
202+ if (($size52865317 == 2))
203+ then $acc252865317
204+ else {
205+ let $acc352865317 = isSymbolA($acc252865317, $list52865317[2])
206+ if (($size52865317 == 3))
207+ then $acc352865317
208+ else {
209+ let $acc452865317 = isSymbolA($acc352865317, $list52865317[3])
210+ if (($size52865317 == 4))
211+ then $acc452865317
212+ else {
213+ let $acc552865317 = isSymbolA($acc452865317, $list52865317[4])
214+ if (($size52865317 == 5))
215+ then $acc552865317
216+ else {
217+ let $acc652865317 = isSymbolA($acc552865317, $list52865317[5])
218+ if (($size52865317 == 6))
219+ then $acc652865317
220+ else {
221+ let $acc752865317 = isSymbolA($acc652865317, $list52865317[6])
222+ if (($size52865317 == 7))
223+ then $acc752865317
224+ else {
225+ let $acc852865317 = isSymbolA($acc752865317, $list52865317[7])
226+ if (($size52865317 == 8))
227+ then $acc852865317
228+ else {
229+ let $acc952865317 = isSymbolA($acc852865317, $list52865317[8])
230+ throw("List size exceed 8")
231+ }
232+ }
233+ }
234+ }
235+ }
236+ }
237+ }
238+ }
239+ }
240+ }) + "A")) + getAmountOrClear((toString({
241+ let $list53545385 = genotype
242+ let $size53545385 = size($list53545385)
243+ let $acc053545385 = 0
244+ if (($size53545385 == 0))
245+ then $acc053545385
246+ else {
247+ let $acc153545385 = isSymbolB($acc053545385, $list53545385[0])
248+ if (($size53545385 == 1))
249+ then $acc153545385
250+ else {
251+ let $acc253545385 = isSymbolB($acc153545385, $list53545385[1])
252+ if (($size53545385 == 2))
253+ then $acc253545385
254+ else {
255+ let $acc353545385 = isSymbolB($acc253545385, $list53545385[2])
256+ if (($size53545385 == 3))
257+ then $acc353545385
258+ else {
259+ let $acc453545385 = isSymbolB($acc353545385, $list53545385[3])
260+ if (($size53545385 == 4))
261+ then $acc453545385
262+ else {
263+ let $acc553545385 = isSymbolB($acc453545385, $list53545385[4])
264+ if (($size53545385 == 5))
265+ then $acc553545385
266+ else {
267+ let $acc653545385 = isSymbolB($acc553545385, $list53545385[5])
268+ if (($size53545385 == 6))
269+ then $acc653545385
270+ else {
271+ let $acc753545385 = isSymbolB($acc653545385, $list53545385[6])
272+ if (($size53545385 == 7))
273+ then $acc753545385
274+ else {
275+ let $acc853545385 = isSymbolB($acc753545385, $list53545385[7])
276+ if (($size53545385 == 8))
277+ then $acc853545385
278+ else {
279+ let $acc953545385 = isSymbolB($acc853545385, $list53545385[8])
280+ throw("List size exceed 8")
281+ }
282+ }
283+ }
284+ }
285+ }
286+ }
287+ }
288+ }
289+ }
290+ }) + "B"))) + getAmountOrClear((toString({
291+ let $list54225453 = genotype
292+ let $size54225453 = size($list54225453)
293+ let $acc054225453 = 0
294+ if (($size54225453 == 0))
295+ then $acc054225453
296+ else {
297+ let $acc154225453 = isSymbolC($acc054225453, $list54225453[0])
298+ if (($size54225453 == 1))
299+ then $acc154225453
300+ else {
301+ let $acc254225453 = isSymbolC($acc154225453, $list54225453[1])
302+ if (($size54225453 == 2))
303+ then $acc254225453
304+ else {
305+ let $acc354225453 = isSymbolC($acc254225453, $list54225453[2])
306+ if (($size54225453 == 3))
307+ then $acc354225453
308+ else {
309+ let $acc454225453 = isSymbolC($acc354225453, $list54225453[3])
310+ if (($size54225453 == 4))
311+ then $acc454225453
312+ else {
313+ let $acc554225453 = isSymbolC($acc454225453, $list54225453[4])
314+ if (($size54225453 == 5))
315+ then $acc554225453
316+ else {
317+ let $acc654225453 = isSymbolC($acc554225453, $list54225453[5])
318+ if (($size54225453 == 6))
319+ then $acc654225453
320+ else {
321+ let $acc754225453 = isSymbolC($acc654225453, $list54225453[6])
322+ if (($size54225453 == 7))
323+ then $acc754225453
324+ else {
325+ let $acc854225453 = isSymbolC($acc754225453, $list54225453[7])
326+ if (($size54225453 == 8))
327+ then $acc854225453
328+ else {
329+ let $acc954225453 = isSymbolC($acc854225453, $list54225453[8])
330+ throw("List size exceed 8")
331+ }
332+ }
333+ }
334+ }
335+ }
336+ }
337+ }
338+ }
339+ }
340+ }) + "C"))) + getAmountOrClear((toString({
341+ let $list54925523 = genotype
342+ let $size54925523 = size($list54925523)
343+ let $acc054925523 = 0
344+ if (($size54925523 == 0))
345+ then $acc054925523
346+ else {
347+ let $acc154925523 = isSymbolD($acc054925523, $list54925523[0])
348+ if (($size54925523 == 1))
349+ then $acc154925523
350+ else {
351+ let $acc254925523 = isSymbolD($acc154925523, $list54925523[1])
352+ if (($size54925523 == 2))
353+ then $acc254925523
354+ else {
355+ let $acc354925523 = isSymbolD($acc254925523, $list54925523[2])
356+ if (($size54925523 == 3))
357+ then $acc354925523
358+ else {
359+ let $acc454925523 = isSymbolD($acc354925523, $list54925523[3])
360+ if (($size54925523 == 4))
361+ then $acc454925523
362+ else {
363+ let $acc554925523 = isSymbolD($acc454925523, $list54925523[4])
364+ if (($size54925523 == 5))
365+ then $acc554925523
366+ else {
367+ let $acc654925523 = isSymbolD($acc554925523, $list54925523[5])
368+ if (($size54925523 == 6))
369+ then $acc654925523
370+ else {
371+ let $acc754925523 = isSymbolD($acc654925523, $list54925523[6])
372+ if (($size54925523 == 7))
373+ then $acc754925523
374+ else {
375+ let $acc854925523 = isSymbolD($acc754925523, $list54925523[7])
376+ if (($size54925523 == 8))
377+ then $acc854925523
378+ else {
379+ let $acc954925523 = isSymbolD($acc854925523, $list54925523[8])
380+ throw("List size exceed 8")
381+ }
382+ }
383+ }
384+ }
385+ }
386+ }
387+ }
388+ }
389+ }
390+ }) + "D"))) + getAmountOrClear((toString({
391+ let $list55605591 = genotype
392+ let $size55605591 = size($list55605591)
393+ let $acc055605591 = 0
394+ if (($size55605591 == 0))
395+ then $acc055605591
396+ else {
397+ let $acc155605591 = isSymbolE($acc055605591, $list55605591[0])
398+ if (($size55605591 == 1))
399+ then $acc155605591
400+ else {
401+ let $acc255605591 = isSymbolE($acc155605591, $list55605591[1])
402+ if (($size55605591 == 2))
403+ then $acc255605591
404+ else {
405+ let $acc355605591 = isSymbolE($acc255605591, $list55605591[2])
406+ if (($size55605591 == 3))
407+ then $acc355605591
408+ else {
409+ let $acc455605591 = isSymbolE($acc355605591, $list55605591[3])
410+ if (($size55605591 == 4))
411+ then $acc455605591
412+ else {
413+ let $acc555605591 = isSymbolE($acc455605591, $list55605591[4])
414+ if (($size55605591 == 5))
415+ then $acc555605591
416+ else {
417+ let $acc655605591 = isSymbolE($acc555605591, $list55605591[5])
418+ if (($size55605591 == 6))
419+ then $acc655605591
420+ else {
421+ let $acc755605591 = isSymbolE($acc655605591, $list55605591[6])
422+ if (($size55605591 == 7))
423+ then $acc755605591
424+ else {
425+ let $acc855605591 = isSymbolE($acc755605591, $list55605591[7])
426+ if (($size55605591 == 8))
427+ then $acc855605591
428+ else {
429+ let $acc955605591 = isSymbolE($acc855605591, $list55605591[8])
430+ throw("List size exceed 8")
431+ }
432+ }
433+ }
434+ }
435+ }
436+ }
437+ }
438+ }
439+ }
440+ }) + "E"))) + getAmountOrClear((toString({
441+ let $list56285659 = genotype
442+ let $size56285659 = size($list56285659)
443+ let $acc056285659 = 0
444+ if (($size56285659 == 0))
445+ then $acc056285659
446+ else {
447+ let $acc156285659 = isSymbolF($acc056285659, $list56285659[0])
448+ if (($size56285659 == 1))
449+ then $acc156285659
450+ else {
451+ let $acc256285659 = isSymbolF($acc156285659, $list56285659[1])
452+ if (($size56285659 == 2))
453+ then $acc256285659
454+ else {
455+ let $acc356285659 = isSymbolF($acc256285659, $list56285659[2])
456+ if (($size56285659 == 3))
457+ then $acc356285659
458+ else {
459+ let $acc456285659 = isSymbolF($acc356285659, $list56285659[3])
460+ if (($size56285659 == 4))
461+ then $acc456285659
462+ else {
463+ let $acc556285659 = isSymbolF($acc456285659, $list56285659[4])
464+ if (($size56285659 == 5))
465+ then $acc556285659
466+ else {
467+ let $acc656285659 = isSymbolF($acc556285659, $list56285659[5])
468+ if (($size56285659 == 6))
469+ then $acc656285659
470+ else {
471+ let $acc756285659 = isSymbolF($acc656285659, $list56285659[6])
472+ if (($size56285659 == 7))
473+ then $acc756285659
474+ else {
475+ let $acc856285659 = isSymbolF($acc756285659, $list56285659[7])
476+ if (($size56285659 == 8))
477+ then $acc856285659
478+ else {
479+ let $acc956285659 = isSymbolF($acc856285659, $list56285659[8])
480+ throw("List size exceed 8")
481+ }
482+ }
483+ }
484+ }
485+ }
486+ }
487+ }
488+ }
489+ }
490+ }) + "F"))) + getAmountOrClear((toString({
491+ let $list56985729 = genotype
492+ let $size56985729 = size($list56985729)
493+ let $acc056985729 = 0
494+ if (($size56985729 == 0))
495+ then $acc056985729
496+ else {
497+ let $acc156985729 = isSymbolG($acc056985729, $list56985729[0])
498+ if (($size56985729 == 1))
499+ then $acc156985729
500+ else {
501+ let $acc256985729 = isSymbolG($acc156985729, $list56985729[1])
502+ if (($size56985729 == 2))
503+ then $acc256985729
504+ else {
505+ let $acc356985729 = isSymbolG($acc256985729, $list56985729[2])
506+ if (($size56985729 == 3))
507+ then $acc356985729
508+ else {
509+ let $acc456985729 = isSymbolG($acc356985729, $list56985729[3])
510+ if (($size56985729 == 4))
511+ then $acc456985729
512+ else {
513+ let $acc556985729 = isSymbolG($acc456985729, $list56985729[4])
514+ if (($size56985729 == 5))
515+ then $acc556985729
516+ else {
517+ let $acc656985729 = isSymbolG($acc556985729, $list56985729[5])
518+ if (($size56985729 == 6))
519+ then $acc656985729
520+ else {
521+ let $acc756985729 = isSymbolG($acc656985729, $list56985729[6])
522+ if (($size56985729 == 7))
523+ then $acc756985729
524+ else {
525+ let $acc856985729 = isSymbolG($acc756985729, $list56985729[7])
526+ if (($size56985729 == 8))
527+ then $acc856985729
528+ else {
529+ let $acc956985729 = isSymbolG($acc856985729, $list56985729[8])
530+ throw("List size exceed 8")
531+ }
532+ }
533+ }
534+ }
535+ }
536+ }
537+ }
538+ }
539+ }
540+ }) + "G"))) + getAmountOrClear((toString({
541+ let $list57665797 = genotype
542+ let $size57665797 = size($list57665797)
543+ let $acc057665797 = 0
544+ if (($size57665797 == 0))
545+ then $acc057665797
546+ else {
547+ let $acc157665797 = isSymbolH($acc057665797, $list57665797[0])
548+ if (($size57665797 == 1))
549+ then $acc157665797
550+ else {
551+ let $acc257665797 = isSymbolH($acc157665797, $list57665797[1])
552+ if (($size57665797 == 2))
553+ then $acc257665797
554+ else {
555+ let $acc357665797 = isSymbolH($acc257665797, $list57665797[2])
556+ if (($size57665797 == 3))
557+ then $acc357665797
558+ else {
559+ let $acc457665797 = isSymbolH($acc357665797, $list57665797[3])
560+ if (($size57665797 == 4))
561+ then $acc457665797
562+ else {
563+ let $acc557665797 = isSymbolH($acc457665797, $list57665797[4])
564+ if (($size57665797 == 5))
565+ then $acc557665797
566+ else {
567+ let $acc657665797 = isSymbolH($acc557665797, $list57665797[5])
568+ if (($size57665797 == 6))
569+ then $acc657665797
570+ else {
571+ let $acc757665797 = isSymbolH($acc657665797, $list57665797[6])
572+ if (($size57665797 == 7))
573+ then $acc757665797
574+ else {
575+ let $acc857665797 = isSymbolH($acc757665797, $list57665797[7])
576+ if (($size57665797 == 8))
577+ then $acc857665797
578+ else {
579+ let $acc957665797 = isSymbolH($acc857665797, $list57665797[8])
580+ throw("List size exceed 8")
581+ }
582+ }
583+ }
584+ }
585+ }
586+ }
587+ }
588+ }
589+ }
590+ }) + "H")))
154591 }
155592
156593
157-func getWinnerExpired (gameStep) = if (if (if ((gameStep == 0))
158- then true
159- else (gameStep == 3))
160- then true
161- else (gameStep == 5))
162- then "maker"
163- else if (if (if ((gameStep == 1))
164- then true
165- else (gameStep == 2))
166- then true
167- else (gameStep == 4))
168- then "taker"
169- else "draw"
594+func getAssetOrigin (generation) = if ((generation == "G"))
595+ then incubatorAddress
596+ else breederAddress
170597
171598
172-func sendPrize (gameId,playerAddress,playerRole,winner) = {
173- let makerAddress = getMaker(gameId)
174- let takerAddress = getTaker(gameId)
175- if (getPrizeSent(gameId, playerRole))
176- then throw("You have already got the prize")
177- else if ((winner == playerRole))
178- then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, (getBetEggs(gameId) * 2), eggsAssetId)]
179- else if ((winner == "draw"))
180- then if ((playerRole == "maker"))
181- then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, getBetEggs(gameId), eggsAssetId)]
182- else [IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(playerAddress, getBetEggs(gameId), eggsAssetId)]
183- else throw("You lose and don't have any prize")
599+func getAssetRarity (assetId) = if (if ((value(assetInfo(assetId)).issuer == Address(breederAddress)))
600+ then true
601+ else (value(assetInfo(assetId)).issuer == Address(incubatorAddress)))
602+ then {
603+ let assetName = value(assetInfo(assetId)).name
604+ let generation = take(takeRight(assetName, 2), 1)
605+ let gen = ((getGen(assetName) + "-") + generation)
606+ let quantity = getIntegerValue(Address(getAssetOrigin(generation)), (("stats_" + gen) + "_quantity"))
607+ let power = pow((10000 / quantity), 4, 5, 1, 2, FLOOR)
608+ if ((power > 0))
609+ then power
610+ else 2
611+ }
612+ else throw("not valid NFT")
613+
614+
615+func getWinner (gameId) = {
616+ let gameStep = getStep(gameId)
617+ if ((6 > gameStep))
618+ then {
619+ let expirationHeight = getExpirationHeight(gameId)
620+ if ((expirationHeight == 0))
621+ then throw("Game is not started")
622+ else if ((expirationHeight > height))
623+ then throw("Game is not finished or expired")
624+ else if (((getStep(gameId) % 2) == 0))
625+ then "maker"
626+ else "taker"
627+ }
628+ else {
629+ let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",")
630+ let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",")
631+ let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0])
632+ let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1])
633+ let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2])
634+ let takerRarity1 = getRarity(gameId, "taker", makerDuckOrder[0])
635+ let takerRarity2 = getRarity(gameId, "taker", makerDuckOrder[1])
636+ let takerRarity3 = getRarity(gameId, "taker", makerDuckOrder[2])
637+ let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3))
638+ if ((makerScore > 0))
639+ then "maker"
640+ else if ((0 > makerScore))
641+ then "taker"
642+ else "draw"
643+ }
184644 }
185645
186646
187647 @Callable(i)
188648 func makeGame (slot,rarityRangeWorst,rarityRangeMedium,rarityRangeBest) = {
189649 let callerAddress = toBase58String(i.caller.bytes)
190650 let slotGameId = getSlot(slot)
191651 let payment = value(i.payments[0])
192652 let eggs = (payment.amount - makerFee)
193653 let gameId = getNextGameId()
194654 if ((getPlayerCurrentGame(callerAddress) != 0))
195655 then throw("You already have an active game")
196656 else if (if ((0 > slot))
197657 then true
198658 else (slot >= SLOTS))
199659 then throw("Invalid slot")
200660 else if ((slotGameId != 0))
201661 then throw("This slot is busy")
202662 else if ((payment.assetId != eggsAssetId))
203663 then throw(("You can attach only EGGs with the following asset id: " + toBase58String(eggsAssetId)))
204664 else if ((0 >= eggs))
205665 then throw("Not enough EGGs")
206666 else if (if ((1 > rarityRangeWorst))
207667 then true
208668 else (rarityRangeWorst > 5))
209669 then throw("Invalid rarity range for the worst duck")
210670 else if (if ((1 > rarityRangeMedium))
211671 then true
212672 else (rarityRangeMedium > 5))
213673 then throw("Invalid rarity range for the medium duck")
214674 else if (if ((1 > rarityRangeBest))
215675 then true
216676 else (rarityRangeBest > 5))
217677 then throw("Invalid rarity range for the best duck")
218678 else if ((rarityRangeWorst >= rarityRangeMedium))
219679 then throw("The medium duck must be better than the worst one")
220680 else if ((rarityRangeMedium >= rarityRangeBest))
221681 then throw("The best duck must be better than the medium one")
222- else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
682+ else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "maker"), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
223683 }
224684
225685
226686
227687 @Callable(i)
228688 func takeGame (slot) = {
229689 let callerAddress = toBase58String(i.caller.bytes)
230690 let gameId = getSlot(slot)
231691 let payment = value(i.payments[0])
232692 if ((getPlayerCurrentGame(callerAddress) != 0))
233693 then throw("You already have an active game")
234694 else if (if ((0 > slot))
235695 then true
236696 else (slot >= SLOTS))
237697 then throw("Invalid slot")
238698 else if ((getSlot(slot) == 0))
239699 then throw("This slot is empty")
240700 else if ((payment.assetId != eggsAssetId))
241701 then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(eggsAssetId)))
242702 else if ((payment.amount != (getBetEggs(gameId) + takerFee)))
243703 then throw("Insufficient eggs amount")
244704 else if ((height >= getWaitingExpirationHeight(gameId)))
245705 then throw("This game is expired")
246- else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getTakerKey(gameId), callerAddress), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), IntegerEntry(getSlotKey(slot), 0)]
706+ else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getTakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "taker"), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), IntegerEntry(getSlotKey(slot), 0)]
247707 }
248708
249709
250710
251711 @Callable(i)
252712 func kickGame (slot) = {
253713 let gameId = getSlot(slot)
254714 if (if ((0 > slot))
255715 then true
256716 else (slot >= SLOTS))
257717 then throw("Invalid slot")
258718 else if ((gameId == 0))
259719 then throw("Slot is empty")
260720 else if ((getWaitingExpirationHeight(gameId) > height))
261721 then throw("Waiting is not finished yet")
262722 else {
263723 let maker = getMaker(gameId)
264724 [IntegerEntry(getPlayerCurrentGameKey(maker), 0), IntegerEntry(getSlotKey(slot), 0), ScriptTransfer(Address(fromBase58String(maker)), (getBetEggs(gameId) + makerFee), eggsAssetId)]
265725 }
266726 }
267727
268728
269729
270730 @Callable(i)
271-func pickDucks (gameId) = {
731+func pickDucks () = {
272732 let callerAddress = toBase58String(i.caller.bytes)
733+ let gameId = getPlayerCurrentGame(callerAddress)
734+ let playerRole = getPlayerRole(gameId, callerAddress)
273735 let gameStep = getStep(gameId)
736+ let worstRarityRange = getRarityRange(gameId, "worst")
737+ let mediumRarityRange = getRarityRange(gameId, "meduim")
738+ let bestRarityRange = getRarityRange(gameId, "best")
274739 let worstDuckId = value(value(i.payments[0]).assetId)
275740 let mediumDuckId = value(value(i.payments[1]).assetId)
276741 let bestDuckId = value(value(i.payments[2]).assetId)
277- let worstRarityRange = getRarityRange(gameId, "worst")
278- let mediumRarityRange = getRarityRange(gameId, "meduim")
279- let bestRarityRange = getRarityRange(gameId, "best")
280- if (if ((value(assetInfo(worstDuckId)).issuer != Address(breederAddress)))
281- then (value(assetInfo(worstDuckId)).issuer != Address(incubatorAddress))
282- else false)
283- then throw("Invalid worstDuck NFT")
284- else if (if ((value(assetInfo(mediumDuckId)).issuer != Address(breederAddress)))
285- then (value(assetInfo(mediumDuckId)).issuer != Address(incubatorAddress))
286- else false)
287- then throw("Invalid mediumDuck NFT")
288- else if (if ((value(assetInfo(bestDuckId)).issuer != Address(breederAddress)))
289- then (value(assetInfo(bestDuckId)).issuer != Address(incubatorAddress))
742+ let worstRarity = getAssetRarity(worstDuckId)
743+ let mediumRarity = getAssetRarity(mediumDuckId)
744+ let bestRarity = getAssetRarity(bestDuckId)
745+ if ((gameId == 0))
746+ then throw("You don't have an active game")
747+ else if ((getExpirationHeight(gameId) == 0))
748+ then throw("Game is not started")
749+ else if (if ((gameStep == 0))
750+ then (playerRole != "taker")
290751 else false)
291- then throw("Invalid bestDuck NFT")
292- else if ((gameStep == 0))
293- then if ((callerAddress != getTaker(gameId)))
294- then throw("It is the taker's turn to pick now")
295- else {
296- let invokeWorstRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [worstDuckId], nil)
297- if ((invokeWorstRes == invokeWorstRes))
298- then {
299- let worstRarity = match invokeWorstRes {
300- case r: Int =>
301- r
302- case _ =>
303- throw("Incorrect invoke result")
304- }
305- let invokeMediumRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [mediumDuckId], nil)
306- if ((invokeMediumRes == invokeMediumRes))
307- then {
308- let mediumRarity = match invokeMediumRes {
309- case r: Int =>
310- r
311- case _ =>
312- throw("Incorrect invoke result")
313- }
314- let invokeBestRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [bestDuckId], nil)
315- if ((invokeBestRes == invokeBestRes))
316- then {
317- let bestRarity = match invokeWorstRes {
318- case r: Int =>
319- r
320- case _ =>
321- throw("Incorrect invoke result")
322- }
323- if (if ((worstRarity >= (worstRarityRange * 10)))
324- then true
325- else (((worstRarityRange - 1) * 10) > worstRarity))
326- then throw("Worst duck doesn't fit rarity range")
327- else if (if ((mediumRarity >= (mediumRarityRange * 10)))
328- then true
329- else (((mediumRarityRange - 1) * 10) > mediumRarity))
330- then throw("Medium duck doesn't fit rarity range")
331- else if (if (if (if ((bestRarityRange == 5))
332- then (40 > bestRarity)
333- else false)
334- then true
335- else (bestRarity >= (bestRarityRange * 10)))
336- then true
337- else (((bestRarityRange - 1) * 10) > bestRarity))
338- then throw("Best duck doesn't fit rarity range")
339- else [IntegerEntry(getRarityKey(gameId, "taker", "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, "taker", "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, "taker", "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
340- }
341- else throw("Strict value is not equal to itself.")
342- }
343- else throw("Strict value is not equal to itself.")
344- }
345- else throw("Strict value is not equal to itself.")
346- }
347- else if ((gameStep == 1))
348- then if ((callerAddress != getMaker(gameId)))
349- then throw("It is the maker's turn to pick now")
350- else {
351- let invokeWorstRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [worstDuckId], nil)
352- if ((invokeWorstRes == invokeWorstRes))
353- then {
354- let worstRarity = match invokeWorstRes {
355- case r: Int =>
356- r
357- case _ =>
358- throw("Incorrect invoke result")
359- }
360- let invokeMediumRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [mediumDuckId], nil)
361- if ((invokeMediumRes == invokeMediumRes))
362- then {
363- let mediumRarity = match invokeMediumRes {
364- case r: Int =>
365- r
366- case _ =>
367- throw("Incorrect invoke result")
368- }
369- let invokeBestRes = invoke(Address(farmingAddress), "getAssetRarityCallable", [bestDuckId], nil)
370- if ((invokeBestRes == invokeBestRes))
371- then {
372- let bestRarity = match invokeWorstRes {
373- case r: Int =>
374- r
375- case _ =>
376- throw("Incorrect invoke result")
377- }
378- if (if ((worstRarity >= (worstRarityRange * 10)))
379- then true
380- else (((worstRarityRange - 1) * 10) > worstRarity))
381- then throw("Worst duck doesn't fit rarity range")
382- else if (if ((mediumRarity >= (mediumRarityRange * 10)))
383- then true
384- else (((mediumRarityRange - 1) * 10) > mediumRarity))
385- then throw("Medium duck doesn't fit rarity range")
386- else if (if (if (if ((bestRarityRange == 5))
387- then (40 > bestRarity)
388- else false)
389- then true
390- else (bestRarity >= (bestRarityRange * 10)))
391- then true
392- else (((bestRarityRange - 1) * 10) > bestRarity))
393- then throw("Best duck doesn't fit rarity range")
394- else [IntegerEntry(getRarityKey(gameId, "maker", "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, "maker", "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, "maker", "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
395- }
396- else throw("Strict value is not equal to itself.")
397- }
398- else throw("Strict value is not equal to itself.")
399- }
400- else throw("Strict value is not equal to itself.")
401- }
402- else throw("The worst duck has already been picked")
752+ then throw("It is the taker's turn to pick now")
753+ else if (if ((gameStep == 1))
754+ then (playerRole != "maker")
755+ else false)
756+ then throw("It is the maker's turn to pick now")
757+ else if ((gameStep > 1))
758+ then throw("Ducks have already been picked")
759+ else if (if ((worstRarity >= (worstRarityRange * 10)))
760+ then true
761+ else (((worstRarityRange - 1) * 10) > worstRarity))
762+ then throw("Worst duck doesn't fit rarity range")
763+ else if (if ((mediumRarity >= (mediumRarityRange * 10)))
764+ then true
765+ else (((mediumRarityRange - 1) * 10) > mediumRarity))
766+ then throw("Medium duck doesn't fit rarity range")
767+ else if (if (if (if ((bestRarityRange == 5))
768+ then (40 > bestRarity)
769+ else false)
770+ then true
771+ else (bestRarity >= (bestRarityRange * 10)))
772+ then true
773+ else (((bestRarityRange - 1) * 10) > bestRarity))
774+ then throw("Best duck doesn't fit rarity range")
775+ else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
403776 }
404777
405778
406779
407780 @Callable(i)
408-func commit (gameId,hash) = {
781+func commit (hash) = {
409782 let callerAddress = toBase58String(i.caller.bytes)
783+ let gameId = getPlayerCurrentGame(callerAddress)
784+ let playerRole = getPlayerRole(gameId, callerAddress)
410785 let gameStep = getStep(gameId)
411- if ((2 > gameStep))
412- then throw("Ducks hasn't been picked yet")
413- else if ((gameStep == 2))
414- then if ((callerAddress != getMaker(gameId)))
415- then throw("It is the maker's turn to commit now")
416- else [StringEntry(getCommitKey(gameId, "maker"), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
417- else if ((gameStep == 3))
418- then if ((callerAddress != getTaker(gameId)))
419- then throw("It is the taker's turn to commit now")
420- else [StringEntry(getCommitKey(gameId, "taker"), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
421- else throw("Commit is finished")
786+ if ((gameId == 0))
787+ then throw("You don't have an active game")
788+ else if ((2 > gameStep))
789+ then throw("Commit is not started")
790+ else if (if ((gameStep == 2))
791+ then (playerRole != "taker")
792+ else false)
793+ then throw("It is the taker's turn to pick now")
794+ else if (if ((gameStep == 3))
795+ then (playerRole != "maker")
796+ else false)
797+ then throw("It is the maker's turn to pick now")
798+ else if ((gameStep > 3))
799+ then throw("Commit is finished")
800+ else [StringEntry(getCommitKey(gameId, playerRole), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
422801 }
423802
424803
425804
426805 @Callable(i)
427-func reveal (gameId,duckOrder,salt) = {
806+func reveal (duckOrder,salt) = {
428807 let callerAddress = toBase58String(i.caller.bytes)
808+ let gameId = getPlayerCurrentGame(callerAddress)
809+ let playerRole = getPlayerRole(gameId, callerAddress)
429810 let gameStep = getStep(gameId)
430- if ((4 > gameStep))
431- then throw("Reveal is not started")
432- else if (if (if (if (if (if ((duckOrder != "worst,medium,best"))
433- then true
434- else (duckOrder != "worst,best,medium"))
435- then true
436- else (duckOrder != "medium,worst,best"))
437- then true
438- else (duckOrder != "medium,best,worst"))
439- then true
440- else (duckOrder != "best,worst,medium"))
441- then true
442- else (duckOrder != "best,medium,worst"))
443- then throw("Invalid duckOrder")
444- else if ((gameStep == 4))
445- then if ((callerAddress != getMaker(gameId)))
446- then throw("It is the maker's turn to reveal now")
447- else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, "maker")))
448- then throw("reveal data is not valid")
449- else [StringEntry(getDuckOrderKey(gameId, "maker"), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
450- else if ((gameStep == 5))
451- then if ((callerAddress != getTaker(gameId)))
452- then throw("It is the taker's turn to reveal now")
453- else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, "taker")))
454- then throw("reveal data is not valid")
455- else [StringEntry(getDuckOrderKey(gameId, "taker"), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
456- else throw("Reveal is finished")
811+ if ((gameId == 0))
812+ then throw("You don't have an active game")
813+ else if ((4 > gameStep))
814+ then throw("Reveal is not started")
815+ else if (if ((gameStep == 4))
816+ then (playerRole != "taker")
817+ else false)
818+ then throw("It is the taker's turn to pick now")
819+ else if (if ((gameStep == 5))
820+ then (playerRole != "maker")
821+ else false)
822+ then throw("It is the maker's turn to pick now")
823+ else if ((gameStep > 5))
824+ then throw("Reveal is finished")
825+ else if (if (if (if (if (if ((duckOrder != "worst,medium,best"))
826+ then true
827+ else (duckOrder != "worst,best,medium"))
828+ then true
829+ else (duckOrder != "medium,worst,best"))
830+ then true
831+ else (duckOrder != "medium,best,worst"))
832+ then true
833+ else (duckOrder != "best,worst,medium"))
834+ then true
835+ else (duckOrder != "best,medium,worst"))
836+ then throw("Reveal data is not valid")
837+ else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, playerRole)))
838+ then throw("Reveal doesn't match commit")
839+ else [StringEntry(getDuckOrderKey(gameId, playerRole), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
457840 }
458841
459842
460843
461844 @Callable(i)
462-func getPrize (gameId) = {
845+func getPrize () = {
463846 let callerAddress = toBase58String(i.caller.bytes)
464- let gameStep = getStep(gameId)
465- if ((gameStep != 6))
466- then throw("Game is not finished")
467- else if ((callerAddress == getMaker(gameId)))
468- then sendPrize(gameId, i.caller, "maker", getWinner(gameId))
469- else if ((callerAddress == getTaker(gameId)))
470- then sendPrize(gameId, i.caller, "taker", getWinner(gameId))
471- else throw("Invalid caller address")
472- }
473-
474-
475-
476-@Callable(i)
477-func getPrizeExpired (gameId) = {
478- let callerAddress = toBase58String(i.caller.bytes)
479- let gameStep = getStep(gameId)
480- if ((gameStep == 6))
481- then throw("Game is finished, call getPrize instead")
482- else if ((getExpirationHeight(gameId) > height))
483- then throw("Game is not expired")
484- else if ((callerAddress == getMaker(gameId)))
485- then sendPrize(gameId, i.caller, "maker", getWinnerExpired(gameStep))
486- else if ((callerAddress == getTaker(gameId)))
487- then sendPrize(gameId, i.caller, "taker", getWinnerExpired(gameStep))
488- else throw("Invalid caller address")
847+ let gameId = getPlayerCurrentGame(callerAddress)
848+ let playerRole = getPlayerRole(gameId, callerAddress)
849+ let makerAddress = getMaker(gameId)
850+ let takerAddress = getTaker(gameId)
851+ let winner = getWinner(gameId)
852+ if ((gameId == 0))
853+ then throw("You don't have an active game")
854+ else if (getPrizeSent(gameId, playerRole))
855+ then throw("You have already got the prize")
856+ else if ((winner == playerRole))
857+ then [IntegerEntry(getPlayerCurrentGameKey(makerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(takerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
858+ else if ((winner == "draw"))
859+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), BooleanEntry(getPrizeSentKey(gameId, playerRole), true), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
860+ else throw("You lose and don't have any prize")
489861 }
490862
491863
492864 @Verifier(tx)
493865 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
494866

github/deemru/w8io/169f3d6 
121.56 ms