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