From 665d5c8e096a908c0932b656b3572dcba292a94e Mon Sep 17 00:00:00 2001 From: Sheldon Holmgren Date: Thu, 15 Jun 2023 15:23:39 +0000 Subject: [PATCH 01/38] Add CompilationUnit.implementation_address --- crytic_compile/compilation_unit.py | 22 ++++++++++++++++++++++ crytic_compile/platform/etherscan.py | 8 ++++++++ 2 files changed, 30 insertions(+) diff --git a/crytic_compile/compilation_unit.py b/crytic_compile/compilation_unit.py index e3e9b64d..92a6228a 100644 --- a/crytic_compile/compilation_unit.py +++ b/crytic_compile/compilation_unit.py @@ -46,6 +46,10 @@ def __init__(self, crytic_compile: "CryticCompile", unique_id: str): compiler="N/A", version="N/A", optimized=False ) + # if the compilation unit comes from etherscan-like service and is a proxy, + # store the implementation address + self._implementation_address: Optional[str] = None + self._crytic_compile: "CryticCompile" = crytic_compile if unique_id == ".": @@ -130,6 +134,24 @@ def create_source_unit(self, filename: Filename) -> SourceUnit: self.filenames.append(filename) return self._source_units[filename] + @property + def implementation_address(self) -> Optional[str]: + """Return the implementation address if the compilation unit is a proxy + + Returns: + Optional[str]: Implementation address + """ + return self._implementation_address + + @implementation_address.setter + def implementation_address(self, implementation: str) -> None: + """Set the implementation address + + Args: + implementation (str): Implementation address + """ + self._implementation_address = implementation + # endregion ################################################################################### ################################################################################### diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 0a490977..c70c8eda 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -382,6 +382,14 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: optimize_runs=optimize_runs, ) compilation_unit.compiler_version.look_for_installed_version() + + if "Proxy" in result and result["Proxy"] == "1": + assert "Implementation" in result + implementation = result["Implementation"] + if prefix is not None: + implementation = f"{prefix}:{implementation}" + compilation_unit.implementation_address = implementation + solc_standard_json.standalone_compile( filenames, compilation_unit, From 5297ed28445a90d7e375d283bb256b84457fc7c0 Mon Sep 17 00:00:00 2001 From: Sheldon Holmgren Date: Thu, 29 Jun 2023 08:37:27 +0000 Subject: [PATCH 02/38] Appease mypy --- crytic_compile/platform/etherscan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index c70c8eda..4231c94c 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -385,7 +385,7 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: if "Proxy" in result and result["Proxy"] == "1": assert "Implementation" in result - implementation = result["Implementation"] + implementation = str(result["Implementation"]) if prefix is not None: implementation = f"{prefix}:{implementation}" compilation_unit.implementation_address = implementation From 24bc0984b8588b012fd946b3a6a247967bf9676c Mon Sep 17 00:00:00 2001 From: Sheldon Holmgren Date: Thu, 29 Jun 2023 08:37:49 +0000 Subject: [PATCH 03/38] Fix proxy resolution for non-Ethereum networks --- crytic_compile/platform/etherscan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 4231c94c..d5f24afb 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -386,8 +386,8 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: if "Proxy" in result and result["Proxy"] == "1": assert "Implementation" in result implementation = str(result["Implementation"]) - if prefix is not None: - implementation = f"{prefix}:{implementation}" + if target.startswith(tuple(SUPPORTED_NETWORK)): + implementation = f"{target[:target.find(':')]}:{implementation}" compilation_unit.implementation_address = implementation solc_standard_json.standalone_compile( From a6a33a8c42659ce7b01ad6dd57c117a5e7ce3759 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 8 Aug 2023 15:45:30 -0500 Subject: [PATCH 04/38] feat: compile vyper 0.3.7 via standard json input --- crytic_compile/crytic_compile.py | 41 ++--- crytic_compile/platform/all_platforms.py | 2 +- crytic_compile/platform/vyper.py | 196 ++++++++++------------- 3 files changed, 107 insertions(+), 132 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 7b81bbaa..98becc40 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -15,7 +15,9 @@ from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, Type, Union from crytic_compile.compilation_unit import CompilationUnit -from crytic_compile.platform import all_platforms, solc_standard_json +from crytic_compile.platform import all_platforms +from crytic_compile.platform.solc_standard_json import SolcStandardJson +from crytic_compile.platform.vyper import VyperStandardJson from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.all_export import PLATFORMS_EXPORT from crytic_compile.platform.solc import Solc @@ -628,11 +630,7 @@ def compile_all(target: str, **kwargs: str) -> List[CryticCompile]: """ use_solc_standard_json = kwargs.get("solc_standard_json", False) - # Attempt to perform glob expansion of target/filename - globbed_targets = glob.glob(target, recursive=True) - # Check if the target refers to a valid target already. - # If it does not, we assume it's a glob pattern. compilations: List[CryticCompile] = [] if os.path.isfile(target) or is_supported(target): if target.endswith(".zip"): @@ -644,28 +642,33 @@ def compile_all(target: str, **kwargs: str) -> List[CryticCompile]: compilations = load_from_zip(tmp.name) else: compilations.append(CryticCompile(target, **kwargs)) - elif os.path.isdir(target) or len(globbed_targets) > 0: - # We create a new glob to find solidity files at this path (in case this is a directory) - filenames = glob.glob(os.path.join(target, "*.sol")) - if not filenames: - filenames = glob.glob(os.path.join(target, "*.vy")) - if not filenames: - filenames = globbed_targets - + elif os.path.isdir(target): + solidity_filenames = glob.glob(os.path.join(target, "*.sol")) + vyper_filenames = glob.glob(os.path.join(target, "*.vy")) # Determine if we're using --standard-solc option to # aggregate many files into a single compilation. if use_solc_standard_json: # If we're using standard solc, then we generated our # input to create a single compilation with all files - standard_json = solc_standard_json.SolcStandardJson() - for filename in filenames: - standard_json.add_source_file(filename) - compilations.append(CryticCompile(standard_json, **kwargs)) + solc_standard_json = SolcStandardJson() + solc_standard_json.add_source_files(solidity_filenames) + compilations.append(CryticCompile(solc_standard_json, **kwargs)) else: # We compile each file and add it to our compilations. - for filename in filenames: + for filename in solidity_filenames: compilations.append(CryticCompile(filename, **kwargs)) + + if vyper_filenames: + vyper_standard_json = VyperStandardJson() + vyper_standard_json.add_source_files(vyper_filenames) + compilations.append(CryticCompile(vyper_standard_json, **kwargs)) else: - raise ValueError(f"{str(target)} is not a file or directory.") + raise NotImplementedError() + # TODO split glob into language + # # Attempt to perform glob expansion of target/filename + # globbed_targets = glob.glob(target, recursive=True) + # print(globbed_targets) + + # raise ValueError(f"{str(target)} is not a file or directory.") return compilations diff --git a/crytic_compile/platform/all_platforms.py b/crytic_compile/platform/all_platforms.py index 624629e2..5e2fe1ba 100644 --- a/crytic_compile/platform/all_platforms.py +++ b/crytic_compile/platform/all_platforms.py @@ -14,6 +14,6 @@ from .solc_standard_json import SolcStandardJson from .standard import Standard from .truffle import Truffle -from .vyper import Vyper +from .vyper import VyperStandardJson from .waffle import Waffle from .foundry import Foundry diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 49133fd9..ad8783ee 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -15,6 +15,7 @@ from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename +from crytic_compile.utils.subprocess import run # Handle cycle from crytic_compile.utils.natspec import Natspec @@ -25,7 +26,7 @@ LOGGER = logging.getLogger("CryticCompile") -class Vyper(AbstractPlatform): +class VyperStandardJson(AbstractPlatform): """ Vyper platform """ @@ -33,6 +34,28 @@ class Vyper(AbstractPlatform): NAME = "vyper" PROJECT_URL = "https://github.com/vyperlang/vyper" TYPE = Type.VYPER + standard_json_input: Dict = { + "language": "Vyper", + "sources": {}, + "settings": { + "outputSelection": { + "*": { + "*": [ + "abi", + "devdoc", + "userdoc", + "evm.bytecode", + "evm.deployedBytecode", + "evm.deployedBytecode.sourceMap", + ], + "": ["ast"], + } + } + }, + } + + def __init__(self, target: Optional[Path] = None, **_kwargs: str): + super().__init__(target, **_kwargs) def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: """Compile the target @@ -44,46 +67,61 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: """ target = self._target + # If the target was a directory `add_source_file` should have been called + # by `compile_all`. Otherwise, we should have a single file target. + if self._target is not None and os.path.isfile(self._target): + self.add_source_files([target]) - vyper = kwargs.get("vyper", "vyper") + vyper_bin = kwargs.get("vyper", "vyper") + output_file = Path("crytic-export/standard_input.json") + output_file.parent.mkdir(exist_ok=True, parents=True) + with open(output_file, "w") as f: + f.write(json.dumps(self.standard_json_input)) - targets_json = _run_vyper(target, vyper) + compilation_artifacts = _run_vyper_standard_json(output_file.as_posix(), vyper_bin) - assert "version" in targets_json compilation_unit = CompilationUnit(crytic_compile, str(target)) + compiler_version = compilation_artifacts["compiler"].split("-")[1] + assert compiler_version == "0.3.7" compilation_unit.compiler_version = CompilerVersion( - compiler="vyper", version=targets_json["version"], optimized=False + compiler="vyper", version=compiler_version, optimized=False ) - assert target in targets_json - - info = targets_json[target] - filename = convert_filename(target, _relative_to_short, crytic_compile) - - contract_name = Path(target).parts[-1] - - source_unit = compilation_unit.create_source_unit(filename) - - source_unit.add_contract_name(contract_name) - compilation_unit.filename_to_contracts[filename].add(contract_name) - source_unit.abis[contract_name] = info["abi"] - source_unit.bytecodes_init[contract_name] = info["bytecode"].replace("0x", "") - source_unit.bytecodes_runtime[contract_name] = info["bytecode_runtime"].replace("0x", "") - # Vyper does not provide the source mapping for the init bytecode - source_unit.srcmaps_init[contract_name] = [] - # info["source_map"]["pc_pos_map"] contains the source mapping in a simpler format - # However pc_pos_map_compressed" seems to follow solc's format, so for convenience - # We store the same - # TODO: create SourceMapping class, so that srcmaps_runtime would store an class - # That will give more flexebility to different compilers - source_unit.srcmaps_runtime[contract_name] = info["source_map"]["pc_pos_map_compressed"] - - # Natspec not yet handled for vyper - source_unit.natspec[contract_name] = Natspec({}, {}) - - ast = _get_vyper_ast(target, vyper) - source_unit.ast = ast + for source_file, contract_info in compilation_artifacts["contracts"].items(): + filename = convert_filename(source_file, _relative_to_short, crytic_compile) + source_unit = compilation_unit.create_source_unit(filename) + for contract_name, contract_metadata in contract_info.items(): + source_unit.add_contract_name(contract_name) + compilation_unit.filename_to_contracts[filename].add(contract_name) + + source_unit.abis[contract_name] = contract_metadata["abi"] + source_unit.bytecodes_init[contract_name] = contract_metadata["evm"]["bytecode"][ + "object" + ].replace("0x", "") + # Vyper does not provide the source mapping for the init bytecode + source_unit.srcmaps_init[contract_name] = [] + source_unit.srcmaps_runtime[contract_name] = contract_metadata["evm"][ + "deployedBytecode" + ]["sourceMap"] + source_unit.bytecodes_runtime[contract_name] = contract_metadata["evm"][ + "deployedBytecode" + ]["object"].replace("0x", "") + source_unit.natspec[contract_name] = Natspec( + contract_metadata["userdoc"], contract_metadata["devdoc"] + ) + + for source_file, ast in compilation_artifacts["sources"].items(): + filename = convert_filename(source_file, _relative_to_short, crytic_compile) + source_unit = compilation_unit.create_source_unit(filename) + source_unit.ast = ast + + def add_source_files(self, file_paths: List[str]) -> None: + for file_path in file_paths: + with open(file_path, "r") as f: + self.standard_json_input["sources"][file_path] = { + "content": f.read(), + } def clean(self, **_kwargs: str) -> None: """Clean compilation artifacts @@ -129,13 +167,16 @@ def _guessed_tests(self) -> List[str]: return [] -def _run_vyper( - filename: str, vyper: str, env: Optional[Dict] = None, working_dir: Optional[str] = None +def _run_vyper_standard_json( + standard_input_path: str, + vyper: str, + env: Optional[Dict] = None, + working_dir: Optional[str] = None, ) -> Dict: - """Run vyper + """Run vyper and write compilation output to a file Args: - filename (str): vyper file + standard_input_path (str): path to the standard input json file vyper (str): vyper binary env (Optional[Dict], optional): Environment variables. Defaults to None. working_dir (Optional[str], optional): Working directory. Defaults to None. @@ -146,81 +187,12 @@ def _run_vyper( Returns: Dict: Vyper json compilation artifact """ - if not os.path.isfile(filename): - raise InvalidCompilation(f"{filename} does not exist (are you in the correct directory?)") - - cmd = [vyper, filename, "-f", "combined_json"] - - additional_kwargs: Dict = {"cwd": working_dir} if working_dir else {} - stderr = "" - LOGGER.info( - "'%s' running", - " ".join(cmd), - ) - try: - with subprocess.Popen( - cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - executable=shutil.which(cmd[0]), - **additional_kwargs, - ) as process: - stdout, stderr = process.communicate() - res = stdout.split(b"\n") - res = res[-2] - return json.loads(res) - except OSError as error: - # pylint: disable=raise-missing-from - raise InvalidCompilation(error) - except json.decoder.JSONDecodeError: - # pylint: disable=raise-missing-from - raise InvalidCompilation(f"Invalid vyper compilation\n{stderr}") - - -def _get_vyper_ast( - filename: str, vyper: str, env: Optional[Dict] = None, working_dir: Optional[str] = None -) -> Dict: - """Get ast from vyper - - Args: - filename (str): vyper file - vyper (str): vyper binary - env (Dict, optional): Environment variables. Defaults to None. - working_dir (str, optional): Working directory. Defaults to None. - - Raises: - InvalidCompilation: If vyper failed to run - - Returns: - Dict: [description] - """ - if not os.path.isfile(filename): - raise InvalidCompilation(f"{filename} does not exist (are you in the correct directory?)") - - cmd = [vyper, filename, "-f", "ast"] - - additional_kwargs: Dict = {"cwd": working_dir} if working_dir else {} - stderr = "" - try: - with subprocess.Popen( - cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - executable=shutil.which(cmd[0]), - **additional_kwargs, - ) as process: - stdout, stderr = process.communicate() - res = stdout.split(b"\n") - res = res[-2] - return json.loads(res) - except json.decoder.JSONDecodeError: - # pylint: disable=raise-missing-from - raise InvalidCompilation(f"Invalid vyper compilation\n{stderr}") - except Exception as exception: - # pylint: disable=raise-missing-from - raise InvalidCompilation(exception) + cmd = [vyper, standard_input_path, "--standard-json", "-o", "crytic-export/artifacts.json"] + success = run(cmd, cwd=working_dir, extra_env=env) + if success is None: + raise InvalidCompilation("Vyper compilation failed") + with open("crytic-export/artifacts.json", "r") as f: + return json.load(f) def _relative_to_short(relative: Path) -> Path: From 1833299dd99d2a4c4a9a88034c3f459647f9d634 Mon Sep 17 00:00:00 2001 From: Simone Date: Wed, 9 Aug 2023 16:50:40 +0200 Subject: [PATCH 05/38] Add config function --- crytic_compile/platform/abstract_platform.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index c266520a..3555abdd 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -4,7 +4,7 @@ This gives the skeleton for any platform supported by crytic-compile """ import abc -from typing import TYPE_CHECKING, List, Dict +from typing import TYPE_CHECKING, List, Dict, Any, Optional from crytic_compile.platform import Type from crytic_compile.utils.unit_tests import guess_tests @@ -154,6 +154,19 @@ def is_dependency(self, path: str) -> bool: """ return False + @staticmethod + @abc.abstractmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as version, remappings ecc. + + Args: + working_dir (str): path to the target + + Returns: + Optional[Dict[str, Any]]: Data such as version, remappings ecc + """ + return None + # Only _guessed_tests is an abstract method # guessed_tests will call the generic guess_tests and appends to the list # platforms-dependent tests From a7a508023c2a600652aa0a93d7aa6e0966b94e89 Mon Sep 17 00:00:00 2001 From: Simone Date: Wed, 9 Aug 2023 16:51:08 +0200 Subject: [PATCH 06/38] Add default config function --- crytic_compile/platform/archive.py | 14 +++++++++++++- crytic_compile/platform/brownie.py | 14 +++++++++++++- crytic_compile/platform/buidler.py | 14 +++++++++++++- crytic_compile/platform/dapp.py | 14 +++++++++++++- crytic_compile/platform/embark.py | 14 +++++++++++++- crytic_compile/platform/etherlime.py | 14 +++++++++++++- crytic_compile/platform/etherscan.py | 14 +++++++++++++- crytic_compile/platform/hardhat.py | 12 ++++++++++++ crytic_compile/platform/solc.py | 12 ++++++++++++ crytic_compile/platform/truffle.py | 14 +++++++++++++- crytic_compile/platform/vyper.py | 14 +++++++++++++- crytic_compile/platform/waffle.py | 14 +++++++++++++- 12 files changed, 154 insertions(+), 10 deletions(-) diff --git a/crytic_compile/platform/archive.py b/crytic_compile/platform/archive.py index e7fc417d..f7ed0faf 100644 --- a/crytic_compile/platform/archive.py +++ b/crytic_compile/platform/archive.py @@ -7,7 +7,7 @@ import json import os from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any +from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any, Optional from crytic_compile.platform import Type as TypePlatform from crytic_compile.platform import standard @@ -118,6 +118,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return Path(target).parts[-1].endswith("_export_archive.json") + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, _path: str) -> bool: """Check if the _path is a dependency. Always false diff --git a/crytic_compile/platform/brownie.py b/crytic_compile/platform/brownie.py index 855d7269..22db2191 100755 --- a/crytic_compile/platform/brownie.py +++ b/crytic_compile/platform/brownie.py @@ -8,7 +8,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -114,6 +114,18 @@ def is_supported(target: str, **kwargs: str) -> bool: or os.path.isfile(os.path.join(target, "brownie-config.yml")) ) + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency (not supported for brownie) diff --git a/crytic_compile/platform/buidler.py b/crytic_compile/platform/buidler.py index 3f577d9f..9689d034 100755 --- a/crytic_compile/platform/buidler.py +++ b/crytic_compile/platform/buidler.py @@ -7,7 +7,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Tuple +from typing import TYPE_CHECKING, List, Tuple, Optional, Dict, Any from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform.exceptions import InvalidCompilation @@ -193,6 +193,18 @@ def is_supported(target: str, **kwargs: str) -> bool: is_typescript = os.path.isfile(os.path.join(target, "buidler.config.ts")) return is_javascript or is_typescript + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/dapp.py b/crytic_compile/platform/dapp.py index 5749569b..c788bec5 100755 --- a/crytic_compile/platform/dapp.py +++ b/crytic_compile/platform/dapp.py @@ -12,7 +12,7 @@ from pathlib import Path # Cycle dependency -from typing import TYPE_CHECKING, List, Optional +from typing import TYPE_CHECKING, List, Optional, Dict, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -157,6 +157,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return "dapp " in txt return False + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency (not supported for brownie) diff --git a/crytic_compile/platform/embark.py b/crytic_compile/platform/embark.py index 37503413..189c51cc 100755 --- a/crytic_compile/platform/embark.py +++ b/crytic_compile/platform/embark.py @@ -8,7 +8,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List +from typing import TYPE_CHECKING, List, Dict, Any, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -200,6 +200,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return os.path.isfile(os.path.join(target, "embark.json")) + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/etherlime.py b/crytic_compile/platform/etherlime.py index e677b60d..0e535e2f 100755 --- a/crytic_compile/platform/etherlime.py +++ b/crytic_compile/platform/etherlime.py @@ -10,7 +10,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Optional, Any +from typing import TYPE_CHECKING, List, Optional, Any, Dict from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -192,6 +192,18 @@ def is_supported(target: str, **kwargs: str) -> bool: ) return False + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 0a490977..5163c018 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -9,7 +9,7 @@ import urllib.request from json.decoder import JSONDecodeError from pathlib import Path, PurePosixPath -from typing import TYPE_CHECKING, Dict, List, Union, Tuple, Optional +from typing import TYPE_CHECKING, Dict, List, Union, Tuple, Optional, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -411,6 +411,18 @@ def is_supported(target: str, **kwargs: str) -> bool: target = target[target.find(":") + 1 :] return bool(re.match(r"^\s*0x[a-zA-Z0-9]{40}\s*$", target)) + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/hardhat.py b/crytic_compile/platform/hardhat.py index ca3f5f84..9b20fcbe 100755 --- a/crytic_compile/platform/hardhat.py +++ b/crytic_compile/platform/hardhat.py @@ -218,6 +218,18 @@ def is_supported(target: str, **kwargs: str) -> bool: or os.path.isfile(os.path.join(target, "hardhat.config.cjs")) ) + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/solc.py b/crytic_compile/platform/solc.py index ef8b93fa..47e88cf5 100644 --- a/crytic_compile/platform/solc.py +++ b/crytic_compile/platform/solc.py @@ -199,6 +199,18 @@ def is_supported(target: str, **kwargs: str) -> bool: """ return os.path.isfile(target) and target.endswith(".sol") + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency (always false for direct solc) diff --git a/crytic_compile/platform/truffle.py b/crytic_compile/platform/truffle.py index 67c3b74c..852b83a4 100755 --- a/crytic_compile/platform/truffle.py +++ b/crytic_compile/platform/truffle.py @@ -11,7 +11,7 @@ import subprocess import uuid from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional, Tuple +from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -309,6 +309,18 @@ def is_supported(target: str, **kwargs: str) -> bool: os.path.join(target, "truffle-config.js") ) + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + # pylint: disable=no-self-use def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 49133fd9..7c8e7600 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -7,7 +7,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -120,6 +120,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return os.path.isfile(target) and target.endswith(".vy") + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def _guessed_tests(self) -> List[str]: """Guess the potential unit tests commands diff --git a/crytic_compile/platform/waffle.py b/crytic_compile/platform/waffle.py index 6735649a..25738c5d 100755 --- a/crytic_compile/platform/waffle.py +++ b/crytic_compile/platform/waffle.py @@ -10,7 +10,7 @@ import subprocess import tempfile from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion @@ -260,6 +260,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return False + @staticmethod + def config(working_dir: str) -> Optional[Dict[str, Any]]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the path is a dependency From c65f67b7694914a34cdf155b31c2f4efd978b33e Mon Sep 17 00:00:00 2001 From: Simone Date: Wed, 9 Aug 2023 16:52:37 +0200 Subject: [PATCH 07/38] Parse foundry configuration --- crytic_compile/platform/foundry.py | 51 +++++++++++++++++++++++++++++- setup.py | 2 +- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index f0d6c7f8..67fef228 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -3,8 +3,10 @@ """ import logging import os +import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List +from typing import TYPE_CHECKING, List, Dict, Any +import toml from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.types import Type @@ -98,6 +100,53 @@ def is_supported(target: str, **kwargs: str) -> bool: return os.path.isfile(os.path.join(target, "foundry.toml")) + @staticmethod + def config(working_dir: str) -> Dict[str, Any]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Dict[str, Any]: Data such as remappings + """ + result = {} + result["remappings"] = ( + subprocess.run(["forge", "remappings"], stdout=subprocess.PIPE, check=True) + .stdout.decode("utf-8") + .replace("\n", " ") + .strip() + ) + with open("foundry.toml", "r") as f: + foundry_toml = toml.loads(f.read()) + default_profile = foundry_toml["profile"]["default"] + + if "solc_version" in default_profile: + result["solc_version"] = default_profile["solc_version"] + if "offline" in default_profile: + result["offline"] = default_profile["offline"] + if "optimizer" in default_profile: + result["optimizer"] = default_profile["optimizer"] + else: + # Default to true + result["optimizer"] = True + if "optimizer_runs" in default_profile: + result["optimizer_runs"] = default_profile["optimizer_runs"] + else: + # Default to 200 + result["optimizer_runs"] = 200 + if "via_ir" in default_profile: + result["via_ir"] = default_profile["via_ir"] + if "allow_paths" in default_profile: + result["allow_paths"] = default_profile["allow_paths"] + if "evm_version" in default_profile: + result["evm_version"] = default_profile["evm_version"] + else: + # Default to london + result["evm_version"] = "london" + + return result + # pylint: disable=no-self-use def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/setup.py b/setup.py index b268b07b..06b2f3d4 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ version="0.3.2", packages=find_packages(), python_requires=">=3.8", - install_requires=["pycryptodome>=3.4.6", "cbor2", "solc-select>=v1.0.2"], + install_requires=["pycryptodome>=3.4.6", "cbor2", "solc-select>=v1.0.2", "toml>=0.10.2"], extras_require={ "test": [ "pytest", From e34b0cc57c5b8eb3af74c18b9809826d49313729 Mon Sep 17 00:00:00 2001 From: Simone Date: Wed, 9 Aug 2023 16:52:56 +0200 Subject: [PATCH 08/38] Add auto-compile option --- crytic_compile/crytic_compile.py | 44 +++++++++++++++++++++ crytic_compile/cryticparser/cryticparser.py | 8 ++++ crytic_compile/cryticparser/defaults.py | 1 + 3 files changed, 53 insertions(+) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index e437afef..a087b001 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -14,6 +14,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, Type, Union +from solc_select.solc_select import switch_global_version, current_version from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.platform import all_platforms, solc_standard_json from crytic_compile.platform.abstract_platform import AbstractPlatform @@ -116,6 +117,49 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: if isinstance(target, str): platform = self._init_platform(target, **kwargs) + # If the platform is Solc it means we are trying to compile a single + # we try to see if we are in a known compilation framework to retrieve + # information like remappings and solc version + if kwargs["auto_compile"] and isinstance(platform, Solc): + # Try to get the platform of the current working directory + platform_wd = next( + ( + p(target) + for p in get_platforms() + if p.is_supported(str(self._working_dir), **kwargs) + ), + None, + ) + # If no platform has been found or if it's a Solc we can't do anything + if platform_wd and not isinstance(platform_wd, Solc): + solc_config = platform_wd.config(str(self._working_dir)) + if solc_config: + kwargs["solc_args"] = "" + kwargs["solc_remaps"] = "" + + if "remappings" in solc_config: + kwargs["solc_remaps"] = solc_config["remappings"] + if ( + "solc_version" in solc_config + and solc_config["solc_version"] != current_version()[0] + ): + # Respect foundry offline option and don't install a missing solc version + if "offline" in solc_config and solc_config["offline"]: + switch_global_version(solc_config["solc_version"], False) + else: + switch_global_version(solc_config["solc_version"], True) + if "optimizer" in solc_config and solc_config["optimizer"]: + kwargs["solc_args"] += "--optimize" + if "optimizer_runs" in solc_config: + kwargs[ + "solc_args" + ] += f"--optimize-runs {solc_config['optimizer_runs']}" + if "via_ir" in solc_config and solc_config["via_ir"]: + kwargs["solc_args"] += "--via-ir" + if "allow_paths" in solc_config: + kwargs["solc_args"] += f"--allow-paths {solc_config['allow_paths']}" + if "evm_version" in solc_config: + kwargs["solc_args"] += f"--evm-version {solc_config['evm_version']}" else: platform = target diff --git a/crytic_compile/cryticparser/cryticparser.py b/crytic_compile/cryticparser/cryticparser.py index f8848377..a134a2e3 100755 --- a/crytic_compile/cryticparser/cryticparser.py +++ b/crytic_compile/cryticparser/cryticparser.py @@ -65,6 +65,14 @@ def init(parser: ArgumentParser) -> None: default=DEFAULTS_FLAG_IN_CONFIG["skip_clean"], ) + group_compile.add_argument( + "--auto-compile", + help="Try to get the solc options automatically when compiling a single file", + action="store_true", + dest="auto_compile", + default=DEFAULTS_FLAG_IN_CONFIG["auto_compile"], + ) + _init_solc(parser) _init_truffle(parser) _init_embark(parser) diff --git a/crytic_compile/cryticparser/defaults.py b/crytic_compile/cryticparser/defaults.py index fda8dc0a..518baf6f 100755 --- a/crytic_compile/cryticparser/defaults.py +++ b/crytic_compile/cryticparser/defaults.py @@ -47,4 +47,5 @@ "foundry_out_directory": "out", "export_dir": "crytic-export", "compile_libraries": None, + "auto_compile": False, } From 1e736711e79839d9de3fa8f1a984f3e3f458aefd Mon Sep 17 00:00:00 2001 From: Simone Date: Wed, 9 Aug 2023 17:30:42 +0200 Subject: [PATCH 09/38] Don't change the global solc version --- crytic_compile/crytic_compile.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index a087b001..388a127c 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -14,7 +14,12 @@ from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, Type, Union -from solc_select.solc_select import switch_global_version, current_version +from solc_select.solc_select import ( + install_artifacts, + installed_versions, + current_version, + artifact_path, +) from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.platform import all_platforms, solc_standard_json from crytic_compile.platform.abstract_platform import AbstractPlatform @@ -143,11 +148,18 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: "solc_version" in solc_config and solc_config["solc_version"] != current_version()[0] ): - # Respect foundry offline option and don't install a missing solc version - if "offline" in solc_config and solc_config["offline"]: - switch_global_version(solc_config["solc_version"], False) + solc_version = solc_config["solc_version"] + if solc_version in installed_versions(): + kwargs["solc"] = str(artifact_path(solc_version).absolute()) else: - switch_global_version(solc_config["solc_version"], True) + # Respect foundry offline option and don't install a missing solc version + if ( + "offline" not in solc_config + or "offline" in solc_config + and not solc_config["offline"] + ): + install_artifacts([solc_version]) + kwargs["solc"] = str(artifact_path(solc_version).absolute()) if "optimizer" in solc_config and solc_config["optimizer"]: kwargs["solc_args"] += "--optimize" if "optimizer_runs" in solc_config: From 94911afaf13bf4bad77cfd494563de6192e43465 Mon Sep 17 00:00:00 2001 From: vikramarun <33469661+vikramarun@users.noreply.github.com> Date: Wed, 9 Aug 2023 23:52:00 +0530 Subject: [PATCH 10/38] chore: add base, gnosis, polygonzkevm --- crytic_compile/platform/etherscan.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index e00dcaf4..dfddbbea 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -50,6 +50,9 @@ "testnet.avax:": ("-testnet.snowtrace.io", "testnet.snowtrace.io"), "ftm:": (".ftmscan.com", "ftmscan.com"), "goerli.base:": ("-goerli.basescan.org", "goerli.basescan.org"), + "base:": (".basescan.org", "basescan.org"), + "gno:": (".gnosisscan.io", "gnosisscan.io"), + "polyzk:": ("-zkevm.polygonscan.com", "zkevm.polygonscan.com"), } @@ -237,6 +240,9 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: ftmscan_api_key = kwargs.get("ftmscan_api_key", None) bscan_api_key = kwargs.get("bscan_api_key", None) optim_api_key = kwargs.get("optim_api_key", None) + base_api_key = kwargs.get("base_api_key", None) + gno_api_key = kwargs.get("gno_api_key", None) + polyzk_api_key = kwargs.get("polyzk_api_key", None) export_dir = kwargs.get("export_dir", "crytic-export") export_dir = os.path.join( @@ -267,6 +273,15 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: if optim_api_key and "optim" in etherscan_url: etherscan_url += f"&apikey={optim_api_key}" etherscan_bytecode_url += f"&apikey={optim_api_key}" + if base_api_key and "base" in etherscan_url: + etherscan_url += f"&apikey={base_api_key}" + etherscan_bytecode_url += f"&apikey={base_api_key}" + if gno_api_key and "gno" in etherscan_url: + etherscan_url += f"&apikey={gno_api_key}" + etherscan_bytecode_url += f"&apikey={gno_api_key}" + if polyzk_api_key and "zkevm" in etherscan_url: + etherscan_url += f"&apikey={polyzk_api_key}" + etherscan_bytecode_url += f"&apikey={polyzk_api_key}" source_code: str = "" result: Dict[str, Union[bool, str, int]] = {} From b91b88a5b4892c5ea0d37bf599476d9fe896d1a7 Mon Sep 17 00:00:00 2001 From: Simone Date: Thu, 10 Aug 2023 18:17:44 +0200 Subject: [PATCH 11/38] Add PlatformConfig class --- crytic_compile/crytic_compile.py | 36 +++++++++---------- crytic_compile/platform/abstract_platform.py | 25 +++++++++++-- crytic_compile/platform/archive.py | 6 ++-- crytic_compile/platform/brownie.py | 8 ++--- crytic_compile/platform/buidler.py | 8 ++--- crytic_compile/platform/dapp.py | 8 ++--- crytic_compile/platform/embark.py | 8 ++--- crytic_compile/platform/etherlime.py | 8 ++--- crytic_compile/platform/etherscan.py | 8 ++--- crytic_compile/platform/foundry.py | 38 +++++++++++--------- crytic_compile/platform/hardhat.py | 6 ++-- crytic_compile/platform/solc.py | 6 ++-- crytic_compile/platform/standard.py | 16 +++++++-- crytic_compile/platform/truffle.py | 8 ++--- crytic_compile/platform/vyper.py | 8 ++--- crytic_compile/platform/waffle.py | 8 ++--- 16 files changed, 119 insertions(+), 86 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 388a127c..551b0f03 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -137,41 +137,37 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: ) # If no platform has been found or if it's a Solc we can't do anything if platform_wd and not isinstance(platform_wd, Solc): - solc_config = platform_wd.config(str(self._working_dir)) - if solc_config: + platform_config = platform_wd.config(str(self._working_dir)) + if platform_config: kwargs["solc_args"] = "" kwargs["solc_remaps"] = "" - if "remappings" in solc_config: - kwargs["solc_remaps"] = solc_config["remappings"] + if platform_config.remappings: + kwargs["solc_remaps"] = platform_config.remappings if ( - "solc_version" in solc_config - and solc_config["solc_version"] != current_version()[0] + platform_config.solc_version + and platform_config.solc_version != current_version()[0] ): - solc_version = solc_config["solc_version"] + solc_version = platform_config.solc_version if solc_version in installed_versions(): kwargs["solc"] = str(artifact_path(solc_version).absolute()) else: # Respect foundry offline option and don't install a missing solc version - if ( - "offline" not in solc_config - or "offline" in solc_config - and not solc_config["offline"] - ): + if not platform_config.offline: install_artifacts([solc_version]) kwargs["solc"] = str(artifact_path(solc_version).absolute()) - if "optimizer" in solc_config and solc_config["optimizer"]: + if platform_config.optimizer: kwargs["solc_args"] += "--optimize" - if "optimizer_runs" in solc_config: + if platform_config.optimizer_runs: kwargs[ "solc_args" - ] += f"--optimize-runs {solc_config['optimizer_runs']}" - if "via_ir" in solc_config and solc_config["via_ir"]: + ] += f"--optimize-runs {platform_config.optimizer_runs}" + if platform_config.via_ir: kwargs["solc_args"] += "--via-ir" - if "allow_paths" in solc_config: - kwargs["solc_args"] += f"--allow-paths {solc_config['allow_paths']}" - if "evm_version" in solc_config: - kwargs["solc_args"] += f"--evm-version {solc_config['evm_version']}" + if platform_config.allow_paths: + kwargs["solc_args"] += f"--allow-paths {platform_config.allow_paths}" + if platform_config.evm_version: + kwargs["solc_args"] += f"--evm-version {platform_config.evm_version}" else: platform = target diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index 3555abdd..eae66b91 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -4,7 +4,8 @@ This gives the skeleton for any platform supported by crytic-compile """ import abc -from typing import TYPE_CHECKING, List, Dict, Any, Optional +from typing import TYPE_CHECKING, List, Dict, Optional +from dataclasses import dataclass, field from crytic_compile.platform import Type from crytic_compile.utils.unit_tests import guess_tests @@ -22,6 +23,24 @@ class IncorrectPlatformInitialization(Exception): pass +@dataclass +class PlatformConfig: + """ + This class represents a generic platform configuration + """ + offline: bool = False + remappings: Optional[str] = None + solc_version: Optional[str] = None + optimizer: bool = False + optimizer_runs: Optional[int] = None + via_ir: bool = False + allow_paths: Optional[str] = None + evm_version: Optional[str] = None + src_path: str = "src" + tests_path: str = "test" + libs_path: List[str] = field(default_factory=lambda: ["lib"]) + + class AbstractPlatform(metaclass=abc.ABCMeta): """ This is the abstract class for the platform @@ -156,14 +175,14 @@ def is_dependency(self, path: str) -> bool: @staticmethod @abc.abstractmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as version, remappings ecc. Args: working_dir (str): path to the target Returns: - Optional[Dict[str, Any]]: Data such as version, remappings ecc + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/archive.py b/crytic_compile/platform/archive.py index f7ed0faf..93c1e447 100644 --- a/crytic_compile/platform/archive.py +++ b/crytic_compile/platform/archive.py @@ -13,7 +13,7 @@ from crytic_compile.platform import standard # Cycle dependency -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig if TYPE_CHECKING: from crytic_compile import CryticCompile @@ -119,14 +119,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return Path(target).parts[-1].endswith("_export_archive.json") @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/brownie.py b/crytic_compile/platform/brownie.py index 22db2191..5677f964 100755 --- a/crytic_compile/platform/brownie.py +++ b/crytic_compile/platform/brownie.py @@ -8,11 +8,11 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional, Any +from typing import TYPE_CHECKING, Dict, List, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import Filename, convert_filename @@ -115,14 +115,14 @@ def is_supported(target: str, **kwargs: str) -> bool: ) @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/buidler.py b/crytic_compile/platform/buidler.py index 9689d034..2186e9f4 100755 --- a/crytic_compile/platform/buidler.py +++ b/crytic_compile/platform/buidler.py @@ -7,7 +7,7 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Tuple, Optional, Dict, Any +from typing import TYPE_CHECKING, List, Tuple, Optional from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform.exceptions import InvalidCompilation @@ -15,7 +15,7 @@ from crytic_compile.utils.naming import convert_filename, extract_name from crytic_compile.utils.natspec import Natspec from crytic_compile.compilation_unit import CompilationUnit -from .abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig # Handle cycle from .solc import relative_to_short @@ -194,14 +194,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return is_javascript or is_typescript @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/dapp.py b/crytic_compile/platform/dapp.py index c788bec5..f46296e8 100755 --- a/crytic_compile/platform/dapp.py +++ b/crytic_compile/platform/dapp.py @@ -12,11 +12,11 @@ from pathlib import Path # Cycle dependency -from typing import TYPE_CHECKING, List, Optional, Dict, Any +from typing import TYPE_CHECKING, List, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_name from crytic_compile.utils.subprocess import run @@ -158,14 +158,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return False @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/embark.py b/crytic_compile/platform/embark.py index 189c51cc..9cddb275 100755 --- a/crytic_compile/platform/embark.py +++ b/crytic_compile/platform/embark.py @@ -8,11 +8,11 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Dict, Any, Optional +from typing import TYPE_CHECKING, List, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_filename, extract_name @@ -201,14 +201,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return os.path.isfile(os.path.join(target, "embark.json")) @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/etherlime.py b/crytic_compile/platform/etherlime.py index 0e535e2f..a5883b95 100755 --- a/crytic_compile/platform/etherlime.py +++ b/crytic_compile/platform/etherlime.py @@ -10,11 +10,11 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Optional, Any, Dict +from typing import TYPE_CHECKING, List, Optional, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename @@ -193,14 +193,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return False @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 5163c018..89e66352 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -9,12 +9,12 @@ import urllib.request from json.decoder import JSONDecodeError from pathlib import Path, PurePosixPath -from typing import TYPE_CHECKING, Dict, List, Union, Tuple, Optional, Any +from typing import TYPE_CHECKING, Dict, List, Union, Tuple, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import solc_standard_json -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import Filename @@ -412,14 +412,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return bool(re.match(r"^\s*0x[a-zA-Z0-9]{40}\s*$", target)) @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index 67fef228..2e7a7901 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -5,10 +5,10 @@ import os import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Dict, Any +from typing import TYPE_CHECKING, List, Optional import toml -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.types import Type from crytic_compile.platform.hardhat import hardhat_like_parsing from crytic_compile.utils.subprocess import run @@ -101,17 +101,17 @@ def is_supported(target: str, **kwargs: str) -> bool: return os.path.isfile(os.path.join(target, "foundry.toml")) @staticmethod - def config(working_dir: str) -> Dict[str, Any]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ - result = {} - result["remappings"] = ( + result = PlatformConfig() + result.remappings = ( subprocess.run(["forge", "remappings"], stdout=subprocess.PIPE, check=True) .stdout.decode("utf-8") .replace("\n", " ") @@ -122,28 +122,34 @@ def config(working_dir: str) -> Dict[str, Any]: default_profile = foundry_toml["profile"]["default"] if "solc_version" in default_profile: - result["solc_version"] = default_profile["solc_version"] + result.solc_version = default_profile["solc_version"] if "offline" in default_profile: - result["offline"] = default_profile["offline"] + result.offline = default_profile["offline"] if "optimizer" in default_profile: - result["optimizer"] = default_profile["optimizer"] + result.optimizer = default_profile["optimizer"] else: # Default to true - result["optimizer"] = True + result.optimizer = True if "optimizer_runs" in default_profile: - result["optimizer_runs"] = default_profile["optimizer_runs"] + result.optimizer_runs = default_profile["optimizer_runs"] else: # Default to 200 - result["optimizer_runs"] = 200 + result.optimizer_runs = 200 if "via_ir" in default_profile: - result["via_ir"] = default_profile["via_ir"] + result.via_ir = default_profile["via_ir"] if "allow_paths" in default_profile: - result["allow_paths"] = default_profile["allow_paths"] + result.allow_paths = default_profile["allow_paths"] if "evm_version" in default_profile: - result["evm_version"] = default_profile["evm_version"] + result.evm_version = default_profile["evm_version"] else: # Default to london - result["evm_version"] = "london" + result.evm_version = "london" + if "src" in default_profile: + result.src_path = default_profile["src"] + if "test" in default_profile: + result.tests_path = default_profile["test"] + if "libs" in default_profile: + result.libs_path = default_profile["libs"] return result diff --git a/crytic_compile/platform/hardhat.py b/crytic_compile/platform/hardhat.py index 9b20fcbe..32e07a13 100755 --- a/crytic_compile/platform/hardhat.py +++ b/crytic_compile/platform/hardhat.py @@ -15,7 +15,7 @@ from crytic_compile.utils.naming import convert_filename, extract_name from crytic_compile.utils.natspec import Natspec from crytic_compile.utils.subprocess import run -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig # Handle cycle from crytic_compile.platform.solc import relative_to_short @@ -219,14 +219,14 @@ def is_supported(target: str, **kwargs: str) -> bool: ) @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/solc.py b/crytic_compile/platform/solc.py index 47e88cf5..0dd3800d 100644 --- a/crytic_compile/platform/solc.py +++ b/crytic_compile/platform/solc.py @@ -12,7 +12,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import ( @@ -200,14 +200,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return os.path.isfile(target) and target.endswith(".sol") @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/standard.py b/crytic_compile/platform/standard.py index f2046dfa..9273bb8b 100644 --- a/crytic_compile/platform/standard.py +++ b/crytic_compile/platform/standard.py @@ -5,12 +5,12 @@ import os from collections import defaultdict from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any +from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import Type as PlatformType -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.utils.naming import Filename # Cycle dependency @@ -120,6 +120,18 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return Path(target).parts[-1].endswith("_export.json") + @staticmethod + def config(working_dir: str) -> Optional[PlatformConfig]: + """Return configuration data that should be passed to solc, such as remappings. + + Args: + working_dir (str): path to the working directory + + Returns: + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... + """ + return None + def is_dependency(self, path: str) -> bool: """Check if the target is a dependency This function always return false, the deps are handled by crytic_compile_dependencies diff --git a/crytic_compile/platform/truffle.py b/crytic_compile/platform/truffle.py index 852b83a4..486ddc6f 100755 --- a/crytic_compile/platform/truffle.py +++ b/crytic_compile/platform/truffle.py @@ -11,12 +11,12 @@ import subprocess import uuid from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional, Tuple, Any +from typing import TYPE_CHECKING, Dict, List, Optional, Tuple from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import solc -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename @@ -310,14 +310,14 @@ def is_supported(target: str, **kwargs: str) -> bool: ) @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 7c8e7600..6fac311d 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -7,11 +7,11 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional, Any +from typing import TYPE_CHECKING, Dict, List, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename @@ -121,14 +121,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return os.path.isfile(target) and target.endswith(".vy") @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None diff --git a/crytic_compile/platform/waffle.py b/crytic_compile/platform/waffle.py index 25738c5d..053bc7c3 100755 --- a/crytic_compile/platform/waffle.py +++ b/crytic_compile/platform/waffle.py @@ -10,11 +10,11 @@ import subprocess import tempfile from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Optional, Any +from typing import TYPE_CHECKING, Dict, List, Optional from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform +from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename @@ -261,14 +261,14 @@ def is_supported(target: str, **kwargs: str) -> bool: return False @staticmethod - def config(working_dir: str) -> Optional[Dict[str, Any]]: + def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as remappings. Args: working_dir (str): path to the working directory Returns: - Dict[str, Any]: Data such as remappings + Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... """ return None From 677075ced3669bb567f680238e62c810ffb00b57 Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 11 Aug 2023 10:37:09 +0200 Subject: [PATCH 12/38] Add scripts path in PlatformConfig --- crytic_compile/platform/abstract_platform.py | 2 ++ crytic_compile/platform/foundry.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index eae66b91..d48df420 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -28,6 +28,7 @@ class PlatformConfig: """ This class represents a generic platform configuration """ + offline: bool = False remappings: Optional[str] = None solc_version: Optional[str] = None @@ -39,6 +40,7 @@ class PlatformConfig: src_path: str = "src" tests_path: str = "test" libs_path: List[str] = field(default_factory=lambda: ["lib"]) + scripts_path: str = "script" class AbstractPlatform(metaclass=abc.ABCMeta): diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index 2e7a7901..4969e8cc 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -150,6 +150,8 @@ def config(working_dir: str) -> Optional[PlatformConfig]: result.tests_path = default_profile["test"] if "libs" in default_profile: result.libs_path = default_profile["libs"] + if "script" in default_profile: + result.scripts_path = default_profile["script"] return result From 0d3e8e8354fb74473c2dd2f3e1df693912dcf6d6 Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 11 Aug 2023 10:37:28 +0200 Subject: [PATCH 13/38] Update foundry link --- crytic_compile/platform/foundry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index 4969e8cc..f5f91a08 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -26,7 +26,7 @@ class Foundry(AbstractPlatform): """ NAME = "Foundry" - PROJECT_URL = "https://github.com/gakonst/foundry" + PROJECT_URL = "https://github.com/foundry-rs/foundry" TYPE = Type.FOUNDRY # pylint: disable=too-many-locals,too-many-statements,too-many-branches From 7e186a8bc487d4464c5116c92723f6f25e81e48d Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 11 Aug 2023 10:38:45 +0200 Subject: [PATCH 14/38] Skip compiling foundry test and script --- crytic_compile/cryticparser/cryticparser.py | 8 +++++++ crytic_compile/cryticparser/defaults.py | 1 + crytic_compile/platform/foundry.py | 23 ++++++++++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/crytic_compile/cryticparser/cryticparser.py b/crytic_compile/cryticparser/cryticparser.py index a134a2e3..88ea4da6 100755 --- a/crytic_compile/cryticparser/cryticparser.py +++ b/crytic_compile/cryticparser/cryticparser.py @@ -504,3 +504,11 @@ def _init_foundry(parser: ArgumentParser) -> None: dest="foundry_out_directory", default=DEFAULTS_FLAG_IN_CONFIG["foundry_out_directory"], ) + + group_foundry.add_argument( + "--foundry-compile-all", + help="Don't skip compiling test and script", + action="store_true", + dest="foundry_compile_all", + default=DEFAULTS_FLAG_IN_CONFIG["foundry_compile_all"], + ) diff --git a/crytic_compile/cryticparser/defaults.py b/crytic_compile/cryticparser/defaults.py index 518baf6f..8b57e64a 100755 --- a/crytic_compile/cryticparser/defaults.py +++ b/crytic_compile/cryticparser/defaults.py @@ -45,6 +45,7 @@ "hardhat_artifacts_directory": None, "foundry_ignore_compile": False, "foundry_out_directory": "out", + "foundry_compile_all": False, "export_dir": "crytic-export", "compile_libraries": None, "auto_compile": False, diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index f5f91a08..65e95583 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -51,12 +51,25 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: ) if not ignore_compile: + compilation_command = [ + "forge", + "build", + "--build-info", + ] + + compile_all = kwargs.get("foundry_compile_all", False) + + if not compile_all: + foundry_config = self.config(crytic_compile.working_dir) + compilation_command += [ + "--skip", + f"*/{foundry_config.tests_path}/**", + f"*/{foundry_config.scripts_path}/**", + "--force", + ] + run( - [ - "forge", - "build", - "--build-info", - ], + compilation_command, cwd=self._target, ) From 3bd372970a8eafec4b0ef12266fa4ed26f368cba Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 11 Aug 2023 10:49:44 +0200 Subject: [PATCH 15/38] Lint --- crytic_compile/crytic_compile.py | 2 ++ crytic_compile/platform/abstract_platform.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 551b0f03..2c077197 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -90,6 +90,7 @@ class CryticCompile: Main class. """ + # pylint: disable=too-many-branches def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: """See https://github.com/crytic/crytic-compile/wiki/Configuration Target is usually a file or a project directory. It can be an AbstractPlatform @@ -120,6 +121,7 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: self._working_dir = Path.cwd() + # pylint: disable=too-many-nested-blocks if isinstance(target, str): platform = self._init_platform(target, **kwargs) # If the platform is Solc it means we are trying to compile a single diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index d48df420..167bf5c3 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -22,7 +22,7 @@ class IncorrectPlatformInitialization(Exception): # pylint: disable=unnecessary-pass pass - +# pylint: disable=too-many-instance-attributes @dataclass class PlatformConfig: """ From 0b8f205c83e751fb55edc5ba93ff8d92d88092b7 Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 11 Aug 2023 11:31:42 +0200 Subject: [PATCH 16/38] Lint --- crytic_compile/crytic_compile.py | 2 +- crytic_compile/platform/abstract_platform.py | 1 + crytic_compile/platform/foundry.py | 17 +++++++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 2c077197..b3809284 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -127,7 +127,7 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: # If the platform is Solc it means we are trying to compile a single # we try to see if we are in a known compilation framework to retrieve # information like remappings and solc version - if kwargs["auto_compile"] and isinstance(platform, Solc): + if kwargs.get("auto_compile", False) and isinstance(platform, Solc): # Try to get the platform of the current working directory platform_wd = next( ( diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index 167bf5c3..8654a35e 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -22,6 +22,7 @@ class IncorrectPlatformInitialization(Exception): # pylint: disable=unnecessary-pass pass + # pylint: disable=too-many-instance-attributes @dataclass class PlatformConfig: diff --git a/crytic_compile/platform/foundry.py b/crytic_compile/platform/foundry.py index 65e95583..d46494d5 100755 --- a/crytic_compile/platform/foundry.py +++ b/crytic_compile/platform/foundry.py @@ -60,13 +60,14 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: compile_all = kwargs.get("foundry_compile_all", False) if not compile_all: - foundry_config = self.config(crytic_compile.working_dir) - compilation_command += [ - "--skip", - f"*/{foundry_config.tests_path}/**", - f"*/{foundry_config.scripts_path}/**", - "--force", - ] + foundry_config = self.config(str(crytic_compile.working_dir.absolute())) + if foundry_config: + compilation_command += [ + "--skip", + f"*/{foundry_config.tests_path}/**", + f"*/{foundry_config.scripts_path}/**", + "--force", + ] run( compilation_command, @@ -130,7 +131,7 @@ def config(working_dir: str) -> Optional[PlatformConfig]: .replace("\n", " ") .strip() ) - with open("foundry.toml", "r") as f: + with open("foundry.toml", "r", encoding="utf-8") as f: foundry_toml = toml.loads(f.read()) default_profile = foundry_toml["profile"]["default"] From 80f3050575b70d57365aae4fb30b74977d53af9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 23:53:23 +0000 Subject: [PATCH 17/38] Bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.10 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.8 to 1.8.10. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.8...v1.8.10) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9a9c2e0a..7ed7a957 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,7 +45,7 @@ jobs: path: dist/ - name: publish - uses: pypa/gh-action-pypi-publish@v1.8.8 + uses: pypa/gh-action-pypi-publish@v1.8.10 - name: sign uses: sigstore/gh-action-sigstore-python@v2.0.0 From 48f5ccea9becf76d1733f28381471037a666b5fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Aug 2023 23:53:26 +0000 Subject: [PATCH 18/38] Bump sigstore/gh-action-sigstore-python from 2.0.0 to 2.0.1 Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases) - [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: sigstore/gh-action-sigstore-python dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9a9c2e0a..dc964a5f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,7 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.8.8 - name: sign - uses: sigstore/gh-action-sigstore-python@v2.0.0 + uses: sigstore/gh-action-sigstore-python@v2.0.1 with: inputs: ./dist/*.tar.gz ./dist/*.whl release-signing-artifacts: true From a7c32c00b116a2fbf965f91907d56a6ec8f57959 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Tue, 29 Aug 2023 16:01:56 -0500 Subject: [PATCH 19/38] split srcmap --- crytic_compile/platform/vyper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index ad8783ee..83542625 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -103,7 +103,7 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: source_unit.srcmaps_init[contract_name] = [] source_unit.srcmaps_runtime[contract_name] = contract_metadata["evm"][ "deployedBytecode" - ]["sourceMap"] + ]["sourceMap"].split(";") source_unit.bytecodes_runtime[contract_name] = contract_metadata["evm"][ "deployedBytecode" ]["object"].replace("0x", "") From 1150349d640452e6b9ba6d71c1e9ddaa2ba9c63b Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Thu, 31 Aug 2023 09:57:51 -0500 Subject: [PATCH 20/38] use tempfiles --- crytic_compile/platform/vyper.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 83542625..fb02b1ff 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -4,8 +4,7 @@ import json import logging import os -import shutil -import subprocess +import tempfile from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional @@ -73,13 +72,15 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: self.add_source_files([target]) vyper_bin = kwargs.get("vyper", "vyper") - output_file = Path("crytic-export/standard_input.json") - output_file.parent.mkdir(exist_ok=True, parents=True) - with open(output_file, "w") as f: - f.write(json.dumps(self.standard_json_input)) - - compilation_artifacts = _run_vyper_standard_json(output_file.as_posix(), vyper_bin) - + compilation_artifacts = None + with tempfile.NamedTemporaryFile(mode="a+") as f: + json.dump(self.standard_json_input, f) + f.seek(0) + compilation_artifacts = _run_vyper_standard_json(f.name, vyper_bin) + + if "errors" in compilation_artifacts: + # TODO format errors + raise InvalidCompilation(compilation_artifacts["errors"]) compilation_unit = CompilationUnit(crytic_compile, str(target)) compiler_version = compilation_artifacts["compiler"].split("-")[1] @@ -187,12 +188,13 @@ def _run_vyper_standard_json( Returns: Dict: Vyper json compilation artifact """ - cmd = [vyper, standard_input_path, "--standard-json", "-o", "crytic-export/artifacts.json"] - success = run(cmd, cwd=working_dir, extra_env=env) - if success is None: - raise InvalidCompilation("Vyper compilation failed") - with open("crytic-export/artifacts.json", "r") as f: - return json.load(f) + with tempfile.NamedTemporaryFile(mode="a+") as f: + cmd = [vyper, standard_input_path, "--standard-json", "-o", f.name] + success = run(cmd, cwd=working_dir, extra_env=env) + if success is None: + raise InvalidCompilation("Vyper compilation failed") + f.seek(0) + return json.loads(f.read()) def _relative_to_short(relative: Path) -> Path: From 852d59a040e4cb570c49105ff161d37d804f8019 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Thu, 31 Aug 2023 11:28:58 -0500 Subject: [PATCH 21/38] fix bug causing standard json to be shared across classes instances --- crytic_compile/platform/vyper.py | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index fb02b1ff..bb69a587 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -33,28 +33,28 @@ class VyperStandardJson(AbstractPlatform): NAME = "vyper" PROJECT_URL = "https://github.com/vyperlang/vyper" TYPE = Type.VYPER - standard_json_input: Dict = { - "language": "Vyper", - "sources": {}, - "settings": { - "outputSelection": { - "*": { - "*": [ - "abi", - "devdoc", - "userdoc", - "evm.bytecode", - "evm.deployedBytecode", - "evm.deployedBytecode.sourceMap", - ], - "": ["ast"], - } - } - }, - } def __init__(self, target: Optional[Path] = None, **_kwargs: str): super().__init__(target, **_kwargs) + self.standard_json_input = { + "language": "Vyper", + "sources": {}, + "settings": { + "outputSelection": { + "*": { + "*": [ + "abi", + "devdoc", + "userdoc", + "evm.bytecode", + "evm.deployedBytecode", + "evm.deployedBytecode.sourceMap", + ], + "": ["ast"], + } + } + }, + } def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: """Compile the target @@ -75,7 +75,7 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: compilation_artifacts = None with tempfile.NamedTemporaryFile(mode="a+") as f: json.dump(self.standard_json_input, f) - f.seek(0) + f.flush() compilation_artifacts = _run_vyper_standard_json(f.name, vyper_bin) if "errors" in compilation_artifacts: From 13968446d404e59840814eb9a6ea42975929b915 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Thu, 31 Aug 2023 17:28:11 -0500 Subject: [PATCH 22/38] use stdin/stdout --- crytic_compile/platform/vyper.py | 46 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index bb69a587..4479c533 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -4,7 +4,8 @@ import json import logging import os -import tempfile +import subprocess +import shutil from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional @@ -72,15 +73,8 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: self.add_source_files([target]) vyper_bin = kwargs.get("vyper", "vyper") - compilation_artifacts = None - with tempfile.NamedTemporaryFile(mode="a+") as f: - json.dump(self.standard_json_input, f) - f.flush() - compilation_artifacts = _run_vyper_standard_json(f.name, vyper_bin) - if "errors" in compilation_artifacts: - # TODO format errors - raise InvalidCompilation(compilation_artifacts["errors"]) + compilation_artifacts = _run_vyper_standard_json(self.standard_json_input, vyper_bin) compilation_unit = CompilationUnit(crytic_compile, str(target)) compiler_version = compilation_artifacts["compiler"].split("-")[1] @@ -169,7 +163,7 @@ def _guessed_tests(self) -> List[str]: def _run_vyper_standard_json( - standard_input_path: str, + standard_json_input: Dict, vyper: str, env: Optional[Dict] = None, working_dir: Optional[str] = None, @@ -177,7 +171,7 @@ def _run_vyper_standard_json( """Run vyper and write compilation output to a file Args: - standard_input_path (str): path to the standard input json file + standard_json_input (Dict): Dict containing the vyper standard json input vyper (str): vyper binary env (Optional[Dict], optional): Environment variables. Defaults to None. working_dir (Optional[str], optional): Working directory. Defaults to None. @@ -188,13 +182,29 @@ def _run_vyper_standard_json( Returns: Dict: Vyper json compilation artifact """ - with tempfile.NamedTemporaryFile(mode="a+") as f: - cmd = [vyper, standard_input_path, "--standard-json", "-o", f.name] - success = run(cmd, cwd=working_dir, extra_env=env) - if success is None: - raise InvalidCompilation("Vyper compilation failed") - f.seek(0) - return json.loads(f.read()) + cmd = [vyper, "--standard-json"] + + with subprocess.Popen( + cmd, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=env, + executable=shutil.which(cmd[0]), + ) as process: + + stdout_b, stderr_b = process.communicate(json.dumps(standard_json_input).encode("utf-8")) + stdout, stderr = ( + stdout_b.decode(), + stderr_b.decode(errors="backslashreplace"), + ) # convert bytestrings to unicode strings + + vyper_standard_output = json.loads(stdout) + if "errors" in vyper_standard_output: + # TODO format errors + raise InvalidCompilation(vyper_standard_output["errors"]) + + return vyper_standard_output def _relative_to_short(relative: Path) -> Path: From 55429bf64e82b1111814f25798dab0e03aa7223a Mon Sep 17 00:00:00 2001 From: Zane Helton Date: Sat, 2 Sep 2023 18:03:47 -0400 Subject: [PATCH 23/38] chore: add flags for base, gnosis, polygonzkevm --- crytic_compile/cryticparser/cryticparser.py | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crytic_compile/cryticparser/cryticparser.py b/crytic_compile/cryticparser/cryticparser.py index f8848377..4b412a76 100755 --- a/crytic_compile/cryticparser/cryticparser.py +++ b/crytic_compile/cryticparser/cryticparser.py @@ -385,6 +385,30 @@ def _init_etherscan(parser: ArgumentParser) -> None: default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"], ) + group_etherscan.add_argument( + "--base-apikey", + help="Basescan API key.", + action="store", + dest="base_api_key", + default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"], + ) + + group_etherscan.add_argument( + "--gno-apikey", + help="Gnosisscan API key.", + action="store", + dest="gno_api_key", + default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"], + ) + + group_etherscan.add_argument( + "--polyzk-apikey", + help="zkEVM Polygonscan API key.", + action="store", + dest="polyzk_api_key", + default=DEFAULTS_FLAG_IN_CONFIG["etherscan_api_key"], + ) + group_etherscan.add_argument( "--etherscan-export-directory", help="Directory in which to save the analyzed contracts.", From 373e25bc75f4ba41e2225acd80d654b361635589 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:21:56 +0000 Subject: [PATCH 24/38] Bump cachix/install-nix-action from 20 to 23 Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 20 to 23. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v20...v23) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caf91f58..ec032123 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: pip install . - name: Set up nix if: matrix.type == 'dapp' - uses: cachix/install-nix-action@v20 + uses: cachix/install-nix-action@v23 - name: Set up cachix if: matrix.type == 'dapp' uses: cachix/cachix-action@v12 From b224c54544fbb7728df35c220465933a19337219 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Sep 2023 23:21:59 +0000 Subject: [PATCH 25/38] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/black.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/darglint.yml | 2 +- .github/workflows/doc.yml | 2 +- .github/workflows/etherscan.yml | 2 +- .github/workflows/linter.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/pylint.yml | 2 +- .github/workflows/pytest.yml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index b3eb5c93..ac57d0be 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caf91f58..b0ef7d98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - os: windows-2022 type: foundry steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up shell if: runner.os == 'Windows' run: | diff --git a/.github/workflows/darglint.yml b/.github/workflows/darglint.yml index f7c24c18..54dd2d21 100644 --- a/.github/workflows/darglint.yml +++ b/.github/workflows/darglint.yml @@ -17,7 +17,7 @@ jobs: tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 with: diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 594cbb0b..3272b365 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -28,7 +28,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v3 - uses: actions/setup-python@v4 diff --git a/.github/workflows/etherscan.yml b/.github/workflows/etherscan.yml index 0dc97de0..d0fdd706 100644 --- a/.github/workflows/etherscan.yml +++ b/.github/workflows/etherscan.yml @@ -24,7 +24,7 @@ jobs: os: ["ubuntu-latest", "windows-2022"] type: ["etherscan"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up shell if: runner.os == 'Windows' run: | diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 410060d2..43fe1955 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 14ce76a2..b0177f60 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf062360..c960d037 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 13a0bbbb..5598bc1e 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0fa1c525..85f3a7c5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.8 uses: actions/setup-python@v4 with: From d5f6c1bffa6bda6cc9b787a2d931f587648019f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 23:49:15 +0000 Subject: [PATCH 26/38] Bump sigstore/gh-action-sigstore-python from 2.0.1 to 2.1.0 Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 2.0.1 to 2.1.0. - [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases) - [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/v2.0.1...v2.1.0) --- updated-dependencies: - dependency-name: sigstore/gh-action-sigstore-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf062360..cd8a9a43 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,7 +48,7 @@ jobs: uses: pypa/gh-action-pypi-publish@v1.8.10 - name: sign - uses: sigstore/gh-action-sigstore-python@v2.0.1 + uses: sigstore/gh-action-sigstore-python@v2.1.0 with: inputs: ./dist/*.tar.gz ./dist/*.whl release-signing-artifacts: true From fb5de47337e2fb5b06fc8fe9b5ba2dd1a4cac617 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 5 Oct 2023 11:34:35 +0200 Subject: [PATCH 27/38] Improvements - Remove the auto flag, crytic-compile will directly use the auto feature if its on .sol file + the working director is a known platform - Remove abstract from config to reduce code footprint --- crytic_compile/crytic_compile.py | 2 +- crytic_compile/cryticparser/cryticparser.py | 8 -------- crytic_compile/platform/abstract_platform.py | 1 - crytic_compile/platform/archive.py | 12 ------------ crytic_compile/platform/brownie.py | 12 ------------ crytic_compile/platform/buidler.py | 12 ------------ crytic_compile/platform/dapp.py | 12 ------------ crytic_compile/platform/embark.py | 12 ------------ crytic_compile/platform/etherlime.py | 12 ------------ crytic_compile/platform/etherscan.py | 12 ------------ crytic_compile/platform/hardhat.py | 12 ------------ crytic_compile/platform/solc.py | 12 ------------ crytic_compile/platform/standard.py | 12 ------------ crytic_compile/platform/truffle.py | 12 ------------ crytic_compile/platform/vyper.py | 12 ------------ 15 files changed, 1 insertion(+), 154 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index b3809284..5c238598 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -127,7 +127,7 @@ def __init__(self, target: Union[str, AbstractPlatform], **kwargs: str) -> None: # If the platform is Solc it means we are trying to compile a single # we try to see if we are in a known compilation framework to retrieve # information like remappings and solc version - if kwargs.get("auto_compile", False) and isinstance(platform, Solc): + if isinstance(platform, Solc): # Try to get the platform of the current working directory platform_wd = next( ( diff --git a/crytic_compile/cryticparser/cryticparser.py b/crytic_compile/cryticparser/cryticparser.py index 9754ce9e..d8b3da6a 100755 --- a/crytic_compile/cryticparser/cryticparser.py +++ b/crytic_compile/cryticparser/cryticparser.py @@ -65,14 +65,6 @@ def init(parser: ArgumentParser) -> None: default=DEFAULTS_FLAG_IN_CONFIG["skip_clean"], ) - group_compile.add_argument( - "--auto-compile", - help="Try to get the solc options automatically when compiling a single file", - action="store_true", - dest="auto_compile", - default=DEFAULTS_FLAG_IN_CONFIG["auto_compile"], - ) - _init_solc(parser) _init_truffle(parser) _init_embark(parser) diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index 8654a35e..92413abf 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -177,7 +177,6 @@ def is_dependency(self, path: str) -> bool: return False @staticmethod - @abc.abstractmethod def config(working_dir: str) -> Optional[PlatformConfig]: """Return configuration data that should be passed to solc, such as version, remappings ecc. diff --git a/crytic_compile/platform/archive.py b/crytic_compile/platform/archive.py index 93c1e447..2f1b5105 100644 --- a/crytic_compile/platform/archive.py +++ b/crytic_compile/platform/archive.py @@ -118,18 +118,6 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return Path(target).parts[-1].endswith("_export_archive.json") - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, _path: str) -> bool: """Check if the _path is a dependency. Always false diff --git a/crytic_compile/platform/brownie.py b/crytic_compile/platform/brownie.py index 5677f964..17065dcd 100755 --- a/crytic_compile/platform/brownie.py +++ b/crytic_compile/platform/brownie.py @@ -114,18 +114,6 @@ def is_supported(target: str, **kwargs: str) -> bool: or os.path.isfile(os.path.join(target, "brownie-config.yml")) ) - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency (not supported for brownie) diff --git a/crytic_compile/platform/buidler.py b/crytic_compile/platform/buidler.py index 2186e9f4..14bd0573 100755 --- a/crytic_compile/platform/buidler.py +++ b/crytic_compile/platform/buidler.py @@ -193,18 +193,6 @@ def is_supported(target: str, **kwargs: str) -> bool: is_typescript = os.path.isfile(os.path.join(target, "buidler.config.ts")) return is_javascript or is_typescript - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/dapp.py b/crytic_compile/platform/dapp.py index f46296e8..9d367245 100755 --- a/crytic_compile/platform/dapp.py +++ b/crytic_compile/platform/dapp.py @@ -157,18 +157,6 @@ def is_supported(target: str, **kwargs: str) -> bool: return "dapp " in txt return False - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the path is a dependency (not supported for brownie) diff --git a/crytic_compile/platform/embark.py b/crytic_compile/platform/embark.py index 9cddb275..24a54b19 100755 --- a/crytic_compile/platform/embark.py +++ b/crytic_compile/platform/embark.py @@ -200,18 +200,6 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return os.path.isfile(os.path.join(target, "embark.json")) - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/etherlime.py b/crytic_compile/platform/etherlime.py index a5883b95..2e82f035 100755 --- a/crytic_compile/platform/etherlime.py +++ b/crytic_compile/platform/etherlime.py @@ -192,18 +192,6 @@ def is_supported(target: str, **kwargs: str) -> bool: ) return False - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 6e50133c..1ce9497c 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -430,18 +430,6 @@ def is_supported(target: str, **kwargs: str) -> bool: target = target[target.find(":") + 1 :] return bool(re.match(r"^\s*0x[a-zA-Z0-9]{40}\s*$", target)) - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/hardhat.py b/crytic_compile/platform/hardhat.py index 32e07a13..92738866 100755 --- a/crytic_compile/platform/hardhat.py +++ b/crytic_compile/platform/hardhat.py @@ -218,18 +218,6 @@ def is_supported(target: str, **kwargs: str) -> bool: or os.path.isfile(os.path.join(target, "hardhat.config.cjs")) ) - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/solc.py b/crytic_compile/platform/solc.py index 0dd3800d..5c9f8c3e 100644 --- a/crytic_compile/platform/solc.py +++ b/crytic_compile/platform/solc.py @@ -199,18 +199,6 @@ def is_supported(target: str, **kwargs: str) -> bool: """ return os.path.isfile(target) and target.endswith(".sol") - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, _path: str) -> bool: """Check if the path is a dependency (always false for direct solc) diff --git a/crytic_compile/platform/standard.py b/crytic_compile/platform/standard.py index 9273bb8b..88a8ac76 100644 --- a/crytic_compile/platform/standard.py +++ b/crytic_compile/platform/standard.py @@ -120,18 +120,6 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return Path(target).parts[-1].endswith("_export.json") - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def is_dependency(self, path: str) -> bool: """Check if the target is a dependency This function always return false, the deps are handled by crytic_compile_dependencies diff --git a/crytic_compile/platform/truffle.py b/crytic_compile/platform/truffle.py index 486ddc6f..d2cea0cf 100755 --- a/crytic_compile/platform/truffle.py +++ b/crytic_compile/platform/truffle.py @@ -309,18 +309,6 @@ def is_supported(target: str, **kwargs: str) -> bool: os.path.join(target, "truffle-config.js") ) - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - # pylint: disable=no-self-use def is_dependency(self, path: str) -> bool: """Check if the path is a dependency diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 6fac311d..a99e0b85 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -120,18 +120,6 @@ def is_supported(target: str, **kwargs: str) -> bool: return False return os.path.isfile(target) and target.endswith(".vy") - @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: - """Return configuration data that should be passed to solc, such as remappings. - - Args: - working_dir (str): path to the working directory - - Returns: - Optional[PlatformConfig]: Platform configuration data such as optimization, remappings... - """ - return None - def _guessed_tests(self) -> List[str]: """Guess the potential unit tests commands From 41577ea243027391c4550d9ede94099feff29802 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 5 Oct 2023 11:40:36 +0200 Subject: [PATCH 28/38] Fix linter --- crytic_compile/platform/abstract_platform.py | 2 +- crytic_compile/platform/archive.py | 4 ++-- crytic_compile/platform/brownie.py | 2 +- crytic_compile/platform/buidler.py | 6 +++--- crytic_compile/platform/dapp.py | 4 ++-- crytic_compile/platform/embark.py | 4 ++-- crytic_compile/platform/etherlime.py | 2 +- crytic_compile/platform/etherscan.py | 2 +- crytic_compile/platform/hardhat.py | 10 +++++----- crytic_compile/platform/solc.py | 2 +- crytic_compile/platform/standard.py | 4 ++-- crytic_compile/platform/truffle.py | 2 +- crytic_compile/platform/vyper.py | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/crytic_compile/platform/abstract_platform.py b/crytic_compile/platform/abstract_platform.py index 92413abf..b369e155 100644 --- a/crytic_compile/platform/abstract_platform.py +++ b/crytic_compile/platform/abstract_platform.py @@ -177,7 +177,7 @@ def is_dependency(self, path: str) -> bool: return False @staticmethod - def config(working_dir: str) -> Optional[PlatformConfig]: + def config(working_dir: str) -> Optional[PlatformConfig]: # pylint: disable=unused-argument """Return configuration data that should be passed to solc, such as version, remappings ecc. Args: diff --git a/crytic_compile/platform/archive.py b/crytic_compile/platform/archive.py index 2f1b5105..e7fc417d 100644 --- a/crytic_compile/platform/archive.py +++ b/crytic_compile/platform/archive.py @@ -7,13 +7,13 @@ import json import os from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any, Optional +from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any from crytic_compile.platform import Type as TypePlatform from crytic_compile.platform import standard # Cycle dependency -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform if TYPE_CHECKING: from crytic_compile import CryticCompile diff --git a/crytic_compile/platform/brownie.py b/crytic_compile/platform/brownie.py index 17065dcd..855d7269 100755 --- a/crytic_compile/platform/brownie.py +++ b/crytic_compile/platform/brownie.py @@ -12,7 +12,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import Filename, convert_filename diff --git a/crytic_compile/platform/buidler.py b/crytic_compile/platform/buidler.py index 14bd0573..9c596cbd 100755 --- a/crytic_compile/platform/buidler.py +++ b/crytic_compile/platform/buidler.py @@ -7,15 +7,15 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Tuple, Optional +from typing import TYPE_CHECKING, List, Tuple +from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_name from crytic_compile.utils.natspec import Natspec -from crytic_compile.compilation_unit import CompilationUnit -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig # Handle cycle from .solc import relative_to_short diff --git a/crytic_compile/platform/dapp.py b/crytic_compile/platform/dapp.py index 9d367245..3cc38a7a 100755 --- a/crytic_compile/platform/dapp.py +++ b/crytic_compile/platform/dapp.py @@ -16,13 +16,13 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_name -from crytic_compile.utils.subprocess import run # Handle cycle from crytic_compile.utils.natspec import Natspec +from crytic_compile.utils.subprocess import run if TYPE_CHECKING: from crytic_compile import CryticCompile diff --git a/crytic_compile/platform/embark.py b/crytic_compile/platform/embark.py index 24a54b19..37503413 100755 --- a/crytic_compile/platform/embark.py +++ b/crytic_compile/platform/embark.py @@ -8,11 +8,11 @@ import shutil import subprocess from pathlib import Path -from typing import TYPE_CHECKING, List, Optional +from typing import TYPE_CHECKING, List from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_filename, extract_name diff --git a/crytic_compile/platform/etherlime.py b/crytic_compile/platform/etherlime.py index 2e82f035..e677b60d 100755 --- a/crytic_compile/platform/etherlime.py +++ b/crytic_compile/platform/etherlime.py @@ -14,7 +14,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename diff --git a/crytic_compile/platform/etherscan.py b/crytic_compile/platform/etherscan.py index 1ce9497c..dfddbbea 100644 --- a/crytic_compile/platform/etherscan.py +++ b/crytic_compile/platform/etherscan.py @@ -14,7 +14,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import solc_standard_json -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import Filename diff --git a/crytic_compile/platform/hardhat.py b/crytic_compile/platform/hardhat.py index 92738866..35a02122 100755 --- a/crytic_compile/platform/hardhat.py +++ b/crytic_compile/platform/hardhat.py @@ -9,17 +9,17 @@ from pathlib import Path from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union +from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation + +# Handle cycle +from crytic_compile.platform.solc import relative_to_short from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename, extract_name from crytic_compile.utils.natspec import Natspec from crytic_compile.utils.subprocess import run -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig - -# Handle cycle -from crytic_compile.platform.solc import relative_to_short -from crytic_compile.compilation_unit import CompilationUnit if TYPE_CHECKING: from crytic_compile import CryticCompile diff --git a/crytic_compile/platform/solc.py b/crytic_compile/platform/solc.py index 5c9f8c3e..ef8b93fa 100644 --- a/crytic_compile/platform/solc.py +++ b/crytic_compile/platform/solc.py @@ -12,7 +12,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import ( diff --git a/crytic_compile/platform/standard.py b/crytic_compile/platform/standard.py index 88a8ac76..f2046dfa 100644 --- a/crytic_compile/platform/standard.py +++ b/crytic_compile/platform/standard.py @@ -5,12 +5,12 @@ import os from collections import defaultdict from pathlib import Path -from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any, Optional +from typing import TYPE_CHECKING, Dict, List, Tuple, Type, Any from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import Type as PlatformType -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.utils.naming import Filename # Cycle dependency diff --git a/crytic_compile/platform/truffle.py b/crytic_compile/platform/truffle.py index d2cea0cf..67c3b74c 100755 --- a/crytic_compile/platform/truffle.py +++ b/crytic_compile/platform/truffle.py @@ -16,7 +16,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion from crytic_compile.platform import solc -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index a99e0b85..49133fd9 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -11,7 +11,7 @@ from crytic_compile.compilation_unit import CompilationUnit from crytic_compile.compiler.compiler import CompilerVersion -from crytic_compile.platform.abstract_platform import AbstractPlatform, PlatformConfig +from crytic_compile.platform.abstract_platform import AbstractPlatform from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename From 7f854428e0a7dd8121f6799320d9c79764026c60 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 5 Oct 2023 11:49:44 +0200 Subject: [PATCH 29/38] Minor --- crytic_compile/cryticparser/defaults.py | 1 - 1 file changed, 1 deletion(-) diff --git a/crytic_compile/cryticparser/defaults.py b/crytic_compile/cryticparser/defaults.py index 8b57e64a..9635f365 100755 --- a/crytic_compile/cryticparser/defaults.py +++ b/crytic_compile/cryticparser/defaults.py @@ -48,5 +48,4 @@ "foundry_compile_all": False, "export_dir": "crytic-export", "compile_libraries": None, - "auto_compile": False, } From 2ac11ee30f38a3df868274f67fb8dd94aff1d874 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 5 Oct 2023 12:02:44 +0200 Subject: [PATCH 30/38] - Fix bug (missing add_source_files) - Fix linters --- crytic_compile/crytic_compile.py | 2 +- crytic_compile/platform/solc_standard_json.py | 9 ++++++++ crytic_compile/platform/vyper.py | 23 +++++++++++-------- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/crytic_compile/crytic_compile.py b/crytic_compile/crytic_compile.py index 98becc40..b7b55a7f 100644 --- a/crytic_compile/crytic_compile.py +++ b/crytic_compile/crytic_compile.py @@ -623,7 +623,7 @@ def compile_all(target: str, **kwargs: str) -> List[CryticCompile]: **kwargs: optional arguments. Used: "solc_standard_json" Raises: - ValueError: If the target could not be compiled + NotImplementedError: If the target could not be compiled Returns: List[CryticCompile]: Returns a list of CryticCompile instances for all compilations which occurred. diff --git a/crytic_compile/platform/solc_standard_json.py b/crytic_compile/platform/solc_standard_json.py index d7006f9a..beadf442 100644 --- a/crytic_compile/platform/solc_standard_json.py +++ b/crytic_compile/platform/solc_standard_json.py @@ -405,6 +405,15 @@ def add_source_file(self, file_path: str) -> None: """ add_source_file(self._json, file_path) + def add_source_files(self, files_path: List[str]) -> None: + """Append files + + Args: + files_path (List[str]): files to append + """ + for file_path in files_path: + add_source_file(self._json, file_path) + def add_remapping(self, remapping: str) -> None: """Append our remappings diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 4479c533..4721faa6 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -4,8 +4,8 @@ import json import logging import os -import subprocess import shutil +import subprocess from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional @@ -15,7 +15,6 @@ from crytic_compile.platform.exceptions import InvalidCompilation from crytic_compile.platform.types import Type from crytic_compile.utils.naming import convert_filename -from crytic_compile.utils.subprocess import run # Handle cycle from crytic_compile.utils.natspec import Natspec @@ -112,8 +111,18 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None: source_unit.ast = ast def add_source_files(self, file_paths: List[str]) -> None: + """ + Append files + + Args: + file_paths (List[str]): files to append + + Returns: + + """ + for file_path in file_paths: - with open(file_path, "r") as f: + with open(file_path, "r", encoding="utf8") as f: self.standard_json_input["sources"][file_path] = { "content": f.read(), } @@ -163,10 +172,7 @@ def _guessed_tests(self) -> List[str]: def _run_vyper_standard_json( - standard_json_input: Dict, - vyper: str, - env: Optional[Dict] = None, - working_dir: Optional[str] = None, + standard_json_input: Dict, vyper: str, env: Optional[Dict] = None ) -> Dict: """Run vyper and write compilation output to a file @@ -174,7 +180,6 @@ def _run_vyper_standard_json( standard_json_input (Dict): Dict containing the vyper standard json input vyper (str): vyper binary env (Optional[Dict], optional): Environment variables. Defaults to None. - working_dir (Optional[str], optional): Working directory. Defaults to None. Raises: InvalidCompilation: If vyper failed to run @@ -194,7 +199,7 @@ def _run_vyper_standard_json( ) as process: stdout_b, stderr_b = process.communicate(json.dumps(standard_json_input).encode("utf-8")) - stdout, stderr = ( + stdout, _stderr = ( stdout_b.decode(), stderr_b.decode(errors="backslashreplace"), ) # convert bytestrings to unicode strings From 8fdc90ec9db224a040ee4400a98c5a95d79929cd Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Thu, 5 Oct 2023 13:34:41 +0200 Subject: [PATCH 31/38] Fix mypy --- crytic_compile/platform/vyper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crytic_compile/platform/vyper.py b/crytic_compile/platform/vyper.py index 4721faa6..bcf4725b 100644 --- a/crytic_compile/platform/vyper.py +++ b/crytic_compile/platform/vyper.py @@ -35,7 +35,7 @@ class VyperStandardJson(AbstractPlatform): TYPE = Type.VYPER def __init__(self, target: Optional[Path] = None, **_kwargs: str): - super().__init__(target, **_kwargs) + super().__init__(str(target), **_kwargs) self.standard_json_input = { "language": "Vyper", "sources": {}, @@ -123,7 +123,7 @@ def add_source_files(self, file_paths: List[str]) -> None: for file_path in file_paths: with open(file_path, "r", encoding="utf8") as f: - self.standard_json_input["sources"][file_path] = { + self.standard_json_input["sources"][file_path] = { # type: ignore "content": f.read(), } From 83473a01a5fbe266d28e5be2e8def379154ca17b Mon Sep 17 00:00:00 2001 From: Sam Alws Date: Thu, 5 Oct 2023 14:12:53 -0400 Subject: [PATCH 32/38] Tests for file ordering --- .github/workflows/ci.yml | 2 +- scripts/ci_test_hardhat_multi_file.sh | 18 +++++++ scripts/ci_test_solc_multi_file.sh | 17 +++++++ tests/expected/hardhat-multi-file/A.json | 1 + tests/expected/hardhat-multi-file/B.json | 1 + tests/expected/hardhat-multi-file/C.json | 1 + tests/expected/hardhat-multi-file/D.json | 1 + tests/expected/hardhat-multi-file/E.json | 1 + tests/expected/hardhat-multi-file/G.json | 1 + tests/expected/hardhat-multi-file/I.json | 1 + tests/expected/hardhat-multi-file/K.json | 1 + tests/expected/hardhat-multi-file/X.json | 1 + tests/expected/hardhat-multi-file/Z.json | 1 + .../hardhat-multi-file/combined_solc.json | 1 + tests/expected/solc-multi-file/A.json | 1 + tests/expected/solc-multi-file/B.json | 1 + tests/expected/solc-multi-file/C.json | 1 + tests/expected/solc-multi-file/D.json | 1 + tests/expected/solc-multi-file/E.json | 1 + tests/expected/solc-multi-file/G.json | 1 + tests/expected/solc-multi-file/I.json | 1 + tests/expected/solc-multi-file/K.json | 1 + .../solc-multi-file/combined_solc.json | 1 + tests/hardhat-multi-file/contracts/A.sol | 51 +++++++++++++++++++ tests/hardhat-multi-file/contracts/C.sol | 36 +++++++++++++ tests/hardhat-multi-file/contracts/E/E.sol | 25 +++++++++ tests/hardhat-multi-file/contracts/E/G.sol | 25 +++++++++ tests/hardhat-multi-file/contracts/I/I.sol | 28 ++++++++++ tests/hardhat-multi-file/contracts/I/K.sol | 25 +++++++++ tests/hardhat-multi-file/contracts/X/X.sol | 28 ++++++++++ tests/hardhat-multi-file/contracts/X/Z.sol | 22 ++++++++ tests/hardhat-multi-file/hardhat.config.js | 22 ++++++++ tests/hardhat-multi-file/package.json | 11 ++++ .../scripts/sample-script.js | 32 ++++++++++++ tests/hardhat-multi-file/test/sample-test.js | 14 +++++ tests/process_combined_solc.js | 12 +++++ tests/solc-multi-file/A.sol | 48 +++++++++++++++++ tests/solc-multi-file/C.sol | 33 ++++++++++++ tests/solc-multi-file/E/E.sol | 22 ++++++++ tests/solc-multi-file/E/G.sol | 22 ++++++++ tests/solc-multi-file/I/I.sol | 25 +++++++++ tests/solc-multi-file/I/K.sol | 22 ++++++++ tests/solc-multi-file/X/X.sol | 25 +++++++++ tests/solc-multi-file/X/Z.sol | 19 +++++++ 44 files changed, 603 insertions(+), 1 deletion(-) create mode 100755 scripts/ci_test_hardhat_multi_file.sh create mode 100755 scripts/ci_test_solc_multi_file.sh create mode 100644 tests/expected/hardhat-multi-file/A.json create mode 100644 tests/expected/hardhat-multi-file/B.json create mode 100644 tests/expected/hardhat-multi-file/C.json create mode 100644 tests/expected/hardhat-multi-file/D.json create mode 100644 tests/expected/hardhat-multi-file/E.json create mode 100644 tests/expected/hardhat-multi-file/G.json create mode 100644 tests/expected/hardhat-multi-file/I.json create mode 100644 tests/expected/hardhat-multi-file/K.json create mode 100644 tests/expected/hardhat-multi-file/X.json create mode 100644 tests/expected/hardhat-multi-file/Z.json create mode 100644 tests/expected/hardhat-multi-file/combined_solc.json create mode 100644 tests/expected/solc-multi-file/A.json create mode 100644 tests/expected/solc-multi-file/B.json create mode 100644 tests/expected/solc-multi-file/C.json create mode 100644 tests/expected/solc-multi-file/D.json create mode 100644 tests/expected/solc-multi-file/E.json create mode 100644 tests/expected/solc-multi-file/G.json create mode 100644 tests/expected/solc-multi-file/I.json create mode 100644 tests/expected/solc-multi-file/K.json create mode 100644 tests/expected/solc-multi-file/combined_solc.json create mode 100644 tests/hardhat-multi-file/contracts/A.sol create mode 100644 tests/hardhat-multi-file/contracts/C.sol create mode 100644 tests/hardhat-multi-file/contracts/E/E.sol create mode 100644 tests/hardhat-multi-file/contracts/E/G.sol create mode 100644 tests/hardhat-multi-file/contracts/I/I.sol create mode 100644 tests/hardhat-multi-file/contracts/I/K.sol create mode 100644 tests/hardhat-multi-file/contracts/X/X.sol create mode 100644 tests/hardhat-multi-file/contracts/X/Z.sol create mode 100644 tests/hardhat-multi-file/hardhat.config.js create mode 100644 tests/hardhat-multi-file/package.json create mode 100644 tests/hardhat-multi-file/scripts/sample-script.js create mode 100644 tests/hardhat-multi-file/test/sample-test.js create mode 100644 tests/process_combined_solc.js create mode 100644 tests/solc-multi-file/A.sol create mode 100644 tests/solc-multi-file/C.sol create mode 100644 tests/solc-multi-file/E/E.sol create mode 100644 tests/solc-multi-file/E/G.sol create mode 100644 tests/solc-multi-file/I/I.sol create mode 100644 tests/solc-multi-file/I/K.sol create mode 100644 tests/solc-multi-file/X/X.sol create mode 100644 tests/solc-multi-file/X/Z.sol diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caf91f58..ca8f3d09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "windows-2022"] - type: ["brownie", "buidler", "dapp", "embark", "hardhat", "solc", "truffle", "waffle", "foundry", "standard"] + type: ["brownie", "buidler", "dapp", "embark", "hardhat", "solc", "truffle", "waffle", "foundry", "standard", "solc_multi_file", "hardhat_multi_file"] exclude: # Currently broken, tries to pull git:// which is blocked by GH - type: embark diff --git a/scripts/ci_test_hardhat_multi_file.sh b/scripts/ci_test_hardhat_multi_file.sh new file mode 100755 index 00000000..074be214 --- /dev/null +++ b/scripts/ci_test_hardhat_multi_file.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +DIR=$(mktemp -d) + +cp -r tests/hardhat-multi-file "$DIR" +cd "$DIR/hardhat-multi-file" || exit 255 +npm install +crytic-compile --compile-remove-metadata --export-formats solc,truffle . + +cd - || exit 255 +node tests/process_combined_solc.js "$DIR/hardhat-multi-file/crytic-export/combined_solc.json" "$DIR" +DIFF=$(diff -r "$DIR/hardhat-multi-file/crytic-export" tests/expected/hardhat-multi-file) +if [ "$?" != "0" ] || [ "$DIFF" != "" ] +then + echo "hardhat-multi-file test failed" + echo "$DIFF" + exit 255 +fi diff --git a/scripts/ci_test_solc_multi_file.sh b/scripts/ci_test_solc_multi_file.sh new file mode 100755 index 00000000..01b9d6f8 --- /dev/null +++ b/scripts/ci_test_solc_multi_file.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +DIR=$(mktemp -d) + +cp -r tests/solc-multi-file "$DIR" +cd "$DIR/solc-multi-file" || exit 255 +crytic-compile --compile-remove-metadata --export-formats solc,truffle A.sol + +cd - || exit 255 +node tests/process_combined_solc.js "$DIR/solc-multi-file/crytic-export/combined_solc.json" "$DIR" +DIFF=$(diff -r "$DIR/solc-multi-file/crytic-export" tests/expected/solc-multi-file) +if [ "$?" != "0" ] || [ "$DIFF" != "" ] +then + echo "solc-multi-file test failed" + echo "$DIFF" + exit 255 +fi diff --git a/tests/expected/hardhat-multi-file/A.json b/tests/expected/hardhat-multi-file/A.json new file mode 100644 index 00000000..647e3d27 --- /dev/null +++ b/tests/expected/hardhat-multi-file/A.json @@ -0,0 +1 @@ +{"contractName": "A", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}, {"internalType": "uint256", "name": "zval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "set", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b506040516122143803806122148339818101604052604081101561003357600080fd5b81019080805190602001909291908051906020019092919050505060008081905550816001819055508060028190555060405161006f906101bb565b604051809103906000f08015801561008b573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806040516100d9906101c8565b80828152602001915050604051809103906000f0801580156100ff573d6000803e3d6000fd5b50600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060405161014d906101d5565b80828152602001915050604051809103906000f080158015610173573d6000803e3d6000fd5b50600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506101e2565b6119028061054383390190565b61012d80611e4583390190565b6102a280611f7283390190565b610352806101f16000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011e565b6040518082815260200191505060405180910390f35b80600081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010357600080fd5b505af1158015610117573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561018857600080fd5b505afa15801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b8101908080519060200190929190505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022b57600080fd5b505afa15801561023f573d6000803e3d6000fd5b505050506040513d602081101561025557600080fd5b8101908080519060200190929190505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ce57600080fd5b505afa1580156102e2573d6000803e3d6000fd5b505050506040513d60208110156102f857600080fd5b8101908080519060200190929190505050600254600154600054010101010190509056fe608060405234801561001057600080fd5b5060008081905550600660018190555060016000540160405161003290610117565b80828152602001915050604051809103906000f080158015610058573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600054016040516100ab90610124565b80828152602001915050604051809103906000f0801580156100d1573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610131565b6107ed8061026e83390190565b610ea780610a5b83390190565b61012e806101406000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fea264697066735822122080543e0c8069e143ba3a6838f29f42fe1ec0df2721ac2c383b84466b346d191664736f6c63430007030033608060405234801561001057600080fd5b506040516107ed3803806107ed8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610503806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea2646970667358221220b82df2aa2e430319215b47e2ba4c79732ea53c9686190c1dc8530c55b72060e564736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b50604051610ea7380380610ea78339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610bbd806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea2646970667358221220df9be5d8f790b183800142a7b55385ddfdcdb8a32d28a3611189c1f9935f083e64736f6c63430007030033608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea26469706673582212207adf748c4fbc65b7c753bb0a72e946f848bffb9e1d7c8e268d29021c42b7df4964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011e565b6040518082815260200191505060405180910390f35b80600081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010357600080fd5b505af1158015610117573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561018857600080fd5b505afa15801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b8101908080519060200190929190505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022b57600080fd5b505afa15801561023f573d6000803e3d6000fd5b505050506040513d602081101561025557600080fd5b8101908080519060200190929190505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ce57600080fd5b505afa1580156102e2573d6000803e3d6000fd5b505050506040513d60208110156102f857600080fd5b8101908080519060200190929190505050600254600154600054010101010190509056fe", "ast": {"absolutePath": "contracts/A.sol", "exportedSymbols": {"A": [97], "B": [150], "C": [191], "D": [229], "E": [285], "G": [344], "I": [421], "K": [480]}, "id": 151, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 1, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:0"}, {"absolutePath": "contracts/C.sol", "file": "./C.sol", "id": 2, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 230, "src": "62:17:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/E/G.sol", "file": "./E/G.sol", "id": 3, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 345, "src": "80:19:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/I/K.sol", "file": "./I/K.sol", "id": 4, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 481, "src": "100:19:0", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [150, 191, 229], "contractKind": "contract", "fullyImplemented": true, "id": 97, "linearizedBaseContracts": [97], "name": "A", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 6, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 97, "src": "136:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 5, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "136:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 8, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 97, "src": "149:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 7, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "149:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 10, "mutability": "mutable", "name": "z", "nodeType": "VariableDeclaration", "scope": 97, "src": "162:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 9, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "162:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 12, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "scope": 97, "src": "175:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}, "typeName": {"id": 11, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 150, "src": "175:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "visibility": "internal"}, {"constant": false, "id": 14, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 97, "src": "182:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}, "typeName": {"id": 13, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "182:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "visibility": "internal"}, {"constant": false, "id": 16, "mutability": "mutable", "name": "d", "nodeType": "VariableDeclaration", "scope": 97, "src": "189:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}, "typeName": {"id": 15, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "189:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "visibility": "internal"}, {"body": {"id": 55, "nodeType": "Block", "src": "237:103:0", "statements": [{"expression": {"id": 25, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 23, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "243:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 24, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "247:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "243:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 26, "nodeType": "ExpressionStatement", "src": "243:5:0"}, {"expression": {"id": 29, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 27, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "254:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 28, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18, "src": "258:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "254:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 30, "nodeType": "ExpressionStatement", "src": "254:8:0"}, {"expression": {"id": 33, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 31, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10, "src": "268:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 32, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "272:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "268:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 34, "nodeType": "ExpressionStatement", "src": "268:8:0"}, {"expression": {"id": 39, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 35, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12, "src": "282:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [], "expression": {"argumentTypes": [], "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "286:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_B_$150_$", "typeString": "function () returns (contract B)"}, "typeName": {"id": 36, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 150, "src": "290:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}}, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "286:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "src": "282:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "id": 40, "nodeType": "ExpressionStatement", "src": "282:11:0"}, {"expression": {"id": 46, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 41, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "299:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 44, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "309:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 43, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "303:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$191_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"id": 42, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "307:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}}, "id": 45, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "303:11:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "src": "299:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 47, "nodeType": "ExpressionStatement", "src": "299:15:0"}, {"expression": {"id": 53, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 48, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "320:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 51, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "330:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 50, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "324:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$229_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"id": 49, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "328:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}}, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "324:11:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "src": "320:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 54, "nodeType": "ExpressionStatement", "src": "320:15:0"}]}, "id": 56, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 21, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 18, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 56, "src": "209:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 17, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "209:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 20, "mutability": "mutable", "name": "zval", "nodeType": "VariableDeclaration", "scope": 56, "src": "223:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 19, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "223:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "208:28:0"}, "returnParameters": {"id": 22, "nodeType": "ParameterList", "parameters": [], "src": "237:0:0"}, "scope": 97, "src": "197:143:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 79, "nodeType": "Block", "src": "389:49:0", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 77, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 73, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 69, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 65, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 63, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 61, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "402:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 62, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "404:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 64, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10, "src": "406:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 66, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12, "src": "408:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "id": 67, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 149, "src": "408:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 68, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "408:8:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:14:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 70, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "417:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 71, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 180, "src": "417:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 72, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "417:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:22:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 74, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "425:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 75, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 228, "src": "425:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 76, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "425:8:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:31:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 60, "id": 78, "nodeType": "Return", "src": "395:38:0"}]}, "functionSelector": "853255cc", "id": 80, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 57, "nodeType": "ParameterList", "parameters": [], "src": "356:2:0"}, "returnParameters": {"id": 60, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 59, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 80, "src": "380:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 58, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "380:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "379:9:0"}, "scope": 97, "src": "344:94:0", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 95, "nodeType": "Block", "src": "476:37:0", "statements": [{"expression": {"id": 87, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 85, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "482:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 86, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 82, "src": "486:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "482:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 88, "nodeType": "ExpressionStatement", "src": "482:8:0"}, {"expression": {"arguments": [{"id": 92, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 82, "src": "503:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 89, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "496:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 91, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 190, "src": "496:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 93, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "496:12:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 94, "nodeType": "ExpressionStatement", "src": "496:12:0"}]}, "functionSelector": "60fe47b1", "id": 96, "implemented": true, "kind": "function", "modifiers": [], "name": "set", "nodeType": "FunctionDefinition", "parameters": {"id": 83, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 82, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 96, "src": "455:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 81, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "455:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "454:14:0"}, "returnParameters": {"id": 84, "nodeType": "ParameterList", "parameters": [], "src": "476:0:0"}, "scope": 97, "src": "442:71:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 151, "src": "121:394:0"}, {"abstract": false, "baseContracts": [], "contractDependencies": [344, 480], "contractKind": "contract", "fullyImplemented": true, "id": 150, "linearizedBaseContracts": [150], "name": "B", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 99, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 150, "src": "532:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 98, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "532:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 101, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 150, "src": "545:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 100, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "545:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 103, "mutability": "mutable", "name": "g", "nodeType": "VariableDeclaration", "scope": 150, "src": "558:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}, "typeName": {"id": 102, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 344, "src": "558:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "visibility": "internal"}, {"constant": false, "id": 105, "mutability": "mutable", "name": "k", "nodeType": "VariableDeclaration", "scope": 150, "src": "565:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}, "typeName": {"id": 104, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 480, "src": "565:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "visibility": "internal"}, {"body": {"id": 134, "nodeType": "Block", "src": "587:67:0", "statements": [{"expression": {"id": 110, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 108, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "593:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 109, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "597:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "593:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 111, "nodeType": "ExpressionStatement", "src": "593:5:0"}, {"expression": {"id": 114, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 112, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 101, "src": "604:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "36", "id": 113, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "608:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_6_by_1", "typeString": "int_const 6"}, "value": "6"}, "src": "604:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 115, "nodeType": "ExpressionStatement", "src": "604:5:0"}, {"expression": {"id": 123, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 116, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 103, "src": "615:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 121, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 119, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "625:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 120, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "627:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "625:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 118, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "619:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_G_$344_$", "typeString": "function (uint256) returns (contract G)"}, "typeName": {"id": 117, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 344, "src": "623:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}}, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "619:10:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "src": "615:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "id": 124, "nodeType": "ExpressionStatement", "src": "615:14:0"}, {"expression": {"id": 132, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 125, "name": "k", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 105, "src": "635:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 130, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 128, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "645:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "32", "id": 129, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "647:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2"}, "value": "2"}, "src": "645:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 127, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "639:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_K_$480_$", "typeString": "function (uint256) returns (contract K)"}, "typeName": {"id": 126, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 480, "src": "643:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}}, "id": 131, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "639:10:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "src": "635:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "id": 133, "nodeType": "ExpressionStatement", "src": "635:14:0"}]}, "id": 135, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 106, "nodeType": "ParameterList", "parameters": [], "src": "584:2:0"}, "returnParameters": {"id": 107, "nodeType": "ParameterList", "parameters": [], "src": "587:0:0"}, "scope": 150, "src": "573:81:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 148, "nodeType": "Block", "src": "704:29:0", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 146, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 142, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 140, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "717:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"id": 141, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 101, "src": "719:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "717:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 143, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 103, "src": "721:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "id": 144, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 325, "src": "721:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 145, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "721:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "717:11:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 139, "id": 147, "nodeType": "Return", "src": "710:18:0"}]}, "functionSelector": "a0d7afb7", "id": 149, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 136, "nodeType": "ParameterList", "parameters": [], "src": "671:2:0"}, "returnParameters": {"id": 139, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 138, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 149, "src": "695:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 137, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "695:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "694:9:0"}, "scope": 150, "src": "658:75:0", "stateMutability": "view", "virtual": false, "visibility": "public"}], "scope": 151, "src": "517:218:0"}], "src": "37:699:0"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/B.json b/tests/expected/hardhat-multi-file/B.json new file mode 100644 index 00000000..a0f522d7 --- /dev/null +++ b/tests/expected/hardhat-multi-file/B.json @@ -0,0 +1 @@ +{"contractName": "B", "abi": [{"inputs": [], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [], "name": "diff", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b5060008081905550600660018190555060016000540160405161003290610117565b80828152602001915050604051809103906000f080158015610058573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600054016040516100ab90610124565b80828152602001915050604051809103906000f0801580156100d1573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610131565b6107ed8061026e83390190565b610ea780610a5b83390190565b61012e806101406000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fe608060405234801561001057600080fd5b506040516107ed3803806107ed8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610503806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea2646970667358221220b82df2aa2e430319215b47e2ba4c79732ea53c9686190c1dc8530c55b72060e564736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b50604051610ea7380380610ea78339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610bbd806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea2646970667358221220df9be5d8f790b183800142a7b55385ddfdcdb8a32d28a3611189c1f9935f083e64736f6c63430007030033608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea26469706673582212207adf748c4fbc65b7c753bb0a72e946f848bffb9e1d7c8e268d29021c42b7df4964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fe", "ast": {"absolutePath": "contracts/A.sol", "exportedSymbols": {"A": [97], "B": [150], "C": [191], "D": [229], "E": [285], "G": [344], "I": [421], "K": [480]}, "id": 151, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 1, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:0"}, {"absolutePath": "contracts/C.sol", "file": "./C.sol", "id": 2, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 230, "src": "62:17:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/E/G.sol", "file": "./E/G.sol", "id": 3, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 345, "src": "80:19:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/I/K.sol", "file": "./I/K.sol", "id": 4, "nodeType": "ImportDirective", "scope": 151, "sourceUnit": 481, "src": "100:19:0", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [150, 191, 229], "contractKind": "contract", "fullyImplemented": true, "id": 97, "linearizedBaseContracts": [97], "name": "A", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 6, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 97, "src": "136:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 5, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "136:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 8, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 97, "src": "149:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 7, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "149:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 10, "mutability": "mutable", "name": "z", "nodeType": "VariableDeclaration", "scope": 97, "src": "162:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 9, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "162:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 12, "mutability": "mutable", "name": "b", "nodeType": "VariableDeclaration", "scope": 97, "src": "175:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}, "typeName": {"id": 11, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 150, "src": "175:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "visibility": "internal"}, {"constant": false, "id": 14, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 97, "src": "182:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}, "typeName": {"id": 13, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "182:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "visibility": "internal"}, {"constant": false, "id": 16, "mutability": "mutable", "name": "d", "nodeType": "VariableDeclaration", "scope": 97, "src": "189:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}, "typeName": {"id": 15, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "189:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "visibility": "internal"}, {"body": {"id": 55, "nodeType": "Block", "src": "237:103:0", "statements": [{"expression": {"id": 25, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 23, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "243:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 24, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "247:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "243:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 26, "nodeType": "ExpressionStatement", "src": "243:5:0"}, {"expression": {"id": 29, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 27, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "254:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 28, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18, "src": "258:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "254:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 30, "nodeType": "ExpressionStatement", "src": "254:8:0"}, {"expression": {"id": 33, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 31, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10, "src": "268:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 32, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "272:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "268:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 34, "nodeType": "ExpressionStatement", "src": "268:8:0"}, {"expression": {"id": 39, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 35, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12, "src": "282:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [], "expression": {"argumentTypes": [], "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "286:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_B_$150_$", "typeString": "function () returns (contract B)"}, "typeName": {"id": 36, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 150, "src": "290:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}}, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "286:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "src": "282:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "id": 40, "nodeType": "ExpressionStatement", "src": "282:11:0"}, {"expression": {"id": 46, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 41, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "299:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 44, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "309:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 43, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "303:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$191_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"id": 42, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "307:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}}, "id": 45, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "303:11:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "src": "299:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 47, "nodeType": "ExpressionStatement", "src": "299:15:0"}, {"expression": {"id": 53, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 48, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "320:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 51, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "330:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 50, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "324:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$229_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"id": 49, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "328:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}}, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "324:11:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "src": "320:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 54, "nodeType": "ExpressionStatement", "src": "320:15:0"}]}, "id": 56, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 21, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 18, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 56, "src": "209:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 17, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "209:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 20, "mutability": "mutable", "name": "zval", "nodeType": "VariableDeclaration", "scope": 56, "src": "223:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 19, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "223:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "208:28:0"}, "returnParameters": {"id": 22, "nodeType": "ParameterList", "parameters": [], "src": "237:0:0"}, "scope": 97, "src": "197:143:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 79, "nodeType": "Block", "src": "389:49:0", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 77, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 73, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 69, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 65, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 63, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 61, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "402:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 62, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8, "src": "404:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 64, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 10, "src": "406:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 66, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12, "src": "408:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$150", "typeString": "contract B"}}, "id": 67, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 149, "src": "408:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 68, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "408:8:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:14:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 70, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "417:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 71, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 180, "src": "417:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 72, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "417:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:22:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 74, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16, "src": "425:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 75, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 228, "src": "425:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 76, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "425:8:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "402:31:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 60, "id": 78, "nodeType": "Return", "src": "395:38:0"}]}, "functionSelector": "853255cc", "id": 80, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 57, "nodeType": "ParameterList", "parameters": [], "src": "356:2:0"}, "returnParameters": {"id": 60, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 59, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 80, "src": "380:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 58, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "380:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "379:9:0"}, "scope": 97, "src": "344:94:0", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 95, "nodeType": "Block", "src": "476:37:0", "statements": [{"expression": {"id": 87, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 85, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6, "src": "482:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 86, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 82, "src": "486:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "482:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 88, "nodeType": "ExpressionStatement", "src": "482:8:0"}, {"expression": {"arguments": [{"id": 92, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 82, "src": "503:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 89, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 14, "src": "496:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 91, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 190, "src": "496:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 93, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "496:12:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 94, "nodeType": "ExpressionStatement", "src": "496:12:0"}]}, "functionSelector": "60fe47b1", "id": 96, "implemented": true, "kind": "function", "modifiers": [], "name": "set", "nodeType": "FunctionDefinition", "parameters": {"id": 83, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 82, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 96, "src": "455:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 81, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "455:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "454:14:0"}, "returnParameters": {"id": 84, "nodeType": "ParameterList", "parameters": [], "src": "476:0:0"}, "scope": 97, "src": "442:71:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 151, "src": "121:394:0"}, {"abstract": false, "baseContracts": [], "contractDependencies": [344, 480], "contractKind": "contract", "fullyImplemented": true, "id": 150, "linearizedBaseContracts": [150], "name": "B", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 99, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 150, "src": "532:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 98, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "532:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 101, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 150, "src": "545:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 100, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "545:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 103, "mutability": "mutable", "name": "g", "nodeType": "VariableDeclaration", "scope": 150, "src": "558:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}, "typeName": {"id": 102, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 344, "src": "558:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "visibility": "internal"}, {"constant": false, "id": 105, "mutability": "mutable", "name": "k", "nodeType": "VariableDeclaration", "scope": 150, "src": "565:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}, "typeName": {"id": 104, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 480, "src": "565:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "visibility": "internal"}, {"body": {"id": 134, "nodeType": "Block", "src": "587:67:0", "statements": [{"expression": {"id": 110, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 108, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "593:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 109, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "597:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "593:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 111, "nodeType": "ExpressionStatement", "src": "593:5:0"}, {"expression": {"id": 114, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 112, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 101, "src": "604:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "36", "id": 113, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "608:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_6_by_1", "typeString": "int_const 6"}, "value": "6"}, "src": "604:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 115, "nodeType": "ExpressionStatement", "src": "604:5:0"}, {"expression": {"id": 123, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 116, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 103, "src": "615:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 121, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 119, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "625:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 120, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "627:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "625:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 118, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "619:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_G_$344_$", "typeString": "function (uint256) returns (contract G)"}, "typeName": {"id": 117, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 344, "src": "623:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}}, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "619:10:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "src": "615:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "id": 124, "nodeType": "ExpressionStatement", "src": "615:14:0"}, {"expression": {"id": 132, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 125, "name": "k", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 105, "src": "635:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 130, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 128, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "645:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "32", "id": 129, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "647:1:0", "typeDescriptions": {"typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2"}, "value": "2"}, "src": "645:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 127, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "639:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_K_$480_$", "typeString": "function (uint256) returns (contract K)"}, "typeName": {"id": 126, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 480, "src": "643:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}}, "id": 131, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "639:10:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "src": "635:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$480", "typeString": "contract K"}}, "id": 133, "nodeType": "ExpressionStatement", "src": "635:14:0"}]}, "id": 135, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 106, "nodeType": "ParameterList", "parameters": [], "src": "584:2:0"}, "returnParameters": {"id": 107, "nodeType": "ParameterList", "parameters": [], "src": "587:0:0"}, "scope": 150, "src": "573:81:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 148, "nodeType": "Block", "src": "704:29:0", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 146, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 142, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 140, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 99, "src": "717:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"id": 141, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 101, "src": "719:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "717:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 143, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 103, "src": "721:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$344", "typeString": "contract G"}}, "id": 144, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 325, "src": "721:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 145, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "721:7:0", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "717:11:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 139, "id": 147, "nodeType": "Return", "src": "710:18:0"}]}, "functionSelector": "a0d7afb7", "id": 149, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 136, "nodeType": "ParameterList", "parameters": [], "src": "671:2:0"}, "returnParameters": {"id": 139, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 138, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 149, "src": "695:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 137, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "695:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "694:9:0"}, "scope": 150, "src": "658:75:0", "stateMutability": "view", "virtual": false, "visibility": "public"}], "scope": 151, "src": "517:218:0"}], "src": "37:699:0"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/C.json b/tests/expected/hardhat-multi-file/C.json new file mode 100644 index 00000000..3f0041c4 --- /dev/null +++ b/tests/expected/hardhat-multi-file/C.json @@ -0,0 +1 @@ +{"contractName": "C", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fe", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fe", "ast": {"absolutePath": "contracts/C.sol", "exportedSymbols": {"C": [191], "D": [229]}, "id": 230, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 152, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:1"}, {"abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, "id": 191, "linearizedBaseContracts": [191], "name": "C", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 154, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 191, "src": "77:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 153, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "77:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 156, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 191, "src": "90:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 155, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "90:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"body": {"id": 169, "nodeType": "Block", "src": "130:30:1", "statements": [{"expression": {"id": 163, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 161, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "136:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 162, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "140:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "136:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 164, "nodeType": "ExpressionStatement", "src": "136:5:1"}, {"expression": {"id": 167, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 165, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "147:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 166, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 158, "src": "151:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "147:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 168, "nodeType": "ExpressionStatement", "src": "147:8:1"}]}, "id": 170, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 159, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 158, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 170, "src": "116:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 157, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "116:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "115:14:1"}, "returnParameters": {"id": 160, "nodeType": "ParameterList", "parameters": [], "src": "130:0:1"}, "scope": 191, "src": "104:56:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 179, "nodeType": "Block", "src": "209:21:1", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 177, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 175, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "222:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 176, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "224:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "222:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 174, "id": 178, "nodeType": "Return", "src": "215:10:1"}]}, "functionSelector": "853255cc", "id": 180, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 171, "nodeType": "ParameterList", "parameters": [], "src": "176:2:1"}, "returnParameters": {"id": 174, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 173, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 180, "src": "200:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 172, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "200:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "199:9:1"}, "scope": 191, "src": "164:66:1", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 189, "nodeType": "Block", "src": "269:19:1", "statements": [{"expression": {"id": 187, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 185, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "275:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 186, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 182, "src": "279:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "275:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 188, "nodeType": "ExpressionStatement", "src": "275:8:1"}]}, "functionSelector": "4018d9aa", "id": 190, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 183, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 182, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 190, "src": "248:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 181, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "248:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "247:14:1"}, "returnParameters": {"id": 184, "nodeType": "ParameterList", "parameters": [], "src": "269:0:1"}, "scope": 191, "src": "234:54:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 230, "src": "62:228:1"}, {"abstract": false, "baseContracts": [], "contractDependencies": [191], "contractKind": "contract", "fullyImplemented": true, "id": 229, "linearizedBaseContracts": [229], "name": "D", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 193, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 229, "src": "307:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 192, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "307:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 195, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 229, "src": "320:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 194, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "320:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 197, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 229, "src": "333:3:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}, "typeName": {"id": 196, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "333:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "visibility": "internal"}, {"body": {"id": 217, "nodeType": "Block", "src": "367:48:1", "statements": [{"expression": {"id": 204, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 202, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "373:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 203, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "377:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "373:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 205, "nodeType": "ExpressionStatement", "src": "373:5:1"}, {"expression": {"id": 208, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 206, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "384:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 207, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 199, "src": "388:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "384:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 209, "nodeType": "ExpressionStatement", "src": "384:8:1"}, {"expression": {"id": 215, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 210, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 197, "src": "398:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"hexValue": "35", "id": 213, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "408:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 212, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "402:5:1", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$191_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"id": 211, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "406:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}}, "id": 214, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "402:8:1", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "src": "398:12:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 216, "nodeType": "ExpressionStatement", "src": "398:12:1"}]}, "id": 218, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 200, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 199, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 218, "src": "353:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 198, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "353:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "352:14:1"}, "returnParameters": {"id": 201, "nodeType": "ParameterList", "parameters": [], "src": "367:0:1"}, "scope": 229, "src": "341:74:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 227, "nodeType": "Block", "src": "465:21:1", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 225, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 223, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "478:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"id": 224, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "480:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "478:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 222, "id": 226, "nodeType": "Return", "src": "471:10:1"}]}, "functionSelector": "a0d7afb7", "id": 228, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 219, "nodeType": "ParameterList", "parameters": [], "src": "432:2:1"}, "returnParameters": {"id": 222, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 221, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 228, "src": "456:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 220, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "456:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "455:9:1"}, "scope": 229, "src": "419:67:1", "stateMutability": "view", "virtual": false, "visibility": "public"}], "scope": 230, "src": "292:196:1"}], "src": "37:452:1"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/D.json b/tests/expected/hardhat-multi-file/D.json new file mode 100644 index 00000000..c91bfa9d --- /dev/null +++ b/tests/expected/hardhat-multi-file/D.json @@ -0,0 +1 @@ +{"contractName": "D", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [], "name": "diff", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fe608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fe", "ast": {"absolutePath": "contracts/C.sol", "exportedSymbols": {"C": [191], "D": [229]}, "id": 230, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 152, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:1"}, {"abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, "id": 191, "linearizedBaseContracts": [191], "name": "C", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 154, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 191, "src": "77:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 153, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "77:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 156, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 191, "src": "90:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 155, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "90:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"body": {"id": 169, "nodeType": "Block", "src": "130:30:1", "statements": [{"expression": {"id": 163, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 161, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "136:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 162, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "140:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "136:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 164, "nodeType": "ExpressionStatement", "src": "136:5:1"}, {"expression": {"id": 167, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 165, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "147:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 166, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 158, "src": "151:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "147:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 168, "nodeType": "ExpressionStatement", "src": "147:8:1"}]}, "id": 170, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 159, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 158, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 170, "src": "116:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 157, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "116:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "115:14:1"}, "returnParameters": {"id": 160, "nodeType": "ParameterList", "parameters": [], "src": "130:0:1"}, "scope": 191, "src": "104:56:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 179, "nodeType": "Block", "src": "209:21:1", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 177, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 175, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "222:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 176, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "224:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "222:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 174, "id": 178, "nodeType": "Return", "src": "215:10:1"}]}, "functionSelector": "853255cc", "id": 180, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 171, "nodeType": "ParameterList", "parameters": [], "src": "176:2:1"}, "returnParameters": {"id": 174, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 173, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 180, "src": "200:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 172, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "200:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "199:9:1"}, "scope": 191, "src": "164:66:1", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 189, "nodeType": "Block", "src": "269:19:1", "statements": [{"expression": {"id": 187, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 185, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "275:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 186, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 182, "src": "279:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "275:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 188, "nodeType": "ExpressionStatement", "src": "275:8:1"}]}, "functionSelector": "4018d9aa", "id": 190, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 183, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 182, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 190, "src": "248:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 181, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "248:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "247:14:1"}, "returnParameters": {"id": 184, "nodeType": "ParameterList", "parameters": [], "src": "269:0:1"}, "scope": 191, "src": "234:54:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 230, "src": "62:228:1"}, {"abstract": false, "baseContracts": [], "contractDependencies": [191], "contractKind": "contract", "fullyImplemented": true, "id": 229, "linearizedBaseContracts": [229], "name": "D", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 193, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 229, "src": "307:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 192, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "307:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 195, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 229, "src": "320:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 194, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "320:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 197, "mutability": "mutable", "name": "c", "nodeType": "VariableDeclaration", "scope": 229, "src": "333:3:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}, "typeName": {"id": 196, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "333:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "visibility": "internal"}, {"body": {"id": 217, "nodeType": "Block", "src": "367:48:1", "statements": [{"expression": {"id": 204, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 202, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "373:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 203, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "377:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "373:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 205, "nodeType": "ExpressionStatement", "src": "373:5:1"}, {"expression": {"id": 208, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 206, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "384:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 207, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 199, "src": "388:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "384:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 209, "nodeType": "ExpressionStatement", "src": "384:8:1"}, {"expression": {"id": 215, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 210, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 197, "src": "398:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"hexValue": "35", "id": 213, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "408:1:1", "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 212, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "402:5:1", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$191_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"id": 211, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 191, "src": "406:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}}, "id": 214, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "402:8:1", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "src": "398:12:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$191", "typeString": "contract C"}}, "id": 216, "nodeType": "ExpressionStatement", "src": "398:12:1"}]}, "id": 218, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 200, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 199, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 218, "src": "353:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 198, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "353:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "352:14:1"}, "returnParameters": {"id": 201, "nodeType": "ParameterList", "parameters": [], "src": "367:0:1"}, "scope": 229, "src": "341:74:1", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 227, "nodeType": "Block", "src": "465:21:1", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 225, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 223, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "478:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"id": 224, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "480:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "478:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 222, "id": 226, "nodeType": "Return", "src": "471:10:1"}]}, "functionSelector": "a0d7afb7", "id": 228, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 219, "nodeType": "ParameterList", "parameters": [], "src": "432:2:1"}, "returnParameters": {"id": 222, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 221, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 228, "src": "456:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 220, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "456:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "455:9:1"}, "scope": 229, "src": "419:67:1", "stateMutability": "view", "virtual": false, "visibility": "public"}], "scope": 230, "src": "292:196:1"}], "src": "37:452:1"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/E.json b/tests/expected/hardhat-multi-file/E.json new file mode 100644 index 00000000..d6bf44ad --- /dev/null +++ b/tests/expected/hardhat-multi-file/E.json @@ -0,0 +1 @@ +{"contractName": "E", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fe608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fe", "ast": {"absolutePath": "contracts/E/E.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "I": [421]}, "id": 286, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 231, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:2"}, {"absolutePath": "contracts/C.sol", "file": "../C.sol", "id": 232, "nodeType": "ImportDirective", "scope": 286, "sourceUnit": 230, "src": "62:18:2", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/I/I.sol", "file": "../I/I.sol", "id": 233, "nodeType": "ImportDirective", "scope": 286, "sourceUnit": 422, "src": "81:20:2", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [229], "contractKind": "contract", "fullyImplemented": true, "id": 285, "linearizedBaseContracts": [285], "name": "E", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 235, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 285, "src": "118:9:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 234, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "118:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 237, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 285, "src": "131:9:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 236, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "131:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 239, "mutability": "mutable", "name": "d", "nodeType": "VariableDeclaration", "scope": 285, "src": "144:3:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}, "typeName": {"id": 238, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "144:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "visibility": "internal"}, {"body": {"id": 259, "nodeType": "Block", "src": "178:51:2", "statements": [{"expression": {"id": 246, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 244, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "184:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 245, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "188:1:2", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "184:5:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 247, "nodeType": "ExpressionStatement", "src": "184:5:2"}, {"expression": {"id": 250, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 248, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 237, "src": "195:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 249, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 241, "src": "199:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "195:8:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 251, "nodeType": "ExpressionStatement", "src": "195:8:2"}, {"expression": {"id": 257, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 252, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 239, "src": "209:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 255, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 241, "src": "219:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 254, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "213:5:2", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$229_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"id": 253, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "217:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}}, "id": 256, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "213:11:2", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "src": "209:15:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 258, "nodeType": "ExpressionStatement", "src": "209:15:2"}]}, "id": 260, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 242, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 241, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 260, "src": "164:12:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 240, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "164:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "163:14:2"}, "returnParameters": {"id": 243, "nodeType": "ParameterList", "parameters": [], "src": "178:0:2"}, "scope": 285, "src": "152:77:2", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 273, "nodeType": "Block", "src": "278:30:2", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 271, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 267, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 265, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "291:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 266, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 237, "src": "293:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "291:3:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 268, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 239, "src": "295:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 269, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 228, "src": "295:6:2", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 270, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "295:8:2", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "291:12:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 264, "id": 272, "nodeType": "Return", "src": "284:19:2"}]}, "functionSelector": "853255cc", "id": 274, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 261, "nodeType": "ParameterList", "parameters": [], "src": "245:2:2"}, "returnParameters": {"id": 264, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 263, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 274, "src": "269:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 262, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "269:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "268:9:2"}, "scope": 285, "src": "233:75:2", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 283, "nodeType": "Block", "src": "347:19:2", "statements": [{"expression": {"id": 281, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 279, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "353:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 280, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 276, "src": "357:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "353:8:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 282, "nodeType": "ExpressionStatement", "src": "353:8:2"}]}, "functionSelector": "4018d9aa", "id": 284, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 277, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 276, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 284, "src": "326:12:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 275, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "326:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "325:14:2"}, "returnParameters": {"id": 278, "nodeType": "ParameterList", "parameters": [], "src": "347:0:2"}, "scope": 285, "src": "312:54:2", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 286, "src": "103:265:2"}], "src": "37:332:2"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/G.json b/tests/expected/hardhat-multi-file/G.json new file mode 100644 index 00000000..1878843c --- /dev/null +++ b/tests/expected/hardhat-multi-file/G.json @@ -0,0 +1 @@ +{"contractName": "G", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b506040516107ed3803806107ed8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610503806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe", "ast": {"absolutePath": "contracts/E/G.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "G": [344], "I": [421]}, "id": 345, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 287, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:3"}, {"absolutePath": "contracts/E/E.sol", "file": "./E.sol", "id": 288, "nodeType": "ImportDirective", "scope": 345, "sourceUnit": 286, "src": "62:17:3", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [285], "contractKind": "contract", "fullyImplemented": true, "id": 344, "linearizedBaseContracts": [344], "name": "G", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 290, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 344, "src": "96:9:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 289, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "96:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 292, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 344, "src": "109:9:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 291, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "109:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 294, "mutability": "mutable", "name": "e", "nodeType": "VariableDeclaration", "scope": 344, "src": "122:3:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}, "typeName": {"id": 293, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "122:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "visibility": "internal"}, {"body": {"id": 314, "nodeType": "Block", "src": "156:48:3", "statements": [{"expression": {"id": 301, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 299, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 290, "src": "162:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 300, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "166:1:3", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "162:5:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 302, "nodeType": "ExpressionStatement", "src": "162:5:3"}, {"expression": {"id": 305, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 303, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 292, "src": "173:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 304, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 296, "src": "177:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "173:8:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 306, "nodeType": "ExpressionStatement", "src": "173:8:3"}, {"expression": {"id": 312, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 307, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 294, "src": "187:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"hexValue": "35", "id": 310, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "197:1:3", "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 309, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "191:5:3", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_E_$285_$", "typeString": "function (uint256) returns (contract E)"}, "typeName": {"id": 308, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "195:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}}, "id": 311, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "191:8:3", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "src": "187:12:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 313, "nodeType": "ExpressionStatement", "src": "187:12:3"}]}, "id": 315, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 297, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 296, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 315, "src": "142:12:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 295, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "142:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "141:14:3"}, "returnParameters": {"id": 298, "nodeType": "ParameterList", "parameters": [], "src": "156:0:3"}, "scope": 344, "src": "130:74:3", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 324, "nodeType": "Block", "src": "253:25:3", "statements": [{"expression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 320, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 294, "src": "266:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 321, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 274, "src": "266:5:3", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 322, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "266:7:3", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 319, "id": 323, "nodeType": "Return", "src": "259:14:3"}]}, "functionSelector": "853255cc", "id": 325, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 316, "nodeType": "ParameterList", "parameters": [], "src": "220:2:3"}, "returnParameters": {"id": 319, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 318, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 325, "src": "244:7:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 317, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "244:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "243:9:3"}, "scope": 344, "src": "208:70:3", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 342, "nodeType": "Block", "src": "317:39:3", "statements": [{"expression": {"id": 332, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 330, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 290, "src": "323:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 331, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 327, "src": "327:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "323:8:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 333, "nodeType": "ExpressionStatement", "src": "323:8:3"}, {"expression": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 339, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 337, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 327, "src": "344:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 338, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "349:1:3", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "344:6:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 334, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 294, "src": "337:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 336, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 284, "src": "337:6:3", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 340, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "337:14:3", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 341, "nodeType": "ExpressionStatement", "src": "337:14:3"}]}, "functionSelector": "4018d9aa", "id": 343, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 328, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 327, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 343, "src": "296:12:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 326, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "296:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "295:14:3"}, "returnParameters": {"id": 329, "nodeType": "ParameterList", "parameters": [], "src": "317:0:3"}, "scope": 344, "src": "282:74:3", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 345, "src": "81:277:3"}], "src": "37:322:3"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/I.json b/tests/expected/hardhat-multi-file/I.json new file mode 100644 index 00000000..246256d3 --- /dev/null +++ b/tests/expected/hardhat-multi-file/I.json @@ -0,0 +1 @@ +{"contractName": "I", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe", "ast": {"absolutePath": "contracts/I/I.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "I": [421]}, "id": 422, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 346, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:4"}, {"absolutePath": "contracts/C.sol", "file": "../C.sol", "id": 347, "nodeType": "ImportDirective", "scope": 422, "sourceUnit": 230, "src": "62:18:4", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/E/E.sol", "file": "../E/E.sol", "id": 348, "nodeType": "ImportDirective", "scope": 422, "sourceUnit": 286, "src": "81:20:4", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [229, 285], "contractKind": "contract", "fullyImplemented": true, "id": 421, "linearizedBaseContracts": [421], "name": "I", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 350, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 421, "src": "118:9:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 349, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "118:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 352, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 421, "src": "131:9:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 351, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "131:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 354, "mutability": "mutable", "name": "d", "nodeType": "VariableDeclaration", "scope": 421, "src": "144:3:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}, "typeName": {"id": 353, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "144:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "visibility": "internal"}, {"constant": false, "id": 356, "mutability": "mutable", "name": "e", "nodeType": "VariableDeclaration", "scope": 421, "src": "151:3:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}, "typeName": {"id": 355, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "151:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "visibility": "internal"}, {"body": {"id": 385, "nodeType": "Block", "src": "185:74:4", "statements": [{"expression": {"id": 363, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 361, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 350, "src": "191:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 362, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "195:1:4", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "191:5:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 364, "nodeType": "ExpressionStatement", "src": "191:5:4"}, {"expression": {"id": 367, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 365, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 352, "src": "202:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 366, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 358, "src": "206:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "202:8:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 368, "nodeType": "ExpressionStatement", "src": "202:8:4"}, {"expression": {"id": 374, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 369, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 354, "src": "216:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 372, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 358, "src": "226:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 371, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "220:5:4", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$229_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"id": 370, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "224:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}}, "id": 373, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "220:11:4", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "src": "216:15:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 375, "nodeType": "ExpressionStatement", "src": "216:15:4"}, {"expression": {"id": 383, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 376, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 356, "src": "237:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 381, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 379, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 358, "src": "247:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 380, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "252:1:4", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "247:6:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 378, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "241:5:4", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_E_$285_$", "typeString": "function (uint256) returns (contract E)"}, "typeName": {"id": 377, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "245:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}}, "id": 382, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "241:13:4", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "src": "237:17:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 384, "nodeType": "ExpressionStatement", "src": "237:17:4"}]}, "id": 386, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 359, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 358, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 386, "src": "171:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 357, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "171:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "170:14:4"}, "returnParameters": {"id": 360, "nodeType": "ParameterList", "parameters": [], "src": "185:0:4"}, "scope": 421, "src": "159:100:4", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 403, "nodeType": "Block", "src": "308:38:4", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 401, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 397, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 393, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 391, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 350, "src": "321:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 392, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 352, "src": "323:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:3:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 394, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 354, "src": "325:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 395, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 228, "src": "325:6:4", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 396, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "325:8:4", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:12:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 398, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 356, "src": "334:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 399, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 274, "src": "334:5:4", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 400, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "334:7:4", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:20:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 390, "id": 402, "nodeType": "Return", "src": "314:27:4"}]}, "functionSelector": "853255cc", "id": 404, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 387, "nodeType": "ParameterList", "parameters": [], "src": "275:2:4"}, "returnParameters": {"id": 390, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 389, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 404, "src": "299:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 388, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "299:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "298:9:4"}, "scope": 421, "src": "263:83:4", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 419, "nodeType": "Block", "src": "385:34:4", "statements": [{"expression": {"id": 411, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 409, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 350, "src": "391:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 410, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 406, "src": "395:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "391:8:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 412, "nodeType": "ExpressionStatement", "src": "391:8:4"}, {"expression": {"arguments": [{"id": 416, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 352, "src": "412:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 413, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 356, "src": "405:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 415, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 284, "src": "405:6:4", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 417, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "405:9:4", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 418, "nodeType": "ExpressionStatement", "src": "405:9:4"}]}, "functionSelector": "4018d9aa", "id": 420, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 407, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 406, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 420, "src": "364:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 405, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "364:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "363:14:4"}, "returnParameters": {"id": 408, "nodeType": "ParameterList", "parameters": [], "src": "385:0:4"}, "scope": 421, "src": "350:69:4", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 422, "src": "103:318:4"}], "src": "37:385:4"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/K.json b/tests/expected/hardhat-multi-file/K.json new file mode 100644 index 00000000..553b8272 --- /dev/null +++ b/tests/expected/hardhat-multi-file/K.json @@ -0,0 +1 @@ +{"contractName": "K", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b50604051610ea7380380610ea78339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b610bbd806102ea83390190565b610201806100e96000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea26469706673582212207adf748c4fbc65b7c753bb0a72e946f848bffb9e1d7c8e268d29021c42b7df4964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe", "ast": {"absolutePath": "contracts/I/K.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "I": [421], "K": [480]}, "id": 481, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 423, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:5"}, {"absolutePath": "contracts/I/I.sol", "file": "./I.sol", "id": 424, "nodeType": "ImportDirective", "scope": 481, "sourceUnit": 422, "src": "62:17:5", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [421], "contractKind": "contract", "fullyImplemented": true, "id": 480, "linearizedBaseContracts": [480], "name": "K", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 426, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 480, "src": "96:9:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 425, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "96:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 428, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 480, "src": "109:9:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 427, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "109:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 430, "mutability": "mutable", "name": "i", "nodeType": "VariableDeclaration", "scope": 480, "src": "122:3:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}, "typeName": {"id": 429, "name": "I", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 421, "src": "122:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "visibility": "internal"}, {"body": {"id": 450, "nodeType": "Block", "src": "156:48:5", "statements": [{"expression": {"id": 437, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 435, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 426, "src": "162:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 436, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "166:1:5", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "162:5:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 438, "nodeType": "ExpressionStatement", "src": "162:5:5"}, {"expression": {"id": 441, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 439, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 428, "src": "173:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 440, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 432, "src": "177:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "173:8:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 442, "nodeType": "ExpressionStatement", "src": "173:8:5"}, {"expression": {"id": 448, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 443, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 430, "src": "187:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"hexValue": "35", "id": 446, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "197:1:5", "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 445, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "191:5:5", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_I_$421_$", "typeString": "function (uint256) returns (contract I)"}, "typeName": {"id": 444, "name": "I", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 421, "src": "195:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}}, "id": 447, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "191:8:5", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "src": "187:12:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "id": 449, "nodeType": "ExpressionStatement", "src": "187:12:5"}]}, "id": 451, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 433, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 432, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 451, "src": "142:12:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 431, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "142:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "141:14:5"}, "returnParameters": {"id": 434, "nodeType": "ParameterList", "parameters": [], "src": "156:0:5"}, "scope": 480, "src": "130:74:5", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 460, "nodeType": "Block", "src": "253:25:5", "statements": [{"expression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 456, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 430, "src": "266:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "id": 457, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 404, "src": "266:5:5", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 458, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "266:7:5", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 455, "id": 459, "nodeType": "Return", "src": "259:14:5"}]}, "functionSelector": "853255cc", "id": 461, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 452, "nodeType": "ParameterList", "parameters": [], "src": "220:2:5"}, "returnParameters": {"id": 455, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 454, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 461, "src": "244:7:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 453, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "244:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "243:9:5"}, "scope": 480, "src": "208:70:5", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 478, "nodeType": "Block", "src": "317:39:5", "statements": [{"expression": {"id": 468, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 466, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 426, "src": "323:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 467, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 463, "src": "327:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "323:8:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 469, "nodeType": "ExpressionStatement", "src": "323:8:5"}, {"expression": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 475, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 473, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 463, "src": "344:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 474, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "349:1:5", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "344:6:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 470, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 430, "src": "337:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$421", "typeString": "contract I"}}, "id": 472, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 420, "src": "337:6:5", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 476, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "337:14:5", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 477, "nodeType": "ExpressionStatement", "src": "337:14:5"}]}, "functionSelector": "4018d9aa", "id": 479, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 464, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 463, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 479, "src": "296:12:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 462, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "296:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "295:14:5"}, "returnParameters": {"id": 465, "nodeType": "ParameterList", "parameters": [], "src": "317:0:5"}, "scope": 480, "src": "282:74:5", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 481, "src": "81:277:5"}], "src": "37:322:5"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/X.json b/tests/expected/hardhat-multi-file/X.json new file mode 100644 index 00000000..41d3c91c --- /dev/null +++ b/tests/expected/hardhat-multi-file/X.json @@ -0,0 +1 @@ +{"contractName": "X", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe", "ast": {"absolutePath": "contracts/X/X.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "I": [421], "X": [557]}, "id": 558, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 482, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:6"}, {"absolutePath": "contracts/C.sol", "file": "../C.sol", "id": 483, "nodeType": "ImportDirective", "scope": 558, "sourceUnit": 230, "src": "62:18:6", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "contracts/E/E.sol", "file": "../E/E.sol", "id": 484, "nodeType": "ImportDirective", "scope": 558, "sourceUnit": 286, "src": "81:20:6", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [229, 285], "contractKind": "contract", "fullyImplemented": true, "id": 557, "linearizedBaseContracts": [557], "name": "X", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 486, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 557, "src": "118:9:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 485, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "118:7:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 488, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 557, "src": "131:9:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 487, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "131:7:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 490, "mutability": "mutable", "name": "d", "nodeType": "VariableDeclaration", "scope": 557, "src": "144:3:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}, "typeName": {"id": 489, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "144:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "visibility": "internal"}, {"constant": false, "id": 492, "mutability": "mutable", "name": "e", "nodeType": "VariableDeclaration", "scope": 557, "src": "151:3:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}, "typeName": {"id": 491, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "151:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "visibility": "internal"}, {"body": {"id": 521, "nodeType": "Block", "src": "185:74:6", "statements": [{"expression": {"id": 499, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 497, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 486, "src": "191:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"hexValue": "30", "id": 498, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "195:1:6", "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "191:5:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 500, "nodeType": "ExpressionStatement", "src": "191:5:6"}, {"expression": {"id": 503, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 501, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 488, "src": "202:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 502, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 494, "src": "206:4:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "202:8:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 504, "nodeType": "ExpressionStatement", "src": "202:8:6"}, {"expression": {"id": 510, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 505, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 490, "src": "216:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"id": 508, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 494, "src": "226:4:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 507, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "220:5:6", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$229_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"id": 506, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 229, "src": "224:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}}, "id": 509, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "220:11:6", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "src": "216:15:6", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 511, "nodeType": "ExpressionStatement", "src": "216:15:6"}, {"expression": {"id": 519, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 512, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 492, "src": "237:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 517, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 515, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 494, "src": "247:4:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 516, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "252:1:6", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "247:6:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 514, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "241:5:6", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_E_$285_$", "typeString": "function (uint256) returns (contract E)"}, "typeName": {"id": 513, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "245:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}}, "id": 518, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "241:13:6", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "src": "237:17:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 520, "nodeType": "ExpressionStatement", "src": "237:17:6"}]}, "id": 522, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 495, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 494, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 522, "src": "171:12:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 493, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "171:7:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "170:14:6"}, "returnParameters": {"id": 496, "nodeType": "ParameterList", "parameters": [], "src": "185:0:6"}, "scope": 557, "src": "159:100:6", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 539, "nodeType": "Block", "src": "308:38:6", "statements": [{"expression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 537, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 533, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 529, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 527, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 486, "src": "321:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"id": 528, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 488, "src": "323:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:3:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 530, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 490, "src": "325:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$229", "typeString": "contract D"}}, "id": 531, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 228, "src": "325:6:6", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 532, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "325:8:6", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:12:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 534, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 492, "src": "334:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 535, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 274, "src": "334:5:6", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 536, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "334:7:6", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "321:20:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 526, "id": 538, "nodeType": "Return", "src": "314:27:6"}]}, "functionSelector": "853255cc", "id": 540, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 523, "nodeType": "ParameterList", "parameters": [], "src": "275:2:6"}, "returnParameters": {"id": 526, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 525, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 540, "src": "299:7:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 524, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "299:7:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "298:9:6"}, "scope": 557, "src": "263:83:6", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 555, "nodeType": "Block", "src": "385:34:6", "statements": [{"expression": {"id": 547, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 545, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 486, "src": "391:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 546, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 542, "src": "395:4:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "391:8:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 548, "nodeType": "ExpressionStatement", "src": "391:8:6"}, {"expression": {"arguments": [{"id": 552, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 488, "src": "412:1:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 549, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 492, "src": "405:1:6", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$285", "typeString": "contract E"}}, "id": 551, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 284, "src": "405:6:6", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 553, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "405:9:6", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 554, "nodeType": "ExpressionStatement", "src": "405:9:6"}]}, "functionSelector": "4018d9aa", "id": 556, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 543, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 542, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 556, "src": "364:12:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 541, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "364:7:6", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "363:14:6"}, "returnParameters": {"id": 544, "nodeType": "ParameterList", "parameters": [], "src": "385:0:6"}, "scope": 557, "src": "350:69:6", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 558, "src": "103:318:6"}], "src": "37:385:6"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/Z.json b/tests/expected/hardhat-multi-file/Z.json new file mode 100644 index 00000000..d3c37616 --- /dev/null +++ b/tests/expected/hardhat-multi-file/Z.json @@ -0,0 +1 @@ +{"contractName": "Z", "abi": [{"inputs": [{"internalType": "uint256", "name": "yval", "type": "uint256"}], "stateMutability": "nonpayable", "type": "constructor"}, {"inputs": [{"internalType": "uint256", "name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "stateMutability": "nonpayable", "type": "function"}, {"inputs": [], "name": "sum", "outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}], "stateMutability": "view", "type": "function"}], "bytecode": "0x608060405234801561001057600080fd5b50604051610e99380380610e998339818101604052602081101561003357600080fd5b8101908080519060200190929190505050806000819055506005604051610059906100c6565b80828152602001915050604051809103906000f08015801561007f573d6000803e3d6000fd5b50600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d3565b610bbd806102dc83390190565b6101fa806100e26000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011a565b6040518082815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156100ff57600080fd5b505af1158015610113573d6000803e3d6000fd5b5050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018457600080fd5b505afa158015610198573d6000803e3d6000fd5b505050506040513d60208110156101ae57600080fd5b810190808051906020019092919050505090509056fe608060405234801561001057600080fd5b50604051610bbd380380610bbd8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f90610143565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d690610150565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015d565b6102a28061041883390190565b610503806106ba83390190565b6102ac8061016c6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea2646970667358221220a5363a19a9f78e7325c5b5daf5b391bec6b791a5dcbc774b74c1a26908d75a0164736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033608060405234801561001057600080fd5b506040516105033803806105038339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005f906100cc565b80828152602001915050604051809103906000f080158015610085573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d9565b6102a28061026183390190565b610179806100e86000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea2646970667358221220ec8b5ae5c6f71260e1077af8088b564be4ae241ac16c43e3cac821682be2d7c964736f6c63430007030033608060405234801561001057600080fd5b506040516102a23803806102a28339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055506005604051610060906100cd565b80828152602001915050604051809103906000f080158015610086573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100da565b61012d8061017583390190565b608d806100e86000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea26469706673582212204e7f66950d7eac1667bf123fd0c2c0b36d53de5866b4bd867fac7411e321b0b464736f6c63430007030033608060405234801561001057600080fd5b5060405161012d38038061012d8339818101604052602081101561003357600080fd5b810190808051906020019092919050505060008081905550806001819055505060cc806100616000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea2646970667358221220fa023934f603bf6bcaae6a6ab06db920cce4aca360c67548633e7f3514118cc964736f6c63430007030033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011a565b6040518082815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156100ff57600080fd5b505af1158015610113573d6000803e3d6000fd5b5050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018457600080fd5b505afa158015610198573d6000803e3d6000fd5b505050506040513d60208110156101ae57600080fd5b810190808051906020019092919050505090509056fe", "ast": {"absolutePath": "contracts/X/Z.sol", "exportedSymbols": {"C": [191], "D": [229], "E": [285], "I": [421], "X": [557], "Z": [606]}, "id": 607, "license": "Unlicense", "nodeType": "SourceUnit", "nodes": [{"id": 559, "literals": ["solidity", "^", "0.7", ".0"], "nodeType": "PragmaDirective", "src": "37:23:7"}, {"absolutePath": "contracts/X/X.sol", "file": "./X.sol", "id": 560, "nodeType": "ImportDirective", "scope": 607, "sourceUnit": 558, "src": "62:17:7", "symbolAliases": [], "unitAlias": ""}, {"abstract": false, "baseContracts": [], "contractDependencies": [557], "contractKind": "contract", "fullyImplemented": true, "id": 606, "linearizedBaseContracts": [606], "name": "Z", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 562, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 606, "src": "96:9:7", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 561, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "96:7:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}, {"constant": false, "id": 564, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 606, "src": "109:3:7", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}, "typeName": {"id": 563, "name": "X", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 557, "src": "109:1:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "visibility": "internal"}, {"body": {"id": 580, "nodeType": "Block", "src": "143:37:7", "statements": [{"expression": {"id": 571, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 569, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 562, "src": "149:1:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"id": 570, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 566, "src": "153:4:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "149:8:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 572, "nodeType": "ExpressionStatement", "src": "149:8:7"}, {"expression": {"id": 578, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"id": 573, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 564, "src": "163:1:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"arguments": [{"hexValue": "35", "id": 576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "173:1:7", "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "167:5:7", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_X_$557_$", "typeString": "function (uint256) returns (contract X)"}, "typeName": {"id": 574, "name": "X", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 557, "src": "171:1:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}}, "id": 577, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "167:8:7", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "src": "163:12:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "id": 579, "nodeType": "ExpressionStatement", "src": "163:12:7"}]}, "id": 581, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 567, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 566, "mutability": "mutable", "name": "yval", "nodeType": "VariableDeclaration", "scope": 581, "src": "129:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 565, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "129:7:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "128:14:7"}, "returnParameters": {"id": 568, "nodeType": "ParameterList", "parameters": [], "src": "143:0:7"}, "scope": 606, "src": "117:63:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}, {"body": {"id": 590, "nodeType": "Block", "src": "229:25:7", "statements": [{"expression": {"arguments": [], "expression": {"argumentTypes": [], "expression": {"id": 586, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 564, "src": "242:1:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "id": 587, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 540, "src": "242:5:7", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 588, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "242:7:7", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 585, "id": 589, "nodeType": "Return", "src": "235:14:7"}]}, "functionSelector": "853255cc", "id": 591, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 582, "nodeType": "ParameterList", "parameters": [], "src": "196:2:7"}, "returnParameters": {"id": 585, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 584, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "scope": 591, "src": "220:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 583, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "220:7:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "219:9:7"}, "scope": 606, "src": "184:70:7", "stateMutability": "view", "virtual": false, "visibility": "public"}, {"body": {"id": 604, "nodeType": "Block", "src": "293:25:7", "statements": [{"expression": {"arguments": [{"commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 601, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"id": 599, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 593, "src": "306:4:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"hexValue": "31", "id": 600, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "311:1:7", "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "306:6:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"id": 596, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 564, "src": "299:1:7", "typeDescriptions": {"typeIdentifier": "t_contract$_X_$557", "typeString": "contract X"}}, "id": 598, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 556, "src": "299:6:7", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 602, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "299:14:7", "tryCall": false, "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 603, "nodeType": "ExpressionStatement", "src": "299:14:7"}]}, "functionSelector": "4018d9aa", "id": 605, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 594, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 593, "mutability": "mutable", "name": "xval", "nodeType": "VariableDeclaration", "scope": 605, "src": "272:12:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 592, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "272:7:7", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "visibility": "internal"}], "src": "271:14:7"}, "returnParameters": {"id": 595, "nodeType": "ParameterList", "parameters": [], "src": "293:0:7"}, "scope": 606, "src": "258:60:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "public"}], "scope": 607, "src": "81:239:7"}], "src": "37:284:7"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/hardhat-multi-file/combined_solc.json b/tests/expected/hardhat-multi-file/combined_solc.json new file mode 100644 index 00000000..dfa18271 --- /dev/null +++ b/tests/expected/hardhat-multi-file/combined_solc.json @@ -0,0 +1 @@ +["A.sol","C.sol","E.sol","G.sol","I.sol","K.sol","X.sol","Z.sol"] \ No newline at end of file diff --git a/tests/expected/solc-multi-file/A.json b/tests/expected/solc-multi-file/A.json new file mode 100644 index 00000000..fcbe92a0 --- /dev/null +++ b/tests/expected/solc-multi-file/A.json @@ -0,0 +1 @@ +{"contractName": "A", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "set", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}, {"name": "zval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b506040516040806121478339810180604052604081101561003057600080fd5b81019080805190602001909291908051906020019092919050505060008081905550816001819055508060028190555060405161006c906101b8565b604051809103906000f080158015610088573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806040516100d6906101c5565b80828152602001915050604051809103906000f0801580156100fc573d6000803e3d6000fd5b50600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060405161014a906101d2565b80828152602001915050604051809103906000f080158015610170573d6000803e3d6000fd5b50600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050506101df565b6118698061053683390190565b61012080611d9f83390190565b61028880611ebf83390190565b610348806101ee6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011e565b6040518082815260200191505060405180910390f35b80600081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010357600080fd5b505af1158015610117573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561018857600080fd5b505afa15801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b8101908080519060200190929190505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022b57600080fd5b505afa15801561023f573d6000803e3d6000fd5b505050506040513d602081101561025557600080fd5b8101908080519060200190929190505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ce57600080fd5b505afa1580156102e2573d6000803e3d6000fd5b505050506040513d60208110156102f857600080fd5b8101908080519060200190929190505050600254600154600054010101010190509056fe608060405234801561001057600080fd5b5060008081905550600660018190555060016000540160405161003290610117565b80828152602001915050604051809103906000f080158015610058573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600054016040516100ab90610124565b80828152602001915050604051809103906000f0801580156100d1573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610131565b6107b98061026483390190565b610e4c80610a1d83390190565b610124806101406000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fea165627a7a7230582008d33b5d4c256a0eceb77bc42fdfd9d420cf681a7887e90ea9dabf7fd5d5f0120029608060405234801561001057600080fd5b506040516020806107b98339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6104dc806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea165627a7a72305820a64456b7783085a8bd9be4500d8a031f19eb6878c10d2bc4870b0206d856440b0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b50604051602080610e4c8339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b610b6f806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea165627a7a7230582064e9d104354bc53a0401a52c0f92f7fef89631a95d5981ba30ded73de945581f0029608060405234801561001057600080fd5b50604051602080610b6f8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c90610140565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d39061014d565b80828152602001915050604051809103906000f0801580156100f9573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015a565b6102888061040b83390190565b6104dc8061069383390190565b6102a2806101696000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea165627a7a723058201b7b8e75cd9da2a178e667a01164717174711c9d6e201e14e3e4ae06054f28fb0029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806360fe47b11461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b61007161011e565b6040518082815260200191505060405180910390f35b80600081905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010357600080fd5b505af1158015610117573d6000803e3d6000fd5b5050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561018857600080fd5b505afa15801561019c573d6000803e3d6000fd5b505050506040513d60208110156101b257600080fd5b8101908080519060200190929190505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561022b57600080fd5b505afa15801561023f573d6000803e3d6000fd5b505050506040513d602081101561025557600080fd5b8101908080519060200190929190505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ce57600080fd5b505afa1580156102e2573d6000803e3d6000fd5b505050506040513d60208110156102f857600080fd5b8101908080519060200190929190505050600254600154600054010101010190509056fe", "ast": {"absolutePath": "A.sol", "exportedSymbols": {"A": [96], "B": [149]}, "id": 150, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "C.sol", "file": "./C.sol", "id": 1, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 228, "src": "0:17:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "E/G.sol", "file": "./E/G.sol", "id": 2, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 286, "src": "18:19:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "I/K.sol", "file": "./I/K.sol", "id": 3, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 344, "src": "38:19:0", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [149, 189, 227], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 96, "linearizedBaseContracts": [96], "name": "A", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 5, "name": "x", "nodeType": "VariableDeclaration", "scope": 96, "src": "74:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 4, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "74:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 7, "name": "y", "nodeType": "VariableDeclaration", "scope": 96, "src": "87:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 6, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "87:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 9, "name": "z", "nodeType": "VariableDeclaration", "scope": 96, "src": "100:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 8, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "100:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 11, "name": "b", "nodeType": "VariableDeclaration", "scope": 96, "src": "113:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}, "typeName": {"contractScope": null, "id": 10, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 149, "src": "113:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 13, "name": "c", "nodeType": "VariableDeclaration", "scope": 96, "src": "120:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}, "typeName": {"contractScope": null, "id": 12, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "120:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 15, "name": "d", "nodeType": "VariableDeclaration", "scope": 96, "src": "127:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}, "typeName": {"contractScope": null, "id": 14, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "127:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "value": null, "visibility": "internal"}, {"body": {"id": 54, "nodeType": "Block", "src": "182:103:0", "statements": [{"expression": {"argumentTypes": null, "id": 24, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 22, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "188:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 23, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "192:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "188:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 25, "nodeType": "ExpressionStatement", "src": "188:5:0"}, {"expression": {"argumentTypes": null, "id": 28, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 26, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "199:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 27, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17, "src": "203:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "199:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 29, "nodeType": "ExpressionStatement", "src": "199:8:0"}, {"expression": {"argumentTypes": null, "id": 32, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 30, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9, "src": "213:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 31, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "217:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "213:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 33, "nodeType": "ExpressionStatement", "src": "213:8:0"}, {"expression": {"argumentTypes": null, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 34, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "227:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "id": 36, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "231:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_B_$149_$", "typeString": "function () returns (contract B)"}, "typeName": {"contractScope": null, "id": 35, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 149, "src": "235:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}}, "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "231:7:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "src": "227:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "id": 39, "nodeType": "ExpressionStatement", "src": "227:11:0"}, {"expression": {"argumentTypes": null, "id": 45, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 40, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "244:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 43, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "254:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 42, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "248:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$189_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"contractScope": null, "id": 41, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "252:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}}, "id": 44, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "248:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "src": "244:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 46, "nodeType": "ExpressionStatement", "src": "244:15:0"}, {"expression": {"argumentTypes": null, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 47, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15, "src": "265:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 50, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "275:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 49, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "269:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$227_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"contractScope": null, "id": 48, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "273:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}}, "id": 51, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "269:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "src": "265:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 53, "nodeType": "ExpressionStatement", "src": "265:15:0"}]}, "documentation": null, "id": 55, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 20, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 17, "name": "yval", "nodeType": "VariableDeclaration", "scope": 55, "src": "147:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 16, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "147:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 19, "name": "zval", "nodeType": "VariableDeclaration", "scope": 55, "src": "161:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 18, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "161:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "146:28:0"}, "returnParameters": {"id": 21, "nodeType": "ParameterList", "parameters": [], "src": "182:0:0"}, "scope": 96, "src": "135:150:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 78, "nodeType": "Block", "src": "334:49:0", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 76, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 72, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 68, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 64, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 62, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 60, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "347:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 61, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "349:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 63, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9, "src": "351:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 65, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "353:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "id": 66, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 148, "src": "353:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 67, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "353:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:14:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 69, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "362:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 70, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 178, "src": "362:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 71, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "362:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:22:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 73, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15, "src": "370:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 74, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 226, "src": "370:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 75, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "370:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:31:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 59, "id": 77, "nodeType": "Return", "src": "340:38:0"}]}, "documentation": null, "id": 79, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 56, "nodeType": "ParameterList", "parameters": [], "src": "301:2:0"}, "returnParameters": {"id": 59, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 58, "name": "", "nodeType": "VariableDeclaration", "scope": 79, "src": "325:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 57, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "325:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "324:9:0"}, "scope": 96, "src": "289:94:0", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 94, "nodeType": "Block", "src": "421:37:0", "statements": [{"expression": {"argumentTypes": null, "id": 86, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 84, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "427:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 85, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 81, "src": "431:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "427:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 87, "nodeType": "ExpressionStatement", "src": "427:8:0"}, {"expression": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 91, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 81, "src": "448:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"argumentTypes": null, "id": 88, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "441:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 90, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 188, "src": "441:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 92, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "441:12:0", "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 93, "nodeType": "ExpressionStatement", "src": "441:12:0"}]}, "documentation": null, "id": 95, "implemented": true, "kind": "function", "modifiers": [], "name": "set", "nodeType": "FunctionDefinition", "parameters": {"id": 82, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 81, "name": "xval", "nodeType": "VariableDeclaration", "scope": 95, "src": "400:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 80, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "400:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "399:14:0"}, "returnParameters": {"id": 83, "nodeType": "ParameterList", "parameters": [], "src": "421:0:0"}, "scope": 96, "src": "387:71:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 150, "src": "59:401:0"}, {"baseContracts": [], "contractDependencies": [285, 343], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 149, "linearizedBaseContracts": [149], "name": "B", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 98, "name": "x", "nodeType": "VariableDeclaration", "scope": 149, "src": "477:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 97, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "477:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 100, "name": "y", "nodeType": "VariableDeclaration", "scope": 149, "src": "490:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 99, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "490:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 102, "name": "g", "nodeType": "VariableDeclaration", "scope": 149, "src": "503:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}, "typeName": {"contractScope": null, "id": 101, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "503:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 104, "name": "k", "nodeType": "VariableDeclaration", "scope": 149, "src": "510:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}, "typeName": {"contractScope": null, "id": 103, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 343, "src": "510:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "value": null, "visibility": "internal"}, {"body": {"id": 133, "nodeType": "Block", "src": "539:67:0", "statements": [{"expression": {"argumentTypes": null, "id": 109, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 107, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "545:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 108, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "549:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "545:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 110, "nodeType": "ExpressionStatement", "src": "545:5:0"}, {"expression": {"argumentTypes": null, "id": 113, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 111, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 100, "src": "556:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "36", "id": 112, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "560:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_6_by_1", "typeString": "int_const 6"}, "value": "6"}, "src": "556:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 114, "nodeType": "ExpressionStatement", "src": "556:5:0"}, {"expression": {"argumentTypes": null, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 115, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 102, "src": "567:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 120, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 118, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "577:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "31", "id": 119, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "579:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "577:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 117, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "571:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_G_$285_$", "typeString": "function (uint256) returns (contract G)"}, "typeName": {"contractScope": null, "id": 116, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "575:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}}, "id": 121, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "571:10:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "src": "567:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "id": 123, "nodeType": "ExpressionStatement", "src": "567:14:0"}, {"expression": {"argumentTypes": null, "id": 131, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 124, "name": "k", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 104, "src": "587:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 127, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "597:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "32", "id": 128, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "599:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2"}, "value": "2"}, "src": "597:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 126, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "591:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_K_$343_$", "typeString": "function (uint256) returns (contract K)"}, "typeName": {"contractScope": null, "id": 125, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 343, "src": "595:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}}, "id": 130, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "591:10:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "src": "587:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "id": 132, "nodeType": "ExpressionStatement", "src": "587:14:0"}]}, "documentation": null, "id": 134, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 105, "nodeType": "ParameterList", "parameters": [], "src": "529:2:0"}, "returnParameters": {"id": 106, "nodeType": "ParameterList", "parameters": [], "src": "539:0:0"}, "scope": 149, "src": "518:88:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 147, "nodeType": "Block", "src": "656:29:0", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 145, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 141, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 139, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "669:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"argumentTypes": null, "id": 140, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 100, "src": "671:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "669:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 142, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 102, "src": "673:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "id": 143, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 266, "src": "673:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 144, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "673:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "669:11:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 138, "id": 146, "nodeType": "Return", "src": "662:18:0"}]}, "documentation": null, "id": 148, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 135, "nodeType": "ParameterList", "parameters": [], "src": "623:2:0"}, "returnParameters": {"id": 138, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 137, "name": "", "nodeType": "VariableDeclaration", "scope": 148, "src": "647:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 136, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "647:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "646:9:0"}, "scope": 149, "src": "610:75:0", "stateMutability": "view", "superFunction": null, "visibility": "public"}], "scope": 150, "src": "462:225:0"}], "src": "0:688:0"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/B.json b/tests/expected/solc-multi-file/B.json new file mode 100644 index 00000000..7a70d1f8 --- /dev/null +++ b/tests/expected/solc-multi-file/B.json @@ -0,0 +1 @@ +{"contractName": "B", "abi": [{"constant": true, "inputs": [], "name": "diff", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b5060008081905550600660018190555060016000540160405161003290610117565b80828152602001915050604051809103906000f080158015610058573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002600054016040516100ab90610124565b80828152602001915050604051809103906000f0801580156100d1573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610131565b6107b98061026483390190565b610e4c80610a1d83390190565b610124806101406000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fe608060405234801561001057600080fd5b506040516020806107b98339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6104dc806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea165627a7a72305820a64456b7783085a8bd9be4500d8a031f19eb6878c10d2bc4870b0206d856440b0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b50604051602080610e4c8339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b610b6f806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fea165627a7a7230582064e9d104354bc53a0401a52c0f92f7fef89631a95d5981ba30ded73de945581f0029608060405234801561001057600080fd5b50604051602080610b6f8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c90610140565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d39061014d565b80828152602001915050604051809103906000f0801580156100f9573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015a565b6102888061040b83390190565b6104dc8061069383390190565b6102a2806101696000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea165627a7a723058201b7b8e75cd9da2a178e667a01164717174711c9d6e201e14e3e4ae06054f28fb0029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801560b257600080fd5b505afa15801560c5573d6000803e3d6000fd5b505050506040513d602081101560da57600080fd5b8101908080519060200190929190505050600154600054030190509056fe", "ast": {"absolutePath": "A.sol", "exportedSymbols": {"A": [96], "B": [149]}, "id": 150, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "C.sol", "file": "./C.sol", "id": 1, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 228, "src": "0:17:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "E/G.sol", "file": "./E/G.sol", "id": 2, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 286, "src": "18:19:0", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "I/K.sol", "file": "./I/K.sol", "id": 3, "nodeType": "ImportDirective", "scope": 150, "sourceUnit": 344, "src": "38:19:0", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [149, 189, 227], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 96, "linearizedBaseContracts": [96], "name": "A", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 5, "name": "x", "nodeType": "VariableDeclaration", "scope": 96, "src": "74:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 4, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "74:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 7, "name": "y", "nodeType": "VariableDeclaration", "scope": 96, "src": "87:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 6, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "87:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 9, "name": "z", "nodeType": "VariableDeclaration", "scope": 96, "src": "100:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 8, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "100:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 11, "name": "b", "nodeType": "VariableDeclaration", "scope": 96, "src": "113:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}, "typeName": {"contractScope": null, "id": 10, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 149, "src": "113:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 13, "name": "c", "nodeType": "VariableDeclaration", "scope": 96, "src": "120:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}, "typeName": {"contractScope": null, "id": 12, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "120:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 15, "name": "d", "nodeType": "VariableDeclaration", "scope": 96, "src": "127:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}, "typeName": {"contractScope": null, "id": 14, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "127:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "value": null, "visibility": "internal"}, {"body": {"id": 54, "nodeType": "Block", "src": "182:103:0", "statements": [{"expression": {"argumentTypes": null, "id": 24, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 22, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "188:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 23, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "192:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "188:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 25, "nodeType": "ExpressionStatement", "src": "188:5:0"}, {"expression": {"argumentTypes": null, "id": 28, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 26, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "199:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 27, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17, "src": "203:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "199:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 29, "nodeType": "ExpressionStatement", "src": "199:8:0"}, {"expression": {"argumentTypes": null, "id": 32, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 30, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9, "src": "213:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 31, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "217:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "213:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 33, "nodeType": "ExpressionStatement", "src": "213:8:0"}, {"expression": {"argumentTypes": null, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 34, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "227:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "id": 36, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "231:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$__$returns$_t_contract$_B_$149_$", "typeString": "function () returns (contract B)"}, "typeName": {"contractScope": null, "id": 35, "name": "B", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 149, "src": "235:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}}, "id": 37, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "231:7:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "src": "227:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "id": 39, "nodeType": "ExpressionStatement", "src": "227:11:0"}, {"expression": {"argumentTypes": null, "id": 45, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 40, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "244:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 43, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "254:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 42, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "248:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$189_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"contractScope": null, "id": 41, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "252:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}}, "id": 44, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "248:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "src": "244:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 46, "nodeType": "ExpressionStatement", "src": "244:15:0"}, {"expression": {"argumentTypes": null, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 47, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15, "src": "265:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 50, "name": "zval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19, "src": "275:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 49, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "269:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$227_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"contractScope": null, "id": 48, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "273:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}}, "id": 51, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "269:11:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "src": "265:15:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 53, "nodeType": "ExpressionStatement", "src": "265:15:0"}]}, "documentation": null, "id": 55, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 20, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 17, "name": "yval", "nodeType": "VariableDeclaration", "scope": 55, "src": "147:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 16, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "147:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 19, "name": "zval", "nodeType": "VariableDeclaration", "scope": 55, "src": "161:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 18, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "161:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "146:28:0"}, "returnParameters": {"id": 21, "nodeType": "ParameterList", "parameters": [], "src": "182:0:0"}, "scope": 96, "src": "135:150:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 78, "nodeType": "Block", "src": "334:49:0", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 76, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 72, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 68, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 64, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 62, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 60, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "347:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 61, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 7, "src": "349:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 63, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9, "src": "351:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 65, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 11, "src": "353:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_B_$149", "typeString": "contract B"}}, "id": 66, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 148, "src": "353:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 67, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "353:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:14:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 69, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "362:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 70, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 178, "src": "362:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 71, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "362:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:22:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 73, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 15, "src": "370:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 74, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 226, "src": "370:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 75, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "370:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "347:31:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 59, "id": 77, "nodeType": "Return", "src": "340:38:0"}]}, "documentation": null, "id": 79, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 56, "nodeType": "ParameterList", "parameters": [], "src": "301:2:0"}, "returnParameters": {"id": 59, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 58, "name": "", "nodeType": "VariableDeclaration", "scope": 79, "src": "325:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 57, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "325:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "324:9:0"}, "scope": 96, "src": "289:94:0", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 94, "nodeType": "Block", "src": "421:37:0", "statements": [{"expression": {"argumentTypes": null, "id": 86, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 84, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "427:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 85, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 81, "src": "431:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "427:8:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 87, "nodeType": "ExpressionStatement", "src": "427:8:0"}, {"expression": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 91, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 81, "src": "448:4:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"argumentTypes": null, "id": 88, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13, "src": "441:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 90, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 188, "src": "441:6:0", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 92, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "441:12:0", "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 93, "nodeType": "ExpressionStatement", "src": "441:12:0"}]}, "documentation": null, "id": 95, "implemented": true, "kind": "function", "modifiers": [], "name": "set", "nodeType": "FunctionDefinition", "parameters": {"id": 82, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 81, "name": "xval", "nodeType": "VariableDeclaration", "scope": 95, "src": "400:12:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 80, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "400:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "399:14:0"}, "returnParameters": {"id": 83, "nodeType": "ParameterList", "parameters": [], "src": "421:0:0"}, "scope": 96, "src": "387:71:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 150, "src": "59:401:0"}, {"baseContracts": [], "contractDependencies": [285, 343], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 149, "linearizedBaseContracts": [149], "name": "B", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 98, "name": "x", "nodeType": "VariableDeclaration", "scope": 149, "src": "477:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 97, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "477:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 100, "name": "y", "nodeType": "VariableDeclaration", "scope": 149, "src": "490:9:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 99, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "490:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 102, "name": "g", "nodeType": "VariableDeclaration", "scope": 149, "src": "503:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}, "typeName": {"contractScope": null, "id": 101, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "503:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 104, "name": "k", "nodeType": "VariableDeclaration", "scope": 149, "src": "510:3:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}, "typeName": {"contractScope": null, "id": 103, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 343, "src": "510:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "value": null, "visibility": "internal"}, {"body": {"id": 133, "nodeType": "Block", "src": "539:67:0", "statements": [{"expression": {"argumentTypes": null, "id": 109, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 107, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "545:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 108, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "549:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "545:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 110, "nodeType": "ExpressionStatement", "src": "545:5:0"}, {"expression": {"argumentTypes": null, "id": 113, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 111, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 100, "src": "556:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "36", "id": 112, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "560:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_6_by_1", "typeString": "int_const 6"}, "value": "6"}, "src": "556:5:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 114, "nodeType": "ExpressionStatement", "src": "556:5:0"}, {"expression": {"argumentTypes": null, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 115, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 102, "src": "567:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 120, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 118, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "577:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "31", "id": 119, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "579:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "577:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 117, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "571:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_G_$285_$", "typeString": "function (uint256) returns (contract G)"}, "typeName": {"contractScope": null, "id": 116, "name": "G", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 285, "src": "575:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}}, "id": 121, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "571:10:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "src": "567:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "id": 123, "nodeType": "ExpressionStatement", "src": "567:14:0"}, {"expression": {"argumentTypes": null, "id": 131, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 124, "name": "k", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 104, "src": "587:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 129, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 127, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "597:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "32", "id": 128, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "599:1:0", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2"}, "value": "2"}, "src": "597:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 126, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "591:5:0", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_K_$343_$", "typeString": "function (uint256) returns (contract K)"}, "typeName": {"contractScope": null, "id": 125, "name": "K", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 343, "src": "595:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}}, "id": 130, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "591:10:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "src": "587:14:0", "typeDescriptions": {"typeIdentifier": "t_contract$_K_$343", "typeString": "contract K"}}, "id": 132, "nodeType": "ExpressionStatement", "src": "587:14:0"}]}, "documentation": null, "id": 134, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 105, "nodeType": "ParameterList", "parameters": [], "src": "529:2:0"}, "returnParameters": {"id": 106, "nodeType": "ParameterList", "parameters": [], "src": "539:0:0"}, "scope": 149, "src": "518:88:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 147, "nodeType": "Block", "src": "656:29:0", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 145, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 141, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 139, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 98, "src": "669:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"argumentTypes": null, "id": 140, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 100, "src": "671:1:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "669:3:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 142, "name": "g", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 102, "src": "673:1:0", "typeDescriptions": {"typeIdentifier": "t_contract$_G_$285", "typeString": "contract G"}}, "id": 143, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 266, "src": "673:5:0", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 144, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "673:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "669:11:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 138, "id": 146, "nodeType": "Return", "src": "662:18:0"}]}, "documentation": null, "id": 148, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 135, "nodeType": "ParameterList", "parameters": [], "src": "623:2:0"}, "returnParameters": {"id": 138, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 137, "name": "", "nodeType": "VariableDeclaration", "scope": 148, "src": "647:7:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 136, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "647:7:0", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "646:9:0"}, "scope": 149, "src": "610:75:0", "stateMutability": "view", "superFunction": null, "visibility": "public"}], "scope": 150, "src": "462:225:0"}], "src": "0:688:0"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/C.json b/tests/expected/solc-multi-file/C.json new file mode 100644 index 00000000..d4a424c7 --- /dev/null +++ b/tests/expected/solc-multi-file/C.json @@ -0,0 +1 @@ +{"contractName": "C", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fe", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fe", "ast": {"absolutePath": "C.sol", "exportedSymbols": {"C": [189], "D": [227]}, "id": 228, "nodeType": "SourceUnit", "nodes": [{"baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 189, "linearizedBaseContracts": [189], "name": "C", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 152, "name": "x", "nodeType": "VariableDeclaration", "scope": 189, "src": "15:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 151, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "15:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 154, "name": "y", "nodeType": "VariableDeclaration", "scope": 189, "src": "28:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 153, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "28:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"body": {"id": 167, "nodeType": "Block", "src": "75:30:1", "statements": [{"expression": {"argumentTypes": null, "id": 161, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 159, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "81:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "85:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "81:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 162, "nodeType": "ExpressionStatement", "src": "81:5:1"}, {"expression": {"argumentTypes": null, "id": 165, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 163, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "92:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 164, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "96:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "92:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 166, "nodeType": "ExpressionStatement", "src": "92:8:1"}]}, "documentation": null, "id": 168, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 157, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 156, "name": "yval", "nodeType": "VariableDeclaration", "scope": 168, "src": "54:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 155, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "54:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "53:14:1"}, "returnParameters": {"id": 158, "nodeType": "ParameterList", "parameters": [], "src": "75:0:1"}, "scope": 189, "src": "42:63:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 177, "nodeType": "Block", "src": "154:21:1", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 175, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 173, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "167:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 174, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "169:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "167:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 172, "id": 176, "nodeType": "Return", "src": "160:10:1"}]}, "documentation": null, "id": 178, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 169, "nodeType": "ParameterList", "parameters": [], "src": "121:2:1"}, "returnParameters": {"id": 172, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 171, "name": "", "nodeType": "VariableDeclaration", "scope": 178, "src": "145:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 170, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "145:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "144:9:1"}, "scope": 189, "src": "109:66:1", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 187, "nodeType": "Block", "src": "214:19:1", "statements": [{"expression": {"argumentTypes": null, "id": 185, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 183, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "220:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 184, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 180, "src": "224:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "220:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 186, "nodeType": "ExpressionStatement", "src": "220:8:1"}]}, "documentation": null, "id": 188, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 181, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 180, "name": "xval", "nodeType": "VariableDeclaration", "scope": 188, "src": "193:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 179, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "193:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "192:14:1"}, "returnParameters": {"id": 182, "nodeType": "ParameterList", "parameters": [], "src": "214:0:1"}, "scope": 189, "src": "179:54:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 228, "src": "0:235:1"}, {"baseContracts": [], "contractDependencies": [189], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 227, "linearizedBaseContracts": [227], "name": "D", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 191, "name": "x", "nodeType": "VariableDeclaration", "scope": 227, "src": "252:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 190, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "252:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 193, "name": "y", "nodeType": "VariableDeclaration", "scope": 227, "src": "265:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 192, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "265:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 195, "name": "c", "nodeType": "VariableDeclaration", "scope": 227, "src": "278:3:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}, "typeName": {"contractScope": null, "id": 194, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "278:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "value": null, "visibility": "internal"}, {"body": {"id": 215, "nodeType": "Block", "src": "319:48:1", "statements": [{"expression": {"argumentTypes": null, "id": 202, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 200, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 191, "src": "325:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 201, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "329:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "325:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 203, "nodeType": "ExpressionStatement", "src": "325:5:1"}, {"expression": {"argumentTypes": null, "id": 206, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 204, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "336:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 205, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 197, "src": "340:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "336:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 207, "nodeType": "ExpressionStatement", "src": "336:8:1"}, {"expression": {"argumentTypes": null, "id": 213, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 208, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "350:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "hexValue": "35", "id": 211, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "360:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 210, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "354:5:1", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$189_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"contractScope": null, "id": 209, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "358:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}}, "id": 212, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "354:8:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "src": "350:12:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 214, "nodeType": "ExpressionStatement", "src": "350:12:1"}]}, "documentation": null, "id": 216, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 198, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 197, "name": "yval", "nodeType": "VariableDeclaration", "scope": 216, "src": "298:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 196, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "298:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "297:14:1"}, "returnParameters": {"id": 199, "nodeType": "ParameterList", "parameters": [], "src": "319:0:1"}, "scope": 227, "src": "286:81:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 225, "nodeType": "Block", "src": "417:21:1", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 223, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 221, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 191, "src": "430:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"argumentTypes": null, "id": 222, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "432:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "430:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 220, "id": 224, "nodeType": "Return", "src": "423:10:1"}]}, "documentation": null, "id": 226, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 217, "nodeType": "ParameterList", "parameters": [], "src": "384:2:1"}, "returnParameters": {"id": 220, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 219, "name": "", "nodeType": "VariableDeclaration", "scope": 226, "src": "408:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 218, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "408:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "407:9:1"}, "scope": 227, "src": "371:67:1", "stateMutability": "view", "superFunction": null, "visibility": "public"}], "scope": 228, "src": "237:203:1"}], "src": "0:441:1"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/D.json b/tests/expected/solc-multi-file/D.json new file mode 100644 index 00000000..dc423962 --- /dev/null +++ b/tests/expected/solc-multi-file/D.json @@ -0,0 +1 @@ +{"contractName": "D", "abi": [{"constant": true, "inputs": [], "name": "diff", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fe608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fe", "ast": {"absolutePath": "C.sol", "exportedSymbols": {"C": [189], "D": [227]}, "id": 228, "nodeType": "SourceUnit", "nodes": [{"baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 189, "linearizedBaseContracts": [189], "name": "C", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 152, "name": "x", "nodeType": "VariableDeclaration", "scope": 189, "src": "15:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 151, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "15:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 154, "name": "y", "nodeType": "VariableDeclaration", "scope": 189, "src": "28:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 153, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "28:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"body": {"id": 167, "nodeType": "Block", "src": "75:30:1", "statements": [{"expression": {"argumentTypes": null, "id": 161, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 159, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "81:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "85:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "81:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 162, "nodeType": "ExpressionStatement", "src": "81:5:1"}, {"expression": {"argumentTypes": null, "id": 165, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 163, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "92:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 164, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 156, "src": "96:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "92:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 166, "nodeType": "ExpressionStatement", "src": "92:8:1"}]}, "documentation": null, "id": 168, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 157, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 156, "name": "yval", "nodeType": "VariableDeclaration", "scope": 168, "src": "54:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 155, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "54:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "53:14:1"}, "returnParameters": {"id": 158, "nodeType": "ParameterList", "parameters": [], "src": "75:0:1"}, "scope": 189, "src": "42:63:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 177, "nodeType": "Block", "src": "154:21:1", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 175, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 173, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "167:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 174, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 154, "src": "169:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "167:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 172, "id": 176, "nodeType": "Return", "src": "160:10:1"}]}, "documentation": null, "id": 178, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 169, "nodeType": "ParameterList", "parameters": [], "src": "121:2:1"}, "returnParameters": {"id": 172, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 171, "name": "", "nodeType": "VariableDeclaration", "scope": 178, "src": "145:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 170, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "145:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "144:9:1"}, "scope": 189, "src": "109:66:1", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 187, "nodeType": "Block", "src": "214:19:1", "statements": [{"expression": {"argumentTypes": null, "id": 185, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 183, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 152, "src": "220:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 184, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 180, "src": "224:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "220:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 186, "nodeType": "ExpressionStatement", "src": "220:8:1"}]}, "documentation": null, "id": 188, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 181, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 180, "name": "xval", "nodeType": "VariableDeclaration", "scope": 188, "src": "193:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 179, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "193:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "192:14:1"}, "returnParameters": {"id": 182, "nodeType": "ParameterList", "parameters": [], "src": "214:0:1"}, "scope": 189, "src": "179:54:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 228, "src": "0:235:1"}, {"baseContracts": [], "contractDependencies": [189], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 227, "linearizedBaseContracts": [227], "name": "D", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 191, "name": "x", "nodeType": "VariableDeclaration", "scope": 227, "src": "252:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 190, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "252:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 193, "name": "y", "nodeType": "VariableDeclaration", "scope": 227, "src": "265:9:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 192, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "265:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 195, "name": "c", "nodeType": "VariableDeclaration", "scope": 227, "src": "278:3:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}, "typeName": {"contractScope": null, "id": 194, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "278:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "value": null, "visibility": "internal"}, {"body": {"id": 215, "nodeType": "Block", "src": "319:48:1", "statements": [{"expression": {"argumentTypes": null, "id": 202, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 200, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 191, "src": "325:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 201, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "329:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "325:5:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 203, "nodeType": "ExpressionStatement", "src": "325:5:1"}, {"expression": {"argumentTypes": null, "id": 206, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 204, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "336:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 205, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 197, "src": "340:4:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "336:8:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 207, "nodeType": "ExpressionStatement", "src": "336:8:1"}, {"expression": {"argumentTypes": null, "id": 213, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 208, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 195, "src": "350:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "hexValue": "35", "id": 211, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "360:1:1", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 210, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "354:5:1", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_C_$189_$", "typeString": "function (uint256) returns (contract C)"}, "typeName": {"contractScope": null, "id": 209, "name": "C", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 189, "src": "358:1:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}}, "id": 212, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "354:8:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "src": "350:12:1", "typeDescriptions": {"typeIdentifier": "t_contract$_C_$189", "typeString": "contract C"}}, "id": 214, "nodeType": "ExpressionStatement", "src": "350:12:1"}]}, "documentation": null, "id": 216, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 198, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 197, "name": "yval", "nodeType": "VariableDeclaration", "scope": 216, "src": "298:12:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 196, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "298:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "297:14:1"}, "returnParameters": {"id": 199, "nodeType": "ParameterList", "parameters": [], "src": "319:0:1"}, "scope": 227, "src": "286:81:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 225, "nodeType": "Block", "src": "417:21:1", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 223, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 221, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 191, "src": "430:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": {"argumentTypes": null, "id": 222, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 193, "src": "432:1:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "430:3:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 220, "id": 224, "nodeType": "Return", "src": "423:10:1"}]}, "documentation": null, "id": 226, "implemented": true, "kind": "function", "modifiers": [], "name": "diff", "nodeType": "FunctionDefinition", "parameters": {"id": 217, "nodeType": "ParameterList", "parameters": [], "src": "384:2:1"}, "returnParameters": {"id": 220, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 219, "name": "", "nodeType": "VariableDeclaration", "scope": 226, "src": "408:7:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 218, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "408:7:1", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "407:9:1"}, "scope": 227, "src": "371:67:1", "stateMutability": "view", "superFunction": null, "visibility": "public"}], "scope": 228, "src": "237:203:1"}], "src": "0:441:1"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/E.json b/tests/expected/solc-multi-file/E.json new file mode 100644 index 00000000..2b184d84 --- /dev/null +++ b/tests/expected/solc-multi-file/E.json @@ -0,0 +1 @@ +{"contractName": "E", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fe608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fe", "ast": {"absolutePath": "E/E.sol", "exportedSymbols": {"E": [398]}, "id": 399, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "C.sol", "file": "../C.sol", "id": 345, "nodeType": "ImportDirective", "scope": 399, "sourceUnit": 228, "src": "0:18:2", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "I/I.sol", "file": "../I/I.sol", "id": 346, "nodeType": "ImportDirective", "scope": 399, "sourceUnit": 475, "src": "19:20:2", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [227], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 398, "linearizedBaseContracts": [398], "name": "E", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 348, "name": "x", "nodeType": "VariableDeclaration", "scope": 398, "src": "56:9:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 347, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "56:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 350, "name": "y", "nodeType": "VariableDeclaration", "scope": 398, "src": "69:9:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 349, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "69:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 352, "name": "d", "nodeType": "VariableDeclaration", "scope": 398, "src": "82:3:2", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}, "typeName": {"contractScope": null, "id": 351, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "82:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "value": null, "visibility": "internal"}, {"body": {"id": 372, "nodeType": "Block", "src": "123:51:2", "statements": [{"expression": {"argumentTypes": null, "id": 359, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 357, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 348, "src": "129:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 358, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "133:1:2", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "129:5:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 360, "nodeType": "ExpressionStatement", "src": "129:5:2"}, {"expression": {"argumentTypes": null, "id": 363, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 361, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 350, "src": "140:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 362, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 354, "src": "144:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "140:8:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 364, "nodeType": "ExpressionStatement", "src": "140:8:2"}, {"expression": {"argumentTypes": null, "id": 370, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 365, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 352, "src": "154:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 368, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 354, "src": "164:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 367, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "158:5:2", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$227_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"contractScope": null, "id": 366, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "162:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}}, "id": 369, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "158:11:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "src": "154:15:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 371, "nodeType": "ExpressionStatement", "src": "154:15:2"}]}, "documentation": null, "id": 373, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 355, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 354, "name": "yval", "nodeType": "VariableDeclaration", "scope": 373, "src": "102:12:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 353, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "102:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "101:14:2"}, "returnParameters": {"id": 356, "nodeType": "ParameterList", "parameters": [], "src": "123:0:2"}, "scope": 398, "src": "90:84:2", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 386, "nodeType": "Block", "src": "223:30:2", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 384, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 380, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 378, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 348, "src": "236:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 379, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 350, "src": "238:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "236:3:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 381, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 352, "src": "240:1:2", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 382, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 226, "src": "240:6:2", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 383, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "240:8:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "236:12:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 377, "id": 385, "nodeType": "Return", "src": "229:19:2"}]}, "documentation": null, "id": 387, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 374, "nodeType": "ParameterList", "parameters": [], "src": "190:2:2"}, "returnParameters": {"id": 377, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 376, "name": "", "nodeType": "VariableDeclaration", "scope": 387, "src": "214:7:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 375, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "214:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "213:9:2"}, "scope": 398, "src": "178:75:2", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 396, "nodeType": "Block", "src": "292:19:2", "statements": [{"expression": {"argumentTypes": null, "id": 394, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 392, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 348, "src": "298:1:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 393, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 389, "src": "302:4:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "298:8:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 395, "nodeType": "ExpressionStatement", "src": "298:8:2"}]}, "documentation": null, "id": 397, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 390, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 389, "name": "xval", "nodeType": "VariableDeclaration", "scope": 397, "src": "271:12:2", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 388, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "271:7:2", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "270:14:2"}, "returnParameters": {"id": 391, "nodeType": "ParameterList", "parameters": [], "src": "292:0:2"}, "scope": 398, "src": "257:54:2", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 399, "src": "41:272:2"}], "src": "0:314:2"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/G.json b/tests/expected/solc-multi-file/G.json new file mode 100644 index 00000000..25fc32e4 --- /dev/null +++ b/tests/expected/solc-multi-file/G.json @@ -0,0 +1 @@ +{"contractName": "G", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b506040516020806107b98339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6104dc806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe", "ast": {"absolutePath": "E/G.sol", "exportedSymbols": {"G": [285]}, "id": 286, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "E/E.sol", "file": "./E.sol", "id": 229, "nodeType": "ImportDirective", "scope": 286, "sourceUnit": 399, "src": "0:17:3", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [398], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 285, "linearizedBaseContracts": [285], "name": "G", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 231, "name": "x", "nodeType": "VariableDeclaration", "scope": 285, "src": "34:9:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 230, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "34:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 233, "name": "y", "nodeType": "VariableDeclaration", "scope": 285, "src": "47:9:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 232, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "47:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 235, "name": "e", "nodeType": "VariableDeclaration", "scope": 285, "src": "60:3:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}, "typeName": {"contractScope": null, "id": 234, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 398, "src": "60:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "value": null, "visibility": "internal"}, {"body": {"id": 255, "nodeType": "Block", "src": "101:48:3", "statements": [{"expression": {"argumentTypes": null, "id": 242, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 240, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 231, "src": "107:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 241, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "111:1:3", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "107:5:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 243, "nodeType": "ExpressionStatement", "src": "107:5:3"}, {"expression": {"argumentTypes": null, "id": 246, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 244, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 233, "src": "118:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 245, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 237, "src": "122:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "118:8:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 247, "nodeType": "ExpressionStatement", "src": "118:8:3"}, {"expression": {"argumentTypes": null, "id": 253, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 248, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "132:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "hexValue": "35", "id": 251, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "142:1:3", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 250, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "136:5:3", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_E_$398_$", "typeString": "function (uint256) returns (contract E)"}, "typeName": {"contractScope": null, "id": 249, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 398, "src": "140:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}}, "id": 252, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "136:8:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "src": "132:12:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 254, "nodeType": "ExpressionStatement", "src": "132:12:3"}]}, "documentation": null, "id": 256, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 238, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 237, "name": "yval", "nodeType": "VariableDeclaration", "scope": 256, "src": "80:12:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 236, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "80:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "79:14:3"}, "returnParameters": {"id": 239, "nodeType": "ParameterList", "parameters": [], "src": "101:0:3"}, "scope": 285, "src": "68:81:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 265, "nodeType": "Block", "src": "198:25:3", "statements": [{"expression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 261, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "211:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 262, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 387, "src": "211:5:3", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 263, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "211:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 260, "id": 264, "nodeType": "Return", "src": "204:14:3"}]}, "documentation": null, "id": 266, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 257, "nodeType": "ParameterList", "parameters": [], "src": "165:2:3"}, "returnParameters": {"id": 260, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 259, "name": "", "nodeType": "VariableDeclaration", "scope": 266, "src": "189:7:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 258, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "189:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "188:9:3"}, "scope": 285, "src": "153:70:3", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 283, "nodeType": "Block", "src": "262:39:3", "statements": [{"expression": {"argumentTypes": null, "id": 273, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 271, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 231, "src": "268:1:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 272, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 268, "src": "272:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "268:8:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 274, "nodeType": "ExpressionStatement", "src": "268:8:3"}, {"expression": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 280, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 278, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 268, "src": "289:4:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "31", "id": 279, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "294:1:3", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "289:6:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"argumentTypes": null, "id": 275, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 235, "src": "282:1:3", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 277, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 397, "src": "282:6:3", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 281, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "282:14:3", "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 282, "nodeType": "ExpressionStatement", "src": "282:14:3"}]}, "documentation": null, "id": 284, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 269, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 268, "name": "xval", "nodeType": "VariableDeclaration", "scope": 284, "src": "241:12:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 267, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "241:7:3", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "240:14:3"}, "returnParameters": {"id": 270, "nodeType": "ParameterList", "parameters": [], "src": "262:0:3"}, "scope": 285, "src": "227:74:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 286, "src": "19:284:3"}], "src": "0:304:3"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/I.json b/tests/expected/solc-multi-file/I.json new file mode 100644 index 00000000..24815794 --- /dev/null +++ b/tests/expected/solc-multi-file/I.json @@ -0,0 +1 @@ +{"contractName": "I", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b50604051602080610b6f8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c90610140565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d39061014d565b80828152602001915050604051809103906000f0801580156100f9573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015a565b6102888061040b83390190565b6104dc8061069383390190565b6102a2806101696000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fe", "ast": {"absolutePath": "I/I.sol", "exportedSymbols": {"I": [474]}, "id": 475, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "C.sol", "file": "../C.sol", "id": 400, "nodeType": "ImportDirective", "scope": 475, "sourceUnit": 228, "src": "0:18:4", "symbolAliases": [], "unitAlias": ""}, {"absolutePath": "E/E.sol", "file": "../E/E.sol", "id": 401, "nodeType": "ImportDirective", "scope": 475, "sourceUnit": 399, "src": "19:20:4", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [227, 398], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 474, "linearizedBaseContracts": [474], "name": "I", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 403, "name": "x", "nodeType": "VariableDeclaration", "scope": 474, "src": "56:9:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 402, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "56:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 405, "name": "y", "nodeType": "VariableDeclaration", "scope": 474, "src": "69:9:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 404, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "69:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 407, "name": "d", "nodeType": "VariableDeclaration", "scope": 474, "src": "82:3:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}, "typeName": {"contractScope": null, "id": 406, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "82:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 409, "name": "e", "nodeType": "VariableDeclaration", "scope": 474, "src": "89:3:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}, "typeName": {"contractScope": null, "id": 408, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 398, "src": "89:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "value": null, "visibility": "internal"}, {"body": {"id": 438, "nodeType": "Block", "src": "130:74:4", "statements": [{"expression": {"argumentTypes": null, "id": 416, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 414, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 403, "src": "136:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 415, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "140:1:4", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "136:5:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 417, "nodeType": "ExpressionStatement", "src": "136:5:4"}, {"expression": {"argumentTypes": null, "id": 420, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 418, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 405, "src": "147:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 419, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 411, "src": "151:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "147:8:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 421, "nodeType": "ExpressionStatement", "src": "147:8:4"}, {"expression": {"argumentTypes": null, "id": 427, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 422, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 407, "src": "161:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 425, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 411, "src": "171:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 424, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "165:5:4", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_D_$227_$", "typeString": "function (uint256) returns (contract D)"}, "typeName": {"contractScope": null, "id": 423, "name": "D", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 227, "src": "169:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}}, "id": 426, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "165:11:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "src": "161:15:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 428, "nodeType": "ExpressionStatement", "src": "161:15:4"}, {"expression": {"argumentTypes": null, "id": 436, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 429, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 409, "src": "182:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 434, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 432, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 411, "src": "192:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "31", "id": 433, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "197:1:4", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "192:6:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "id": 431, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "186:5:4", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_E_$398_$", "typeString": "function (uint256) returns (contract E)"}, "typeName": {"contractScope": null, "id": 430, "name": "E", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 398, "src": "190:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}}, "id": 435, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "186:13:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "src": "182:17:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 437, "nodeType": "ExpressionStatement", "src": "182:17:4"}]}, "documentation": null, "id": 439, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 412, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 411, "name": "yval", "nodeType": "VariableDeclaration", "scope": 439, "src": "109:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 410, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "109:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "108:14:4"}, "returnParameters": {"id": 413, "nodeType": "ParameterList", "parameters": [], "src": "130:0:4"}, "scope": 474, "src": "97:107:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 456, "nodeType": "Block", "src": "253:38:4", "statements": [{"expression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 454, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 450, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 446, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 444, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 403, "src": "266:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "id": 445, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 405, "src": "268:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "266:3:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 447, "name": "d", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 407, "src": "270:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_D_$227", "typeString": "contract D"}}, "id": 448, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "diff", "nodeType": "MemberAccess", "referencedDeclaration": 226, "src": "270:6:4", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 449, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "270:8:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "266:12:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 451, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 409, "src": "279:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 452, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 387, "src": "279:5:4", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 453, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "279:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "266:20:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 443, "id": 455, "nodeType": "Return", "src": "259:27:4"}]}, "documentation": null, "id": 457, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 440, "nodeType": "ParameterList", "parameters": [], "src": "220:2:4"}, "returnParameters": {"id": 443, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 442, "name": "", "nodeType": "VariableDeclaration", "scope": 457, "src": "244:7:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 441, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "244:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "243:9:4"}, "scope": 474, "src": "208:83:4", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 472, "nodeType": "Block", "src": "330:34:4", "statements": [{"expression": {"argumentTypes": null, "id": 464, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 462, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 403, "src": "336:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 463, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 459, "src": "340:4:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "336:8:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 465, "nodeType": "ExpressionStatement", "src": "336:8:4"}, {"expression": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "id": 469, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 405, "src": "357:1:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"argumentTypes": null, "id": 466, "name": "e", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 409, "src": "350:1:4", "typeDescriptions": {"typeIdentifier": "t_contract$_E_$398", "typeString": "contract E"}}, "id": 468, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 397, "src": "350:6:4", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 470, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "350:9:4", "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 471, "nodeType": "ExpressionStatement", "src": "350:9:4"}]}, "documentation": null, "id": 473, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 460, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 459, "name": "xval", "nodeType": "VariableDeclaration", "scope": 473, "src": "309:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 458, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "309:7:4", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "308:14:4"}, "returnParameters": {"id": 461, "nodeType": "ParameterList", "parameters": [], "src": "330:0:4"}, "scope": 474, "src": "295:69:4", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 475, "src": "41:325:4"}], "src": "0:367:4"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/K.json b/tests/expected/solc-multi-file/K.json new file mode 100644 index 00000000..7f229ebb --- /dev/null +++ b/tests/expected/solc-multi-file/K.json @@ -0,0 +1 @@ +{"contractName": "K", "abi": [{"constant": false, "inputs": [{"name": "xval", "type": "uint256"}], "name": "setX", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function"}, {"constant": true, "inputs": [], "name": "sum", "outputs": [{"name": "", "type": "uint256"}], "payable": false, "stateMutability": "view", "type": "function"}, {"inputs": [{"name": "yval", "type": "uint256"}], "payable": false, "stateMutability": "nonpayable", "type": "constructor"}], "bytecode": "0x608060405234801561001057600080fd5b50604051602080610e4c8339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b610b6f806102dd83390190565b6101f7806100e66000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe608060405234801561001057600080fd5b50604051602080610b6f8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c90610140565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600181016040516100d39061014d565b80828152602001915050604051809103906000f0801580156100f9573d6000803e3d6000fd5b50600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505061015a565b6102888061040b83390190565b6104dc8061069383390190565b6102a2806101696000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610120565b6040518082815260200191505060405180910390f35b80600081905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa6001546040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010557600080fd5b505af1158015610119573d6000803e3d6000fd5b5050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018a57600080fd5b505afa15801561019e573d6000803e3d6000fd5b505050506040513d60208110156101b457600080fd5b8101908080519060200190929190505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b15801561022d57600080fd5b505afa158015610241573d6000803e3d6000fd5b505050506040513d602081101561025757600080fd5b810190808051906020019092919050505060015460005401010190509056fea165627a7a723058201b7b8e75cd9da2a178e667a01164717174711c9d6e201e14e3e4ae06054f28fb0029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029608060405234801561001057600080fd5b506040516020806104dc8339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055508060405161005c906100c9565b80828152602001915050604051809103906000f080158015610082573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d6565b6102888061025483390190565b61016f806100e56000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610091565b6040518082815260200191505060405180910390f35b8060008190555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0d7afb76040518163ffffffff1660e01b815260040160206040518083038186803b1580156100fb57600080fd5b505afa15801561010f573d6000803e3d6000fd5b505050506040513d602081101561012557600080fd5b8101908080519060200190929190505050600154600054010190509056fea165627a7a723058206bdc11d417aeff0c4da7642e2036c5e5c68c62d525fc7e9ed79c779d84fb2b500029608060405234801561001057600080fd5b506040516020806102888339810180604052602081101561003057600080fd5b81019080805190602001909291905050506000808190555080600181905550600560405161005d906100ca565b80828152602001915050604051809103906000f080158015610083573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100d7565b6101208061016883390190565b6083806100e56000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063a0d7afb714602d575b600080fd5b60336049565b6040518082815260200191505060405180910390f35b60006001546000540390509056fea165627a7a723058205293c815104c3b1b1f414bd5cb22f2589503885e136303c3db22f0f3c5985c730029608060405234801561001057600080fd5b506040516020806101208339810180604052602081101561003057600080fd5b810190808051906020019092919050505060008081905550806001819055505060c28061005e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80634018d9aa146037578063853255cc146062575b600080fd5b606060048036036020811015604b57600080fd5b8101908080359060200190929190505050607e565b005b60686088565b6040518082815260200191505060405180910390f35b8060008190555050565b60006001546000540190509056fea165627a7a72305820ca30592a9e9f5c97a3ff34d1f7e96d9a8b3c42640780d9c596a734d5d88262bf0029", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80634018d9aa1461003b578063853255cc14610069575b600080fd5b6100676004803603602081101561005157600080fd5b8101908080359060200190929190505050610087565b005b610071610121565b6040518082815260200191505060405180910390f35b80600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634018d9aa600183016040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561010657600080fd5b505af115801561011a573d6000803e3d6000fd5b5050505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853255cc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561018b57600080fd5b505afa15801561019f573d6000803e3d6000fd5b505050506040513d60208110156101b557600080fd5b810190808051906020019092919050505090509056fe", "ast": {"absolutePath": "I/K.sol", "exportedSymbols": {"K": [343]}, "id": 344, "nodeType": "SourceUnit", "nodes": [{"absolutePath": "I/I.sol", "file": "./I.sol", "id": 287, "nodeType": "ImportDirective", "scope": 344, "sourceUnit": 475, "src": "0:17:5", "symbolAliases": [], "unitAlias": ""}, {"baseContracts": [], "contractDependencies": [474], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 343, "linearizedBaseContracts": [343], "name": "K", "nodeType": "ContractDefinition", "nodes": [{"constant": false, "id": 289, "name": "x", "nodeType": "VariableDeclaration", "scope": 343, "src": "34:9:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 288, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "34:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 291, "name": "y", "nodeType": "VariableDeclaration", "scope": 343, "src": "47:9:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 290, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "47:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}, {"constant": false, "id": 293, "name": "i", "nodeType": "VariableDeclaration", "scope": 343, "src": "60:3:5", "stateVariable": true, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}, "typeName": {"contractScope": null, "id": 292, "name": "I", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 474, "src": "60:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "value": null, "visibility": "internal"}, {"body": {"id": 313, "nodeType": "Block", "src": "101:48:5", "statements": [{"expression": {"argumentTypes": null, "id": 300, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 298, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 289, "src": "107:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "hexValue": "30", "id": 299, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "111:1:5", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0"}, "value": "0"}, "src": "107:5:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 301, "nodeType": "ExpressionStatement", "src": "107:5:5"}, {"expression": {"argumentTypes": null, "id": 304, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 302, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 291, "src": "118:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 303, "name": "yval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 295, "src": "122:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "118:8:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 305, "nodeType": "ExpressionStatement", "src": "118:8:5"}, {"expression": {"argumentTypes": null, "id": 311, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 306, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 293, "src": "132:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "hexValue": "35", "id": 309, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "142:1:5", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}, "value": "5"}], "expression": {"argumentTypes": [{"typeIdentifier": "t_rational_5_by_1", "typeString": "int_const 5"}], "id": 308, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "NewExpression", "src": "136:5:5", "typeDescriptions": {"typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$returns$_t_contract$_I_$474_$", "typeString": "function (uint256) returns (contract I)"}, "typeName": {"contractScope": null, "id": 307, "name": "I", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 474, "src": "140:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}}, "id": 310, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "136:8:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "src": "132:12:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "id": 312, "nodeType": "ExpressionStatement", "src": "132:12:5"}]}, "documentation": null, "id": 314, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": {"id": 296, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 295, "name": "yval", "nodeType": "VariableDeclaration", "scope": 314, "src": "80:12:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 294, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "80:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "79:14:5"}, "returnParameters": {"id": 297, "nodeType": "ParameterList", "parameters": [], "src": "101:0:5"}, "scope": 343, "src": "68:81:5", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}, {"body": {"id": 323, "nodeType": "Block", "src": "198:25:5", "statements": [{"expression": {"argumentTypes": null, "arguments": [], "expression": {"argumentTypes": [], "expression": {"argumentTypes": null, "id": 319, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 293, "src": "211:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "id": 320, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sum", "nodeType": "MemberAccess", "referencedDeclaration": 457, "src": "211:5:5", "typeDescriptions": {"typeIdentifier": "t_function_external_view$__$returns$_t_uint256_$", "typeString": "function () view external returns (uint256)"}}, "id": 321, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "211:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "functionReturnParameters": 318, "id": 322, "nodeType": "Return", "src": "204:14:5"}]}, "documentation": null, "id": 324, "implemented": true, "kind": "function", "modifiers": [], "name": "sum", "nodeType": "FunctionDefinition", "parameters": {"id": 315, "nodeType": "ParameterList", "parameters": [], "src": "165:2:5"}, "returnParameters": {"id": 318, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 317, "name": "", "nodeType": "VariableDeclaration", "scope": 324, "src": "189:7:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 316, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "189:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "188:9:5"}, "scope": 343, "src": "153:70:5", "stateMutability": "view", "superFunction": null, "visibility": "public"}, {"body": {"id": 341, "nodeType": "Block", "src": "262:39:5", "statements": [{"expression": {"argumentTypes": null, "id": 331, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": {"argumentTypes": null, "id": 329, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 289, "src": "268:1:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "Assignment", "operator": "=", "rightHandSide": {"argumentTypes": null, "id": 330, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 326, "src": "272:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "src": "268:8:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "id": 332, "nodeType": "ExpressionStatement", "src": "268:8:5"}, {"expression": {"argumentTypes": null, "arguments": [{"argumentTypes": null, "commonType": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "id": 338, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": {"argumentTypes": null, "id": 336, "name": "xval", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 326, "src": "289:4:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": {"argumentTypes": null, "hexValue": "31", "id": 337, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "294:1:5", "subdenomination": null, "typeDescriptions": {"typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1"}, "value": "1"}, "src": "289:6:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}], "expression": {"argumentTypes": [{"typeIdentifier": "t_uint256", "typeString": "uint256"}], "expression": {"argumentTypes": null, "id": 333, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 293, "src": "282:1:5", "typeDescriptions": {"typeIdentifier": "t_contract$_I_$474", "typeString": "contract I"}}, "id": 335, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "setX", "nodeType": "MemberAccess", "referencedDeclaration": 473, "src": "282:6:5", "typeDescriptions": {"typeIdentifier": "t_function_external_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256) external"}}, "id": 339, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "282:14:5", "typeDescriptions": {"typeIdentifier": "t_tuple$__$", "typeString": "tuple()"}}, "id": 340, "nodeType": "ExpressionStatement", "src": "282:14:5"}]}, "documentation": null, "id": 342, "implemented": true, "kind": "function", "modifiers": [], "name": "setX", "nodeType": "FunctionDefinition", "parameters": {"id": 327, "nodeType": "ParameterList", "parameters": [{"constant": false, "id": 326, "name": "xval", "nodeType": "VariableDeclaration", "scope": 342, "src": "241:12:5", "stateVariable": false, "storageLocation": "default", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}, "typeName": {"id": 325, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "241:7:5", "typeDescriptions": {"typeIdentifier": "t_uint256", "typeString": "uint256"}}, "value": null, "visibility": "internal"}], "src": "240:14:5"}, "returnParameters": {"id": 328, "nodeType": "ParameterList", "parameters": [], "src": "262:0:5"}, "scope": 343, "src": "227:74:5", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public"}], "scope": 344, "src": "19:284:5"}], "src": "0:304:5"}, "userdoc": {"methods": {}, "notice": null}, "devdoc": {"methods": {}, "author": null, "details": null, "title": null}} \ No newline at end of file diff --git a/tests/expected/solc-multi-file/combined_solc.json b/tests/expected/solc-multi-file/combined_solc.json new file mode 100644 index 00000000..d9aab0a8 --- /dev/null +++ b/tests/expected/solc-multi-file/combined_solc.json @@ -0,0 +1 @@ +["A.sol","C.sol","E.sol","G.sol","I.sol","K.sol"] \ No newline at end of file diff --git a/tests/hardhat-multi-file/contracts/A.sol b/tests/hardhat-multi-file/contracts/A.sol new file mode 100644 index 00000000..0bb6bd5f --- /dev/null +++ b/tests/hardhat-multi-file/contracts/A.sol @@ -0,0 +1,51 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "./C.sol"; +import "./E/G.sol"; +import "./I/K.sol"; + +contract A { + uint256 x; + uint256 y; + uint256 z; + B b; + C c; + D d; + + constructor(uint256 yval, uint256 zval) { + x = 0; + y = yval; + z = zval; + b = new B(); + c = new C(zval); + d = new D(zval); + } + + function sum() public view returns (uint256) { + return x+y+z+b.diff()+c.sum()+d.diff(); + } + + function set(uint256 xval) public { + x = xval; + c.setX(xval); + } +} + +contract B { + uint256 x; + uint256 y; + G g; + K k; + + constructor() { + x = 0; + y = 6; + g = new G(x+1); + k = new K(x+2); + } + + function diff() public view returns (uint256) { + return x-y+g.sum(); + } +} diff --git a/tests/hardhat-multi-file/contracts/C.sol b/tests/hardhat-multi-file/contracts/C.sol new file mode 100644 index 00000000..ccbe12f5 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/C.sol @@ -0,0 +1,36 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +contract C { + uint256 x; + uint256 y; + + constructor(uint256 yval) { + x = 0; + y = yval; + } + + function sum() public view returns (uint256) { + return x+y; + } + + function setX(uint256 xval) public { + x = xval; + } +} + +contract D { + uint256 x; + uint256 y; + C c; + + constructor(uint256 yval) { + x = 0; + y = yval; + c = new C(5); + } + + function diff() public view returns (uint256) { + return x-y; + } +} diff --git a/tests/hardhat-multi-file/contracts/E/E.sol b/tests/hardhat-multi-file/contracts/E/E.sol new file mode 100644 index 00000000..db3f88d9 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/E/E.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "../C.sol"; +import "../I/I.sol"; + +contract E { + uint256 x; + uint256 y; + D d; + + constructor(uint256 yval) { + x = 0; + y = yval; + d = new D(yval); + } + + function sum() public view returns (uint256) { + return x+y+d.diff(); + } + + function setX(uint256 xval) public { + x = xval; + } +} diff --git a/tests/hardhat-multi-file/contracts/E/G.sol b/tests/hardhat-multi-file/contracts/E/G.sol new file mode 100644 index 00000000..8683fab2 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/E/G.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "./E.sol"; + +contract G { + uint256 x; + uint256 y; + E e; + + constructor(uint256 yval) { + x = 0; + y = yval; + e = new E(5); + } + + function sum() public view returns (uint256) { + return e.sum(); + } + + function setX(uint256 xval) public { + x = xval; + e.setX(xval+1); + } +} diff --git a/tests/hardhat-multi-file/contracts/I/I.sol b/tests/hardhat-multi-file/contracts/I/I.sol new file mode 100644 index 00000000..a1963604 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/I/I.sol @@ -0,0 +1,28 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "../C.sol"; +import "../E/E.sol"; + +contract I { + uint256 x; + uint256 y; + D d; + E e; + + constructor(uint256 yval) { + x = 0; + y = yval; + d = new D(yval); + e = new E(yval+1); + } + + function sum() public view returns (uint256) { + return x+y+d.diff()+e.sum(); + } + + function setX(uint256 xval) public { + x = xval; + e.setX(y); + } +} diff --git a/tests/hardhat-multi-file/contracts/I/K.sol b/tests/hardhat-multi-file/contracts/I/K.sol new file mode 100644 index 00000000..65f1bd73 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/I/K.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "./I.sol"; + +contract K { + uint256 x; + uint256 y; + I i; + + constructor(uint256 yval) { + x = 0; + y = yval; + i = new I(5); + } + + function sum() public view returns (uint256) { + return i.sum(); + } + + function setX(uint256 xval) public { + x = xval; + i.setX(xval+1); + } +} diff --git a/tests/hardhat-multi-file/contracts/X/X.sol b/tests/hardhat-multi-file/contracts/X/X.sol new file mode 100644 index 00000000..dd590b27 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/X/X.sol @@ -0,0 +1,28 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "../C.sol"; +import "../E/E.sol"; + +contract X { + uint256 x; + uint256 y; + D d; + E e; + + constructor(uint256 yval) { + x = 0; + y = yval; + d = new D(yval); + e = new E(yval+1); + } + + function sum() public view returns (uint256) { + return x+y+d.diff()+e.sum(); + } + + function setX(uint256 xval) public { + x = xval; + e.setX(y); + } +} diff --git a/tests/hardhat-multi-file/contracts/X/Z.sol b/tests/hardhat-multi-file/contracts/X/Z.sol new file mode 100644 index 00000000..201b7451 --- /dev/null +++ b/tests/hardhat-multi-file/contracts/X/Z.sol @@ -0,0 +1,22 @@ +//SPDX-License-Identifier: Unlicense +pragma solidity ^0.7.0; + +import "./X.sol"; + +contract Z { + uint256 y; + X x; + + constructor(uint256 yval) { + y = yval; + x = new X(5); + } + + function sum() public view returns (uint256) { + return x.sum(); + } + + function setX(uint256 xval) public { + x.setX(xval+1); + } +} diff --git a/tests/hardhat-multi-file/hardhat.config.js b/tests/hardhat-multi-file/hardhat.config.js new file mode 100644 index 00000000..c51cfb93 --- /dev/null +++ b/tests/hardhat-multi-file/hardhat.config.js @@ -0,0 +1,22 @@ +require("@nomiclabs/hardhat-waffle"); + +// This is a sample Hardhat task. To learn how to create your own go to +// https://hardhat.org/guides/create-task.html +task("accounts", "Prints the list of accounts", async () => { + const accounts = await ethers.getSigners(); + + for (const account of accounts) { + console.log(account.address); + } +}); + +// You need to export an object to set up your config +// Go to https://hardhat.org/config/ to learn more + +/** + * @type import('hardhat/config').HardhatUserConfig + */ +module.exports = { + solidity: "0.7.3", +}; + diff --git a/tests/hardhat-multi-file/package.json b/tests/hardhat-multi-file/package.json new file mode 100644 index 00000000..074828dd --- /dev/null +++ b/tests/hardhat-multi-file/package.json @@ -0,0 +1,11 @@ +{ + "name": "hardhat-project", + "devDependencies": { + "@nomiclabs/hardhat-ethers": "^2.0.0", + "@nomiclabs/hardhat-waffle": "^2.0.0", + "chai": "^4.2.0", + "ethereum-waffle": "^3.2.0", + "ethers": "^5.0.19", + "hardhat": "^2.0.2" + } +} diff --git a/tests/hardhat-multi-file/scripts/sample-script.js b/tests/hardhat-multi-file/scripts/sample-script.js new file mode 100644 index 00000000..2b7bcd93 --- /dev/null +++ b/tests/hardhat-multi-file/scripts/sample-script.js @@ -0,0 +1,32 @@ +// We require the Hardhat Runtime Environment explicitly here. This is optional +// but useful for running the script in a standalone fashion through `node