Minor improvements to the function-id printer

- Do not print shadowed functions
- Do not printer slither's internal function
pull/886/head
Josselin 3 years ago
parent 403e96ca7a
commit ace923595c
  1. 6
      setup.py
  2. 2
      slither/printers/summary/function_ids.py

@ -11,10 +11,10 @@ setup(
install_requires=[
"prettytable>=0.7.2",
"pysha3>=1.0.2",
# "crytic-compile>=0.2.0",
"crytic-compile",
"crytic-compile>=0.2.0",
# "crytic-compile",
],
dependency_links=["git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile"],
# dependency_links=["git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile"],
license="AGPL-3.0",
long_description=open("README.md").read(),
entry_points={

@ -26,6 +26,8 @@ class FunctionIds(AbstractPrinter):
txt += "\n{}:\n".format(contract.name)
table = MyPrettyTable(["Name", "ID"])
for function in contract.functions:
if function.is_shadowed or function.is_constructor_variables:
continue
if function.visibility in ["public", "external"]:
function_id = get_function_id(function.solidity_signature)
table.add_row([function.solidity_signature, f"{function_id:#0{10}x}"])

Loading…
Cancel
Save