diff --git a/myth b/myth index a36ab4f8..8c4a03d4 100755 --- a/myth +++ b/myth @@ -275,6 +275,8 @@ elif (len(args.solidity_file)): if(args.graph and len(args.solidity_file) > 1): exitWithError(args.outform, "Cannot generate call graphs from multiple input files. Please do it one at a time.") + idx = 0 + for file in args.solidity_file: if ":" in file: @@ -286,7 +288,10 @@ elif (len(args.solidity_file)): try: signatures.add_signatures_from_file(file, sigs) # Parse file for new function signatures - contract = SolidityContract(file, contract_name) + print(util.get_indexed_address(idx)) + + contract = SolidityContract(file, contract_name, util.get_indexed_address(idx)) + idx += 1 logging.info("Analyzing contract %s:%s" % (file, contract.name)) diff --git a/mythril/ether/soliditycontract.py b/mythril/ether/soliditycontract.py index a3310fd8..17220d4b 100644 --- a/mythril/ether/soliditycontract.py +++ b/mythril/ether/soliditycontract.py @@ -20,7 +20,7 @@ class SolidityFile: class SolidityContract(ETHContract): - def __init__(self, input_file, contract_name=None): + def __init__(self, input_file, contract_name=None, address=""): data = get_solc_json(input_file) @@ -81,4 +81,4 @@ class SolidityContract(ETHContract): self.mappings.append(SourceMapping(idx, offset, length, lineno)) - super().__init__(self.code, self.creation_code, name) + super().__init__(self.code, self.creation_code, name, address)