tx · CXFAudcm6MerqJsy1sWHC6mYfDRZ9UAPnrowfcKcQD5r

3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f:  -0.01400000 Waves

2018.10.11 12:20 [370746] smart account 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f > SELF 0.00000000 Waves

{ "type": 13, "id": "CXFAudcm6MerqJsy1sWHC6mYfDRZ9UAPnrowfcKcQD5r", "fee": 1400000, "feeAssetId": null, "timestamp": 1539249682560, "version": 1, "sender": "3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f", "senderPublicKey": "4BRdUi95rN89kRWamqTcb9Dj9pLpAQbjLt17MPxcgGhG", "proofs": [ "4mLN3BePdrC9wi49XTC7uZsKxREod569ptoWrqmBEKJzf92ocb6c67EHTc76xNBNBKh7WAf4NsereonXanBGJFqU" ], "script": "base64:AQQAAAAJcmVkUHViS2V5AQAAACCcvkAYXSO2dto8Bjx/Z65U0bGrFY5cIkLHdfY5mFVSDwQAAAALZ3JlZW5QdWJLZXkBAAAAIPlfPeSXGejVVO8XgpF607z8UJ46ZmmLUq4Rq0R8IFM8BAAAAApibHVlUHViS2V5AQAAACA97ajD767lxQiKGSbQ60FmHM7Nfb7azWSBD/TaFp3/QAQAAAAHcmVkQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGfSoosyZxu2GPr01RED4+I9rSQ9LlF8XgQAAAAJZ3JlZW5BZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUeYFF8qf7pD+lzgJaCmi860XRkyZFP24HBAAAAAhibHVlQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEG1BP9MronfM5Ad2fldCE7DdHowHHByOQQAAAAIY29udHJhY3QIBQAAAAJ0eAAAAAZzZW5kZXIEAAAACXJlZFNpZ25lZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAACXJlZFB1Y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RhU2l6ZQAAAAAAAAAADwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAADbnR4BQAAAAckbWF0Y2gwBgYKiPp9", "chainId": 84, "height": 370746, "spentComplexity": 0 } View: original | compacted Prev: GM1Up9EHbhfQaazDjd9uS9o9MLZsM3eyYPbFBSLhhK16 Next: 6FyW9dBsVQ7MvhaxWvTAozLTMzh347naFJZ63knUdx7q Diff:
OldNewDifferences
1616 let fromKey = ttx.data[0].key
1717 let toKey = ttx.data[1].key
1818 let turnToKey = ttx.data[2].key
19+ let newTurnFromKey = ttx.data[3].key
1920 let newFromUnits = ttx.data[0].value
2021 let newToUnits = ttx.data[1].value
2122 let turnToValue = ttx.data[2].value
23+ let newTurnFromValue = ttx.data[3].value
2224 let turnCorrect = if (if (if (if (if (if (if (if (if (if (if (if ((fromKey == "country1"))
2325 then (toKey == "country2")
2426 else false)
9294 else false
9395 let turnFromKey = ("turn_" + fromKey)
9496 let turnFromValue = extract(getInteger(contract, turnFromKey))
95- let turnAllowed = ((height - 5) > turnFromValue)
97+ let turnAllowed = if (if (((height - 2) > turnFromValue))
98+ then (turnFromKey == newTurnFromKey)
99+ else false)
100+ then (newTurnFromValue == height)
101+ else false
96102 let oldTurnToKey = ("turn_" + toKey)
97103 let oldTurnToValue = extract(getInteger(contract, oldTurnToKey))
98104 let locked = if ((("turn_" + toKey) == turnToKey))
142148 else false)
143149 then (attackers > defenders)
144150 else false)
145- then (newFromUnits == 0)
151+ then (newFromUnits == multiAttackers)
146152 else false)
147153 then (newToUnits == ((attackers - defenders) * multiAttackers))
148154 else false)
153159 else false)
154160 then (defenders > attackers)
155161 else false)
156- then (newFromUnits == 0)
162+ then (newFromUnits == multiAttackers)
157163 else false)
158164 then (newToUnits == ((defenders - attackers) * multiDefenders))
159165 else false)
164170 else false)
165171 then (attackers == defenders)
166172 else false)
167- then (newFromUnits == 0)
173+ then (newFromUnits == multiAttackers)
168174 else false)
169175 then (newToUnits == (((defenders + 1) - attackers) * multiDefenders))
170176 else false)
173179 let move = if (if (if (if (if (king)
174180 then (multiAttackers == multiDefenders)
175181 else false)
176- then (newFromUnits == 0)
182+ then (newFromUnits == multiAttackers)
177183 else false)
178184 then (10 >= (attackers + defenders))
179185 else false)
193199 then (dataSize == 3)
194200 else false)
195201 then true
196- else (dataSize == 12)
202+ else (dataSize == 15)
197203 case ntx: TransferTransaction =>
198204 true
199205 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 1 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let redPubKey = base58'BYrrqVpD5uuz7cndnPwuUxuYFUK6Bovu6yfoV8seY6Px'
44 let greenPubKey = base58'HnSkSntD7ihFgZpLNmHgdVnVmCYxJLC96eNbubTXsWju'
55 let bluePubKey = base58'5Ak4HQK3cnkwe6XVUXwpCYeSAARwruKyAmsmegePUPvo'
66 let redAddr = Address(base58'3MyP3hrK8SBvtXtggNWdsry8KuGdrv1sFrV')
77 let greenAddr = Address(base58'3MzzYQCC8Ks86exHaWV2VpaANbNLPRDunNJ')
88 let blueAddr = Address(base58'3MuuWYr3DyjEkncbNU1tUeFbyvcyZng9gz4')
99 let contract = tx.sender
1010 let redSigned = sigVerify(tx.bodyBytes, tx.proofs[0], redPubKey)
1111 let greenSigned = sigVerify(tx.bodyBytes, tx.proofs[0], greenPubKey)
1212 let blueSigned = sigVerify(tx.bodyBytes, tx.proofs[0], bluePubKey)
1313 match tx {
1414 case ttx: DataTransaction =>
1515 let dataSize = size(ttx.data)
1616 let fromKey = ttx.data[0].key
1717 let toKey = ttx.data[1].key
1818 let turnToKey = ttx.data[2].key
19+ let newTurnFromKey = ttx.data[3].key
1920 let newFromUnits = ttx.data[0].value
2021 let newToUnits = ttx.data[1].value
2122 let turnToValue = ttx.data[2].value
23+ let newTurnFromValue = ttx.data[3].value
2224 let turnCorrect = if (if (if (if (if (if (if (if (if (if (if (if ((fromKey == "country1"))
2325 then (toKey == "country2")
2426 else false)
2527 then true
2628 else if ((fromKey == "country2"))
2729 then if ((toKey == "country1"))
2830 then true
2931 else (toKey == "country3")
3032 else false)
3133 then true
3234 else if ((fromKey == "country3"))
3335 then if (if ((toKey == "country2"))
3436 then true
3537 else (toKey == "country4"))
3638 then true
3739 else (toKey == "country5")
3840 else false)
3941 then true
4042 else if ((fromKey == "country4"))
4143 then if ((toKey == "country3"))
4244 then true
4345 else (toKey == "country8")
4446 else false)
4547 then true
4648 else if ((fromKey == "country5"))
4749 then if ((toKey == "country3"))
4850 then true
4951 else (toKey == "country10")
5052 else false)
5153 then true
5254 else if ((fromKey == "country6"))
5355 then (toKey == "country7")
5456 else false)
5557 then true
5658 else if ((fromKey == "country7"))
5759 then if ((toKey == "country6"))
5860 then true
5961 else (toKey == "country8")
6062 else false)
6163 then true
6264 else if ((fromKey == "country8"))
6365 then if (if ((toKey == "country4"))
6466 then true
6567 else (toKey == "country7"))
6668 then true
6769 else (toKey == "country9")
6870 else false)
6971 then true
7072 else if ((fromKey == "country9"))
7173 then if ((toKey == "country8"))
7274 then true
7375 else (toKey == "country10")
7476 else false)
7577 then true
7678 else if ((fromKey == "country10"))
7779 then if (if ((toKey == "country5"))
7880 then true
7981 else (toKey == "country10"))
8082 then true
8183 else (toKey == "country11")
8284 else false)
8385 then true
8486 else if ((fromKey == "country11"))
8587 then if ((toKey == "country10"))
8688 then true
8789 else (toKey == "country12")
8890 else false)
8991 then true
9092 else if ((fromKey == "country12"))
9193 then (toKey == "country11")
9294 else false
9395 let turnFromKey = ("turn_" + fromKey)
9496 let turnFromValue = extract(getInteger(contract, turnFromKey))
95- let turnAllowed = ((height - 5) > turnFromValue)
97+ let turnAllowed = if (if (((height - 2) > turnFromValue))
98+ then (turnFromKey == newTurnFromKey)
99+ else false)
100+ then (newTurnFromValue == height)
101+ else false
96102 let oldTurnToKey = ("turn_" + toKey)
97103 let oldTurnToValue = extract(getInteger(contract, oldTurnToKey))
98104 let locked = if ((("turn_" + toKey) == turnToKey))
99105 then (turnToValue == height)
100106 else false
101107 let lockNotChanged = if ((("turn_" + toKey) == turnToKey))
102108 then (turnToValue == oldTurnToValue)
103109 else false
104110 let fromUnits = extract(getInteger(contract, fromKey))
105111 let toUnits = extract(getInteger(contract, toKey))
106112 let redAttackers = (fromUnits % 100)
107113 let greenAttackers = (((fromUnits - redAttackers) % 10000) / 100)
108114 let blueAttackers = (((fromUnits - (greenAttackers * 100)) - redAttackers) / 10000)
109115 let redDefenders = (toUnits % 100)
110116 let greenDefenders = (((toUnits - redDefenders) % 10000) / 100)
111117 let blueDefenders = ((((toUnits - (greenDefenders * 100)) - redDefenders) % 1000000) / 10000)
112118 let whiteDefenders = ((((toUnits - (blueDefenders * 10000)) - (greenDefenders * 100)) - redDefenders) / 1000000)
113119 let countryAttackers = ((redAttackers + greenAttackers) + blueAttackers)
114120 let countryDefenders = ((redDefenders + greenDefenders) + blueDefenders)
115121 let unlimitedAttackers = (((redAttackers + greenAttackers) + blueAttackers) + (height - turnFromValue))
116122 let unlimitedDefenders = (((redDefenders + greenDefenders) + blueDefenders) + (height - oldTurnToValue))
117123 let attackers = if ((unlimitedAttackers >= 10))
118124 then 10
119125 else unlimitedAttackers
120126 let defenders = if ((unlimitedDefenders >= 10))
121127 then 10
122128 else unlimitedDefenders
123129 let king = if (if (if ((redAttackers > 0))
124130 then redSigned
125131 else false)
126132 then true
127133 else if ((greenAttackers > 0))
128134 then greenSigned
129135 else false)
130136 then true
131137 else if ((blueAttackers > 0))
132138 then blueSigned
133139 else false
134140 let multiAttackers = if ((countryAttackers > 0))
135141 then (fromUnits / countryAttackers)
136142 else 0
137143 let multiDefenders = if ((countryDefenders > 0))
138144 then (toUnits / countryDefenders)
139145 else 0
140146 let win = if (if (if (if (if (king)
141147 then (multiAttackers != multiDefenders)
142148 else false)
143149 then (attackers > defenders)
144150 else false)
145- then (newFromUnits == 0)
151+ then (newFromUnits == multiAttackers)
146152 else false)
147153 then (newToUnits == ((attackers - defenders) * multiAttackers))
148154 else false)
149155 then locked
150156 else false
151157 let lost = if (if (if (if (if (king)
152158 then (multiAttackers != multiDefenders)
153159 else false)
154160 then (defenders > attackers)
155161 else false)
156- then (newFromUnits == 0)
162+ then (newFromUnits == multiAttackers)
157163 else false)
158164 then (newToUnits == ((defenders - attackers) * multiDefenders))
159165 else false)
160166 then lockNotChanged
161167 else false
162168 let draw = if (if (if (if (if (king)
163169 then (multiAttackers != multiDefenders)
164170 else false)
165171 then (attackers == defenders)
166172 else false)
167- then (newFromUnits == 0)
173+ then (newFromUnits == multiAttackers)
168174 else false)
169175 then (newToUnits == (((defenders + 1) - attackers) * multiDefenders))
170176 else false)
171177 then lockNotChanged
172178 else false
173179 let move = if (if (if (if (if (king)
174180 then (multiAttackers == multiDefenders)
175181 else false)
176- then (newFromUnits == 0)
182+ then (newFromUnits == multiAttackers)
177183 else false)
178184 then (10 >= (attackers + defenders))
179185 else false)
180186 then (newToUnits == ((attackers + defenders) * multiAttackers))
181187 else false)
182188 then locked
183189 else false
184190 if (if (if (if (if (if (win)
185191 then true
186192 else lost)
187193 then true
188194 else draw)
189195 then true
190196 else move)
191197 then turnAllowed
192198 else false)
193199 then (dataSize == 3)
194200 else false)
195201 then true
196- else (dataSize == 12)
202+ else (dataSize == 15)
197203 case ntx: TransferTransaction =>
198204 true
199205 case _ =>
200206 true
201207 }

github/deemru/w8io/169f3d6 
42.55 ms