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