tx · EGPYfndVDx1uRHe1HMGzHvBgs5yFShFgYyXnWnGFFbgq 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd: -0.10010000 Waves 2022.01.16 04:30 [1880843] smart account 3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd > SELF 0.00000000 Waves
{ "type": 13, "id": "EGPYfndVDx1uRHe1HMGzHvBgs5yFShFgYyXnWnGFFbgq", "fee": 10010000, "feeAssetId": null, "timestamp": 1642296612845, "version": 2, "chainId": 84, "sender": "3N6hQF6HBBQ5JCKB8Xs17Q61wkG3VrLvbGd", "senderPublicKey": "7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi", "proofs": [ "2x8tqRqCSZtrizWKpBadhBXQB7zGMNJet5cMfrcNddhU9gp3DgNa21ySju9jdvqXXQpy8urmBHznKEY9UpFUdEbs" ], "script": "base64:AAIEAAAAAAAAACkIAhIFCgMBCAgSABIAEgUKAwEICBIECgIBARIHCgUBCAgICBIECgIBAQAAACUAAAAAE2dhbWVNYXN0ZXJQdWJsaWNLZXkBAAAAIIdjXkgFFtrkHsQ9EVCCVH0dcNZ4QrNMHlHueDDmJyUCAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGTYmFzZTY0Ok1JSUJJekFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUkFBTUlJQkN3S0NBUUlBK0NwYnpNQktwcSs3VmFyU0RITFcwd1FTb2gyTFRiZ2wxckFoZnJ1WkdDanQ2TU80bzF2MWlMcUt5TkgzRkpzdndsTFVxbXFFN0UyV2w3TGJJUEEyNlB4TzJYQ0RmdmowT1dwN2NFSmtVQkVpeVBZQ24raXVQWFVQd3Vkb0ZnTTRXSGYwSVBiREoyTzZPZ3pRbEJCbU51Nk93cjduYUlUaUpyUEF2YWtQZ0FkbVVQdjRyT3pjdTZCUjBUOEd3c3p3cHJ2d1dabEtGNkFkMDBvbUxGRG14NjZIdkJFNTFzUkJpWElSYkpuakRobG9waXplNExv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AnR4AAAAD3NlbmRlclB1YmxpY0tleX9Bw+4=", "height": 1880843, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4DHYVU6v44pS9MUae5794QcfpYfLyG1Efr69dwADHhkn Next: AkaeEnMSGWu5rEgQnC4vueHt97UCNw9YgsdaxYQ6Rpbu Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | func getGameTieAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_TIEAMOUNT") | |
44 | 44 | ||
45 | 45 | ||
46 | + | func getGameFeeAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_FEEAMOUNT") | |
47 | + | ||
48 | + | ||
46 | 49 | func getGamePlayerLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PLAYER") | |
47 | 50 | ||
48 | 51 | ||
70 | 73 | func getGameTieAmount (gameNumber) = getInteger(this, getGameTieAmountLabel(gameNumber)) | |
71 | 74 | ||
72 | 75 | ||
76 | + | func getGameFeeAmount (gameNumber) = getInteger(this, getGameFeeAmountLabel(gameNumber)) | |
77 | + | ||
78 | + | ||
73 | 79 | func getGameState (gameNumber) = getInteger(this, getGameStateLabel(gameNumber)) | |
74 | 80 | ||
75 | 81 | ||
85 | 91 | func getGameSetup (gameNumber,randomizer,cards0,cards1,cards2,cards3) = [IntegerEntry(setupGamesCounterLabel, gameNumber), IntegerEntry(getGameStateLabel(gameNumber), 0), IntegerEntry(getGameShuffelOffesetLabel(gameNumber), randomizer), StringEntry(getGameCardsSignatureLabel(gameNumber, 0), cards0), StringEntry(getGameCardsSignatureLabel(gameNumber, 1), cards1), StringEntry(getGameCardsSignatureLabel(gameNumber, 2), cards2), StringEntry(getGameCardsSignatureLabel(gameNumber, 3), cards3)] | |
86 | 92 | ||
87 | 93 | ||
88 | - | func createGameMetadata (address,betAmount,tieAmount) = { | |
94 | + | func createGameMetadata (address,betAmount,tieAmount,feeAmount) = { | |
89 | 95 | let gameToReserve = (value(gamesUsedGetCounter()) + 1) | |
90 | 96 | let dealerQueue = value(getDealerQueue()) | |
91 | - | [IntegerEntry(usedGamesCounterLabel, gameToReserve), IntegerEntry(getPlayerCurrentGameLabel(address), gameToReserve), IntegerEntry(getGameStateLabel(gameToReserve), 1), IntegerEntry(getGameBetAmountLabel(gameToReserve), betAmount), IntegerEntry(getGameTieAmountLabel(gameToReserve), tieAmount), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(gameToReserve))), StringEntry(getGamePlayerLabel(gameToReserve), address)] | |
97 | + | [IntegerEntry(usedGamesCounterLabel, gameToReserve), IntegerEntry(getPlayerCurrentGameLabel(address), gameToReserve), IntegerEntry(getGameStateLabel(gameToReserve), 1), IntegerEntry(getGameBetAmountLabel(gameToReserve), betAmount), IntegerEntry(getGameTieAmountLabel(gameToReserve), tieAmount), IntegerEntry(getGameFeeAmountLabel(gameToReserve), feeAmount), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(gameToReserve))), StringEntry(getGamePlayerLabel(gameToReserve), address)] | |
92 | 98 | } | |
93 | 99 | ||
94 | 100 | ||
126 | 132 | if ((cardPlayer >= cardCasino)) | |
127 | 133 | then { | |
128 | 134 | let normalBet = value(getGameBetAmount(currentGame)) | |
135 | + | let fees = value(getGameFeeAmount(currentGame)) | |
129 | 136 | let address = value(addressFromString(value(getGamePlayer(currentGame)))) | |
130 | - | [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), | |
137 | + | [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, (((normalBet + fees) * 2) + normalBet), unit)] | |
131 | 138 | } | |
132 | 139 | else [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame))))))] | |
133 | 140 | } | |
144 | 151 | if ((value(getGameState(currentGame)) != 2)) | |
145 | 152 | then throw("Game is not in correct state.") | |
146 | 153 | else { | |
147 | - | let | |
154 | + | let normalBet = value(getGameBetAmount(currentGame)) | |
148 | 155 | let p = getPayments(i) | |
149 | - | if (( | |
150 | - | then throw((("Payment must me same as the original bet (" + toString( | |
156 | + | if ((p != normalBet)) | |
157 | + | then throw((("Payment must me same as the original bet (" + toString(normalBet)) + ")")) | |
151 | 158 | else [IntegerEntry(getGameStateLabel(currentGame), 3), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(currentGame)))] | |
152 | 159 | } | |
153 | 160 | } | |
161 | 168 | if ((value(getGameState(currentGame)) != 2)) | |
162 | 169 | then throw("Game is not in correct state.") | |
163 | 170 | else { | |
164 | - | let betAmount = value(getGameBetAmount(currentGame)) | |
171 | + | let normalBet = value(getGameBetAmount(currentGame)) | |
172 | + | let fees = value(getGameFeeAmount(currentGame)) | |
165 | 173 | let dealerQueue = value(getDealerQueue()) | |
166 | - | [IntegerEntry(getGameStateLabel(currentGame), 5), ScriptTransfer(i.caller, ( | |
174 | + | [IntegerEntry(getGameStateLabel(currentGame), 5), ScriptTransfer(i.caller, (((normalBet + fees) + fees) / 2), unit)] | |
167 | 175 | } | |
168 | 176 | } | |
169 | 177 | ||
195 | 203 | else if ((cardPlayer > cardCasino)) | |
196 | 204 | then { | |
197 | 205 | let normalBet = value(getGameBetAmount(currentGame)) | |
206 | + | let fees = value(getGameFeeAmount(currentGame)) | |
198 | 207 | let address = value(addressFromString(value(getGamePlayer(currentGame)))) | |
199 | - | [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, normalBet, unit)] | |
208 | + | [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, ((normalBet * 2) + fees), unit)] | |
200 | 209 | } | |
201 | 210 | else [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame))))))] | |
202 | 211 | } | |
210 | 219 | func bet (normalBet,tieBet) = { | |
211 | 220 | let callerAddress = toBase58String(i.caller.bytes) | |
212 | 221 | let p = getPayments(i) | |
213 | - | let betAmount = (normalBet + i.fee) | |
214 | - | let tieAmount = tieBet | |
215 | 222 | let address = toBase58String(i.caller.bytes) | |
216 | 223 | if ((p != (normalBet + tieBet))) | |
217 | 224 | then throw("normal bet + tie bet should be equal to the payment") | |
227 | 234 | case CURRENTGAME: Int => | |
228 | 235 | if ((4 > value(getGameState(CURRENTGAME)))) | |
229 | 236 | then throw((("Game " + toString(CURRENTGAME)) + " is still in progress.")) | |
230 | - | else createGameMetadata(address, | |
237 | + | else createGameMetadata(address, normalBet, tieBet, i.fee) | |
231 | 238 | case _: Unit => | |
232 | - | createGameMetadata(address, | |
239 | + | createGameMetadata(address, normalBet, tieBet, i.fee) | |
233 | 240 | case _ => | |
234 | 241 | throw("Match error") | |
235 | 242 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let gameMasterPublicKey = base58'A7VvRHtZro8bvGa9KAahiP9xovdKJ5hGsTjHLMa6nRPo' | |
5 | 5 | ||
6 | 6 | let RSAPUBLIC = fromBase64String("base64:MIIBIzANBgkqhkiG9w0BAQEFAAOCARAAMIIBCwKCAQIA+CpbzMBKpq+7VarSDHLW0wQSoh2LTbgl1rAhfruZGCjt6MO4o1v1iLqKyNH3FJsvwlLUqmqE7E2Wl7LbIPA26PxO2XCDfvj0OWp7cEJkUBEiyPYCn+iuPXUPwudoFgM4WHf0IPbDJ2O6OgzQlBBmNu6Owr7naITiJrPAvakPgAdmUPv4rOzcu6BR0T8GwszwprvwWZlKF6Ad00omLFDmx66HvBE51sRBiXIRbJnjDhlopize4LoR1FIrQaAu1sfs5bEHLA33jvKybne+IDawCsiINZYdPZV1WWcURC+XAFfBiYCw4PYyguxaBRHotzLc2dOsBV1HDNIjLKVoRknyt50CAwEAAQ==") | |
7 | 7 | ||
8 | 8 | let gameToken = base58'AJRyxpsv9Z4v46eg9b5TpnVXn3DteJYPHRJSbMckYPWw' | |
9 | 9 | ||
10 | 10 | let cardPosition = 3 | |
11 | 11 | ||
12 | 12 | let setupGamesCounterLabel = "G_SETUPGAMESCOUNTER" | |
13 | 13 | ||
14 | 14 | let usedGamesCounterLabel = "G_USEDGAMESCOUNTER" | |
15 | 15 | ||
16 | 16 | let dealerQueueLabel = "G_DEALERQUEUE" | |
17 | 17 | ||
18 | 18 | let gameMaxBetLabel = "G_MAXBET" | |
19 | 19 | ||
20 | 20 | let gameMinBetLabel = "G_MINBET" | |
21 | 21 | ||
22 | 22 | func gamesMaxBet () = getInteger(this, gameMaxBetLabel) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func gamesMinBet () = getInteger(this, gameMinBetLabel) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func gamesSetupGetCounter () = getInteger(this, setupGamesCounterLabel) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func gamesUsedGetCounter () = getInteger(this, usedGamesCounterLabel) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getDealerQueue () = getString(this, dealerQueueLabel) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func checkPermission (callerPublicKey) = (callerPublicKey != gameMasterPublicKey) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getGameBetAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_BETAMOUNT") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getGameTieAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_TIEAMOUNT") | |
44 | 44 | ||
45 | 45 | ||
46 | + | func getGameFeeAmountLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_FEEAMOUNT") | |
47 | + | ||
48 | + | ||
46 | 49 | func getGamePlayerLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PLAYER") | |
47 | 50 | ||
48 | 51 | ||
49 | 52 | func getGamePayoutLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_PAYOUT") | |
50 | 53 | ||
51 | 54 | ||
52 | 55 | func getGameStateLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_STATE") | |
53 | 56 | ||
54 | 57 | ||
55 | 58 | func getGameShuffelOffesetLabel (gameNumber) = (("G_" + toString(gameNumber)) + "_OFFSET") | |
56 | 59 | ||
57 | 60 | ||
58 | 61 | func getGameCardsSignatureLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARDSIGNATURE_") + toString(card)) | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | func getPlayerCurrentGameLabel (address) = (("P_" + address) + "_CURRENTGAME") | |
62 | 65 | ||
63 | 66 | ||
64 | 67 | func getPlayerCurrentGame (address) = getInteger(this, getPlayerCurrentGameLabel(address)) | |
65 | 68 | ||
66 | 69 | ||
67 | 70 | func getGameBetAmount (gameNumber) = getInteger(this, getGameBetAmountLabel(gameNumber)) | |
68 | 71 | ||
69 | 72 | ||
70 | 73 | func getGameTieAmount (gameNumber) = getInteger(this, getGameTieAmountLabel(gameNumber)) | |
71 | 74 | ||
72 | 75 | ||
76 | + | func getGameFeeAmount (gameNumber) = getInteger(this, getGameFeeAmountLabel(gameNumber)) | |
77 | + | ||
78 | + | ||
73 | 79 | func getGameState (gameNumber) = getInteger(this, getGameStateLabel(gameNumber)) | |
74 | 80 | ||
75 | 81 | ||
76 | 82 | func getGamePlayer (gameNumber) = getString(this, getGamePlayerLabel(gameNumber)) | |
77 | 83 | ||
78 | 84 | ||
79 | 85 | func getGameCardsSignature (gameNumber,card) = getString(this, getGameCardsSignatureLabel(gameNumber, card)) | |
80 | 86 | ||
81 | 87 | ||
82 | 88 | func getGameCardsLabel (gameNumber,card) = ((("G_" + toString(gameNumber)) + "_CARD_") + toString(card)) | |
83 | 89 | ||
84 | 90 | ||
85 | 91 | func getGameSetup (gameNumber,randomizer,cards0,cards1,cards2,cards3) = [IntegerEntry(setupGamesCounterLabel, gameNumber), IntegerEntry(getGameStateLabel(gameNumber), 0), IntegerEntry(getGameShuffelOffesetLabel(gameNumber), randomizer), StringEntry(getGameCardsSignatureLabel(gameNumber, 0), cards0), StringEntry(getGameCardsSignatureLabel(gameNumber, 1), cards1), StringEntry(getGameCardsSignatureLabel(gameNumber, 2), cards2), StringEntry(getGameCardsSignatureLabel(gameNumber, 3), cards3)] | |
86 | 92 | ||
87 | 93 | ||
88 | - | func createGameMetadata (address,betAmount,tieAmount) = { | |
94 | + | func createGameMetadata (address,betAmount,tieAmount,feeAmount) = { | |
89 | 95 | let gameToReserve = (value(gamesUsedGetCounter()) + 1) | |
90 | 96 | let dealerQueue = value(getDealerQueue()) | |
91 | - | [IntegerEntry(usedGamesCounterLabel, gameToReserve), IntegerEntry(getPlayerCurrentGameLabel(address), gameToReserve), IntegerEntry(getGameStateLabel(gameToReserve), 1), IntegerEntry(getGameBetAmountLabel(gameToReserve), betAmount), IntegerEntry(getGameTieAmountLabel(gameToReserve), tieAmount), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(gameToReserve))), StringEntry(getGamePlayerLabel(gameToReserve), address)] | |
97 | + | [IntegerEntry(usedGamesCounterLabel, gameToReserve), IntegerEntry(getPlayerCurrentGameLabel(address), gameToReserve), IntegerEntry(getGameStateLabel(gameToReserve), 1), IntegerEntry(getGameBetAmountLabel(gameToReserve), betAmount), IntegerEntry(getGameTieAmountLabel(gameToReserve), tieAmount), IntegerEntry(getGameFeeAmountLabel(gameToReserve), feeAmount), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(gameToReserve))), StringEntry(getGamePlayerLabel(gameToReserve), address)] | |
92 | 98 | } | |
93 | 99 | ||
94 | 100 | ||
95 | 101 | func getCardValue (stringCard) = parseIntValue(split(stringCard, "/")[0]) | |
96 | 102 | ||
97 | 103 | ||
98 | 104 | func getPayments (i) = if ((size(i.payments) == 0)) | |
99 | 105 | then throw("Payment must be attached") | |
100 | 106 | else if ((size(i.payments) == 1)) | |
101 | 107 | then { | |
102 | 108 | let pmt = i.payments[0] | |
103 | 109 | pmt.amount | |
104 | 110 | } | |
105 | 111 | else throw("There should be only one payment") | |
106 | 112 | ||
107 | 113 | ||
108 | 114 | func verifyCard (card,gameNumber,cardNumber) = rsaVerify_16Kb(SHA256, toBytes(card), fromBase64String(split(value(getGameCardsSignature(gameNumber, cardNumber)), " ")[0]), RSAPUBLIC) | |
109 | 115 | ||
110 | 116 | ||
111 | 117 | @Callable(i) | |
112 | 118 | func revealRound2 (currentGame,card2,card3) = if (checkPermission(i.callerPublicKey)) | |
113 | 119 | then throw("revealRound2_FORBBIDEN") | |
114 | 120 | else { | |
115 | 121 | let dealerQueue = value(getDealerQueue()) | |
116 | 122 | let nextGameToProcess = split(dealerQueue, ",")[1] | |
117 | 123 | if ((nextGameToProcess == toString(currentGame))) | |
118 | 124 | then if (if (if ((value(getGameState(currentGame)) == 3)) | |
119 | 125 | then verifyCard(card2, currentGame, 2) | |
120 | 126 | else false) | |
121 | 127 | then verifyCard(card3, currentGame, 3) | |
122 | 128 | else false) | |
123 | 129 | then { | |
124 | 130 | let cardPlayer = getCardValue(split(card2, "+")[cardPosition]) | |
125 | 131 | let cardCasino = getCardValue(split(card3, "+")[cardPosition]) | |
126 | 132 | if ((cardPlayer >= cardCasino)) | |
127 | 133 | then { | |
128 | 134 | let normalBet = value(getGameBetAmount(currentGame)) | |
135 | + | let fees = value(getGameFeeAmount(currentGame)) | |
129 | 136 | let address = value(addressFromString(value(getGamePlayer(currentGame)))) | |
130 | - | [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), | |
137 | + | [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, (((normalBet + fees) * 2) + normalBet), unit)] | |
131 | 138 | } | |
132 | 139 | else [StringEntry(getGameCardsLabel(currentGame, 2), card2), StringEntry(getGameCardsLabel(currentGame, 3), card3), IntegerEntry(getGameStateLabel(currentGame), 6), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame))))))] | |
133 | 140 | } | |
134 | 141 | else throw("One of the cards failed to be verified or game is not in state 1.") | |
135 | 142 | else throw(("The next game to process is " + nextGameToProcess)) | |
136 | 143 | } | |
137 | 144 | ||
138 | 145 | ||
139 | 146 | ||
140 | 147 | @Callable(i) | |
141 | 148 | func war () = { | |
142 | 149 | let address = toBase58String(i.caller.bytes) | |
143 | 150 | let currentGame = value(getPlayerCurrentGame(address)) | |
144 | 151 | if ((value(getGameState(currentGame)) != 2)) | |
145 | 152 | then throw("Game is not in correct state.") | |
146 | 153 | else { | |
147 | - | let | |
154 | + | let normalBet = value(getGameBetAmount(currentGame)) | |
148 | 155 | let p = getPayments(i) | |
149 | - | if (( | |
150 | - | then throw((("Payment must me same as the original bet (" + toString( | |
156 | + | if ((p != normalBet)) | |
157 | + | then throw((("Payment must me same as the original bet (" + toString(normalBet)) + ")")) | |
151 | 158 | else [IntegerEntry(getGameStateLabel(currentGame), 3), StringEntry(dealerQueueLabel, ((value(getDealerQueue()) + ",") + toString(currentGame)))] | |
152 | 159 | } | |
153 | 160 | } | |
154 | 161 | ||
155 | 162 | ||
156 | 163 | ||
157 | 164 | @Callable(i) | |
158 | 165 | func surrender () = { | |
159 | 166 | let address = toBase58String(i.caller.bytes) | |
160 | 167 | let currentGame = value(getPlayerCurrentGame(address)) | |
161 | 168 | if ((value(getGameState(currentGame)) != 2)) | |
162 | 169 | then throw("Game is not in correct state.") | |
163 | 170 | else { | |
164 | - | let betAmount = value(getGameBetAmount(currentGame)) | |
171 | + | let normalBet = value(getGameBetAmount(currentGame)) | |
172 | + | let fees = value(getGameFeeAmount(currentGame)) | |
165 | 173 | let dealerQueue = value(getDealerQueue()) | |
166 | - | [IntegerEntry(getGameStateLabel(currentGame), 5), ScriptTransfer(i.caller, ( | |
174 | + | [IntegerEntry(getGameStateLabel(currentGame), 5), ScriptTransfer(i.caller, (((normalBet + fees) + fees) / 2), unit)] | |
167 | 175 | } | |
168 | 176 | } | |
169 | 177 | ||
170 | 178 | ||
171 | 179 | ||
172 | 180 | @Callable(i) | |
173 | 181 | func revealRound1 (currentGame,card0,card1) = if (checkPermission(i.callerPublicKey)) | |
174 | 182 | then throw("revealRound1_FORBBIDEN") | |
175 | 183 | else { | |
176 | 184 | let dealerQueue = value(getDealerQueue()) | |
177 | 185 | let nextGameToProcess = split(dealerQueue, ",")[1] | |
178 | 186 | if ((nextGameToProcess == toString(currentGame))) | |
179 | 187 | then if (if (if ((value(getGameState(currentGame)) == 1)) | |
180 | 188 | then verifyCard(card0, currentGame, 0) | |
181 | 189 | else false) | |
182 | 190 | then verifyCard(card1, currentGame, 1) | |
183 | 191 | else false) | |
184 | 192 | then { | |
185 | 193 | let cardPlayer = getCardValue(split(card0, "+")[cardPosition]) | |
186 | 194 | let cardCasino = getCardValue(split(card1, "+")[cardPosition]) | |
187 | 195 | if ((cardPlayer == cardCasino)) | |
188 | 196 | then { | |
189 | 197 | let tieBet = value(getGameTieAmount(currentGame)) | |
190 | 198 | let address = value(addressFromString(value(getGamePlayer(currentGame)))) | |
191 | 199 | if ((tieBet != 0)) | |
192 | 200 | then [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 2), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, ((tieBet * 10) + tieBet), unit)] | |
193 | 201 | else [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 2), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame))))))] | |
194 | 202 | } | |
195 | 203 | else if ((cardPlayer > cardCasino)) | |
196 | 204 | then { | |
197 | 205 | let normalBet = value(getGameBetAmount(currentGame)) | |
206 | + | let fees = value(getGameFeeAmount(currentGame)) | |
198 | 207 | let address = value(addressFromString(value(getGamePlayer(currentGame)))) | |
199 | - | [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, normalBet, unit)] | |
208 | + | [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame)))))), ScriptTransfer(address, ((normalBet * 2) + fees), unit)] | |
200 | 209 | } | |
201 | 210 | else [StringEntry(getGameCardsLabel(currentGame, 0), card0), StringEntry(getGameCardsLabel(currentGame, 1), card1), IntegerEntry(getGameStateLabel(currentGame), 4), StringEntry(dealerQueueLabel, takeRight(dealerQueue, (size(dealerQueue) - (1 + size(toString(currentGame))))))] | |
202 | 211 | } | |
203 | 212 | else throw("One of the cards failed to be verified or game is not in state 1.") | |
204 | 213 | else throw(("The next game to process is " + nextGameToProcess)) | |
205 | 214 | } | |
206 | 215 | ||
207 | 216 | ||
208 | 217 | ||
209 | 218 | @Callable(i) | |
210 | 219 | func bet (normalBet,tieBet) = { | |
211 | 220 | let callerAddress = toBase58String(i.caller.bytes) | |
212 | 221 | let p = getPayments(i) | |
213 | - | let betAmount = (normalBet + i.fee) | |
214 | - | let tieAmount = tieBet | |
215 | 222 | let address = toBase58String(i.caller.bytes) | |
216 | 223 | if ((p != (normalBet + tieBet))) | |
217 | 224 | then throw("normal bet + tie bet should be equal to the payment") | |
218 | 225 | else if (if ((value(gamesMinBet()) > p)) | |
219 | 226 | then true | |
220 | 227 | else (p > value(gamesMaxBet()))) | |
221 | 228 | then throw((((("Payment needs to be in the following interval [" + toString(value(gamesMinBet()))) + " ") + toString(value(gamesMaxBet()))) + "]")) | |
222 | 229 | else if ((normalBet == 0)) | |
223 | 230 | then throw("normal bet has to be greater than 0") | |
224 | 231 | else if ((value(gamesUsedGetCounter()) >= value(gamesSetupGetCounter()))) | |
225 | 232 | then throw("No available set up games to use.") | |
226 | 233 | else match getPlayerCurrentGame(address) { | |
227 | 234 | case CURRENTGAME: Int => | |
228 | 235 | if ((4 > value(getGameState(CURRENTGAME)))) | |
229 | 236 | then throw((("Game " + toString(CURRENTGAME)) + " is still in progress.")) | |
230 | - | else createGameMetadata(address, | |
237 | + | else createGameMetadata(address, normalBet, tieBet, i.fee) | |
231 | 238 | case _: Unit => | |
232 | - | createGameMetadata(address, | |
239 | + | createGameMetadata(address, normalBet, tieBet, i.fee) | |
233 | 240 | case _ => | |
234 | 241 | throw("Match error") | |
235 | 242 | } | |
236 | 243 | } | |
237 | 244 | ||
238 | 245 | ||
239 | 246 | ||
240 | 247 | @Callable(i) | |
241 | 248 | func setupGame (gameNumber,card0,card1,card2,card3) = if (checkPermission(i.callerPublicKey)) | |
242 | 249 | then throw("setupGame_FORBBIDEN") | |
243 | 250 | else match gamesSetupGetCounter() { | |
244 | 251 | case SETUPGAMESCOUNTER: Int => | |
245 | 252 | let randomizer = (toInt(sha256((take(lastBlock.generationSignature, 16) + take(i.transactionId, 16)))) % 2) | |
246 | 253 | let currentGame = (SETUPGAMESCOUNTER + 1) | |
247 | 254 | if ((gameNumber != currentGame)) | |
248 | 255 | then throw("Wrong game number.") | |
249 | 256 | else if (((randomizer % 2) == 1)) | |
250 | 257 | then getGameSetup(currentGame, randomizer, card0, card1, card2, card3) | |
251 | 258 | else getGameSetup(currentGame, randomizer, card0, card1, card2, card3) | |
252 | 259 | case _ => | |
253 | 260 | throw("InitGame Required") | |
254 | 261 | } | |
255 | 262 | ||
256 | 263 | ||
257 | 264 | ||
258 | 265 | @Callable(i) | |
259 | 266 | func initGame (maxBet,minBet) = if (checkPermission(i.callerPublicKey)) | |
260 | 267 | then throw("initGame_FORBBIDEN") | |
261 | 268 | else match gamesSetupGetCounter() { | |
262 | 269 | case GAMESCOUNTER: Int => | |
263 | 270 | throw("INIT_ALREADY_DONE") | |
264 | 271 | case _ => | |
265 | 272 | [IntegerEntry(setupGamesCounterLabel, 0), IntegerEntry(usedGamesCounterLabel, 0), IntegerEntry(gameMaxBetLabel, maxBet), IntegerEntry(gameMinBetLabel, minBet), StringEntry(dealerQueueLabel, "")] | |
266 | 273 | } | |
267 | 274 | ||
268 | 275 | ||
269 | 276 | @Verifier(tx) | |
270 | 277 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
271 | 278 |
github/deemru/w8io/169f3d6 78.22 ms ◑