tx · 9NqTRapnZEnpEcgMWsH2NtMJrq2Dm6dJ1vVMzULqTJvP

3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5:  -0.05000000 Waves

2024.08.20 10:10 [3246845] smart account 3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5 > SELF 0.00000000 Waves

{ "type": 13, "id": "9NqTRapnZEnpEcgMWsH2NtMJrq2Dm6dJ1vVMzULqTJvP", "fee": 5000000, "feeAssetId": null, "timestamp": 1724137851695, "version": 2, "chainId": 84, "sender": "3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5", "senderPublicKey": "DhKSnv34wE65np8uDd8E6ygEbNsn6fHx9p7q4hJTcgRw", "proofs": [ "4fqrKuxDucnRHkHt19oUxv4Vy8vuTGgyok4AjFSQfBxVLhMwKaAMJNY6QcuPNDXPpgxFHhrgTwg9nMfchfXiKZns" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgQKAggIAAAACQAAAAAMQkFJX0NPTlRSQUNUAgAAACMzTjl0S2l4enFUWVduRVhReHJEUTVwQlRHdlFkNnNGc3ZtVgAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAAGUExBWUVSAgAAAAExAAAAAAJBSQIAAAABMgAAAAAOV0lOTklOR19BTU9VTlQAAAAAAAX14QABAAAABmNoYXJBdAAAAAIAAAADc3RyAAAAAWkJAAGRAAAAAgkABLUAAAACBQAAAANzdHICAAAAAAUAAAABaQEAAAASY2hlY2tJZk1vdmVJc1ZhbGlkAAAAAgAAAAZnYW1lSWQAAAAFYm9hcmQEAAAADGN1cnJlbnRCb2FyZAQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAICAAAADWN1cnJlbnRCb2FyZF8FAAAABmdhbWVJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAgAAAAkwMDA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ZUlkCQAEJQAAAAEFAAAABnNlbmRlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAAB3dpbm5lcl8FAAAABmdhbWVJZAIAAAAEbm9uZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAADG5leHRfcGxheWVyXwUAAAAGZ2FtZUlkBQAAAAJBSQUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5VQHddg==", "height": 3246845, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CponxQq2DtHDkhASbYhDHwcU39mgie1y4qrUZcjzeqUS Next: 9HXUW3e7qW9yfEXJrruUCqGnpndLRLxgqDEmocWPGwTf Diff:
OldNewDifferences
172172 then true
173173 else leftColumn)
174174 then true
175- else middleRow)
175+ else middleColumn)
176176 then true
177177 else rightColumn)
178178 then true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BAI_CONTRACT = "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV"
55
66 let BAI_ASSET_ID = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
77
88 let PLAYER = "1"
99
1010 let AI = "2"
1111
1212 let WINNING_AMOUNT = 100000000
1313
1414 func charAt (str,i) = split(str, "")[i]
1515
1616
1717 func checkIfMoveIsValid (gameId,board) = {
1818 let currentBoard = match getString(("currentBoard_" + gameId)) {
1919 case s: String =>
2020 s
2121 case _ =>
2222 "000000000"
2323 }
2424 let firstSelected = if ((charAt(board, 0) != charAt(currentBoard, 0)))
2525 then 1
2626 else 0
2727 let secondSelected = if ((charAt(board, 1) != charAt(currentBoard, 1)))
2828 then 1
2929 else 0
3030 let thirdSelected = if ((charAt(board, 2) != charAt(currentBoard, 2)))
3131 then 1
3232 else 0
3333 let fourthSelected = if ((charAt(board, 3) != charAt(currentBoard, 3)))
3434 then 1
3535 else 0
3636 let fifthSelected = if ((charAt(board, 4) != charAt(currentBoard, 4)))
3737 then 1
3838 else 0
3939 let sixthSelected = if ((charAt(board, 5) != charAt(currentBoard, 5)))
4040 then 1
4141 else 0
4242 let seventhSelected = if ((charAt(board, 6) != charAt(currentBoard, 6)))
4343 then 1
4444 else 0
4545 let eighthSelected = if ((charAt(board, 7) != charAt(currentBoard, 7)))
4646 then 1
4747 else 0
4848 let ninthSelected = if ((charAt(board, 8) != charAt(currentBoard, 8)))
4949 then 1
5050 else 0
5151 let firstPositionCorrect = if (if ((charAt(board, 0) == charAt(currentBoard, 0)))
5252 then true
5353 else (charAt(currentBoard, 0) == "0"))
5454 then true
5555 else false
5656 let secondPositionCorrect = if (if ((charAt(board, 1) == charAt(currentBoard, 1)))
5757 then true
5858 else (charAt(currentBoard, 1) == "0"))
5959 then true
6060 else false
6161 let thirdPositionCorrect = if (if ((charAt(board, 2) == charAt(currentBoard, 2)))
6262 then true
6363 else (charAt(currentBoard, 2) == "0"))
6464 then true
6565 else false
6666 let fourthPositionCorrect = if (if ((charAt(board, 3) == charAt(currentBoard, 3)))
6767 then true
6868 else (charAt(currentBoard, 3) == "0"))
6969 then true
7070 else false
7171 let fifthPositionCorrect = if (if ((charAt(board, 4) == charAt(currentBoard, 4)))
7272 then true
7373 else (charAt(currentBoard, 4) == "0"))
7474 then true
7575 else false
7676 let sixthPositionCorrect = if (if ((charAt(board, 5) == charAt(currentBoard, 5)))
7777 then true
7878 else (charAt(currentBoard, 5) == "0"))
7979 then true
8080 else false
8181 let seventhPositionCorrect = if (if ((charAt(board, 6) == charAt(currentBoard, 6)))
8282 then true
8383 else (charAt(currentBoard, 6) == "0"))
8484 then true
8585 else false
8686 let eighthPositionCorrect = if (if ((charAt(board, 7) == charAt(currentBoard, 7)))
8787 then true
8888 else (charAt(currentBoard, 7) == "0"))
8989 then true
9090 else false
9191 let ninthPositionCorrect = if (if ((charAt(board, 8) == charAt(currentBoard, 8)))
9292 then true
9393 else (charAt(currentBoard, 8) == "0"))
9494 then true
9595 else false
9696 let noOldPositionOverwritten = if (if (if (if (if (if (if (if (firstPositionCorrect)
9797 then secondPositionCorrect
9898 else false)
9999 then thirdPositionCorrect
100100 else false)
101101 then fourthPositionCorrect
102102 else false)
103103 then fifthPositionCorrect
104104 else false)
105105 then sixthPositionCorrect
106106 else false)
107107 then seventhPositionCorrect
108108 else false)
109109 then eighthPositionCorrect
110110 else false)
111111 then ninthPositionCorrect
112112 else false
113113 let countMoves = ((((((((firstSelected + secondSelected) + thirdSelected) + fourthSelected) + fifthSelected) + sixthSelected) + seventhSelected) + eighthSelected) + ninthSelected)
114114 let onlyOneMove = (1 >= countMoves)
115115 if ((countMoves > 1))
116116 then throw("More than move made!")
117117 else if (!(noOldPositionOverwritten))
118118 then throw("Former position overwritten!")
119119 else if (noOldPositionOverwritten)
120120 then onlyOneMove
121121 else false
122122 }
123123
124124
125125 func checkIfPlayerHasWon (gameId,board,player) = {
126126 let winningCombinations = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
127127 let topRow = if (if ((charAt(board, winningCombinations[0][0]) == player))
128128 then (charAt(board, winningCombinations[0][1]) == player)
129129 else false)
130130 then (charAt(board, winningCombinations[0][2]) == player)
131131 else false
132132 let middleRow = if (if ((charAt(board, winningCombinations[1][0]) == player))
133133 then (charAt(board, winningCombinations[1][1]) == player)
134134 else false)
135135 then (charAt(board, winningCombinations[1][2]) == player)
136136 else false
137137 let bottomRow = if (if ((charAt(board, winningCombinations[2][0]) == player))
138138 then (charAt(board, winningCombinations[2][1]) == player)
139139 else false)
140140 then (charAt(board, winningCombinations[2][2]) == player)
141141 else false
142142 let leftColumn = if (if ((charAt(board, winningCombinations[3][0]) == player))
143143 then (charAt(board, winningCombinations[3][1]) == player)
144144 else false)
145145 then (charAt(board, winningCombinations[3][2]) == player)
146146 else false
147147 let middleColumn = if (if ((charAt(board, winningCombinations[4][0]) == player))
148148 then (charAt(board, winningCombinations[4][1]) == player)
149149 else false)
150150 then (charAt(board, winningCombinations[4][2]) == player)
151151 else false
152152 let rightColumn = if (if ((charAt(board, winningCombinations[5][0]) == player))
153153 then (charAt(board, winningCombinations[5][1]) == player)
154154 else false)
155155 then (charAt(board, winningCombinations[5][2]) == player)
156156 else false
157157 let diagonalOne = if (if ((charAt(board, winningCombinations[6][0]) == player))
158158 then (charAt(board, winningCombinations[6][1]) == player)
159159 else false)
160160 then (charAt(board, winningCombinations[6][2]) == player)
161161 else false
162162 let diagonalTwo = if (if ((charAt(board, winningCombinations[7][0]) == player))
163163 then (charAt(board, winningCombinations[7][1]) == player)
164164 else false)
165165 then (charAt(board, winningCombinations[7][2]) == player)
166166 else false
167167 if (if (if (if (if (if (if (topRow)
168168 then true
169169 else middleRow)
170170 then true
171171 else bottomRow)
172172 then true
173173 else leftColumn)
174174 then true
175- else middleRow)
175+ else middleColumn)
176176 then true
177177 else rightColumn)
178178 then true
179179 else diagonalOne)
180180 then true
181181 else diagonalTwo
182182 }
183183
184184
185185 func getPossibleMovesCount (board) = {
186186 let firstMovePossible = if ((charAt(board, 0) == "0"))
187187 then 1
188188 else 0
189189 let secondMovePossible = if ((charAt(board, 1) == "0"))
190190 then 1
191191 else 0
192192 let thirdMovePossible = if ((charAt(board, 2) == "0"))
193193 then 1
194194 else 0
195195 let fourthMovePossible = if ((charAt(board, 3) == "0"))
196196 then 1
197197 else 0
198198 let fifthMovePossible = if ((charAt(board, 4) == "0"))
199199 then 1
200200 else 0
201201 let sixthMovePossible = if ((charAt(board, 5) == "0"))
202202 then 1
203203 else 0
204204 let seventhMovePossible = if ((charAt(board, 6) == "0"))
205205 then 1
206206 else 0
207207 let eigthMovePossible = if ((charAt(board, 7) == "0"))
208208 then 1
209209 else 0
210210 let ninthMovePossible = if ((charAt(board, 8) == "0"))
211211 then 1
212212 else 0
213213 ((((((((firstMovePossible + secondMovePossible) + thirdMovePossible) + fourthMovePossible) + fifthMovePossible) + sixthMovePossible) + seventhMovePossible) + eigthMovePossible) + ninthMovePossible)
214214 }
215215
216216
217217 @Callable(i)
218218 func callback (gameIdAndBoard) = {
219219 let parts = split(gameIdAndBoard, "_")
220220 let gameId = parts[0]
221221 let board = parts[1]
222222 let nextPlayer = match getString(("next_player_" + gameId)) {
223223 case s: String =>
224224 s
225225 case _ =>
226226 ""
227227 }
228228 let moveOfAIIsValid = checkIfMoveIsValid(gameId, board)
229229 if (!(moveOfAIIsValid))
230230 then throw("Illegal move!")
231231 else if ((nextPlayer != AI))
232232 then throw("Player has to move first!")
233233 else {
234234 let aiHasWon = checkIfPlayerHasWon(gameId, board, AI)
235235 if (aiHasWon)
236236 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "ai")]
237237 else [StringEntry(("currentBoard_" + gameId), board), StringEntry(("next_player_" + gameId), PLAYER)]
238238 }
239239 }
240240
241241
242242
243243 @Callable(i)
244244 func playTTT (game,board) = {
245245 let numberOfPayments = size(i.payments)
246246 if ((numberOfPayments != 1))
247247 then throw("Payment necessary!")
248248 else {
249249 let payment = i.payments[0]
250250 let fee = payment.amount
251251 let feeAssetId = payment.assetId
252252 let minFee = match getInteger(Address(fromBase58String(BAI_CONTRACT)), "price_tictactoe") {
253253 case n: Int =>
254254 n
255255 case _ =>
256256 0
257257 }
258258 if (if ((feeAssetId != BAI_ASSET_ID))
259259 then true
260260 else (minFee > fee))
261261 then throw("Payment of the minimal BAI amount necessary!")
262262 else {
263263 let sender = i.caller
264264 let gameId = if ((size(game) == 0))
265265 then toBase58String(i.transactionId)
266266 else game
267267 let nextPlayer = match getString(("next_player_" + gameId)) {
268268 case s: String =>
269269 s
270270 case _ =>
271271 PLAYER
272272 }
273273 if ((nextPlayer != PLAYER))
274274 then throw("AI hast to move first!")
275275 else {
276276 let currentBoard = match getString(("currentBoard_" + gameId)) {
277277 case s: String =>
278278 s
279279 case _ =>
280280 board
281281 }
282282 let initiator = match getString(("initiator_" + gameId)) {
283283 case s: String =>
284284 s
285285 case _ =>
286286 toString(sender)
287287 }
288288 if ((toString(sender) != initiator))
289289 then throw("Only initiator is allowed to make moves!")
290290 else {
291291 let moveOfPlayerIsValid = checkIfMoveIsValid(gameId, board)
292292 if (!(moveOfPlayerIsValid))
293293 then throw("Illegal move!")
294294 else {
295295 let playerHasWon = checkIfPlayerHasWon(gameId, board, PLAYER)
296296 let numberOfPossibleMoves = getPossibleMovesCount(board)
297297 if (playerHasWon)
298298 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "player"), ScriptTransfer(sender, WINNING_AMOUNT, BAI_ASSET_ID)]
299299 else if ((numberOfPossibleMoves == 0))
300300 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("winner_" + gameId), "draw")]
301301 else {
302302 let nextMove = invoke(Address(fromBase58String(BAI_CONTRACT)), "registerTaskCallback", [((gameId + "_") + board), "tictactoe", "callback"], [AttachedPayment(BAI_ASSET_ID, 10000000)])
303303 if ((nextMove == nextMove))
304304 then [StringEntry(("currentBoard_" + gameId), board), StringEntry(("initiator_" + gameId), toString(sender)), StringEntry(("winner_" + gameId), "none"), StringEntry(("next_player_" + gameId), AI)]
305305 else throw("Strict value is not equal to itself.")
306306 }
307307 }
308308 }
309309 }
310310 }
311311 }
312312 }
313313
314314
315315 @Verifier(tx)
316316 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
317317

github/deemru/w8io/026f985 
33.38 ms