tx · HvtF4Rksy4iaJiaFPFoinf1tPyXTGJCk6S35qithbssK 3N9yGpXQPPEBeY5b3vCyWgFApcs9rcm7YAx: -0.01000000 Waves 2019.02.11 19:06 [490699] smart account 3N9yGpXQPPEBeY5b3vCyWgFApcs9rcm7YAx > SELF 0.00000000 Waves
{ "type": 13, "id": "HvtF4Rksy4iaJiaFPFoinf1tPyXTGJCk6S35qithbssK", "fee": 1000000, "feeAssetId": null, "timestamp": 1549901205565, "version": 1, "sender": "3N9yGpXQPPEBeY5b3vCyWgFApcs9rcm7YAx", "senderPublicKey": "CTniH2L72YDCFEAxVf4ZaomRvfFuVDDEN1c5VHUKdbEZ", "proofs": [ "5V7YfMdSTmc5LgGCqWYixTzU96fyLEzh2SZH6EEoHn9dgKPNGeaXDtjuSLanQzuX9HA5Mb5SfzeTWKgXjmjE9F4P" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABHdhdmUAAAAAAAX14QAEAAAAA2JldAkAAGgAAAACAAAAAAAAAAABBQAAAAR3YXZlBAAAAA5zZXJ2aWNlQWRkcmVzcwkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM043b0Y1SjVtOUJ3QkZDbVZKWldyM0FFSDN1NGM2Q0xvQjkEAAAAEXNlcnZpY2VDb21taXNzaW9uCQAAaQAAAAIFAAAAA2JldAAAAAAAAAAAyAQAAAAEcm9jawEAAAABAAQAAAAFcGFwZXIBAAAAAQEEAAAACHNjaXNzb3JzAQAAAAECBAAAAARub25lCQAAAgAAAAECAAAAAAQAAAAHdGltZW91dAAAAAAAAAAADwQAAAAKcDFNb3ZlSGFzaAkBAAAAB2V4dHJhY3QAAAABCQAEHAAAAAIFAAAAAm1lAgAAAARwMW1oBAAAAAhtYXRjaEtleQkBAAAAB2V4dHJhY3QAAAABCQAEHAAAAAIFAAAAAm1lAgAAAAJtawQAAAAKcGxheWVyMUtleQkBAAAAB2V4dHJhY3QAAAABCQAEHAAAAAIF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CQAAyAAAAAEFAAAAAXcAAAAAAAAAAAEEAAAABndpbm5lcgMJAQAAAAEhAAAAAQUAAAAIbm9XaW5uZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAAXcFAAAAAnAxBAAAAAZsb29zZXIDCQAAAAAAAAIFAAAAAnAxBQAAAAZ3aW5uZXIFAAAAAnAyBQAAAAJwMQQAAAAJcHJpemVQb29sCQAAZQAAAAIJAABlAAAAAgkBAAAADHdhdmVzQmFsYW5jZQAAAAEFAAAAAm1lBQAAABFzZXJ2aWNlQ29tbWlzc2lvbggFAAAABnBheW91dAAAAANmZWUEAAAAC3BheW91dFZhbGlkAwMDCQAAAAAAAAIICQABkQAAAAIFAAAAAnB0AAAAAAAAAAABAAAACXJlY2lwaWVudAUAAAAGd2lubmVyCQAAAAAAAAIICQABkQAAAAIFAAAAAnB0AAAAAAAAAAABAAAABmFtb3VudAMFAAAACG5vV2lubmVyCQAAaQAAAAIFAAAACXByaXplUG9vbAAAAAAAAAAAAgUAAAAJcHJpemVQb29sBwkAAAAAAAACCAkAAZEAAAACBQAAAAJwdAAAAAAAAAAAAgAAAAlyZWNpcGllbnQFAAAABmxvb3NlcgcJAAAAAAAAAggJAAGRAAAAAgUAAAACcHQAAAAAAAAAAAIAAAAGYW1vdW50AwUAAAAIbm9XaW5uZXIJAABpAAAAAgUAAAAJcHJpemVQb29sAAAAAAAAAAACAAAAAAAAAAAABwMDAwkAAAAAAAACCAUAAAAGcGF5b3V0AAAAA2ZlZQAAAAAAAAw1AAkAAAAAAAACCAkAAZEAAAACBQAAAAJwdAAAAAAAAAAAAAAAAAlyZWNpcGllbnQFAAAADnNlcnZpY2VBZGRyZXNzBwkAAAAAAAACCAkAAZEAAAACBQAAAAJwdAAAAAAAAAAAAAAAAAZhbW91bnQFAAAAEXNlcnZpY2VDb21taXNzaW9uBwUAAAALcGF5b3V0VmFsaWQHB5nJ44A=", "chainId": 84, "height": 490699, "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 wave = 100000000 | |
5 | + | let bet = (1 * wave) | |
6 | + | let serviceAddress = addressFromString("3N7oF5J5m9BwBFCmVJZWr3AEH3u4c6CLoB9") | |
7 | + | let serviceCommission = (bet / 200) | |
8 | + | let rock = base58'1' | |
9 | + | let paper = base58'2' | |
10 | + | let scissors = base58'3' | |
11 | + | let none = throw("") | |
12 | + | let timeout = 15 | |
13 | + | let p1MoveHash = extract(getBinary(me, "p1mh")) | |
14 | + | let matchKey = extract(getBinary(me, "mk")) | |
15 | + | let player1Key = extract(getBinary(me, "p1k")) | |
16 | + | match tx { | |
17 | + | case data: DataTransaction => | |
18 | + | let dataValid = if (isDefined(getBinary(data.data, "p2p"))) | |
19 | + | then { | |
20 | + | let h = extract(getInteger(data.data, "h")) | |
21 | + | if (if (if (if (if ((size(data.data) == 4)) | |
22 | + | then ((height + 1) >= h) | |
23 | + | else false) | |
24 | + | then (h >= (height - 1)) | |
25 | + | else false) | |
26 | + | then !(isDefined(getBinary(me, "p2p"))) | |
27 | + | else false) | |
28 | + | then (size(extract(getBinary(data.data, "p2mh"))) == 32) | |
29 | + | else false) | |
30 | + | then match transactionById(extract(getBinary(data.data, "p2p"))) { | |
31 | + | case p2payment: TransferTransaction => | |
32 | + | if (if (if (if ((p2payment.amount == (1 * wave))) | |
33 | + | then (p2payment.recipient == me) | |
34 | + | else false) | |
35 | + | then (p2payment.senderPublicKey == extract(getBinary(data.data, "p2k"))) | |
36 | + | else false) | |
37 | + | then (p2payment.senderPublicKey != player1Key) | |
38 | + | else false) | |
39 | + | then !(isDefined(p2payment.assetId)) | |
40 | + | else false | |
41 | + | case _ => | |
42 | + | none | |
43 | + | } | |
44 | + | else false | |
45 | + | } | |
46 | + | else if (isDefined(getBinary(data.data, "p1m"))) | |
47 | + | then { | |
48 | + | let p1moves = take(extract(getBinary(data.data, "p1m")), 3) | |
49 | + | let p1m1 = take(p1moves, 1) | |
50 | + | let p1m2 = takeRightBytes(take(p1moves, 2), 1) | |
51 | + | let p1m3 = takeRightBytes(p1moves, 1) | |
52 | + | let err1 = if (if (if (if (if (if (if (if ((p1m1 != rock)) | |
53 | + | then (p1m1 != scissors) | |
54 | + | else false) | |
55 | + | then (p1m1 != paper) | |
56 | + | else false) | |
57 | + | then (p1m2 != rock) | |
58 | + | else false) | |
59 | + | then (p1m2 != scissors) | |
60 | + | else false) | |
61 | + | then (p1m2 != paper) | |
62 | + | else false) | |
63 | + | then (p1m3 != rock) | |
64 | + | else false) | |
65 | + | then (p1m3 != scissors) | |
66 | + | else false) | |
67 | + | then (p1m3 != paper) | |
68 | + | else false | |
69 | + | if (if (if (!(err1)) | |
70 | + | then !(isDefined(getBinary(me, "p1m"))) | |
71 | + | else false) | |
72 | + | then (size(data.data) == 1) | |
73 | + | else false) | |
74 | + | then (sha256(extract(getBinary(data.data, "p1m"))) == extract(getBinary(me, "p1mh"))) | |
75 | + | else false | |
76 | + | } | |
77 | + | else if (isDefined(getBinary(data.data, "p2m"))) | |
78 | + | then { | |
79 | + | let p2moves = take(extract(getBinary(data.data, "p2m")), 3) | |
80 | + | let p2m1 = take(p2moves, 1) | |
81 | + | let p2m2 = takeRightBytes(take(p2moves, 2), 1) | |
82 | + | let p2m3 = takeRightBytes(p2moves, 1) | |
83 | + | let err2 = if (if (if (if (if (if (if (if ((p2m1 != rock)) | |
84 | + | then (p2m1 != scissors) | |
85 | + | else false) | |
86 | + | then (p2m1 != paper) | |
87 | + | else false) | |
88 | + | then (p2m2 != rock) | |
89 | + | else false) | |
90 | + | then (p2m2 != scissors) | |
91 | + | else false) | |
92 | + | then (p2m2 != paper) | |
93 | + | else false) | |
94 | + | then (p2m3 != rock) | |
95 | + | else false) | |
96 | + | then (p2m3 != scissors) | |
97 | + | else false) | |
98 | + | then (p2m3 != paper) | |
99 | + | else false | |
100 | + | if (if (if (!(err2)) | |
101 | + | then !(isDefined(getBinary(me, "p2m"))) | |
102 | + | else false) | |
103 | + | then (size(data.data) == 1) | |
104 | + | else false) | |
105 | + | then (sha256(extract(getBinary(data.data, "p2m"))) == extract(getBinary(me, "p2mh"))) | |
106 | + | else false | |
107 | + | } | |
108 | + | else if (isDefined(getBinary(data.data, "w"))) | |
109 | + | then { | |
110 | + | let h = extract(getInteger(me, "h")) | |
111 | + | let p1moves = take(extract(getBinary(me, "p1m")), 3) | |
112 | + | let p2moves = take(extract(getBinary(me, "p2m")), 3) | |
113 | + | let p1m1 = take(p1moves, 1) | |
114 | + | let p2m1 = take(p2moves, 1) | |
115 | + | let p1m2 = takeRightBytes(take(p1moves, 2), 1) | |
116 | + | let p2m2 = takeRightBytes(take(p2moves, 2), 1) | |
117 | + | let p1m3 = takeRightBytes(p1moves, 1) | |
118 | + | let p2m3 = takeRightBytes(p2moves, 1) | |
119 | + | let score = (((if (if (if (if ((p1m1 == rock)) | |
120 | + | then (p2m1 == scissors) | |
121 | + | else false) | |
122 | + | then true | |
123 | + | else if ((p1m1 == paper)) | |
124 | + | then (p2m1 == rock) | |
125 | + | else false) | |
126 | + | then true | |
127 | + | else if ((p1m1 == scissors)) | |
128 | + | then (p2m1 == paper) | |
129 | + | else false) | |
130 | + | then 1 | |
131 | + | else if ((p1m1 == p2m1)) | |
132 | + | then 0 | |
133 | + | else -1) + (if (if (if (if ((p1m2 == rock)) | |
134 | + | then (p2m2 == scissors) | |
135 | + | else false) | |
136 | + | then true | |
137 | + | else if ((p1m2 == paper)) | |
138 | + | then (p2m2 == rock) | |
139 | + | else false) | |
140 | + | then true | |
141 | + | else if ((p1m2 == scissors)) | |
142 | + | then (p2m2 == paper) | |
143 | + | else false) | |
144 | + | then 1 | |
145 | + | else if ((p1m2 == p2m2)) | |
146 | + | then 0 | |
147 | + | else -1)) + (if (if (if (if ((p1m3 == rock)) | |
148 | + | then (p2m3 == scissors) | |
149 | + | else false) | |
150 | + | then true | |
151 | + | else if ((p1m3 == paper)) | |
152 | + | then (p2m3 == rock) | |
153 | + | else false) | |
154 | + | then true | |
155 | + | else if ((p1m3 == scissors)) | |
156 | + | then (p2m3 == paper) | |
157 | + | else false) | |
158 | + | then 1 | |
159 | + | else if ((p1m3 == p2m3)) | |
160 | + | then 0 | |
161 | + | else -1)) | |
162 | + | let winner = if (if (((height - h) > timeout)) | |
163 | + | then if (!(isDefined(getBinary(me, "p1m")))) | |
164 | + | then true | |
165 | + | else !(isDefined(getBinary(me, "p1m"))) | |
166 | + | else false) | |
167 | + | then if (if (!(isDefined(getBinary(me, "p1m")))) | |
168 | + | then !(isDefined(getBinary(me, "p1m"))) | |
169 | + | else false) | |
170 | + | then base58'1' | |
171 | + | else if (!(isDefined(getBinary(me, "p1m")))) | |
172 | + | then extract(getBinary(me, "p2k")) | |
173 | + | else player1Key | |
174 | + | else if ((score > 0)) | |
175 | + | then player1Key | |
176 | + | else if ((score == 0)) | |
177 | + | then base58'1' | |
178 | + | else extract(getBinary(me, "p2k")) | |
179 | + | if ((winner == extract(getBinary(data.data, "w")))) | |
180 | + | then (size(data.data) == 1) | |
181 | + | else false | |
182 | + | } | |
183 | + | else none | |
184 | + | dataValid | |
185 | + | case payout: MassTransferTransaction => | |
186 | + | let pt = payout.transfers | |
187 | + | let w = extract(getBinary(me, "w")) | |
188 | + | let p1 = addressFromPublicKey(player1Key) | |
189 | + | let p2 = addressFromPublicKey(extract(getBinary(me, "p2k"))) | |
190 | + | let noWinner = (size(w) == 1) | |
191 | + | let winner = if (!(noWinner)) | |
192 | + | then addressFromPublicKey(w) | |
193 | + | else p1 | |
194 | + | let looser = if ((p1 == winner)) | |
195 | + | then p2 | |
196 | + | else p1 | |
197 | + | let prizePool = ((wavesBalance(me) - serviceCommission) - payout.fee) | |
198 | + | let payoutValid = if (if (if ((pt[1].recipient == winner)) | |
199 | + | then (pt[1].amount == (if (noWinner) | |
200 | + | then (prizePool / 2) | |
201 | + | else prizePool)) | |
202 | + | else false) | |
203 | + | then (pt[2].recipient == looser) | |
204 | + | else false) | |
205 | + | then (pt[2].amount == (if (noWinner) | |
206 | + | then (prizePool / 2) | |
207 | + | else 0)) | |
208 | + | else false | |
209 | + | if (if (if ((payout.fee == 800000)) | |
210 | + | then (pt[0].recipient == serviceAddress) | |
211 | + | else false) | |
212 | + | then (pt[0].amount == serviceCommission) | |
213 | + | else false) | |
214 | + | then payoutValid | |
215 | + | else false | |
216 | + | case _ => | |
217 | + | false | |
218 | + | } |
github/deemru/w8io/026f985 21.56 ms ◑