tx · ByNXzMpcBV9j6tFhP4wPkH5WSGcg7GTUSpvZGZGPLdrk 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f: -0.01400000 Waves 2018.09.28 19:35 [352064] smart account 3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f > SELF 0.00000000 Waves
{ "type": 13, "id": "ByNXzMpcBV9j6tFhP4wPkH5WSGcg7GTUSpvZGZGPLdrk", "fee": 1400000, "feeAssetId": null, "timestamp": 1538152546163, "version": 1, "sender": "3N9UZtJRvvoNgHCjQsWvDUtxiym7KFc7r6f", "senderPublicKey": "4BRdUi95rN89kRWamqTcb9Dj9pLpAQbjLt17MPxcgGhG", "proofs": [ "4hA9cdn9ihRu93xXteqgkQjMitXY6jKyzYDfMcwJBZwqfgsNZ1mqzL2SCkAYWQ6qnxrvXv7E9GL56w6WZaYveuiy" ], "script": "base64:AQQAAAAJcmVkUHViS2V5AQAAACCcvkAYXSO2dto8Bjx/Z65U0bGrFY5cIkLHdfY5mFVSDwQAAAALZ3JlZW5QdWJLZXkBAAAAIPlfPeSXGejVVO8XgpF607z8UJ46ZmmLUq4Rq0R8IFM8BAAAAApibHVlUHViS2V5AQAAACA97ajD767lxQiKGSbQ60FmHM7Nfb7azWSBD/TaFp3/QAQAAAAHcmVkQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVGfSoosyZxu2GPr01RED4+I9rSQ9LlF8XgQAAAAJZ3JlZW5BZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUeYFF8qf7pD+lzgJaCmi860XRkyZFP24HBAAAAAhibHVlQWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEG1BP9MronfM5Ad2fldCE7DdHowHHByOQQAAAAIY29udHJhY3QIBQAAAAJ0eAAAAAZzZW5kZXIEAAAACXJlZFNpZ25lZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAA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QXR0YWNrZXJzBQAAAA5ncmVlbkF0dGFja2VycwUAAAANYmx1ZUF0dGFja2VycwQAAAAJZGVmZW5kZXJzCQAAZAAAAAIJAABkAAAAAgUAAAAMcmVkRGVmZW5kZXJzBQAAAA5ncmVlbkRlZmVuZGVycwUAAAANYmx1ZURlZmVuZGVycwQAAAAEa2luZwMDAwkAAGYAAAACBQAAAAxyZWRBdHRhY2tlcnMAAAAAAAAAAAAFAAAACXJlZFNpZ25lZAcGAwkAAGYAAAACBQAAAA5ncmVlbkF0dGFja2VycwAAAAAAAAAAAAUAAAALZ3JlZW5TaWduZWQHBgMJAABmAAAAAgUAAAANYmx1ZUF0dGFja2VycwAAAAAAAAAAAAUAAAAKYmx1ZVNpZ25lZAcEAAAABW11bHRpCQAAaQAAAAIFAAAACWZyb21Vbml0cwUAAAAJYXR0YWNrZXJzAwMDBQAAAARraW5nCQAAZgAAAAIFAAAACWF0dGFja2VycwUAAAAJZGVmZW5kZXJzBwkAAAAAAAACBQAAAAxuZXdGcm9tVW5pdHMAAAAAAAAAAAAHCQAAAAAAAAIFAAAACm5ld1RvVW5pdHMJAABoAAAAAgkAAGUAAAACBQAAAAlhdHRhY2tlcnMFAAAACWRlZmVuZGVycwUAAAAFbXVsdGkHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAANudHgFAAAAByRtYXRjaDAGBhntU3M=", "chainId": 84, "height": 352064, "spentComplexity": 0 } View: original | compacted Prev: FV6DM4AAAxAVdxZBZ42wpNbAPaT9r5Eofp1Tzxsf2t9R Next: 2AGLtvYvNpX1whP1GF58gKHKrauu76uefrHVw3XSpPQW Diff:
Old | New | Differences | |
---|---|---|---|
92 | 92 | let toUnits = extract(getInteger(contract, toKey)) | |
93 | 93 | let redAttackers = (fromUnits % 100) | |
94 | 94 | let greenAttackers = ((fromUnits - redAttackers) % 100) | |
95 | - | let blueAttackers = ((fromUnits - greenAttackers) % 100) | |
95 | + | let blueAttackers = (((fromUnits - (greenAttackers * 100)) - redAttackers) % 100) | |
96 | 96 | let redDefenders = (toUnits % 100) | |
97 | 97 | let greenDefenders = ((toUnits - redDefenders) % 100) | |
98 | - | let blueDefenders = ((toUnits - greenDefenders) % 100) | |
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)) |
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 | - | let blueAttackers = ((fromUnits - greenAttackers) % 100) | |
95 | + | let blueAttackers = (((fromUnits - (greenAttackers * 100)) - redAttackers) % 100) | |
96 | 96 | let redDefenders = (toUnits % 100) | |
97 | 97 | let greenDefenders = ((toUnits - redDefenders) % 100) | |
98 | - | let blueDefenders = ((toUnits - greenDefenders) % 100) | |
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 multi = (fromUnits / attackers) | |
113 | 113 | if (if (if (king) | |
114 | 114 | then (attackers > defenders) | |
115 | 115 | else false) | |
116 | 116 | then (newFromUnits == 0) | |
117 | 117 | else false) | |
118 | 118 | then (newToUnits == ((attackers - defenders) * multi)) | |
119 | 119 | else false | |
120 | 120 | case ntx: TransferTransaction => | |
121 | 121 | true | |
122 | 122 | case _ => | |
123 | 123 | true | |
124 | 124 | } |
github/deemru/w8io/026f985 28.18 ms ◑