tx · HuHAD4EcWTGEfkn7rJGHat1i9pJU6hMYFZJY1wouyVyp 3MxUatsqdn9o8DKxmh5vp6Y2vb3Zok12wrv: -0.01400000 Waves 2019.11.05 15:35 [751603] smart account 3MxUatsqdn9o8DKxmh5vp6Y2vb3Zok12wrv > SELF 0.00000000 Waves
{ "type": 13, "id": "HuHAD4EcWTGEfkn7rJGHat1i9pJU6hMYFZJY1wouyVyp", "fee": 1400000, "feeAssetId": null, "timestamp": 1572957441813, "version": 1, "sender": "3MxUatsqdn9o8DKxmh5vp6Y2vb3Zok12wrv", "senderPublicKey": "GyH41mG6hmFF9GeLfvkDzfZZ1CNGMNR4RMQFrxcHkS8k", "proofs": [ "2TjrcjKzkuaxDa9ZriS7YJCFMYEgUiMTG2UyAqytar8VyCBWHCzpP1TGH484UZCbMDEPs1mkMJKJhuZp2jQ1yUK7" ], "script": "base64:AAIDAAAAAAAAABAIARIAEgMKAQgSBQoDCAEBAAAAAAAAAAMAAAABaQEAAAAGY3JlYXRlAAAAAAQAAAADcG10CAUAAAABaQAAAAdwYXltZW50BAAAAAZhbW91bnQEAAAAByRtYXRjaDAFAAAAA3BtdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwCAUAAAABcAAAAAZhbW91bnQAAAAAAAAAAAAEAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAA3BtdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFwBQAAAAckbWF0Y2gwBAAAAAckbWF0Y2gxCAUAAAABcAAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gxAgAAAApCeXRlVmVjdG9yBAAAAAFiBQAAAAckbWF0Y2gxCQACWAAAAAEFAAAAAWICAAAABVdBVkVTAgAAAAR1bml0BAAAAAlpbml0Q2VsbHMJAAEsAAAAAgIAAABwbm5ubm5ubm5ubm5ubm5ubm5ub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c2ZlcnMAAAAAJtVVbw==", "chainId": 84, "height": 751603, "spentComplexity": 0 } View: original | compacted Prev: AEwWN74twFgRjD8wynqh9f8zWB2PmezyvW2UCaMTMt6F Next: 4FNAn1uTq1yUXueTwnJsP6qaq4o2EYTJw9pq3CRiPdrN Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | case p: AttachedPayment => | |
17 | 17 | match p.assetId { | |
18 | 18 | case b: ByteVector => | |
19 | - | b | |
19 | + | toBase58String(b) | |
20 | 20 | case _ => | |
21 | - | | |
21 | + | "WAVES" | |
22 | 22 | } | |
23 | 23 | case _ => | |
24 | - | | |
24 | + | "unit" | |
25 | 25 | } | |
26 | 26 | let initCells = ("nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" + "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn") | |
27 | 27 | let gameId = toBase58String(i.transactionId) | |
28 | 28 | let caller = toBase58String(i.caller.bytes) | |
29 | - | let data = (((((((((initCells + ":wait:") + caller) + ":unit:") + toString(amount)) + ":") + | |
30 | - | WriteSet([DataEntry(gameId, data)]) | |
29 | + | let data = (((((((((initCells + ":wait:") + caller) + ":unit:") + toString(amount)) + ":") + assetId) + ":") + caller) + ":1:unit") | |
30 | + | WriteSet([DataEntry(("game:" + gameId), data)]) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | 36 | func join (gameId) = { | |
37 | - | let data = valueOrErrorMessage(getString(this, gameId), "Invalid game id") | |
37 | + | let data = valueOrErrorMessage(getString(this, ("game:" + gameId)), "Invalid game id") | |
38 | 38 | let d = split(data, ":") | |
39 | 39 | if ((d[1] != "wait")) | |
40 | 40 | then throw("The game is already running or completed") | |
52 | 52 | case p: AttachedPayment => | |
53 | 53 | match p.assetId { | |
54 | 54 | case b: ByteVector => | |
55 | - | b | |
55 | + | toBase58String(b) | |
56 | 56 | case _ => | |
57 | - | | |
57 | + | "WAVES" | |
58 | 58 | } | |
59 | 59 | case _ => | |
60 | - | | |
60 | + | "WAVES" | |
61 | 61 | } | |
62 | 62 | if (if ((paymentAmount != parseInt(d[4]))) | |
63 | 63 | then true | |
64 | - | else (paymentAsset != | |
64 | + | else (paymentAsset != d[5])) | |
65 | 65 | then throw("Invalid game payment") | |
66 | 66 | else { | |
67 | 67 | let newData = ((((((((((((((d[0] + ":play:") + d[2]) + ":") + toBase58String(i.caller.bytes)) + ":") + d[4]) + ":") + d[5]) + ":") + d[6]) + ":") + d[7]) + ":") + d[8]) | |
68 | - | WriteSet([DataEntry(gameId, newData)]) | |
68 | + | WriteSet([DataEntry(("game:" + gameId), newData)]) | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func move (gameId,row,col) = { | |
77 | - | let data = valueOrErrorMessage(getString(this, gameId), "Invalid game id") | |
77 | + | let data = valueOrErrorMessage(getString(this, ("game:" + gameId)), "Invalid game id") | |
78 | 78 | let d = split(data, ":") | |
79 | 79 | let oldCells = d[0] | |
80 | 80 | let status = d[1] | |
81 | 81 | let player1 = addressFromStringValue(d[2]) | |
82 | 82 | let player2 = addressFromStringValue(d[3]) | |
83 | 83 | let amount = parseIntValue(d[4]) | |
84 | - | let asset = fromBase58String(d[5]) | |
84 | + | let asset = if ((d[5] == "WAVES")) | |
85 | + | then unit | |
86 | + | else fromBase58String(d[5]) | |
85 | 87 | let moveAddress = addressFromString(d[6]) | |
86 | 88 | let moveNumber = parseIntValue(d[7]) | |
87 | 89 | if (if ((i.caller != player1)) | |
239 | 241 | else toString((moveNumber + 1)))) + ":") + (if (win) | |
240 | 242 | then toBase58String(i.caller.bytes) | |
241 | 243 | else d[8])) | |
242 | - | let transferAsset = if ((asset == base58'')) | |
243 | - | then unit | |
244 | - | else asset | |
245 | - | let transfers = if (win) | |
246 | - | then [ScriptTransfer(i.caller, (amount * 2), transferAsset)] | |
247 | - | else if (filled) | |
248 | - | then [ScriptTransfer(player1, amount, transferAsset), ScriptTransfer(player2, amount, transferAsset)] | |
244 | + | let transfers = if (if (win) | |
245 | + | then (amount > 0) | |
246 | + | else false) | |
247 | + | then [ScriptTransfer(i.caller, (amount * 2), asset)] | |
248 | + | else if (if (filled) | |
249 | + | then (amount > 0) | |
250 | + | else false) | |
251 | + | then [ScriptTransfer(player1, amount, asset), ScriptTransfer(player2, amount, asset)] | |
249 | 252 | else nil | |
250 | - | ScriptResult(WriteSet([DataEntry(gameId, newData)]), TransferSet(transfers)) | |
253 | + | ScriptResult(WriteSet([DataEntry(("game:" + gameId), newData)]), TransferSet(transfers)) | |
251 | 254 | } | |
252 | 255 | } | |
253 | 256 | } |
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 | 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 | - | b | |
19 | + | toBase58String(b) | |
20 | 20 | case _ => | |
21 | - | | |
21 | + | "WAVES" | |
22 | 22 | } | |
23 | 23 | case _ => | |
24 | - | | |
24 | + | "unit" | |
25 | 25 | } | |
26 | 26 | let initCells = ("nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" + "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn") | |
27 | 27 | let gameId = toBase58String(i.transactionId) | |
28 | 28 | let caller = toBase58String(i.caller.bytes) | |
29 | - | let data = (((((((((initCells + ":wait:") + caller) + ":unit:") + toString(amount)) + ":") + | |
30 | - | WriteSet([DataEntry(gameId, data)]) | |
29 | + | let data = (((((((((initCells + ":wait:") + caller) + ":unit:") + toString(amount)) + ":") + assetId) + ":") + caller) + ":1:unit") | |
30 | + | WriteSet([DataEntry(("game:" + gameId), data)]) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | 36 | func join (gameId) = { | |
37 | - | let data = valueOrErrorMessage(getString(this, gameId), "Invalid game id") | |
37 | + | let data = valueOrErrorMessage(getString(this, ("game:" + gameId)), "Invalid game id") | |
38 | 38 | let d = split(data, ":") | |
39 | 39 | if ((d[1] != "wait")) | |
40 | 40 | then throw("The game is already running or completed") | |
41 | 41 | else if ((d[2] == toBase58String(i.caller.bytes))) | |
42 | 42 | then throw("You can't play with yourself") | |
43 | 43 | else { | |
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 | - | b | |
55 | + | toBase58String(b) | |
56 | 56 | case _ => | |
57 | - | | |
57 | + | "WAVES" | |
58 | 58 | } | |
59 | 59 | case _ => | |
60 | - | | |
60 | + | "WAVES" | |
61 | 61 | } | |
62 | 62 | if (if ((paymentAmount != parseInt(d[4]))) | |
63 | 63 | then true | |
64 | - | else (paymentAsset != | |
64 | + | else (paymentAsset != d[5])) | |
65 | 65 | then throw("Invalid game payment") | |
66 | 66 | else { | |
67 | 67 | let newData = ((((((((((((((d[0] + ":play:") + d[2]) + ":") + toBase58String(i.caller.bytes)) + ":") + d[4]) + ":") + d[5]) + ":") + d[6]) + ":") + d[7]) + ":") + d[8]) | |
68 | - | WriteSet([DataEntry(gameId, newData)]) | |
68 | + | WriteSet([DataEntry(("game:" + gameId), newData)]) | |
69 | 69 | } | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func move (gameId,row,col) = { | |
77 | - | let data = valueOrErrorMessage(getString(this, gameId), "Invalid game id") | |
77 | + | let data = valueOrErrorMessage(getString(this, ("game:" + gameId)), "Invalid game id") | |
78 | 78 | let d = split(data, ":") | |
79 | 79 | let oldCells = d[0] | |
80 | 80 | let status = d[1] | |
81 | 81 | let player1 = addressFromStringValue(d[2]) | |
82 | 82 | let player2 = addressFromStringValue(d[3]) | |
83 | 83 | let amount = parseIntValue(d[4]) | |
84 | - | let asset = fromBase58String(d[5]) | |
84 | + | let asset = if ((d[5] == "WAVES")) | |
85 | + | then unit | |
86 | + | else fromBase58String(d[5]) | |
85 | 87 | let moveAddress = addressFromString(d[6]) | |
86 | 88 | let moveNumber = parseIntValue(d[7]) | |
87 | 89 | if (if ((i.caller != player1)) | |
88 | 90 | then (i.caller != player2) | |
89 | 91 | else false) | |
90 | 92 | then throw("You aren't a game member") | |
91 | 93 | else if ((status != "play")) | |
92 | 94 | then throw("The game is not started or completed") | |
93 | 95 | else { | |
94 | 96 | let moveColor = if ((moveAddress == player1)) | |
95 | 97 | then "b" | |
96 | 98 | else if ((moveAddress == player2)) | |
97 | 99 | then "w" | |
98 | 100 | else throw("Invalid move address") | |
99 | 101 | if ((moveAddress != i.caller)) | |
100 | 102 | then throw("Not your turn") | |
101 | 103 | else if ((takeRight(take(oldCells, (((row * 15) + col) + 1)), 1) != "n")) | |
102 | 104 | then throw("The cell is occupied") | |
103 | 105 | else if (if (if (if ((row > 14)) | |
104 | 106 | then true | |
105 | 107 | else (0 > row)) | |
106 | 108 | then true | |
107 | 109 | else (col > 14)) | |
108 | 110 | then true | |
109 | 111 | else (0 > col)) | |
110 | 112 | then throw("Out of bounds") | |
111 | 113 | else { | |
112 | 114 | let cells = ((take(oldCells, ((row * 15) + col)) + moveColor) + takeRight(oldCells, (size(oldCells) - (((row * 15) + col) + 1)))) | |
113 | 115 | let targetLines = ((((((((((((((((((((((((((((((((((((if ((col >= 4)) | |
114 | 116 | then takeRight(take(cells, (((row * 15) + (col - 4)) + 1)), 1) | |
115 | 117 | else "") + (if ((col >= 3)) | |
116 | 118 | then takeRight(take(cells, (((row * 15) + (col - 3)) + 1)), 1) | |
117 | 119 | else "")) + (if ((col >= 2)) | |
118 | 120 | then takeRight(take(cells, (((row * 15) + (col - 2)) + 1)), 1) | |
119 | 121 | else "")) + (if ((col >= 1)) | |
120 | 122 | then takeRight(take(cells, (((row * 15) + (col - 1)) + 1)), 1) | |
121 | 123 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if ((13 >= col)) | |
122 | 124 | then takeRight(take(cells, (((row * 15) + (col + 1)) + 1)), 1) | |
123 | 125 | else "")) + (if ((12 >= col)) | |
124 | 126 | then takeRight(take(cells, (((row * 15) + (col + 2)) + 1)), 1) | |
125 | 127 | else "")) + (if ((11 >= col)) | |
126 | 128 | then takeRight(take(cells, (((row * 15) + (col + 3)) + 1)), 1) | |
127 | 129 | else "")) + (if ((10 >= col)) | |
128 | 130 | then takeRight(take(cells, (((row * 15) + (col + 4)) + 1)), 1) | |
129 | 131 | else "")) + (if ((row >= 4)) | |
130 | 132 | then takeRight(take(cells, ((((row - 4) * 15) + col) + 1)), 1) | |
131 | 133 | else "")) + (if ((row >= 3)) | |
132 | 134 | then takeRight(take(cells, ((((row - 3) * 15) + col) + 1)), 1) | |
133 | 135 | else "")) + (if ((row >= 2)) | |
134 | 136 | then takeRight(take(cells, ((((row - 2) * 15) + col) + 1)), 1) | |
135 | 137 | else "")) + (if ((row >= 1)) | |
136 | 138 | then takeRight(take(cells, ((((row - 1) * 15) + col) + 1)), 1) | |
137 | 139 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if ((13 >= row)) | |
138 | 140 | then takeRight(take(cells, ((((row + 1) * 15) + col) + 1)), 1) | |
139 | 141 | else "")) + (if ((12 >= row)) | |
140 | 142 | then takeRight(take(cells, ((((row + 2) * 15) + col) + 1)), 1) | |
141 | 143 | else "")) + (if ((11 >= row)) | |
142 | 144 | then takeRight(take(cells, ((((row + 3) * 15) + col) + 1)), 1) | |
143 | 145 | else "")) + (if ((10 >= row)) | |
144 | 146 | then takeRight(take(cells, ((((row + 4) * 15) + col) + 1)), 1) | |
145 | 147 | else "")) + (if (if ((row >= 4)) | |
146 | 148 | then (10 >= col) | |
147 | 149 | else false) | |
148 | 150 | then takeRight(take(cells, ((((row - 4) * 15) + (col + 4)) + 1)), 1) | |
149 | 151 | else "")) + (if (if ((row >= 3)) | |
150 | 152 | then (11 >= col) | |
151 | 153 | else false) | |
152 | 154 | then takeRight(take(cells, ((((row - 3) * 15) + (col + 3)) + 1)), 1) | |
153 | 155 | else "")) + (if (if ((row >= 2)) | |
154 | 156 | then (12 >= col) | |
155 | 157 | else false) | |
156 | 158 | then takeRight(take(cells, ((((row - 2) * 15) + (col + 2)) + 1)), 1) | |
157 | 159 | else "")) + (if (if ((row >= 1)) | |
158 | 160 | then (13 >= col) | |
159 | 161 | else false) | |
160 | 162 | then takeRight(take(cells, ((((row - 1) * 15) + (col + 1)) + 1)), 1) | |
161 | 163 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if (if ((13 >= row)) | |
162 | 164 | then (col >= 1) | |
163 | 165 | else false) | |
164 | 166 | then takeRight(take(cells, ((((row + 1) * 15) + (col - 1)) + 1)), 1) | |
165 | 167 | else "")) + (if (if ((12 >= row)) | |
166 | 168 | then (col >= 2) | |
167 | 169 | else false) | |
168 | 170 | then takeRight(take(cells, ((((row + 2) * 15) + (col - 2)) + 1)), 1) | |
169 | 171 | else "")) + (if (if ((11 >= row)) | |
170 | 172 | then (col >= 3) | |
171 | 173 | else false) | |
172 | 174 | then takeRight(take(cells, ((((row + 3) * 15) + (col - 3)) + 1)), 1) | |
173 | 175 | else "")) + (if (if ((10 >= row)) | |
174 | 176 | then (col >= 4) | |
175 | 177 | else false) | |
176 | 178 | then takeRight(take(cells, ((((row + 4) * 15) + (col - 4)) + 1)), 1) | |
177 | 179 | else "")) + (if (if ((row >= 4)) | |
178 | 180 | then (col >= 4) | |
179 | 181 | else false) | |
180 | 182 | then takeRight(take(cells, ((((row - 4) * 15) + (col - 4)) + 1)), 1) | |
181 | 183 | else "")) + (if (if ((row >= 3)) | |
182 | 184 | then (col >= 3) | |
183 | 185 | else false) | |
184 | 186 | then takeRight(take(cells, ((((row - 3) * 15) + (col - 3)) + 1)), 1) | |
185 | 187 | else "")) + (if (if ((row >= 2)) | |
186 | 188 | then (col >= 2) | |
187 | 189 | else false) | |
188 | 190 | then takeRight(take(cells, ((((row - 2) * 15) + (col - 2)) + 1)), 1) | |
189 | 191 | else "")) + (if (if ((row >= 1)) | |
190 | 192 | then (col >= 1) | |
191 | 193 | else false) | |
192 | 194 | then takeRight(take(cells, ((((row - 1) * 15) + (col - 1)) + 1)), 1) | |
193 | 195 | else "")) + takeRight(take(cells, (((row * 15) + col) + 1)), 1)) + (if (if ((13 >= row)) | |
194 | 196 | then (13 >= col) | |
195 | 197 | else false) | |
196 | 198 | then takeRight(take(cells, ((((row + 1) * 15) + (col + 1)) + 1)), 1) | |
197 | 199 | else "")) + (if (if ((12 >= row)) | |
198 | 200 | then (12 >= col) | |
199 | 201 | else false) | |
200 | 202 | then takeRight(take(cells, ((((row + 2) * 15) + (col + 2)) + 1)), 1) | |
201 | 203 | else "")) + (if (if ((11 >= row)) | |
202 | 204 | then (11 >= col) | |
203 | 205 | else false) | |
204 | 206 | then takeRight(take(cells, ((((row + 3) * 15) + (col + 3)) + 1)), 1) | |
205 | 207 | else "")) + (if (if ((10 >= row)) | |
206 | 208 | then (10 >= col) | |
207 | 209 | else false) | |
208 | 210 | then takeRight(take(cells, ((((row + 4) * 15) + (col + 4)) + 1)), 1) | |
209 | 211 | else "")) | |
210 | 212 | if (if ((moveColor != "b")) | |
211 | 213 | then (moveColor != "w") | |
212 | 214 | else false) | |
213 | 215 | then throw("invalid color in check function") | |
214 | 216 | else { | |
215 | 217 | let win = match indexOf(targetLines, ((((moveColor + moveColor) + moveColor) + moveColor) + moveColor)) { | |
216 | 218 | case _: Int => | |
217 | 219 | true | |
218 | 220 | case _ => | |
219 | 221 | false | |
220 | 222 | } | |
221 | 223 | let filled = (moveNumber == 225) | |
222 | 224 | let nextMoveAddress = if ((moveAddress == player1)) | |
223 | 225 | then player2 | |
224 | 226 | else if ((moveAddress == player2)) | |
225 | 227 | then player1 | |
226 | 228 | else throw("Invalid move address") | |
227 | 229 | let newData = ((((((((((((((((cells + ":") + (if (if (win) | |
228 | 230 | then true | |
229 | 231 | else filled) | |
230 | 232 | then "over" | |
231 | 233 | else d[1])) + ":") + d[2]) + ":") + d[3]) + ":") + d[4]) + ":") + d[5]) + ":") + (if (if (win) | |
232 | 234 | then true | |
233 | 235 | else filled) | |
234 | 236 | then d[6] | |
235 | 237 | else toString(nextMoveAddress))) + ":") + (if (if (win) | |
236 | 238 | then true | |
237 | 239 | else filled) | |
238 | 240 | then d[7] | |
239 | 241 | else toString((moveNumber + 1)))) + ":") + (if (win) | |
240 | 242 | then toBase58String(i.caller.bytes) | |
241 | 243 | else d[8])) | |
242 | - | let transferAsset = if ((asset == base58'')) | |
243 | - | then unit | |
244 | - | else asset | |
245 | - | let transfers = if (win) | |
246 | - | then [ScriptTransfer(i.caller, (amount * 2), transferAsset)] | |
247 | - | else if (filled) | |
248 | - | then [ScriptTransfer(player1, amount, transferAsset), ScriptTransfer(player2, amount, transferAsset)] | |
244 | + | let transfers = if (if (win) | |
245 | + | then (amount > 0) | |
246 | + | else false) | |
247 | + | then [ScriptTransfer(i.caller, (amount * 2), asset)] | |
248 | + | else if (if (filled) | |
249 | + | then (amount > 0) | |
250 | + | else false) | |
251 | + | then [ScriptTransfer(player1, amount, asset), ScriptTransfer(player2, amount, asset)] | |
249 | 252 | else nil | |
250 | - | ScriptResult(WriteSet([DataEntry(gameId, newData)]), TransferSet(transfers)) | |
253 | + | ScriptResult(WriteSet([DataEntry(("game:" + gameId), newData)]), TransferSet(transfers)) | |
251 | 254 | } | |
252 | 255 | } | |
253 | 256 | } | |
254 | 257 | } | |
255 | 258 | ||
256 | 259 |
github/deemru/w8io/026f985 59.81 ms ◑