Add support to default empty list

support_tx_sequences
Nikhil Parasaram 6 years ago
parent 63da83a8dc
commit c32bd14b56
  1. 5
      mythril/interfaces/cli.py
  2. 6
      mythril/laser/ethereum/transaction/symbolic.py

@ -328,8 +328,9 @@ def validate_args(parser: argparse.ArgumentParser, args: argparse.Namespace):
exit_with_error( exit_with_error(
args.outform, args.outform,
"The transaction sequence is in incorrect format, It should be " "The transaction sequence is in incorrect format, It should be "
"[list if possible function hashes in 1st transaction, " "[list of possible function hashes in 1st transaction, "
"list of possible func hashes in 2nd tx, ..]", "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: if len(args.transaction_sequences) != args.transaction_count:
args.transaction_count = len(args.transaction_sequences) args.transaction_count = len(args.transaction_sequences)

@ -20,13 +20,17 @@ CREATOR_ADDRESS = 0xAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFEAFFE
ATTACKER_ADDRESS = 0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF 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 This will generate constraints for fixing the function call part of calldata
:param calldata: Calldata :param calldata: Calldata
:param func_hashes: The list of function hashes allowed for this transaction :param func_hashes: The list of function hashes allowed for this transaction
:return: Constraints List :return: Constraints List
""" """
if len(func_hashes) == 0:
return []
constraints = [] constraints = []
for i in range(4): for i in range(4):
constraint = Bool(False) constraint = Bool(False)

Loading…
Cancel
Save