tx · BFg2qfV6Yk4vrANWoymmLRiLcF2M76VWajwURQuNimmh 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f: -0.01400000 Waves 2018.09.29 14:44 [353239] smart account 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f > SELF 0.00000000 Waves
{ "type": 13, "id": "BFg2qfV6Yk4vrANWoymmLRiLcF2M76VWajwURQuNimmh", "fee": 1400000, "feeAssetId": null, "timestamp": 1538221507350, "version": 1, "sender": "3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f", "senderPublicKey": "4BRdUi95rN89kRWamqTcb9Dj9pLpAQbjLt17MPxcgGhG", "proofs": [ "4qW5WrNQYwfZtWpiHVfrKBrsyvfJiuaqt6aQno2CU78dJDFw7i3ahFjC3oCQXn9jMhnXFZXu9veTnFEaVYWiTDnY" ], "script": "base64:AQQAAAAJcmVkUHViS2V5AQAAACCcvkAYXSO2dto8Bjx/Z65U0bGrFY5cIkLHdfY5mFVSDwQAAAALZ3JlZW5QdWJLZXkBAAAAIPlfPeSXGejVVO8XgpF607z8UJ46ZmmLUq4Rq0R8IFM8BAAAAApibHVlUHViS2V5AQAAACA97ajD767lxQiKGSbQ60FmHM7Nfb7azWSBD/TaFp3/QAQAAAAHcmVkQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGfSoosyZxu2GPr01RED4+I9rSQ9LlF8XgQAAAAJZ3JlZW5BZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUeYFF8qf7pD+lzgJaCmi860XRkyZFP24HBAAAAAhibHVlQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEG1BP9MronfM5Ad2fldCE7DdHowHHByOQQAAAAIY29udHJhY3QIBQAAAAJ0eAAAAAZzZW5kZXIEAAAACXJlZFNpZ25lZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAACXJlZF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AAgkAAGUAAAACBQAAAAlkZWZlbmRlcnMFAAAACWF0dGFja2VycwUAAAAObXVsdGlEZWZlbmRlcnMHBAAAAARkcmF3AwMDAwUAAAAEa2luZwkBAAAAAiE9AAAAAgUAAAAObXVsdGlBdHRhY2tlcnMFAAAADm11bHRpRGVmZW5kZXJzBwkAAAAAAAACBQAAAAlhdHRhY2tlcnMFAAAACWRlZmVuZGVycwcJAAAAAAAAAgUAAAAMbmV3RnJvbVVuaXRzAAAAAAAAAAAABwkAAAAAAAACBQAAAApuZXdUb1VuaXRzCQAAaAAAAAIJAABlAAAAAgkAAGQAAAACBQAAAAlkZWZlbmRlcnMAAAAAAAAAAAEFAAAACWF0dGFja2VycwUAAAAObXVsdGlEZWZlbmRlcnMHBAAAAARtb3ZlAwMDAwUAAAAEa2luZwkAAAAAAAACBQAAAA5tdWx0aUF0dGFja2VycwUAAAAObXVsdGlEZWZlbmRlcnMHCQAAAAAAAAIFAAAADG5ld0Zyb21Vbml0cwAAAAAAAAAAAAcJAABnAAAAAgAAAAAAAAAACgkAAGQAAAACBQAAAAlhdHRhY2tlcnMFAAAACWRlZmVuZGVycwcJAAAAAAAAAgUAAAAKbmV3VG9Vbml0cwkAAGgAAAACCQAAZAAAAAIFAAAACWF0dGFja2VycwUAAAAJZGVmZW5kZXJzBQAAAA5tdWx0aUF0dGFja2VycwcDAwMDAwUAAAADd2luBgUAAAAEbG9zdAYFAAAABGRyYXcGBQAAAARtb3ZlCQAAAAAAAAIFAAAACGRhdGFTaXplAAAAAAAAAAACBwYJAAAAAAAAAgUAAAAIZGF0YVNpemUAAAAAAAAAAAwDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA250eAUAAAAHJG1hdGNoMAYGCYckMg==", "chainId": 84, "height": 353239, "spentComplexity": 0 } View: original | compacted Prev: DCYon6pB2DXY3cpRUn3Ycpw15qfKH1n4SK8p2zNJbbXw Next: FFeuTxhcLforNgPx4hwX9MJQ1VHLeJ1odLagV1273QS2 Diff:
Old | New | Differences | |
---|---|---|---|
147 | 147 | else false) | |
148 | 148 | then (newToUnits == ((attackers + defenders) * multiAttackers)) | |
149 | 149 | else false | |
150 | - | if (if (if (win) | |
150 | + | if (if (if (if (if (win) | |
151 | 151 | then true | |
152 | 152 | else lost) | |
153 | 153 | then true | |
154 | 154 | else draw) | |
155 | 155 | then true | |
156 | - | else move | |
156 | + | else move) | |
157 | + | then (dataSize == 2) | |
158 | + | else false) | |
159 | + | then true | |
160 | + | else (dataSize == 12) | |
157 | 161 | case ntx: TransferTransaction => | |
158 | 162 | true | |
159 | 163 | case _ => |
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 | 18 | let newFromUnits = ttx.data[0].value | |
19 | 19 | let newToUnits = ttx.data[1].value | |
20 | 20 | let turnCorrect = if (if (if (if (if (if (if (if (if (if (if (if ((fromKey == "country1")) | |
21 | 21 | then (toKey == "country2") | |
22 | 22 | else false) | |
23 | 23 | then true | |
24 | 24 | else if ((fromKey == "country2")) | |
25 | 25 | then if ((toKey == "country1")) | |
26 | 26 | then true | |
27 | 27 | else (toKey == "country3") | |
28 | 28 | else false) | |
29 | 29 | then true | |
30 | 30 | else if ((fromKey == "country3")) | |
31 | 31 | then if (if ((toKey == "country2")) | |
32 | 32 | then true | |
33 | 33 | else (toKey == "country4")) | |
34 | 34 | then true | |
35 | 35 | else (toKey == "country5") | |
36 | 36 | else false) | |
37 | 37 | then true | |
38 | 38 | else if ((fromKey == "country4")) | |
39 | 39 | then if ((toKey == "country3")) | |
40 | 40 | then true | |
41 | 41 | else (toKey == "country8") | |
42 | 42 | else false) | |
43 | 43 | then true | |
44 | 44 | else if ((fromKey == "country5")) | |
45 | 45 | then if ((toKey == "country3")) | |
46 | 46 | then true | |
47 | 47 | else (toKey == "country10") | |
48 | 48 | else false) | |
49 | 49 | then true | |
50 | 50 | else if ((fromKey == "country6")) | |
51 | 51 | then (toKey == "country7") | |
52 | 52 | else false) | |
53 | 53 | then true | |
54 | 54 | else if ((fromKey == "country7")) | |
55 | 55 | then if ((toKey == "country6")) | |
56 | 56 | then true | |
57 | 57 | else (toKey == "country8") | |
58 | 58 | else false) | |
59 | 59 | then true | |
60 | 60 | else if ((fromKey == "country8")) | |
61 | 61 | then if (if ((toKey == "country4")) | |
62 | 62 | then true | |
63 | 63 | else (toKey == "country7")) | |
64 | 64 | then true | |
65 | 65 | else (toKey == "country9") | |
66 | 66 | else false) | |
67 | 67 | then true | |
68 | 68 | else if ((fromKey == "country9")) | |
69 | 69 | then if ((toKey == "country8")) | |
70 | 70 | then true | |
71 | 71 | else (toKey == "country10") | |
72 | 72 | else false) | |
73 | 73 | then true | |
74 | 74 | else if ((fromKey == "country10")) | |
75 | 75 | then if (if ((toKey == "country5")) | |
76 | 76 | then true | |
77 | 77 | else (toKey == "country10")) | |
78 | 78 | then true | |
79 | 79 | else (toKey == "country11") | |
80 | 80 | else false) | |
81 | 81 | then true | |
82 | 82 | else if ((fromKey == "country11")) | |
83 | 83 | then if ((toKey == "country10")) | |
84 | 84 | then true | |
85 | 85 | else (toKey == "country12") | |
86 | 86 | else false) | |
87 | 87 | then true | |
88 | 88 | else if ((fromKey == "country12")) | |
89 | 89 | then (toKey == "country11") | |
90 | 90 | else false | |
91 | 91 | let fromUnits = extract(getInteger(contract, fromKey)) | |
92 | 92 | let toUnits = extract(getInteger(contract, toKey)) | |
93 | 93 | let redAttackers = (fromUnits % 100) | |
94 | 94 | let greenAttackers = ((fromUnits - redAttackers) / 100) | |
95 | 95 | let blueAttackers = (((fromUnits - (greenAttackers * 100)) - redAttackers) / 100) | |
96 | 96 | let redDefenders = (toUnits % 100) | |
97 | 97 | let greenDefenders = ((toUnits - redDefenders) / 100) | |
98 | 98 | let blueDefenders = (((toUnits - (greenDefenders * 100)) - redDefenders) / 100) | |
99 | 99 | let attackers = ((redAttackers + greenAttackers) + blueAttackers) | |
100 | 100 | let defenders = ((redDefenders + greenDefenders) + blueDefenders) | |
101 | 101 | let king = if (if (if ((redAttackers > 0)) | |
102 | 102 | then redSigned | |
103 | 103 | else false) | |
104 | 104 | then true | |
105 | 105 | else if ((greenAttackers > 0)) | |
106 | 106 | then greenSigned | |
107 | 107 | else false) | |
108 | 108 | then true | |
109 | 109 | else if ((blueAttackers > 0)) | |
110 | 110 | then blueSigned | |
111 | 111 | else false | |
112 | 112 | let multiAttackers = (fromUnits / attackers) | |
113 | 113 | let multiDefenders = (toUnits / defenders) | |
114 | 114 | let win = if (if (if (if (king) | |
115 | 115 | then (multiAttackers != multiDefenders) | |
116 | 116 | else false) | |
117 | 117 | then (attackers > defenders) | |
118 | 118 | else false) | |
119 | 119 | then (newFromUnits == 0) | |
120 | 120 | else false) | |
121 | 121 | then (newToUnits == ((attackers - defenders) * multiAttackers)) | |
122 | 122 | else false | |
123 | 123 | let lost = if (if (if (if (king) | |
124 | 124 | then (multiAttackers != multiDefenders) | |
125 | 125 | else false) | |
126 | 126 | then (defenders > attackers) | |
127 | 127 | else false) | |
128 | 128 | then (newFromUnits == 0) | |
129 | 129 | else false) | |
130 | 130 | then (newToUnits == ((defenders - attackers) * multiDefenders)) | |
131 | 131 | else false | |
132 | 132 | let draw = if (if (if (if (king) | |
133 | 133 | then (multiAttackers != multiDefenders) | |
134 | 134 | else false) | |
135 | 135 | then (attackers == defenders) | |
136 | 136 | else false) | |
137 | 137 | then (newFromUnits == 0) | |
138 | 138 | else false) | |
139 | 139 | then (newToUnits == (((defenders + 1) - attackers) * multiDefenders)) | |
140 | 140 | else false | |
141 | 141 | let move = if (if (if (if (king) | |
142 | 142 | then (multiAttackers == multiDefenders) | |
143 | 143 | else false) | |
144 | 144 | then (newFromUnits == 0) | |
145 | 145 | else false) | |
146 | 146 | then (10 >= (attackers + defenders)) | |
147 | 147 | else false) | |
148 | 148 | then (newToUnits == ((attackers + defenders) * multiAttackers)) | |
149 | 149 | else false | |
150 | - | if (if (if (win) | |
150 | + | if (if (if (if (if (win) | |
151 | 151 | then true | |
152 | 152 | else lost) | |
153 | 153 | then true | |
154 | 154 | else draw) | |
155 | 155 | then true | |
156 | - | else move | |
156 | + | else move) | |
157 | + | then (dataSize == 2) | |
158 | + | else false) | |
159 | + | then true | |
160 | + | else (dataSize == 12) | |
157 | 161 | case ntx: TransferTransaction => | |
158 | 162 | true | |
159 | 163 | case _ => | |
160 | 164 | true | |
161 | 165 | } |
github/deemru/w8io/169f3d6 66.25 ms ◑