diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 92ec4f91..391c7658 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -328,8 +328,9 @@ def validate_args(parser: argparse.ArgumentParser, args: argparse.Namespace): exit_with_error( args.outform, "The transaction sequence is in incorrect format, It should be " - "[list if possible function hashes in 1st transaction, " - "list of possible func hashes in 2nd tx, ..]", + "[list of possible function hashes in 1st transaction, " + "list of possible func hashes in 2nd tx, ..]" + "If any list is empty then all possible functions are considered for that transaction", ) if len(args.transaction_sequences) != args.transaction_count: args.transaction_count = len(args.transaction_sequences) diff --git a/mythril/laser/ethereum/transaction/symbolic.py b/mythril/laser/ethereum/transaction/symbolic.py index 5102723b..cb36f820 100644 --- a/mythril/laser/ethereum/transaction/symbolic.py +++ b/mythril/laser/ethereum/transaction/symbolic.py @@ -20,13 +20,17 @@ CREATOR_ADDRESS = 0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE ATTACKER_ADDRESS = 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF -def generate_function_constraints(calldata: SymbolicCalldata, func_hashes: List[List[int]]) -> List[Bool]: +def generate_function_constraints( + calldata: SymbolicCalldata, func_hashes: List[List[int]] +) -> List[Bool]: """ This will generate constraints for fixing the function call part of calldata :param calldata: Calldata :param func_hashes: The list of function hashes allowed for this transaction :return: Constraints List """ + if len(func_hashes) == 0: + return [] constraints = [] for i in range(4): constraint = Bool(False)