tx · GY5QQSYNA3fbaR6MUoNe79zZF663TiXWNSgdFfi7sTxG 3N37AzHpnP4p5zjS1DwMLGivWvnJhXML8Wx: -0.01000000 Waves 2019.02.05 17:02 [481809] smart account 3N37AzHpnP4p5zjS1DwMLGivWvnJhXML8Wx > SELF 0.00000000 Waves
{ "type": 13, "id": "GY5QQSYNA3fbaR6MUoNe79zZF663TiXWNSgdFfi7sTxG", "fee": 1000000, "feeAssetId": null, "timestamp": 1549375482093, "version": 1, "sender": "3N37AzHpnP4p5zjS1DwMLGivWvnJhXML8Wx", "senderPublicKey": "8sah2nVjkT6fjNfsQhRSkrCgry6KMC2HWx3pdwaNseek", "proofs": [ "2BqmALCedcuUA2XNQP4RfcanjJkjTSQQEBnb9JCkfYXfe3L6RbvW7bHKmmwq65jAoSywyHywsvNAjgbvTWkuWVxu" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAADnNlcnZpY2VBZGRyZXNzCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTjdvRjVKNW05QndCRkNtVkpaV3IzQUVIM3U0YzZDTG9COQQAAAAJaGVpZ2h0S2V5AgAAAAZoZWlnaHQEAAAACnBsYXllcjJLZXkCAAAACnBsYXllcjJLZXkEAAAADXBsYXllcjFLZXlLZXkCAAAACnBsYXllcjFLZXkEAAAADXAxTW92ZUhhc2hLZXkCAAAACnAxTW92ZUhhc2gEAAAAC21hdGNoS2V5S2V5AgAAAAhtYXRjaEtleQQAAAAKcGF5bWVudEtleQIAAAAHcGF5bWVudAQAAAAGc3RhZ2UxAgAAAApwMk1vdmVIYXNoBAAAAAZzdGFnZTICAAAABnAyTW92ZQQAAAAGc3RhZ2UzAgAAAAZwMU1vdmUEAAAABHdhdmUAAAAAAAX14QAEAAAAB2dhbWVCZXQJAABoAAAAAgAAAAAAAAAAAQUAAAAEd2F2ZQQAAAARc2VydmljZUNvbW1pc3Npb24JAABpAAAAAgUAAAAHZ2FtZUJldAAAAA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c3NGcm9tUHVibGljS2V5AAAAAQkBAAAAB2V4dHJhY3QAAAABCQAEHAAAAAIFAAAAAm1lBQAAAApwbGF5ZXIyS2V5BAAAAAtwYXlvdXRWYWxpZAMDBQAAABh3YWl0aW5nVG9vTG9uZ0ZvclBsYXllcjEJAAAAAAAAAggJAAGRAAAAAggFAAAABnBheW91dAAAAAl0cmFuc2ZlcnMAAAAAAAAAAAEAAAAJcmVjaXBpZW50BQAAAAJwMgcGAwkAAAAAAAACBQAAAAVzY29yZQAAAAAAAAAAAAMDAwkAAAAAAAACCQABkAAAAAEIBQAAAAZwYXlvdXQAAAAJdHJhbnNmZXJzAAAAAAAAAAADCQAAAAAAAAIICQABkQAAAAIIBQAAAAZwYXlvdXQAAAAJdHJhbnNmZXJzAAAAAAAAAAABAAAABmFtb3VudAgJAAGRAAAAAggFAAAABnBheW91dAAAAAl0cmFuc2ZlcnMAAAAAAAAAAAIAAAAGYW1vdW50BwkAAAAAAAACCAkAAZEAAAACCAUAAAAGcGF5b3V0AAAACXRyYW5zZmVycwAAAAAAAAAAAQAAAAlyZWNpcGllbnQFAAAAAnAxBwkAAAAAAAACCAkAAZEAAAACCAUAAAAGcGF5b3V0AAAACXRyYW5zZmVycwAAAAAAAAAAAgAAAAlyZWNpcGllbnQFAAAAAnAyBwMJAAAAAAAAAgkAAZAAAAABCAUAAAAGcGF5b3V0AAAACXRyYW5zZmVycwAAAAAAAAAAAgkAAAAAAAACCAkAAZEAAAACCAUAAAAGcGF5b3V0AAAACXRyYW5zZmVycwAAAAAAAAAAAQAAAAlyZWNpcGllbnQDCQAAZgAAAAIFAAAABXNjb3JlAAAAAAAAAAAABQAAAAJwMQUAAAACcDIHAwMFAAAACGZlZVZhbGlkBQAAABRpc0NvbW1pc3Npb25JbmNsdWRlZAcFAAAAC3BheW91dFZhbGlkBwf4PIEk", "chainId": 84, "height": 481809, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 1 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let me = tx.sender | |
4 | + | let serviceAddress = addressFromString("3N7oF5J5m9BwBFCmVJZWr3AEH3u4c6CLoB9") | |
5 | + | let heightKey = "height" | |
6 | + | let player2Key = "player2Key" | |
7 | + | let player1KeyKey = "player1Key" | |
8 | + | let p1MoveHashKey = "p1MoveHash" | |
9 | + | let matchKeyKey = "matchKey" | |
10 | + | let paymentKey = "payment" | |
11 | + | let stage1 = "p2MoveHash" | |
12 | + | let stage2 = "p2Move" | |
13 | + | let stage3 = "p1Move" | |
14 | + | let wave = 100000000 | |
15 | + | let gameBet = (1 * wave) | |
16 | + | let serviceCommission = (gameBet / 200) | |
17 | + | let rock = base58'1' | |
18 | + | let paper = base58'2' | |
19 | + | let scissors = base58'3' | |
20 | + | let player2ReservationTimeout = 3 | |
21 | + | let player1RevealTimeout = 4 | |
22 | + | let p1MoveHash = extract(getBinary(me, p1MoveHashKey)) | |
23 | + | let matchKey = extract(getBinary(me, matchKeyKey)) | |
24 | + | let player1Key = extract(getBinary(me, player1KeyKey)) | |
25 | + | match tx { | |
26 | + | case dataTx: DataTransaction => | |
27 | + | let feeValid = (dataTx.fee == 500000) | |
28 | + | let payloadValid = if (isDefined(getBinary(dataTx.data, stage1))) | |
29 | + | then { | |
30 | + | let h = extract(getInteger(dataTx.data, heightKey)) | |
31 | + | let hasValidReservation = if (isDefined(getInteger(me, heightKey))) | |
32 | + | then (player2ReservationTimeout >= (height - extract(getInteger(me, heightKey)))) | |
33 | + | else false | |
34 | + | let hasPlayer2MoveRevealed = isDefined(getBinary(me, stage2)) | |
35 | + | let heightValid = if (((height + 1) >= h)) | |
36 | + | then (h >= (height - 1)) | |
37 | + | else false | |
38 | + | let isPlayer2KeyDefined = isDefined(getBinary(dataTx.data, player2Key)) | |
39 | + | let sizeValid = (size(dataTx.data) == 3) | |
40 | + | if (if (if (if (!(hasValidReservation)) | |
41 | + | then !(hasPlayer2MoveRevealed) | |
42 | + | else false) | |
43 | + | then heightValid | |
44 | + | else false) | |
45 | + | then isPlayer2KeyDefined | |
46 | + | else false) | |
47 | + | then sizeValid | |
48 | + | else false | |
49 | + | } | |
50 | + | else if (isDefined(getBinary(dataTx.data, stage2))) | |
51 | + | then { | |
52 | + | let p2MoveHash = extract(getBinary(me, stage1)) | |
53 | + | let player2RevealedMoves = isDefined(getBinary(me, stage2)) | |
54 | + | let sizeValid = (size(dataTx.data) == 2) | |
55 | + | let hashValid = (sha256(extract(getBinary(dataTx.data, stage2))) == p2MoveHash) | |
56 | + | let paymentValid = match transactionById(extract(getBinary(dataTx.data, paymentKey))) { | |
57 | + | case p2payment: TransferTransaction => | |
58 | + | if (if (if (if (if ((sha256(p2payment.attachment) == p2MoveHash)) | |
59 | + | then (p2payment.amount == (1 * wave)) | |
60 | + | else false) | |
61 | + | then (p2payment.recipient == me) | |
62 | + | else false) | |
63 | + | then (p2payment.senderPublicKey == extract(getBinary(me, player2Key))) | |
64 | + | else false) | |
65 | + | then !(isDefined(p2payment.assetId)) | |
66 | + | else false) | |
67 | + | then sigVerify(p2payment.bodyBytes, p2payment.proofs[0], p2payment.senderPublicKey) | |
68 | + | else false | |
69 | + | case _ => | |
70 | + | false | |
71 | + | } | |
72 | + | if (if (if (!(player2RevealedMoves)) | |
73 | + | then hashValid | |
74 | + | else false) | |
75 | + | then sizeValid | |
76 | + | else false) | |
77 | + | then paymentValid | |
78 | + | else false | |
79 | + | } | |
80 | + | else if (isDefined(getBinary(dataTx.data, stage3))) | |
81 | + | then { | |
82 | + | let player1RevealedMoves = isDefined(getBinary(me, stage3)) | |
83 | + | let sizeValid = (size(dataTx.data) == 1) | |
84 | + | let proofValid = (size(extract(getBinary(dataTx.data, stage3))) == 32) | |
85 | + | let hashValid = (sha256(extract(getBinary(dataTx.data, stage3))) == extract(getBinary(me, p1MoveHashKey))) | |
86 | + | if (if (if (!(player1RevealedMoves)) | |
87 | + | then sizeValid | |
88 | + | else false) | |
89 | + | then proofValid | |
90 | + | else false) | |
91 | + | then hashValid | |
92 | + | else false | |
93 | + | } | |
94 | + | else false | |
95 | + | if (feeValid) | |
96 | + | then payloadValid | |
97 | + | else false | |
98 | + | case payout: MassTransferTransaction => | |
99 | + | let isCommissionIncluded = if ((payout.transfers[0].recipient == serviceAddress)) | |
100 | + | then (payout.transfers[0].amount == serviceCommission) | |
101 | + | else false | |
102 | + | let feeValid = if (if ((payout.transferCount == 2)) | |
103 | + | then (600000 >= payout.fee) | |
104 | + | else false) | |
105 | + | then true | |
106 | + | else if ((payout.transferCount == 3)) | |
107 | + | then (700000 >= payout.fee) | |
108 | + | else false | |
109 | + | let player1RevealedMoves = isDefined(getBinary(me, stage3)) | |
110 | + | let waitingTooLongForPlayer1 = if (((height - extract(getInteger(me, heightKey))) > player1RevealTimeout)) | |
111 | + | then !(player1RevealedMoves) | |
112 | + | else false | |
113 | + | let p1moves = take(extract(getBinary(me, stage3)), 3) | |
114 | + | let p2moves = take(extract(getBinary(me, stage2)), 3) | |
115 | + | let p1m1 = take(p1moves, 1) | |
116 | + | let p2m1 = take(p2moves, 1) | |
117 | + | let p1m2 = takeRightBytes(take(p1moves, 2), 1) | |
118 | + | let p2m2 = takeRightBytes(take(p2moves, 2), 1) | |
119 | + | let p1m3 = takeRightBytes(p1moves, 1) | |
120 | + | let p2m3 = takeRightBytes(p2moves, 1) | |
121 | + | let round1 = if (if (if (if ((p1m1 == rock)) | |
122 | + | then (p2m1 == scissors) | |
123 | + | else false) | |
124 | + | then true | |
125 | + | else if ((p1m1 == paper)) | |
126 | + | then (p2m1 == rock) | |
127 | + | else false) | |
128 | + | then true | |
129 | + | else if ((p1m1 == scissors)) | |
130 | + | then (p2m1 == paper) | |
131 | + | else false) | |
132 | + | then 1 | |
133 | + | else if ((p1m1 == p2m1)) | |
134 | + | then 0 | |
135 | + | else -1 | |
136 | + | let round2 = if (if (if (if ((p1m2 == rock)) | |
137 | + | then (p2m2 == scissors) | |
138 | + | else false) | |
139 | + | then true | |
140 | + | else if ((p1m2 == paper)) | |
141 | + | then (p2m2 == rock) | |
142 | + | else false) | |
143 | + | then true | |
144 | + | else if ((p1m2 == scissors)) | |
145 | + | then (p2m2 == paper) | |
146 | + | else false) | |
147 | + | then 1 | |
148 | + | else if ((p1m2 == p2m2)) | |
149 | + | then 0 | |
150 | + | else -1 | |
151 | + | let round3 = if (if (if (if ((p1m3 == rock)) | |
152 | + | then (p2m3 == scissors) | |
153 | + | else false) | |
154 | + | then true | |
155 | + | else if ((p1m3 == paper)) | |
156 | + | then (p2m3 == rock) | |
157 | + | else false) | |
158 | + | then true | |
159 | + | else if ((p1m3 == scissors)) | |
160 | + | then (p2m3 == paper) | |
161 | + | else false) | |
162 | + | then 1 | |
163 | + | else if ((p1m3 == p2m3)) | |
164 | + | then 0 | |
165 | + | else -1 | |
166 | + | let score = ((round1 + round2) + round3) | |
167 | + | let p1 = addressFromPublicKey(player1Key) | |
168 | + | let p2 = addressFromPublicKey(extract(getBinary(me, player2Key))) | |
169 | + | let payoutValid = if (if (waitingTooLongForPlayer1) | |
170 | + | then (payout.transfers[1].recipient == p2) | |
171 | + | else false) | |
172 | + | then true | |
173 | + | else if ((score == 0)) | |
174 | + | then if (if (if ((size(payout.transfers) == 3)) | |
175 | + | then (payout.transfers[1].amount == payout.transfers[2].amount) | |
176 | + | else false) | |
177 | + | then (payout.transfers[1].recipient == p1) | |
178 | + | else false) | |
179 | + | then (payout.transfers[2].recipient == p2) | |
180 | + | else false | |
181 | + | else if ((size(payout.transfers) == 2)) | |
182 | + | then (payout.transfers[1].recipient == (if ((score > 0)) | |
183 | + | then p1 | |
184 | + | else p2)) | |
185 | + | else false | |
186 | + | if (if (feeValid) | |
187 | + | then isCommissionIncluded | |
188 | + | else false) | |
189 | + | then payoutValid | |
190 | + | else false | |
191 | + | case _ => | |
192 | + | false | |
193 | + | } |
github/deemru/w8io/026f985 19.48 ms ◑