tx · 6JBJxK2QCMsCr3kMn3sa6GJbz2gsGduF5G65GsE5ya2Q 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f: -0.01400000 Waves 2018.10.12 11:11 [372134] smart account 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f > SELF 0.00000000 Waves
{ "type": 13, "id": "6JBJxK2QCMsCr3kMn3sa6GJbz2gsGduF5G65GsE5ya2Q", "fee": 1400000, "feeAssetId": null, "timestamp": 1539331904167, "version": 1, "sender": "3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f", "senderPublicKey": "4BRdUi95rN89kRWamqTcb9Dj9pLpAQbjLt17MPxcgGhG", "proofs": [ "3tyK9YJeU88rCLay4n9aGsqeHJfNo4QavJ4P5yePY6Y1dXsziwT9avFMeYb2KjCqXkoThmVUK4v8dVz6WYW1HEft" ], "script": "base64:AQQAAAAJcmVkUHViS2V5AQAAACCcvkAYXSO2dto8Bjx/Z65U0bGrFY5cIkLHdfY5mFVSDwQAAAALZ3JlZW5QdWJLZXkBAAAAIPlfPeSXGejVVO8XgpF607z8UJ46ZmmLUq4Rq0R8IFM8BAAAAApibHVlUHViS2V5AQAAACA97ajD767lxQiKGSbQ60FmHM7Nfb7azWSBD/TaFp3/QAQAAAAHcmVkQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGfSoosyZxu2GPr01RED4+I9rSQ9LlF8XgQAAAAJZ3JlZW5BZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUeYFF8qf7pD+lzgJaCmi860XRkyZFP24HBAAAAAhibHVlQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEG1BP9MronfM5Ad2fldCE7DdHowHHByOQQAAAAIY29udHJhY3QIBQAAAAJ0eAAAAAZzZW5kZXIEAAAACXJlZFNpZ25lZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAA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AAAAhkYXRhU2l6ZQAAAAAAAAAADAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADbnR4BQAAAAckbWF0Y2gwBgYsTw82", "chainId": 84, "height": 372134, "spentComplexity": 0 } View: original | compacted Prev: 6FyW9dBsVQ7MvhaxWvTAozLTMzh347naFJZ63knUdx7q Next: 4JgYXnTj52Ak97j1jYyAR6QfwjGqVT1Af96jaEsrx2kw Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | let dataSize = size(ttx.data) | |
16 | 16 | let fromKey = ttx.data[0].key | |
17 | 17 | let toKey = ttx.data[1].key | |
18 | - | let | |
19 | - | let | |
18 | + | let newTurnFromKey = ttx.data[2].key | |
19 | + | let turnToKey = ttx.data[3].key | |
20 | 20 | let newFromUnits = ttx.data[0].value | |
21 | 21 | let newToUnits = ttx.data[1].value | |
22 | - | let | |
23 | - | let | |
22 | + | let newTurnFromValue = ttx.data[2].value | |
23 | + | let turnToValue = ttx.data[3].value | |
24 | 24 | let turnCorrect = if (if (if (if (if (if (if (if (if (if (if (if ((fromKey == "country1")) | |
25 | 25 | then (toKey == "country2") | |
26 | 26 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let redPubKey = base58'BYrrqVpD5uuz7cndnPwuUxuYFUK6Bovu6yfoV8seY6Px' | |
4 | 4 | let greenPubKey = base58'HnSkSntD7ihFgZpLNmHgdVnVmCYxJLC96eNbubTXsWju' | |
5 | 5 | let bluePubKey = base58'5Ak4HQK3cnkwe6XVUXwpCYeSAARwruKyAmsmegePUPvo' | |
6 | 6 | let redAddr = Address(base58'3MyP3hrK8SBvtXtggNWdsry8KuGdrv1sFrV') | |
7 | 7 | let greenAddr = Address(base58'3MzzYQCC8Ks86exHaWV2VpaANbNLPRDunNJ') | |
8 | 8 | let blueAddr = Address(base58'3MuuWYr3DyjEkncbNU1tUeFbyvcyZng9gz4') | |
9 | 9 | let contract = tx.sender | |
10 | 10 | let redSigned = sigVerify(tx.bodyBytes, tx.proofs[0], redPubKey) | |
11 | 11 | let greenSigned = sigVerify(tx.bodyBytes, tx.proofs[0], greenPubKey) | |
12 | 12 | let blueSigned = sigVerify(tx.bodyBytes, tx.proofs[0], bluePubKey) | |
13 | 13 | match tx { | |
14 | 14 | case ttx: DataTransaction => | |
15 | 15 | let dataSize = size(ttx.data) | |
16 | 16 | let fromKey = ttx.data[0].key | |
17 | 17 | let toKey = ttx.data[1].key | |
18 | - | let | |
19 | - | let | |
18 | + | let newTurnFromKey = ttx.data[2].key | |
19 | + | let turnToKey = ttx.data[3].key | |
20 | 20 | let newFromUnits = ttx.data[0].value | |
21 | 21 | let newToUnits = ttx.data[1].value | |
22 | - | let | |
23 | - | let | |
22 | + | let newTurnFromValue = ttx.data[2].value | |
23 | + | let turnToValue = ttx.data[3].value | |
24 | 24 | let turnCorrect = if (if (if (if (if (if (if (if (if (if (if (if ((fromKey == "country1")) | |
25 | 25 | then (toKey == "country2") | |
26 | 26 | else false) | |
27 | 27 | then true | |
28 | 28 | else if ((fromKey == "country2")) | |
29 | 29 | then if ((toKey == "country1")) | |
30 | 30 | then true | |
31 | 31 | else (toKey == "country3") | |
32 | 32 | else false) | |
33 | 33 | then true | |
34 | 34 | else if ((fromKey == "country3")) | |
35 | 35 | then if (if ((toKey == "country2")) | |
36 | 36 | then true | |
37 | 37 | else (toKey == "country4")) | |
38 | 38 | then true | |
39 | 39 | else (toKey == "country5") | |
40 | 40 | else false) | |
41 | 41 | then true | |
42 | 42 | else if ((fromKey == "country4")) | |
43 | 43 | then if ((toKey == "country3")) | |
44 | 44 | then true | |
45 | 45 | else (toKey == "country8") | |
46 | 46 | else false) | |
47 | 47 | then true | |
48 | 48 | else if ((fromKey == "country5")) | |
49 | 49 | then if ((toKey == "country3")) | |
50 | 50 | then true | |
51 | 51 | else (toKey == "country10") | |
52 | 52 | else false) | |
53 | 53 | then true | |
54 | 54 | else if ((fromKey == "country6")) | |
55 | 55 | then (toKey == "country7") | |
56 | 56 | else false) | |
57 | 57 | then true | |
58 | 58 | else if ((fromKey == "country7")) | |
59 | 59 | then if ((toKey == "country6")) | |
60 | 60 | then true | |
61 | 61 | else (toKey == "country8") | |
62 | 62 | else false) | |
63 | 63 | then true | |
64 | 64 | else if ((fromKey == "country8")) | |
65 | 65 | then if (if ((toKey == "country4")) | |
66 | 66 | then true | |
67 | 67 | else (toKey == "country7")) | |
68 | 68 | then true | |
69 | 69 | else (toKey == "country9") | |
70 | 70 | else false) | |
71 | 71 | then true | |
72 | 72 | else if ((fromKey == "country9")) | |
73 | 73 | then if ((toKey == "country8")) | |
74 | 74 | then true | |
75 | 75 | else (toKey == "country10") | |
76 | 76 | else false) | |
77 | 77 | then true | |
78 | 78 | else if ((fromKey == "country10")) | |
79 | 79 | then if (if ((toKey == "country5")) | |
80 | 80 | then true | |
81 | 81 | else (toKey == "country10")) | |
82 | 82 | then true | |
83 | 83 | else (toKey == "country11") | |
84 | 84 | else false) | |
85 | 85 | then true | |
86 | 86 | else if ((fromKey == "country11")) | |
87 | 87 | then if ((toKey == "country10")) | |
88 | 88 | then true | |
89 | 89 | else (toKey == "country12") | |
90 | 90 | else false) | |
91 | 91 | then true | |
92 | 92 | else if ((fromKey == "country12")) | |
93 | 93 | then (toKey == "country11") | |
94 | 94 | else false | |
95 | 95 | let turnFromKey = ("turn_" + fromKey) | |
96 | 96 | let turnFromValue = extract(getInteger(contract, turnFromKey)) | |
97 | 97 | let turnAllowed = if (if (((height - 2) > turnFromValue)) | |
98 | 98 | then (turnFromKey == newTurnFromKey) | |
99 | 99 | else false) | |
100 | 100 | then (newTurnFromValue == height) | |
101 | 101 | else false | |
102 | 102 | let oldTurnToKey = ("turn_" + toKey) | |
103 | 103 | let oldTurnToValue = extract(getInteger(contract, oldTurnToKey)) | |
104 | 104 | let locked = if ((("turn_" + toKey) == turnToKey)) | |
105 | 105 | then (turnToValue == height) | |
106 | 106 | else false | |
107 | 107 | let lockNotChanged = if ((("turn_" + toKey) == turnToKey)) | |
108 | 108 | then (turnToValue == oldTurnToValue) | |
109 | 109 | else false | |
110 | 110 | let fromUnits = extract(getInteger(contract, fromKey)) | |
111 | 111 | let toUnits = extract(getInteger(contract, toKey)) | |
112 | 112 | let redAttackers = (fromUnits % 100) | |
113 | 113 | let greenAttackers = (((fromUnits - redAttackers) % 10000) / 100) | |
114 | 114 | let blueAttackers = (((fromUnits - (greenAttackers * 100)) - redAttackers) / 10000) | |
115 | 115 | let redDefenders = (toUnits % 100) | |
116 | 116 | let greenDefenders = (((toUnits - redDefenders) % 10000) / 100) | |
117 | 117 | let blueDefenders = ((((toUnits - (greenDefenders * 100)) - redDefenders) % 1000000) / 10000) | |
118 | 118 | let whiteDefenders = ((((toUnits - (blueDefenders * 10000)) - (greenDefenders * 100)) - redDefenders) / 1000000) | |
119 | 119 | let countryAttackers = ((redAttackers + greenAttackers) + blueAttackers) | |
120 | 120 | let countryDefenders = ((redDefenders + greenDefenders) + blueDefenders) | |
121 | 121 | let unlimitedAttackers = (((redAttackers + greenAttackers) + blueAttackers) + (height - turnFromValue)) | |
122 | 122 | let unlimitedDefenders = (((redDefenders + greenDefenders) + blueDefenders) + (height - oldTurnToValue)) | |
123 | 123 | let attackers = if ((unlimitedAttackers >= 10)) | |
124 | 124 | then 10 | |
125 | 125 | else unlimitedAttackers | |
126 | 126 | let defenders = if ((unlimitedDefenders >= 10)) | |
127 | 127 | then 10 | |
128 | 128 | else unlimitedDefenders | |
129 | 129 | let king = if (if (if ((redAttackers > 0)) | |
130 | 130 | then redSigned | |
131 | 131 | else false) | |
132 | 132 | then true | |
133 | 133 | else if ((greenAttackers > 0)) | |
134 | 134 | then greenSigned | |
135 | 135 | else false) | |
136 | 136 | then true | |
137 | 137 | else if ((blueAttackers > 0)) | |
138 | 138 | then blueSigned | |
139 | 139 | else false | |
140 | 140 | let multiAttackers = if ((countryAttackers > 0)) | |
141 | 141 | then (fromUnits / countryAttackers) | |
142 | 142 | else 0 | |
143 | 143 | let multiDefenders = if ((countryDefenders > 0)) | |
144 | 144 | then (toUnits / countryDefenders) | |
145 | 145 | else 0 | |
146 | 146 | let win = if (if (if (if (if (king) | |
147 | 147 | then (multiAttackers != multiDefenders) | |
148 | 148 | else false) | |
149 | 149 | then (attackers > defenders) | |
150 | 150 | else false) | |
151 | 151 | then (newFromUnits == multiAttackers) | |
152 | 152 | else false) | |
153 | 153 | then (newToUnits == ((attackers - defenders) * multiAttackers)) | |
154 | 154 | else false) | |
155 | 155 | then locked | |
156 | 156 | else false | |
157 | 157 | let lost = if (if (if (if (if (king) | |
158 | 158 | then (multiAttackers != multiDefenders) | |
159 | 159 | else false) | |
160 | 160 | then (defenders > attackers) | |
161 | 161 | else false) | |
162 | 162 | then (newFromUnits == multiAttackers) | |
163 | 163 | else false) | |
164 | 164 | then (newToUnits == ((defenders - attackers) * multiDefenders)) | |
165 | 165 | else false) | |
166 | 166 | then lockNotChanged | |
167 | 167 | else false | |
168 | 168 | let draw = if (if (if (if (if (king) | |
169 | 169 | then (multiAttackers != multiDefenders) | |
170 | 170 | else false) | |
171 | 171 | then (attackers == defenders) | |
172 | 172 | else false) | |
173 | 173 | then (newFromUnits == multiAttackers) | |
174 | 174 | else false) | |
175 | 175 | then (newToUnits == (((defenders + 1) - attackers) * multiDefenders)) | |
176 | 176 | else false) | |
177 | 177 | then lockNotChanged | |
178 | 178 | else false | |
179 | 179 | let move = if (if (if (if (if (king) | |
180 | 180 | then (multiAttackers == multiDefenders) | |
181 | 181 | else false) | |
182 | 182 | then (newFromUnits == multiAttackers) | |
183 | 183 | else false) | |
184 | 184 | then (10 >= (attackers + defenders)) | |
185 | 185 | else false) | |
186 | 186 | then (newToUnits == ((attackers + defenders) * multiAttackers)) | |
187 | 187 | else false) | |
188 | 188 | then locked | |
189 | 189 | else false | |
190 | 190 | if (if (if (if (if (if (win) | |
191 | 191 | then true | |
192 | 192 | else lost) | |
193 | 193 | then true | |
194 | 194 | else draw) | |
195 | 195 | then true | |
196 | 196 | else move) | |
197 | 197 | then turnAllowed | |
198 | 198 | else false) | |
199 | 199 | then (dataSize == 3) | |
200 | 200 | else false) | |
201 | 201 | then true | |
202 | 202 | else (dataSize == 12) | |
203 | 203 | case ntx: TransferTransaction => | |
204 | 204 | true | |
205 | 205 | case _ => | |
206 | 206 | true | |
207 | 207 | } |
github/deemru/w8io/169f3d6 47.80 ms ◑