Split tx-origin findings into separate results

pull/226/head
David Pokora 6 years ago
parent 4d32e1c014
commit 2dd9fbde0f
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 11
      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: for c in self.contracts:
values = self.detect_tx_origin(c) values = self.detect_tx_origin(c)
for func, nodes in values: for func, nodes in values:
info = "{}.{} uses tx.origin for authorization:\n"
info = info.format(func.contract.name, func.name)
for node in nodes: 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) json = self.generate_json_result(info)
self.add_function_to_json(func, json) self.add_node_to_json(node, json)
self.add_nodes_to_json(nodes, json)
results.append(json) results.append(json)
return results return results

Loading…
Cancel
Save