tx · C4ZjhaLPsYA3FW1p2S1EZZnrTCLRdRy3t9kYJMg2LqAK 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd: -0.10000000 Waves 2021.12.17 01:28 [1837426] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves
{ "type": 13, "id": "C4ZjhaLPsYA3FW1p2S1EZZnrTCLRdRy3t9kYJMg2LqAK", "fee": 10000000, "feeAssetId": null, "timestamp": 1639693722538, "version": 2, "chainId": 84, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "2AmpjZ1Hk9qpMEiSisab8PMQiT3DwtKUEqHZU7YnaHvvo3jdEGpjnaoL8rw6fyUvEAju5grUzM9ac38Eajzo3ri5" ], "script": "base64:AAIFAAAAAAAAABIIAhIECgIBARIDCgEBEgMKAQEAAAANAAAAAAlzZXBhcmF0b3ICAAAAASwAAAAABm1heEJldAAAAAAABfXhAAEAAAAGZ2V0RmVlAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAW4FAAAAByRtYXRjaDAFAAAAAW4JAAACAAAAAQIAAAAbSW5pdGlhbCBmZWUgY2Fubm90IGJlIGZvdW5kAQAAAApnZXROZXdEZWNrAAAAAAkABEwAAAACAgAAAAMwMUMJAARMAAAAAgIAAAADMDJDCQAETAAAAAICAAAAAzAzQwkABEwAAAACAgAAAAMwNEMJAARMAAAAAgIAAAADMDVDCQAETAAAAAICAAAAAzA2QwkABEwAAAACAgAAAAMwN0MJAARMAAAAAgIAAAADMDhDCQAETAAAAAICAAAAAzA5QwkABEwAAAACAgAAAAMxMEMJAARMAAAAAgIAAAADMTFDCQAETAAAAAICAAAAAzEyQwkABEwAAAACAgAAAAMxM0MJAARMAAAAAgIAAAADMDFECQAETAAAAAICAAAAAzAyRAkABEwAAAACAgAAAAMwM0QJAARMAAAAAgIAAAADMDRECQAETAAAAAICAAAAAzA1RAkABEwAAAACAgAAAAMwNkQJAARMAAAAAgIAAAADMDdECQAETAAAAAICAAAAAzA4RAkABEwAAAACAgAAAAMwOUQJAARMAAAAAgIAAAADMTBECQAETAAAAAICAAAAAzExRAkABEwAAAACAgAAAAMxMkQJAARMAAAAAgIAAAADMTNECQAETAAAAAICAAAAAzAxSAkABEwAAAACAgAAAAMwMkgJAARMAAAAAgIAAAADMDNICQAETAAAAAICAAAAAzA0SAkABEwAAAACAgAAAAMwNUgJAARMAAAAAgIAAAADMDZICQAETAAAAAICAAAAAzA3SAkABEwAAAACAgAAAAMwOEgJAARMAAAAAgIAAAADMDlICQAETAAAAAICAAAAAzEwSAkABEwAAAACAgAAAAMxMUgJAARMAAAAAgIAAAADMTJICQAETAAAAAICAAAAAzEzSAkABEwAAAACAgAAAAMwMVMJAARMAAAAAgIAAAADMDJTCQAETAAAAAICAAAAAzAzUwkABEwAAAACAgAAAAMwNFMJAARMAAAAAgIAAAADMDVTCQAETAAAAAICAAAAAzA2UwkABEwAAAACAgAAAAMwN1MJAARMAAAAAgIAAAADMDhTCQAETAAAAAICAAAAAzA5UwkABEwAAAACAgAAAAMxMFMJAARMAAAAAgIAAAADMTFTCQAETAAAAAICAAAAAzEyUwkABEwAAAACAgAAAAMxM1MFAAAAA25pbAEAAAAOZ2V0U2l4TmV3RGVja3MAAAAACQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAAROAAAAAgkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAAJAQAAAApnZXROZXdEZWNrAAAAAAkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAAJAQAAAApnZXROZXdEZWNrAAAAAAEAAAAHZ2V0RGVjawAAAAEAAAAEZGVjawMJAABnAAAA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WVyQ2FyZAUAAAAKY2FyZFBsYXllcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIFAAAABXJvdW5kAgAAAAtfY2FzaW5vQ2FyZAUAAAAKY2FyZENhc2lubwkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkAASwAAAACBQAAAAVyb3VuZAIAAAAFX3N0b3AGBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRvXsBM=", "height": 1837426, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hgf3NUYYrT5U5WL7PWTqQ4BDUCgEfCGJAXPBWsLhmR2o Next: DtDMobNyFDamZhQstGak6PHq9UA2eV4QuUsFy7HEiM3a Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | else deck | |
25 | 25 | ||
26 | 26 | ||
27 | - | func getRandomNumber (salt1,salt2,answersCount) = { | |
28 | - | let | |
29 | - | let index = toInt( | |
30 | - | let | |
31 | - | if ((0 > | |
32 | - | then ((-1 * | |
33 | - | else ( | |
27 | + | func getRandomNumber (i,salt1,salt2,answersCount) = { | |
28 | + | let generator = (toInt(sha256(((take(lastBlock.generationSignature, 16) + take(i.transactionId, 16)) + toBytes(salt1)))) % 17728) | |
29 | + | let index = (toInt(toBytes(pow(generator, 0, 2, 0, 0, HALFUP))) + toInt(toBytes(salt2))) | |
30 | + | let r = (index % answersCount) | |
31 | + | if ((0 > r)) | |
32 | + | then ((-1 * r) + 1) | |
33 | + | else (r + 1) | |
34 | 34 | } | |
35 | - | ||
36 | - | ||
37 | - | func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) { | |
38 | - | case n: Int => | |
39 | - | toString(n) | |
40 | - | case _ => | |
41 | - | address | |
42 | - | } | |
43 | 35 | ||
44 | 36 | ||
45 | 37 | func getPayments (i) = if ((size(i.payments) == 0)) | |
78 | 70 | else getSixNewDecks() | |
79 | 71 | ||
80 | 72 | ||
81 | - | func getPlayerCardAndPositionAndUpdateDeck ( | |
73 | + | func getPlayerCardAndPositionAndUpdateDeck (i,salt1,deck) = { | |
82 | 74 | let avDeck2 = getDeck(deck) | |
83 | - | let cardPosition = getRandomNumber( | |
75 | + | let cardPosition = getRandomNumber(i, salt1, makeString(avDeck2, separator), size(avDeck2)) | |
84 | 76 | let card = avDeck2[(cardPosition % size(avDeck2))] | |
85 | 77 | let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2))) | |
86 | 78 | $Tuple3(card, cardPosition, avDeck3) | |
122 | 114 | else { | |
123 | 115 | let availableProp = (round + "_deck") | |
124 | 116 | let avDeck = getAvailableDeck(this, availableProp) | |
125 | - | let $ | |
126 | - | let cardPlayer = $ | |
127 | - | let cardPositionPlayer = $ | |
128 | - | let avDeck1 = $ | |
129 | - | let $ | |
130 | - | let cardCasino = $ | |
131 | - | let cardPositionCasino = $ | |
132 | - | let avDeck2 = $ | |
117 | + | let $t041794299 = getPlayerCardAndPositionAndUpdateDeck(i, toString(currentRound), avDeck) | |
118 | + | let cardPlayer = $t041794299._1 | |
119 | + | let cardPositionPlayer = $t041794299._2 | |
120 | + | let avDeck1 = $t041794299._3 | |
121 | + | let $t043044425 = getPlayerCardAndPositionAndUpdateDeck(i, toString(currentRound), avDeck1) | |
122 | + | let cardCasino = $t043044425._1 | |
123 | + | let cardPositionCasino = $t043044425._2 | |
124 | + | let avDeck2 = $t043044425._3 | |
133 | 125 | if ((getCardValue(cardPlayer) == getCardValue(cardCasino))) | |
134 | 126 | then { | |
135 | 127 | let currentDraws = 1 | |
195 | 187 | else { | |
196 | 188 | let availableProp = (round + "_deck") | |
197 | 189 | let avDeck = getAvailableDeck(this, availableProp) | |
198 | - | let $ | |
199 | - | let burned1 = $ | |
200 | - | let burnedPos1 = $ | |
201 | - | let burnedDeck1 = $ | |
202 | - | let $ | |
203 | - | let burned2 = $ | |
204 | - | let burnedPos2 = $ | |
205 | - | let burnedDeck2 = $ | |
206 | - | let $ | |
207 | - | let burned3 = $ | |
208 | - | let burnedPos3 = $ | |
209 | - | let burnedDeck3 = $ | |
210 | - | let $ | |
211 | - | let cardPlayer = $ | |
212 | - | let cardPositionPlayer = $ | |
213 | - | let avDeck1 = $ | |
214 | - | let $ | |
215 | - | let cardCasino = $ | |
216 | - | let cardPositionCasino = $ | |
217 | - | let avDeck2 = $ | |
190 | + | let $t096549765 = getPlayerCardAndPositionAndUpdateDeck(i, toString(roundToUse), avDeck) | |
191 | + | let burned1 = $t096549765._1 | |
192 | + | let burnedPos1 = $t096549765._2 | |
193 | + | let burnedDeck1 = $t096549765._3 | |
194 | + | let $t097789904 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned1), burnedDeck1) | |
195 | + | let burned2 = $t097789904._1 | |
196 | + | let burnedPos2 = $t097789904._2 | |
197 | + | let burnedDeck2 = $t097789904._3 | |
198 | + | let $t0991710043 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned2), burnedDeck2) | |
199 | + | let burned3 = $t0991710043._1 | |
200 | + | let burnedPos3 = $t0991710043._2 | |
201 | + | let burnedDeck3 = $t0991710043._3 | |
202 | + | let $t01005610189 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned3), burnedDeck3) | |
203 | + | let cardPlayer = $t01005610189._1 | |
204 | + | let cardPositionPlayer = $t01005610189._2 | |
205 | + | let avDeck1 = $t01005610189._3 | |
206 | + | let $t01020210334 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + cardPlayer), avDeck1) | |
207 | + | let cardCasino = $t01020210334._1 | |
208 | + | let cardPositionCasino = $t01020210334._2 | |
209 | + | let avDeck2 = $t01020210334._3 | |
218 | 210 | if ((getCardValue(cardPlayer) == getCardValue(cardCasino))) | |
219 | 211 | then { | |
220 | 212 | let currentDraws = match getInteger(this, (round + "_drawSequence")) { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "," | |
5 | 5 | ||
6 | 6 | let maxBet = 100000000 | |
7 | 7 | ||
8 | 8 | func getFee (key) = match getInteger(this, key) { | |
9 | 9 | case n: Int => | |
10 | 10 | n | |
11 | 11 | case _ => | |
12 | 12 | throw("Initial fee cannot be found") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getNewDeck () = ["01C", "02C", "03C", "04C", "05C", "06C", "07C", "08C", "09C", "10C", "11C", "12C", "13C", "01D", "02D", "03D", "04D", "05D", "06D", "07D", "08D", "09D", "10D", "11D", "12D", "13D", "01H", "02H", "03H", "04H", "05H", "06H", "07H", "08H", "09H", "10H", "11H", "12H", "13H", "01S", "02S", "03S", "04S", "05S", "06S", "07S", "08S", "09S", "10S", "11S", "12S", "13S"] | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getSixNewDecks () = (((((getNewDeck() ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getDeck (deck) = if ((0 >= size(deck))) | |
23 | 23 | then getSixNewDecks() | |
24 | 24 | else deck | |
25 | 25 | ||
26 | 26 | ||
27 | - | func getRandomNumber (salt1,salt2,answersCount) = { | |
28 | - | let | |
29 | - | let index = toInt( | |
30 | - | let | |
31 | - | if ((0 > | |
32 | - | then ((-1 * | |
33 | - | else ( | |
27 | + | func getRandomNumber (i,salt1,salt2,answersCount) = { | |
28 | + | let generator = (toInt(sha256(((take(lastBlock.generationSignature, 16) + take(i.transactionId, 16)) + toBytes(salt1)))) % 17728) | |
29 | + | let index = (toInt(toBytes(pow(generator, 0, 2, 0, 0, HALFUP))) + toInt(toBytes(salt2))) | |
30 | + | let r = (index % answersCount) | |
31 | + | if ((0 > r)) | |
32 | + | then ((-1 * r) + 1) | |
33 | + | else (r + 1) | |
34 | 34 | } | |
35 | - | ||
36 | - | ||
37 | - | func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) { | |
38 | - | case n: Int => | |
39 | - | toString(n) | |
40 | - | case _ => | |
41 | - | address | |
42 | - | } | |
43 | 35 | ||
44 | 36 | ||
45 | 37 | func getPayments (i) = if ((size(i.payments) == 0)) | |
46 | 38 | then throw("Payment must be attached") | |
47 | 39 | else if ((size(i.payments) == 1)) | |
48 | 40 | then { | |
49 | 41 | let pmt = i.payments[0] | |
50 | 42 | if (isDefined(pmt.assetId)) | |
51 | 43 | then throw("This function accepts WAVES tokens only (0)") | |
52 | 44 | else pmt.amount | |
53 | 45 | } | |
54 | 46 | else throw("There should be only one payment") | |
55 | 47 | ||
56 | 48 | ||
57 | 49 | func getCardValue (stringCard) = { | |
58 | 50 | let p = parseIntValue(take(stringCard, 2)) | |
59 | 51 | if ((p == 1)) | |
60 | 52 | then 20 | |
61 | 53 | else p | |
62 | 54 | } | |
63 | 55 | ||
64 | 56 | ||
65 | 57 | func isPlayerWinner (cardPlayer,cardCasino) = { | |
66 | 58 | let p = getCardValue(cardPlayer) | |
67 | 59 | let o = getCardValue(cardCasino) | |
68 | 60 | (p > o) | |
69 | 61 | } | |
70 | 62 | ||
71 | 63 | ||
72 | 64 | func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp))) | |
73 | 65 | then { | |
74 | 66 | let stringDeck = getStringValue(this, availableProp) | |
75 | 67 | let deck = split(stringDeck, separator) | |
76 | 68 | getDeck(deck) | |
77 | 69 | } | |
78 | 70 | else getSixNewDecks() | |
79 | 71 | ||
80 | 72 | ||
81 | - | func getPlayerCardAndPositionAndUpdateDeck ( | |
73 | + | func getPlayerCardAndPositionAndUpdateDeck (i,salt1,deck) = { | |
82 | 74 | let avDeck2 = getDeck(deck) | |
83 | - | let cardPosition = getRandomNumber( | |
75 | + | let cardPosition = getRandomNumber(i, salt1, makeString(avDeck2, separator), size(avDeck2)) | |
84 | 76 | let card = avDeck2[(cardPosition % size(avDeck2))] | |
85 | 77 | let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2))) | |
86 | 78 | $Tuple3(card, cardPosition, avDeck3) | |
87 | 79 | } | |
88 | 80 | ||
89 | 81 | ||
90 | 82 | func getCurrentRound (customRound,callerAddress) = if ((customRound == 0)) | |
91 | 83 | then { | |
92 | 84 | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
93 | 85 | case a: Int => | |
94 | 86 | a | |
95 | 87 | case _ => | |
96 | 88 | throw("Unable to find the round") | |
97 | 89 | } | |
98 | 90 | currentRound | |
99 | 91 | } | |
100 | 92 | else customRound | |
101 | 93 | ||
102 | 94 | ||
103 | 95 | @Callable(i) | |
104 | 96 | func bet (normalBet,tieBet) = { | |
105 | 97 | let callerAddress = toBase58String(i.caller.bytes) | |
106 | 98 | let p = getPayments(i) | |
107 | 99 | let currentRound = match getInteger(this, (callerAddress + "_round")) { | |
108 | 100 | case a: Int => | |
109 | 101 | (a + 1) | |
110 | 102 | case _ => | |
111 | 103 | 1 | |
112 | 104 | } | |
113 | 105 | let round = ((callerAddress + "_") + toString(currentRound)) | |
114 | 106 | if (isDefined(getBoolean(this, (round + "_stop")))) | |
115 | 107 | then throw("This round is already played") | |
116 | 108 | else if (isDefined(getString(this, round))) | |
117 | 109 | then throw("You cannot bet on this game") | |
118 | 110 | else if ((p != (normalBet + tieBet))) | |
119 | 111 | then throw("normal bet + tie bet should be equal to the payment") | |
120 | 112 | else if ((p > maxBet)) | |
121 | 113 | then throw(("The bet needs to be lower or equal than " + toString(maxBet))) | |
122 | 114 | else { | |
123 | 115 | let availableProp = (round + "_deck") | |
124 | 116 | let avDeck = getAvailableDeck(this, availableProp) | |
125 | - | let $ | |
126 | - | let cardPlayer = $ | |
127 | - | let cardPositionPlayer = $ | |
128 | - | let avDeck1 = $ | |
129 | - | let $ | |
130 | - | let cardCasino = $ | |
131 | - | let cardPositionCasino = $ | |
132 | - | let avDeck2 = $ | |
117 | + | let $t041794299 = getPlayerCardAndPositionAndUpdateDeck(i, toString(currentRound), avDeck) | |
118 | + | let cardPlayer = $t041794299._1 | |
119 | + | let cardPositionPlayer = $t041794299._2 | |
120 | + | let avDeck1 = $t041794299._3 | |
121 | + | let $t043044425 = getPlayerCardAndPositionAndUpdateDeck(i, toString(currentRound), avDeck1) | |
122 | + | let cardCasino = $t043044425._1 | |
123 | + | let cardPositionCasino = $t043044425._2 | |
124 | + | let avDeck2 = $t043044425._3 | |
133 | 125 | if ((getCardValue(cardPlayer) == getCardValue(cardCasino))) | |
134 | 126 | then { | |
135 | 127 | let currentDraws = 1 | |
136 | 128 | if ((tieBet != 0)) | |
137 | 129 | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), normalBet), ScriptTransfer(i.caller, (((tieBet * 10) + tieBet) + i.fee), unit)] | |
138 | 130 | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((callerAddress + "_round"), currentRound), BooleanEntry(round, true), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), normalBet), IntegerEntry((round + "_initialFee"), i.fee)] | |
139 | 131 | } | |
140 | 132 | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
141 | 133 | then [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), normalBet), IntegerEntry((round + "_initialFee"), i.fee), ScriptTransfer(i.caller, (normalBet + i.fee), unit), BooleanEntry((round + "_stop"), true)] | |
142 | 134 | else [StringEntry(availableProp, makeString(avDeck2, separator)), BooleanEntry(round, true), IntegerEntry((callerAddress + "_round"), currentRound), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), normalBet), IntegerEntry((round + "_initialFee"), i.fee), BooleanEntry((round + "_stop"), true)] | |
143 | 135 | } | |
144 | 136 | } | |
145 | 137 | ||
146 | 138 | ||
147 | 139 | ||
148 | 140 | @Callable(i) | |
149 | 141 | func surrender (customRound) = { | |
150 | 142 | let callerAddress = toBase58String(i.caller.bytes) | |
151 | 143 | let roundToUse = getCurrentRound(customRound, callerAddress) | |
152 | 144 | let round = ((callerAddress + "_") + toString(roundToUse)) | |
153 | 145 | if (!(isDefined(getBoolean(this, round)))) | |
154 | 146 | then throw("This round is not played") | |
155 | 147 | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
156 | 148 | then throw("This round is already played") | |
157 | 149 | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
158 | 150 | then throw("This game is not on war") | |
159 | 151 | else { | |
160 | 152 | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
161 | 153 | case a: Int => | |
162 | 154 | a | |
163 | 155 | case _ => | |
164 | 156 | throw("Unable to find original bet amount") | |
165 | 157 | } | |
166 | 158 | let f = getFee((round + "_initialFee")) | |
167 | 159 | [ScriptTransfer(i.caller, ((betAmount / 2) + f), unit), BooleanEntry((round + "_stop"), true)] | |
168 | 160 | } | |
169 | 161 | } | |
170 | 162 | ||
171 | 163 | ||
172 | 164 | ||
173 | 165 | @Callable(i) | |
174 | 166 | func goToWar (customRound) = { | |
175 | 167 | let callerAddress = toBase58String(i.caller.bytes) | |
176 | 168 | let roundToUse = getCurrentRound(customRound, callerAddress) | |
177 | 169 | let round = ((callerAddress + "_") + toString(roundToUse)) | |
178 | 170 | if (!(isDefined(getBoolean(this, round)))) | |
179 | 171 | then throw("This round is not played") | |
180 | 172 | else if (isDefined(getBoolean(this, (round + "_stop")))) | |
181 | 173 | then throw("This round is already played") | |
182 | 174 | else if (!(isDefined(getInteger(this, (round + "_drawSequence"))))) | |
183 | 175 | then throw("This game is not on war") | |
184 | 176 | else { | |
185 | 177 | let betAmount = match getInteger(this, (round + "_betAmount")) { | |
186 | 178 | case a: Int => | |
187 | 179 | a | |
188 | 180 | case _ => | |
189 | 181 | throw("Unable to find original bet amount") | |
190 | 182 | } | |
191 | 183 | let p = getPayments(i) | |
192 | 184 | let f = getFee((round + "_initialFee")) | |
193 | 185 | if ((p != betAmount)) | |
194 | 186 | then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")")) | |
195 | 187 | else { | |
196 | 188 | let availableProp = (round + "_deck") | |
197 | 189 | let avDeck = getAvailableDeck(this, availableProp) | |
198 | - | let $ | |
199 | - | let burned1 = $ | |
200 | - | let burnedPos1 = $ | |
201 | - | let burnedDeck1 = $ | |
202 | - | let $ | |
203 | - | let burned2 = $ | |
204 | - | let burnedPos2 = $ | |
205 | - | let burnedDeck2 = $ | |
206 | - | let $ | |
207 | - | let burned3 = $ | |
208 | - | let burnedPos3 = $ | |
209 | - | let burnedDeck3 = $ | |
210 | - | let $ | |
211 | - | let cardPlayer = $ | |
212 | - | let cardPositionPlayer = $ | |
213 | - | let avDeck1 = $ | |
214 | - | let $ | |
215 | - | let cardCasino = $ | |
216 | - | let cardPositionCasino = $ | |
217 | - | let avDeck2 = $ | |
190 | + | let $t096549765 = getPlayerCardAndPositionAndUpdateDeck(i, toString(roundToUse), avDeck) | |
191 | + | let burned1 = $t096549765._1 | |
192 | + | let burnedPos1 = $t096549765._2 | |
193 | + | let burnedDeck1 = $t096549765._3 | |
194 | + | let $t097789904 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned1), burnedDeck1) | |
195 | + | let burned2 = $t097789904._1 | |
196 | + | let burnedPos2 = $t097789904._2 | |
197 | + | let burnedDeck2 = $t097789904._3 | |
198 | + | let $t0991710043 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned2), burnedDeck2) | |
199 | + | let burned3 = $t0991710043._1 | |
200 | + | let burnedPos3 = $t0991710043._2 | |
201 | + | let burnedDeck3 = $t0991710043._3 | |
202 | + | let $t01005610189 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + burned3), burnedDeck3) | |
203 | + | let cardPlayer = $t01005610189._1 | |
204 | + | let cardPositionPlayer = $t01005610189._2 | |
205 | + | let avDeck1 = $t01005610189._3 | |
206 | + | let $t01020210334 = getPlayerCardAndPositionAndUpdateDeck(i, (toString(roundToUse) + cardPlayer), avDeck1) | |
207 | + | let cardCasino = $t01020210334._1 | |
208 | + | let cardPositionCasino = $t01020210334._2 | |
209 | + | let avDeck2 = $t01020210334._3 | |
218 | 210 | if ((getCardValue(cardPlayer) == getCardValue(cardCasino))) | |
219 | 211 | then { | |
220 | 212 | let currentDraws = match getInteger(this, (round + "_drawSequence")) { | |
221 | 213 | case a: Int => | |
222 | 214 | (a + 1) | |
223 | 215 | case _ => | |
224 | 216 | 0 | |
225 | 217 | } | |
226 | 218 | [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws)] | |
227 | 219 | } | |
228 | 220 | else if (isPlayerWinner(cardPlayer, cardCasino)) | |
229 | 221 | then [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), ScriptTransfer(i.caller, (p + f), unit), BooleanEntry((round + "_stop"), true)] | |
230 | 222 | else [StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), BooleanEntry((round + "_stop"), true)] | |
231 | 223 | } | |
232 | 224 | } | |
233 | 225 | } | |
234 | 226 | ||
235 | 227 | ||
236 | 228 | @Verifier(tx) | |
237 | 229 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
238 | 230 |
github/deemru/w8io/169f3d6 89.15 ms ◑