tx · 3Kipi8SojfZffmAH1aaffTiDeUGtrai7TX2YYkgo2QPq 3Mwpu1wuygknW9T6Fiwey36EVgWHq3JA374: -0.01400000 Waves 2019.08.26 11:11 [647872] smart account 3Mwpu1wuygknW9T6Fiwey36EVgWHq3JA374 > SELF 0.00000000 Waves
{ "type": 13, "id": "3Kipi8SojfZffmAH1aaffTiDeUGtrai7TX2YYkgo2QPq", "fee": 1400000, "feeAssetId": null, "timestamp": 1566807070880, "version": 1, "sender": "3Mwpu1wuygknW9T6Fiwey36EVgWHq3JA374", "senderPublicKey": "DemU5FgQnMdjKkZvS84MvT6TSVu64wNaq8Dd8fQZRzcX", "proofs": [ "4ZPoRSiGSHnFwqzXkuxMh47aJC6PCBQoHRHCnbYq7apVnEGqdCbpinAp96JDHcKicopwbwVQy4f7c7oWJWfqdy3M" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAwAAAAFpAQAAAAZjcmVhdGUAAAAABAAAAANwbXQIBQAAAAFpAAAAB3BheW1lbnQEAAAABmFtb3VudAQAAAAHJG1hdGNoMAUAAAADcG10AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDAIBQAAAAFwAAAABmFtb3VudAAAAAAAAAAAAAQAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAADcG10AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9BdHRhY2hlZFBheW1lbnQEAAAAAXAFAAAAByRtYXRjaDAEAAAAByRtYXRjaDEIBQAAAAFwAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDEFAAAAAWIBAAAAAAEAAAAABAAAAAlpbml0Q2VsbHMJAAEsAAAAAgIAAABwbm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubm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ToJAAGkAAAAAQUAAAAGZ2FtZUlkAgAAAAxfbW92ZV9udW1iZXIJAABkAAAAAgUAAAAKbW92ZU51bWJlcgAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAICAAAABWdhbWU6CQABpAAAAAEFAAAABmdhbWVJZAIAAAANX21vdmVfYWRkcmVzcwkABCUAAAABBQAAAA9uZXh0TW92ZUFkZHJlc3MFAAAAA25pbAAAAABXD8EZ", "chainId": 84, "height": 647872, "spentComplexity": 0 } View: original | compacted Prev: 7TLLFrCRmc1MUAahE2P8LotaNYpVSxMZf19ksEAXANfx Next: CttuE8ENyQC5Xy9Kw5wbEHjvYHqDCS1JV2jBaKbyFyyR Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func | |
7 | + | func create () = { | |
8 | 8 | let pmt = i.payment | |
9 | 9 | let amount = match pmt { | |
10 | 10 | case p: AttachedPayment => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func | |
7 | + | func create () = { | |
8 | 8 | let pmt = i.payment | |
9 | 9 | let amount = match pmt { | |
10 | 10 | case p: AttachedPayment => | |
11 | 11 | p.amount | |
12 | 12 | case _ => | |
13 | 13 | 0 | |
14 | 14 | } | |
15 | 15 | let assetId = match pmt { | |
16 | 16 | case p: AttachedPayment => | |
17 | 17 | match p.assetId { | |
18 | 18 | case b: ByteVector => | |
19 | 19 | b | |
20 | 20 | case _ => | |
21 | 21 | base58'' | |
22 | 22 | } | |
23 | 23 | case _ => | |
24 | 24 | base58'' | |
25 | 25 | } | |
26 | 26 | let initCells = ("nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" + "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn") | |
27 | 27 | let games = valueOrErrorMessage(getInteger(this, "games"), "Invalid games number") | |
28 | 28 | let gameId = (games + 1) | |
29 | 29 | WriteSet([DataEntry("games", (games + 1)), DataEntry((("game:" + toString(gameId)) + "_cells"), initCells), DataEntry((("game:" + toString(gameId)) + "_status"), "wait"), DataEntry((("game:" + toString(gameId)) + "_player1_address"), toBase58String(i.caller.bytes)), DataEntry((("game:" + toString(gameId)) + "_player2_address"), "null"), DataEntry((("game:" + toString(gameId)) + "_payment_amount"), amount), DataEntry((("game:" + toString(gameId)) + "_payment_asset"), assetId), DataEntry((("game:" + toString(gameId)) + "_move_address"), toBase58String(i.caller.bytes)), DataEntry((("game:" + toString(gameId)) + "_move_number"), 1), DataEntry((("game:" + toString(gameId)) + "_winner"), "null")]) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func join (gameId) = { | |
36 | 36 | let gameStatus = valueOrErrorMessage(getString(this, (("game:" + toString(gameId)) + "_status")), "There is no game with the specified number") | |
37 | 37 | if ((gameStatus == "wait")) | |
38 | 38 | then { | |
39 | 39 | let player1 = getStringValue(this, (("game:" + toString(gameId)) + "_player1_address")) | |
40 | 40 | if ((toBase58String(i.caller.bytes) != player1)) | |
41 | 41 | then { | |
42 | 42 | let gameAmount = getIntegerValue(this, (("game:" + toString(gameId)) + "_payment_amount")) | |
43 | 43 | let gameAsset = getBinaryValue(this, (("game:" + toString(gameId)) + "_payment_asset")) | |
44 | 44 | let pmt = i.payment | |
45 | 45 | let paymentAmount = match pmt { | |
46 | 46 | case p: AttachedPayment => | |
47 | 47 | p.amount | |
48 | 48 | case _ => | |
49 | 49 | 0 | |
50 | 50 | } | |
51 | 51 | let paymentAsset = match pmt { | |
52 | 52 | case p: AttachedPayment => | |
53 | 53 | match p.assetId { | |
54 | 54 | case b: ByteVector => | |
55 | 55 | b | |
56 | 56 | case _ => | |
57 | 57 | base58'' | |
58 | 58 | } | |
59 | 59 | case _ => | |
60 | 60 | base58'' | |
61 | 61 | } | |
62 | 62 | if (if ((paymentAmount == gameAmount)) | |
63 | 63 | then (paymentAsset == gameAsset) | |
64 | 64 | else false) | |
65 | 65 | then WriteSet([DataEntry((("game:" + toString(gameId)) + "_status"), "play"), DataEntry((("game:" + toString(gameId)) + "_player2_address"), toBase58String(i.caller.bytes))]) | |
66 | 66 | else throw("Invalid game payment") | |
67 | 67 | } | |
68 | 68 | else throw("You can't play with yourself") | |
69 | 69 | } | |
70 | 70 | else throw("The game is already running or completed") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func move (gameId,row,col) = { | |
77 | 77 | let gameStatus = valueOrErrorMessage(getString(this, (("game:" + toString(gameId)) + "_status")), "There is no game with the specified number") | |
78 | 78 | let player1 = addressFromStringValue(getStringValue(this, (("game:" + toString(gameId)) + "_player1_address"))) | |
79 | 79 | let player2 = addressFromStringValue(getStringValue(this, (("game:" + toString(gameId)) + "_player2_address"))) | |
80 | 80 | if (if ((i.caller != player1)) | |
81 | 81 | then (i.caller != player2) | |
82 | 82 | else false) | |
83 | 83 | then throw() | |
84 | 84 | else if ((gameStatus != "play")) | |
85 | 85 | then throw("The game is not started or completed") | |
86 | 86 | else { | |
87 | 87 | let moveAddress = addressFromString(getStringValue(this, ((("game:" + toString(gameId)) + "_") + "_move_address"))) | |
88 | 88 | let moveColor = if ((moveAddress == player1)) | |
89 | 89 | then "b" | |
90 | 90 | else if ((moveAddress == player2)) | |
91 | 91 | then "w" | |
92 | 92 | else throw("Invalid move address") | |
93 | 93 | let moveNumber = getIntegerValue(this, (("game:" + toString(gameId)) + "_move_number")) | |
94 | 94 | let cells = valueOrErrorMessage(getString(this, (("game:" + toString(gameId)) + "_cells")), "Invalid cells number") | |
95 | 95 | if ((moveAddress != i.caller)) | |
96 | 96 | then throw("Not your turn") | |
97 | 97 | else if ((takeRight(take(cells, (((row * 15) + col) + 1)), 1) != "n")) | |
98 | 98 | then throw("The cell is occupied") | |
99 | 99 | else { | |
100 | 100 | let newCells = if (if (if (if ((row > 14)) | |
101 | 101 | then true | |
102 | 102 | else (0 > row)) | |
103 | 103 | then true | |
104 | 104 | else (col > 14)) | |
105 | 105 | then true | |
106 | 106 | else (0 > col)) | |
107 | 107 | then throw("Out of bounds") | |
108 | 108 | else ((take(cells, ((row * 15) + col)) + moveColor) + takeRight(cells, (size(cells) - (((row * 15) + col) + 1)))) | |
109 | 109 | let targetLines = ((((((((((((((((((((((((((((((((((((if ((col >= 4)) | |
110 | 110 | then takeRight(take(cells, (((row * 15) + (col - 4)) + 1)), 1) | |
111 | 111 | else "") + (if ((col >= 3)) | |
112 | 112 | then takeRight(take(cells, (((row * 15) + (col - 3)) + 1)), 1) | |
113 | 113 | else "")) + (if ((col >= 2)) | |
114 | 114 | then takeRight(take(cells, (((row * 15) + (col - 2)) + 1)), 1) | |
115 | 115 | else "")) + (if ((col >= 1)) | |
116 | 116 | then takeRight(take(cells, (((row * 15) + (col - 1)) + 1)), 1) | |
117 | 117 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if ((13 >= col)) | |
118 | 118 | then takeRight(take(cells, (((row * 15) + (col + 1)) + 1)), 1) | |
119 | 119 | else "")) + (if ((12 >= col)) | |
120 | 120 | then takeRight(take(cells, (((row * 15) + (col + 2)) + 1)), 1) | |
121 | 121 | else "")) + (if ((11 >= col)) | |
122 | 122 | then takeRight(take(cells, (((row * 15) + (col + 3)) + 1)), 1) | |
123 | 123 | else "")) + (if ((10 >= col)) | |
124 | 124 | then takeRight(take(cells, (((row * 15) + (col + 4)) + 1)), 1) | |
125 | 125 | else "")) + (if ((row >= 4)) | |
126 | 126 | then takeRight(take(cells, ((((row - 4) * 15) + col) + 1)), 1) | |
127 | 127 | else "")) + (if ((row >= 3)) | |
128 | 128 | then takeRight(take(cells, ((((row - 3) * 15) + col) + 1)), 1) | |
129 | 129 | else "")) + (if ((row >= 2)) | |
130 | 130 | then takeRight(take(cells, ((((row - 2) * 15) + col) + 1)), 1) | |
131 | 131 | else "")) + (if ((row >= 1)) | |
132 | 132 | then takeRight(take(cells, ((((row - 1) * 15) + col) + 1)), 1) | |
133 | 133 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if ((13 >= row)) | |
134 | 134 | then takeRight(take(cells, ((((row + 1) * 15) + col) + 1)), 1) | |
135 | 135 | else "")) + (if ((12 >= row)) | |
136 | 136 | then takeRight(take(cells, ((((row + 2) * 15) + col) + 1)), 1) | |
137 | 137 | else "")) + (if ((11 >= row)) | |
138 | 138 | then takeRight(take(cells, ((((row + 3) * 15) + col) + 1)), 1) | |
139 | 139 | else "")) + (if ((10 >= row)) | |
140 | 140 | then takeRight(take(cells, ((((row + 4) * 15) + col) + 1)), 1) | |
141 | 141 | else "")) + (if (if ((row >= 4)) | |
142 | 142 | then (10 >= col) | |
143 | 143 | else false) | |
144 | 144 | then takeRight(take(cells, ((((row - 4) * 15) + (col + 4)) + 1)), 1) | |
145 | 145 | else "")) + (if (if ((row >= 3)) | |
146 | 146 | then (11 >= col) | |
147 | 147 | else false) | |
148 | 148 | then takeRight(take(cells, ((((row - 3) * 15) + (col + 3)) + 1)), 1) | |
149 | 149 | else "")) + (if (if ((row >= 2)) | |
150 | 150 | then (12 >= col) | |
151 | 151 | else false) | |
152 | 152 | then takeRight(take(cells, ((((row - 2) * 15) + (col + 2)) + 1)), 1) | |
153 | 153 | else "")) + (if (if ((row >= 1)) | |
154 | 154 | then (13 >= col) | |
155 | 155 | else false) | |
156 | 156 | then takeRight(take(cells, ((((row - 1) * 15) + (col + 1)) + 1)), 1) | |
157 | 157 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if (if ((13 >= row)) | |
158 | 158 | then (col >= 1) | |
159 | 159 | else false) | |
160 | 160 | then takeRight(take(cells, ((((row + 1) * 15) + (col - 1)) + 1)), 1) | |
161 | 161 | else "")) + (if (if ((12 >= row)) | |
162 | 162 | then (col >= 2) | |
163 | 163 | else false) | |
164 | 164 | then takeRight(take(cells, ((((row + 2) * 15) + (col - 2)) + 1)), 1) | |
165 | 165 | else "")) + (if (if ((11 >= row)) | |
166 | 166 | then (col >= 3) | |
167 | 167 | else false) | |
168 | 168 | then takeRight(take(cells, ((((row + 3) * 15) + (col - 3)) + 1)), 1) | |
169 | 169 | else "")) + (if (if ((10 >= row)) | |
170 | 170 | then (col >= 4) | |
171 | 171 | else false) | |
172 | 172 | then takeRight(take(cells, ((((row + 4) * 15) + (col - 4)) + 1)), 1) | |
173 | 173 | else "")) + (if (if ((row >= 4)) | |
174 | 174 | then (col >= 4) | |
175 | 175 | else false) | |
176 | 176 | then takeRight(take(cells, ((((row - 4) * 15) + (col - 4)) + 1)), 1) | |
177 | 177 | else "")) + (if (if ((row >= 3)) | |
178 | 178 | then (col >= 3) | |
179 | 179 | else false) | |
180 | 180 | then takeRight(take(cells, ((((row - 3) * 15) + (col - 3)) + 1)), 1) | |
181 | 181 | else "")) + (if (if ((row >= 2)) | |
182 | 182 | then (col >= 2) | |
183 | 183 | else false) | |
184 | 184 | then takeRight(take(cells, ((((row - 2) * 15) + (col - 2)) + 1)), 1) | |
185 | 185 | else "")) + (if (if ((row >= 1)) | |
186 | 186 | then (col >= 1) | |
187 | 187 | else false) | |
188 | 188 | then takeRight(take(cells, ((((row - 1) * 15) + (col - 1)) + 1)), 1) | |
189 | 189 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if (if ((13 >= row)) | |
190 | 190 | then (13 >= col) | |
191 | 191 | else false) | |
192 | 192 | then takeRight(take(cells, ((((row + 1) * 15) + (col + 1)) + 1)), 1) | |
193 | 193 | else "")) + (if (if ((12 >= row)) | |
194 | 194 | then (12 >= col) | |
195 | 195 | else false) | |
196 | 196 | then takeRight(take(cells, ((((row + 2) * 15) + (col + 2)) + 1)), 1) | |
197 | 197 | else "")) + (if (if ((11 >= row)) | |
198 | 198 | then (11 >= col) | |
199 | 199 | else false) | |
200 | 200 | then takeRight(take(cells, ((((row + 3) * 15) + (col + 3)) + 1)), 1) | |
201 | 201 | else "")) + (if (if ((10 >= row)) | |
202 | 202 | then (10 >= col) | |
203 | 203 | else false) | |
204 | 204 | then takeRight(take(cells, ((((row + 4) * 15) + (col + 4)) + 1)), 1) | |
205 | 205 | else "")) | |
206 | 206 | let win = if (if ((moveColor != "b")) | |
207 | 207 | then (moveColor != "w") | |
208 | 208 | else false) | |
209 | 209 | then throw("invalid color in check function") | |
210 | 210 | else match indexOf(targetLines, ((((moveColor + moveColor) + moveColor) + moveColor) + moveColor)) { | |
211 | 211 | case _: Int => | |
212 | 212 | true | |
213 | 213 | case _ => | |
214 | 214 | false | |
215 | 215 | } | |
216 | 216 | let filled = (moveNumber == 225) | |
217 | 217 | let paymentAmount = getIntegerValue(this, (("game:" + toString(gameId)) + "_payment_amount")) | |
218 | 218 | let paymentAsset = fromBase58String(getStringValue(this, (("game:" + toString(gameId)) + "_payment_asset"))) | |
219 | 219 | if (win) | |
220 | 220 | then ScriptResult(WriteSet([DataEntry((("game:" + toString(gameId)) + "_status"), "over"), DataEntry((("game:" + toString(gameId)) + "_cells"), newCells), DataEntry((("game:" + toString(gameId)) + "_winner"), toBase58String(i.caller.bytes))]), TransferSet([if ((paymentAsset == base58'')) | |
221 | 221 | then ScriptTransfer(i.caller, (paymentAmount * 2), unit) | |
222 | 222 | else ScriptTransfer(i.caller, (paymentAmount * 2), paymentAsset)])) | |
223 | 223 | else if (filled) | |
224 | 224 | then ScriptResult(WriteSet([DataEntry((("game:" + toString(gameId)) + "_status"), "over"), DataEntry((("game:" + toString(gameId)) + "_cells"), newCells)]), TransferSet([if ((paymentAsset == base58'')) | |
225 | 225 | then ScriptTransfer(player1, paymentAmount, unit) | |
226 | 226 | else ScriptTransfer(player1, paymentAmount, paymentAsset), if ((paymentAsset == base58'')) | |
227 | 227 | then ScriptTransfer(player2, paymentAmount, unit) | |
228 | 228 | else ScriptTransfer(player2, paymentAmount, paymentAsset)])) | |
229 | 229 | else { | |
230 | 230 | let nextMoveAddress = if ((moveAddress == player1)) | |
231 | 231 | then player2 | |
232 | 232 | else if ((moveAddress == player2)) | |
233 | 233 | then player1 | |
234 | 234 | else throw("Invalid move address") | |
235 | 235 | WriteSet([DataEntry((("game:" + toString(gameId)) + "_cells"), newCells), DataEntry((("game:" + toString(gameId)) + "_move_number"), (moveNumber + 1)), DataEntry((("game:" + toString(gameId)) + "_move_address"), toString(nextMoveAddress))]) | |
236 | 236 | } | |
237 | 237 | } | |
238 | 238 | } | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 |
github/deemru/w8io/026f985 56.75 ms ◑