Skip to content

Commit

Permalink
Merge pull request #546 from crytic/dev-printer-function-id-padding
Browse files Browse the repository at this point in the history
Add padding to function id printer
  • Loading branch information
montyly authored Jul 21, 2020
2 parents 823c27a + a474896 commit 5cea116
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions slither/printers/summary/function_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ def output(self, _filename):
table = MyPrettyTable(['Name', 'ID'])
for function in contract.functions:
if function.visibility in ['public', 'external']:
table.add_row([function.solidity_signature, hex(get_function_id(function.solidity_signature))])
function_id = get_function_id(function.solidity_signature)
table.add_row([function.solidity_signature, f"{function_id:#0{10}x}"])
for variable in contract.state_variables:
if variable.visibility in ['public']:
sig = variable.function_name
table.add_row([sig, hex(get_function_id(sig))])
function_id = get_function_id(sig)
table.add_row([sig, f"{function_id:#0{10}x}"])
txt += str(table) + '\n'
all_tables.append((contract.name, table))

Expand Down

0 comments on commit 5cea116

Please sign in to comment.