mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
576 B
22 lines
576 B
import sys
|
|
from slither.slither import Slither
|
|
|
|
if len(sys.argv) != 2:
|
|
print('python functions_called.py functions_called.sol')
|
|
exit(-1)
|
|
|
|
# Init slither
|
|
slither = Slither(sys.argv[1])
|
|
|
|
# Get the contract
|
|
contract = slither.get_contract_from_name('Contract')
|
|
|
|
# Get the variable
|
|
entry_point = contract.get_function_from_signature('entry_point()')
|
|
|
|
all_calls = entry_point.all_internal_calls()
|
|
|
|
all_calls_formated = [f.contract.name + '.' + f.name for f in all_calls]
|
|
|
|
# Print the result
|
|
print('From entry_point the functions reached are {}'.format(all_calls_formated))
|
|
|