Split erc20-interface and erc721-interface findings into separate results

pull/226/head
David Pokora 6 years ago
parent 142b69b70e
commit 1c4a22a602
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 14
      slither/detectors/erc/incorrect_erc20_interface.py
  2. 14
      slither/detectors/erc/incorrect_erc721_interface.py

@ -83,13 +83,13 @@ contract Token{
for c in self.contracts: for c in self.contracts:
functions = IncorrectERC20InterfaceDetection.detect_incorrect_erc20_interface(c) functions = IncorrectERC20InterfaceDetection.detect_incorrect_erc20_interface(c)
if functions: if functions:
info = "{} ({}) has incorrect ERC20 function interface(s):\n"
info = info.format(c.name,
c.source_mapping_str)
for function in functions: for function in functions:
info += "\t-{} ({})\n".format(function.name, function.source_mapping_str) info = "{} ({}) has incorrect ERC20 function interface: {} ({})\n".format(c.name,
json = self.generate_json_result(info) c.source_mapping_str,
self.add_functions_to_json(functions, json) function.name,
results.append(json) function.source_mapping_str)
json = self.generate_json_result(info)
self.add_function_to_json(function, json)
results.append(json)
return results return results

@ -84,13 +84,13 @@ contract Token{
for c in self.contracts: for c in self.contracts:
functions = IncorrectERC721InterfaceDetection.detect_incorrect_erc721_interface(c) functions = IncorrectERC721InterfaceDetection.detect_incorrect_erc721_interface(c)
if functions: if functions:
info = "{} ({}) has incorrect ERC721 function interface(s):\n"
info = info.format(c.name,
c.source_mapping_str)
for function in functions: for function in functions:
info += "\t-{} ({})\n".format(function.name, function.source_mapping_str) info = "{} ({}) has incorrect ERC721 function interface: {} ({})\n".format(c.name,
json = self.generate_json_result(info) c.source_mapping_str,
self.add_functions_to_json(functions, json) function.name,
results.append(json) function.source_mapping_str)
json = self.generate_json_result(info)
self.add_function_to_json(function, json)
results.append(json)
return results return results

Loading…
Cancel
Save