From 2dd9fbde0f80e5082ee69d0f5e05ad5f9e13ad63 Mon Sep 17 00:00:00 2001 From: David Pokora Date: Wed, 8 May 2019 12:15:47 -0400 Subject: [PATCH] Split tx-origin findings into separate results --- slither/detectors/statements/tx_origin.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/slither/detectors/statements/tx_origin.py b/slither/detectors/statements/tx_origin.py index bbd86d9bf..fa49fc0b3 100644 --- a/slither/detectors/statements/tx_origin.py +++ b/slither/detectors/statements/tx_origin.py @@ -65,15 +65,14 @@ Bob is the owner of `TxOrigin`. Bob calls Eve's contract. Eve's contract calls ` for c in self.contracts: values = self.detect_tx_origin(c) for func, nodes in values: - info = "{}.{} uses tx.origin for authorization:\n" - info = info.format(func.contract.name, func.name) - for node in nodes: - info += "\t- {} ({})\n".format(node.expression, node.source_mapping_str) + info = "{}.{} uses tx.origin for authorization: \"{}\" ({})\n".format(func.contract.name, + func.name, + node.expression, + node.source_mapping_str) - json = self.generate_json_result(info) - self.add_function_to_json(func, json) - self.add_nodes_to_json(nodes, json) - results.append(json) + json = self.generate_json_result(info) + self.add_node_to_json(node, json) + results.append(json) return results