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:AAIFAAAAAAAAABIIAhIECgIBARIDCgEBEgMKAQEAAAAOAAAAAAlzZXBhcmF0b3ICAAAAASwAAAAABm1heEJldAAAAAAABfXhAAEAAAAGZ2V0RmVlAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAW4FAAAAByRtYXRjaDAFAAAAAW4JAAACAAAAAQIAAAAbSW5pdGlhbCBmZWUgY2Fubm90IGJlIGZvdW5kAQAAAApnZXROZXdEZWNrAAAAAAkABEwAAAACAgAAAAMwMUMJAARMAAAAAgIAAAADMDJDCQAETAAAAAICAAAAAzAzQwkABEwAAAACAgAAAAMwNEMJAARMAAAAAgIAAAADMDVDCQAETAAAAAICAAAAAzA2QwkABEwAAAACAgAAAAMwN0MJAARMAAAAAgIAAAADMDhDCQAETAAAAAICAAAAAzA5QwkABEwAAAACAgAAAAMxMEMJAARMAAAAAgIAAAADMTFDCQAETAAAAAICAAAAAzEyQwkABEwAAAACAgAAAAMxM0MJAARMAAAAAgIAAAADMDFECQAETAAAAAICAAAAAzAyRAkABEwAAAACAgAAAAMwM0QJAARMAAAAAgIAAAADMDRECQAETAAAAAICAAAAAzA1RAkABEwAAAACAgAAAAMwNkQJAARMAAAAAgIAAAADMDdECQAETAAAAAICAAAAAzA4RAkABEwAAAACAgAAAAMwOUQJAARMAAAAAgIAAAADMTBECQAETAAAAAICAAAAAzExRAkABEwAAAACAgAAAAMxMkQJAARMAAAAAgIAAAADMTNECQAETAAAAAICAAAAAzAxSAkABEwAAAACAgAAAAMwMkgJAARMAAAAAgIAAAADMDNICQAETAAAAAICAAAAAzA0SAkABEwAAAACAgAAAAMwNUgJAARMAAAAAgIAAAADMDZICQAETAAAAAICAAAAAzA3SAkABEwAAAACAgAAAAMwOEgJAARMAAAAAgIAAAADMDlICQAETAAAAAICAAAAAzEwSAkABEwAAAACAgAAAAMxMUgJAARMAAAAAgIAAAADMTJICQAETAAAAAICAAAAAzEzSAkABEwAAAACAgAAAAMwMVMJAARMAAAAAgIAAAADMDJTCQAETAAAAAICAAAAAzAzUwkABEwAAAACAgAAAAMwNFMJAARMAAAAAgIAAAADMDVTCQAETAAAAAICAAAAAzA2UwkABEwAAAACAgAAAAMwN1MJAARMAAAAAgIAAAADMDhTCQAETAAAAAICAAAAAzA5UwkABEwAAAACAgAAAAMxMFMJAARMAAAAAgIAAAADMTFTCQAETAAAAAICAAAAAzEyUwkABEwAAAACAgAAAAMxM1MFAAAAA25pbAEAAAAOZ2V0U2l4TmV3RGVja3MAAAAACQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAAROAAAAAgkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAAJAQAAAApnZXROZXdEZWNrAAAAAAkBAAAACmdldE5ld0RlY2sAAAAACQEAAAAKZ2V0TmV3RGVjawAAAAAJAQAAAApnZXROZXdEZWNrAAAAAAEAAAAHZ2V0RGVjawAAAAEAAAAEZGVjawMJAABnAAAAAgAA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AAKY2FyZENhc2lubwkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkAASwAAAACBQAAAAVyb3VuZAIAAAAFX3N0b3AGBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQp+iKA=", "height": 1837369, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2LouZuo7GwERSnjGuJxuD3Dff1jw6HpgvLUTSqs6EJ5G Next: Hgf3NUYYrT5U5WL7PWTqQ4BDUCgEfCGJAXPBWsLhmR2o Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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+
515
616 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"]
717
3949 let pmt = i.payments[0]
4050 if (isDefined(pmt.assetId))
4151 then throw("This function accepts WAVES tokens only (0)")
42- else $Tuple2(pmt.amount, 0)
52+ else pmt.amount
4353 }
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")
5555
5656
5757 func getCardValue (stringCard) = {
101101
102102
103103 @Callable(i)
104-func bet () = {
104+func bet (normalBet,tieBet) = {
105105 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)
109107 let currentRound = match getInteger(this, (callerAddress + "_round")) {
110108 case a: Int =>
111109 (a + 1)
117115 then throw("This round is already played")
118116 else if (isDefined(getString(this, round)))
119117 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)]
137143 }
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- }
142144 }
143145
144146
161163 case _ =>
162164 throw("Unable to find original bet amount")
163165 }
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)]
165168 }
166169 }
167170
185188 case _ =>
186189 throw("Unable to find original bet amount")
187190 }
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"))
191193 if ((p != betAmount))
192194 then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")"))
193195 else {
194196 let availableProp = (round + "_deck")
195197 let avDeck = getAvailableDeck(this, availableProp)
196- let $t088268926 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck)
197- let burned1 = $t088268926._1
198- let burnedPos1 = $t088268926._2
199- let burnedDeck1 = $t088268926._3
200- let $t089399052 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1)
201- let burned2 = $t089399052._1
202- let burnedPos2 = $t089399052._2
203- let burnedDeck2 = $t089399052._3
204- let $t090659178 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2)
205- let burned3 = $t090659178._1
206- let burnedPos3 = $t090659178._2
207- let burnedDeck3 = $t090659178._3
208- let $t091919311 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3)
209- let cardPlayer = $t091919311._1
210- let cardPositionPlayer = $t091919311._2
211- let avDeck1 = $t091919311._3
212- let $t093249443 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1)
213- let cardCasino = $t093249443._1
214- let cardPositionCasino = $t093249443._2
215- let avDeck2 = $t093249443._3
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
216218 if ((getCardValue(cardPlayer) == getCardValue(cardCasino)))
217219 then {
218220 let currentDraws = match getInteger(this, (round + "_drawSequence")) {
221223 case _ =>
222224 0
223225 }
224-[StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)]
226+[StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws)]
225227 }
226228 else if (isPlayerWinner(cardPlayer, cardCasino))
227- then [StringEntry(availableProp, makeString(avDeck2, separator)), 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)]
228- else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)]
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)]
229231 }
230232 }
231233 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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+
515
616 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"]
717
818
919 func getSixNewDecks () = (((((getNewDeck() ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck()) ++ getNewDeck())
1020
1121
1222 func getDeck (deck) = if ((0 >= size(deck)))
1323 then getSixNewDecks()
1424 else deck
1525
1626
1727 func getRandomNumber (salt1,salt2,answersCount) = {
1828 let hash = sha256(toBytes((salt1 + salt2)))
1929 let index = toInt(hash)
2030 let rand = (index % answersCount)
2131 if ((0 > rand))
2232 then ((-1 * rand) + 1)
2333 else (rand + 1)
2434 }
2535
2636
2737 func getPreviousRandomNumber (address) = match getInteger(this, (address + "_LastRandonNumber")) {
2838 case n: Int =>
2939 toString(n)
3040 case _ =>
3141 address
3242 }
3343
3444
3545 func getPayments (i) = if ((size(i.payments) == 0))
3646 then throw("Payment must be attached")
3747 else if ((size(i.payments) == 1))
3848 then {
3949 let pmt = i.payments[0]
4050 if (isDefined(pmt.assetId))
4151 then throw("This function accepts WAVES tokens only (0)")
42- else $Tuple2(pmt.amount, 0)
52+ else pmt.amount
4353 }
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")
5555
5656
5757 func getCardValue (stringCard) = {
5858 let p = parseIntValue(take(stringCard, 2))
5959 if ((p == 1))
6060 then 20
6161 else p
6262 }
6363
6464
6565 func isPlayerWinner (cardPlayer,cardCasino) = {
6666 let p = getCardValue(cardPlayer)
6767 let o = getCardValue(cardCasino)
6868 (p > o)
6969 }
7070
7171
7272 func getAvailableDeck (this,availableProp) = if (isDefined(getString(this, availableProp)))
7373 then {
7474 let stringDeck = getStringValue(this, availableProp)
7575 let deck = split(stringDeck, separator)
7676 getDeck(deck)
7777 }
7878 else getSixNewDecks()
7979
8080
8181 func getPlayerCardAndPositionAndUpdateDeck (meKey,callerAddress,deck) = {
8282 let avDeck2 = getDeck(deck)
8383 let cardPosition = getRandomNumber(((meKey + makeString(avDeck2, separator)) + callerAddress), getPreviousRandomNumber(callerAddress), size(avDeck2))
8484 let card = avDeck2[(cardPosition % size(avDeck2))]
8585 let avDeck3 = removeByIndex(avDeck2, (cardPosition % size(avDeck2)))
8686 $Tuple3(card, cardPosition, avDeck3)
8787 }
8888
8989
9090 func getCurrentRound (customRound,callerAddress) = if ((customRound == 0))
9191 then {
9292 let currentRound = match getInteger(this, (callerAddress + "_round")) {
9393 case a: Int =>
9494 a
9595 case _ =>
9696 throw("Unable to find the round")
9797 }
9898 currentRound
9999 }
100100 else customRound
101101
102102
103103 @Callable(i)
104-func bet () = {
104+func bet (normalBet,tieBet) = {
105105 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)
109107 let currentRound = match getInteger(this, (callerAddress + "_round")) {
110108 case a: Int =>
111109 (a + 1)
112110 case _ =>
113111 1
114112 }
115113 let round = ((callerAddress + "_") + toString(currentRound))
116114 if (isDefined(getBoolean(this, (round + "_stop"))))
117115 then throw("This round is already played")
118116 else if (isDefined(getString(this, round)))
119117 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)]
137143 }
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- }
142144 }
143145
144146
145147
146148 @Callable(i)
147149 func surrender (customRound) = {
148150 let callerAddress = toBase58String(i.caller.bytes)
149151 let roundToUse = getCurrentRound(customRound, callerAddress)
150152 let round = ((callerAddress + "_") + toString(roundToUse))
151153 if (!(isDefined(getBoolean(this, round))))
152154 then throw("This round is not played")
153155 else if (isDefined(getBoolean(this, (round + "_stop"))))
154156 then throw("This round is already played")
155157 else if (!(isDefined(getInteger(this, (round + "_drawSequence")))))
156158 then throw("This game is not on war")
157159 else {
158160 let betAmount = match getInteger(this, (round + "_betAmount")) {
159161 case a: Int =>
160162 a
161163 case _ =>
162164 throw("Unable to find original bet amount")
163165 }
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)]
165168 }
166169 }
167170
168171
169172
170173 @Callable(i)
171174 func goToWar (customRound) = {
172175 let callerAddress = toBase58String(i.caller.bytes)
173176 let roundToUse = getCurrentRound(customRound, callerAddress)
174177 let round = ((callerAddress + "_") + toString(roundToUse))
175178 if (!(isDefined(getBoolean(this, round))))
176179 then throw("This round is not played")
177180 else if (isDefined(getBoolean(this, (round + "_stop"))))
178181 then throw("This round is already played")
179182 else if (!(isDefined(getInteger(this, (round + "_drawSequence")))))
180183 then throw("This game is not on war")
181184 else {
182185 let betAmount = match getInteger(this, (round + "_betAmount")) {
183186 case a: Int =>
184187 a
185188 case _ =>
186189 throw("Unable to find original bet amount")
187190 }
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"))
191193 if ((p != betAmount))
192194 then throw((((("original bet amount (" + toString(betAmount)) + ") different to the current payment (") + toString(p)) + ")"))
193195 else {
194196 let availableProp = (round + "_deck")
195197 let avDeck = getAvailableDeck(this, availableProp)
196- let $t088268926 = getPlayerCardAndPositionAndUpdateDeck(round, round, avDeck)
197- let burned1 = $t088268926._1
198- let burnedPos1 = $t088268926._2
199- let burnedDeck1 = $t088268926._3
200- let $t089399052 = getPlayerCardAndPositionAndUpdateDeck((round + burned1), round, burnedDeck1)
201- let burned2 = $t089399052._1
202- let burnedPos2 = $t089399052._2
203- let burnedDeck2 = $t089399052._3
204- let $t090659178 = getPlayerCardAndPositionAndUpdateDeck((round + burned2), round, burnedDeck2)
205- let burned3 = $t090659178._1
206- let burnedPos3 = $t090659178._2
207- let burnedDeck3 = $t090659178._3
208- let $t091919311 = getPlayerCardAndPositionAndUpdateDeck((round + burned3), round, burnedDeck3)
209- let cardPlayer = $t091919311._1
210- let cardPositionPlayer = $t091919311._2
211- let avDeck1 = $t091919311._3
212- let $t093249443 = getPlayerCardAndPositionAndUpdateDeck((round + cardPlayer), round, avDeck1)
213- let cardCasino = $t093249443._1
214- let cardPositionCasino = $t093249443._2
215- let avDeck2 = $t093249443._3
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
216218 if ((getCardValue(cardPlayer) == getCardValue(cardCasino)))
217219 then {
218220 let currentDraws = match getInteger(this, (round + "_drawSequence")) {
219221 case a: Int =>
220222 (a + 1)
221223 case _ =>
222224 0
223225 }
224-[StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws), IntegerEntry((round + "_betAmount"), p)]
226+[StringEntry(availableProp, makeString(avDeck2, separator)), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_drawSequence"), currentDraws)]
225227 }
226228 else if (isPlayerWinner(cardPlayer, cardCasino))
227- then [StringEntry(availableProp, makeString(avDeck2, separator)), 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)]
228- else [StringEntry(availableProp, makeString(avDeck2, separator)), StringEntry((round + "_round"), round), IntegerEntry((round + "_LastRandonNumber"), cardPositionCasino), StringEntry((round + "_playerCard"), cardPlayer), StringEntry((round + "_casinoCard"), cardCasino), IntegerEntry((round + "_betAmount"), p), BooleanEntry((round + "_stop"), true)]
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)]
229231 }
230232 }
231233 }
232234
233235
234236 @Verifier(tx)
235237 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
236238

github/deemru/w8io/169f3d6 
298.13 ms