diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0469ecf..d2a74c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,26 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.7", "pypy3.8", "pypy3.9" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10" ] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python dependencies + uses: py-actions/py-dependency-install@v4 + with: + path: "requirements_dev.txt" + - name: Setup tox for GH actions + run: pip install tox-gh-actions + - name: Test with tox + run: make test + test_windows: + runs-on: windows-latest + strategy: + matrix: + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10" ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -25,18 +44,18 @@ jobs: deploy: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: test + needs: [test, test_windows] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install Python dependencies uses: py-actions/py-dependency-install@v4 with: - path: "requirements_dev.txt" + path: "requirements_deploy.txt" - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} @@ -44,7 +63,7 @@ jobs: run: make release notify-slack: - needs: test + needs: [test, test_windows] runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: diff --git a/HISTORY.md b/HISTORY.md index a7d2b86..c5719c5 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,34 @@ # History +0.13.3 (2024-06-17) +-------------------- +- Fix hardhat artifacts collection + +0.13.2 (2024-06-17) +-------------------- +- Fix hardhat artifacts collection + +0.13.1 (2024-06-11) +-------------------- +- Fix hardhat artifacts collection +- Add `output` option to `fuzz run --dry-run` command + +0.13.0 (2024-06-04) +-------------------- +- Add Windows support +- Drop support for Python 3.7 +- Add support for Python 3.12 + +0.12.3 (2024-05-23) +-------------------- +- Unlinked libraries detection for Foundry and Hardhat project +- Update checks for fuzzing cli. Now fuzzing cli will check for new versions and notify the user if a new version is available + +0.12.2 (2024-04-23) +-------------------- +- Fix hardhat artifacts collection +- Ignore library contracts by default + 0.12.1 (2024-03-07) -------------------- - Change `fuzz run` command behavior on contract targets absence (now it will emit warning instead of an error) diff --git a/README.md b/README.md index 0af120f..ca0c55b 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ Table of Contents - [Product Analytics Collection](#product-analytics-collection) ## Installing -The Diligence Fuzzing CLI runs on Python 3.7+, including PyPy. - +The Diligence Fuzzing CLI runs on Python 3.8+, including PyPy. +### Linux and macOS To get started, simply run ```console @@ -45,6 +45,25 @@ $ python3 setup.py install ``` > Don't forget to add the directory containing the `fuzz` executable to your system's PATH environment variable. +### Windows +> We recommend using Windows Subsystem for Linux (WSL) for a better experience +1. Install [Visual Studio Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) for CLI's dependencies compilation +2. Run the following command to install the CLI +```console +$ pip3 install diligence-fuzzing +``` + +Alternatively, clone the repository and run + +```console +$ pip3 install . +``` +Or directly through Python's :code:`setuptools`: +```console +$ python3 setup.py install +``` +> Don't forget to add the directory containing the `fuzz` executable to your system's PATH environment variable. + # Basic Usage Fuzz is a command-line tool for smart contract fuzzing. It provides several modes of fuzzing, including smart mode, manual mode, and Foundry tests fuzzing. diff --git a/docs/configuration.md b/docs/configuration.md index 9a34384..5510269 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -22,30 +22,32 @@ Each source has a different priority, based on the order in which they appear in | `allow_analytics` | `FUZZ_ALLOW_ANALYTICS` | `True` | `bool` | Switch to allow/disallow fuzzing-cli to send product usage analytics. Can also be turned off using `fuzz config set no-product-analytics` or on a prompt upon first campaign submission | ## [Fuzzing Configuration Options](#fuzzing-configuration-options) -| Variable | Environment Variable | Default Value | Type | Description | -|----------------------------------|---------------------------------------|---------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------| -| `ide` | `FUZZ_IDE` | `None` | Optional `str` | The IDE that the project is using (e.g., `truffle`, `hardhat`). Usually, detected automatically | -| `build_directory` | `FUZZ_BUILD_DIRECTORY` | `None` | Optional `Path` | The path to the build directory of the project. | -| `sources_directory` | `FUZZ_SOURCES_DIRECTORY` | `None` | Optional `Path` | The path to the sources directory of the project. | -| `key` | `FUZZ_API_KEY` | `None` | Optional `str` | The API key used to submit campaigns to the Diligence Fuzzing API. | -| `smart_mode` | `FUZZ_SMART_MODE` | `False` | `bool` | Whether to use smart mode for the fuzzing campaign. | -| `project` | `FUZZ_PROJECT` | `None` | Optional `str` | The name of the project to add submitted campaigns to | -| `corpus_target` | `FUZZ_CORPUS_TARGET` | `None` | Optional `str` | The name of the corpus target to be used in the Diligence Fuzzing API. | -| `number_of_cores` | `FUZZ_NUMBER_OF_CORES` | `1` | `int` | The number of CPU cores to use for fuzzing. | -| `time_limit` | `FUZZ_TIME_LIMIT` | `None` | Optional `str` | The time limit for each individual fuzzing job (e.g., `10m`, `1h`, `30s`). | -| `targets` | `FUZZ_TARGETS` | `None` | Optional `List[str]` | A list of Solidity files to be fuzzed. | -| `deployed_contract_address` | `FUZZ_DEPLOYED_CONTRACT_ADDRESS` | `None` | Optional `str` | The address of the deployed contract to be used in the fuzzing campaign. | -| `additional_contracts_addresses` | `FUZZ_ADDITIONAL_CONTRACTS_ADDRESSES` | `None` | Optional `Union[List[str], str]` | A list of additional contract addresses to be used in the fuzzing campaign (could be a string with comma-separated addresses) | -| `rpc_url` | `FUZZ_RPC_URL` | `"http://localhost:8545"` | `str` | The URL of the RPC node where the contract are deployed. | -| `campaign_name_prefix` | `FUZZ_CAMPAIGN_NAME_PREFIX` | `"untitled"` | `str` | The prefix to use for the name of the fuzzing campaign. | -| `map_to_original_source` | `FUZZ_MAP_TO_ORIGINAL_SOURCE` | `False` | `bool` | Whether to map the generated inputs to the original source code. | -| `enable_cheat_codes` | `FUZZ_ENABLE_CHEAT_CODES` | `None` | Optional `bool` | Whether to enable cheat codes for the fuzzing campaign (`True` by default for foundry tests campaigns) | -| `chain_id` | `FUZZ_CHAIN_ID` | `None` | Optional `str` | The chain ID for the blockchain. | -| `incremental` | `FUZZ_INCREMENTAL` | `False` | `bool` | Whether to use incremental mode for the fuzzing campaign. | -| `truffle_executable_path` | `FUZZ_TRUFFLE_EXECUTABLE_PATH` | `truffle` | Optional `str` | The path to the Truffle executable (for projects using the Truffle) | -| `dry_run` | `FUZZ_DRY_RUN` | `False` | `bool` | Whether to run the fuzzer in dry run mode when the campaign isn't submitted but the payload is outputted. | -| `max_sequence_length` | `FUZZ_MAX_SEQUENCE_LENGTH` | `None` | Optional `int` | Max sequence length (fuzzer parameter) | -| `ignore_code_hash` | `FUZZ_IGNORE_CODE_HASH` | `None` | Optional `bool` | Ignore code hash (fuzzer parameter) | +| Variable | Environment Variable | Default Value | Type | Description | +|----------------------------------|---------------------------------------|---------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `ide` | `FUZZ_IDE` | `None` | Optional `str` | The IDE that the project is using (e.g., `truffle`, `hardhat`). Usually, detected automatically | +| `build_directory` | `FUZZ_BUILD_DIRECTORY` | `None` | Optional `Path` | The path to the build directory of the project. | +| `sources_directory` | `FUZZ_SOURCES_DIRECTORY` | `None` | Optional `Path` | The path to the sources directory of the project. | +| `key` | `FUZZ_API_KEY` | `None` | Optional `str` | The API key used to submit campaigns to the Diligence Fuzzing API. | +| `smart_mode` | `FUZZ_SMART_MODE` | `False` | `bool` | Whether to use smart mode for the fuzzing campaign. | +| `project` | `FUZZ_PROJECT` | `None` | Optional `str` | The name of the project to add submitted campaigns to | +| `corpus_target` | `FUZZ_CORPUS_TARGET` | `None` | Optional `str` | The name of the corpus target to be used in the Diligence Fuzzing API. | +| `number_of_cores` | `FUZZ_NUMBER_OF_CORES` | `1` | `int` | The number of CPU cores to use for fuzzing. | +| `time_limit` | `FUZZ_TIME_LIMIT` | `None` | Optional `str` | The time limit for each individual fuzzing job (e.g., `10m`, `1h`, `30s`). | +| `targets` | `FUZZ_TARGETS` | `None` | Optional `List[str]` | A list of Solidity files to be fuzzed. | +| `deployed_contract_address` | `FUZZ_DEPLOYED_CONTRACT_ADDRESS` | `None` | Optional `str` | The address of the deployed contract to be used in the fuzzing campaign. | +| `additional_contracts_addresses` | `FUZZ_ADDITIONAL_CONTRACTS_ADDRESSES` | `None` | Optional `Union[List[str], str]` | A list of additional contract addresses to be used in the fuzzing campaign (could be a string with comma-separated addresses) | +| `rpc_url` | `FUZZ_RPC_URL` | `"http://localhost:8545"` | `str` | The URL of the RPC node where the contract are deployed. | +| `campaign_name_prefix` | `FUZZ_CAMPAIGN_NAME_PREFIX` | `"untitled"` | `str` | The prefix to use for the name of the fuzzing campaign. | +| `map_to_original_source` | `FUZZ_MAP_TO_ORIGINAL_SOURCE` | `False` | `bool` | Whether to map the generated inputs to the original source code. | +| `enable_cheat_codes` | `FUZZ_ENABLE_CHEAT_CODES` | `None` | Optional `bool` | Whether to enable cheat codes for the fuzzing campaign (`True` by default for foundry tests campaigns) | +| `chain_id` | `FUZZ_CHAIN_ID` | `None` | Optional `str` | The chain ID for the blockchain. | +| `incremental` | `FUZZ_INCREMENTAL` | `False` | `bool` | Whether to use incremental mode for the fuzzing campaign. | +| `truffle_executable_path` | `FUZZ_TRUFFLE_EXECUTABLE_PATH` | `truffle` | Optional `str` | The path to the Truffle executable (for projects using the Truffle) | +| `dry_run` | `FUZZ_DRY_RUN` | `False` | `bool` | Whether to run the fuzzer in dry run mode when the campaign isn't submitted but the payload is outputted. | +| `max_sequence_length` | `FUZZ_MAX_SEQUENCE_LENGTH` | `None` | Optional `int` | Max sequence length (fuzzer parameter) | +| `ignore_code_hash` | `FUZZ_IGNORE_CODE_HASH` | `None` | Optional `bool` | Ignore code hash (fuzzer parameter) | +| `include_library_contracts` | `FUZZ_INCLUDE_LIBRARY_CONTRACTS` | `False` | Optional `bool` | Submit library contracts along with regular contracts. By default, fuzzing-cli will ignore libraries and won't send them as contract objects because ones will be included in the main contract. For cases, when library is deployed, set this option to `False`. | +| `check_updates` | `FUZZ_CHECK_UPDATES` | `True` | `bool` | Allow fuzzing-cli to check for updates in the PyPi registry. | ## [Arming Configuration Options](#arming-configuration-options) | Variable | Environment Variable | Default Value | Type | Description | diff --git a/fuzzing_cli/__init__.py b/fuzzing_cli/__init__.py index c5544bc..ef6acb0 100644 --- a/fuzzing_cli/__init__.py +++ b/fuzzing_cli/__init__.py @@ -4,4 +4,4 @@ __author__ = """Dominik Muhs""" __email__ = "dominik.muhs@consensys.net" -__version__ = "0.12.1" +__version__ = "0.13.3" diff --git a/fuzzing_cli/cli.py b/fuzzing_cli/cli.py index b967d9b..9957aec 100644 --- a/fuzzing_cli/cli.py +++ b/fuzzing_cli/cli.py @@ -9,12 +9,14 @@ from fuzzing_cli import __version__ from fuzzing_cli.fuzz.arm import fuzz_arm +from fuzzing_cli.fuzz.config import AdditionalOptions from fuzzing_cli.fuzz.disarm import fuzz_disarm from fuzzing_cli.fuzz.foundry_tests import cli as foundry_test from fuzzing_cli.fuzz.fuzz_config import cli as fuzz_config from fuzzing_cli.fuzz.fuzzing_lessons import cli as fuzz_lesson from fuzzing_cli.fuzz.quickcheck import fuzz_auto from fuzzing_cli.fuzz.run import fuzz_run +from fuzzing_cli.fuzz.utils import check_latest_version from fuzzing_cli.fuzz.version import fuzz_version LOGGER = logging.getLogger("fuzzing-cli") @@ -71,6 +73,9 @@ def cli(ctx, debug: bool, config: str) -> None: LOGGER.debug(f"Initializing tool name middleware with {__version__}") + options = AdditionalOptions() + check_latest_version(options) + LOGGER.debug("Registering main commands") diff --git a/fuzzing_cli/fuzz/arm.py b/fuzzing_cli/fuzz/arm.py index a53fbd8..b3f3d94 100644 --- a/fuzzing_cli/fuzz/arm.py +++ b/fuzzing_cli/fuzz/arm.py @@ -1,4 +1,5 @@ import logging +from pathlib import Path from typing import List, Optional, Tuple import click @@ -6,6 +7,7 @@ from fuzzing_cli.fuzz.analytics import trace from fuzzing_cli.fuzz.config import AnalyzeOptions, FuzzingOptions, omit_none +from fuzzing_cli.fuzz.exceptions import ScribbleError from fuzzing_cli.fuzz.scribble import ScribbleMixin from fuzzing_cli.fuzz.utils import detect_ide from fuzzing_cli.util import sol_files_by_directory @@ -20,13 +22,13 @@ def handle_validation_errors( fuzzing_options: FuzzingOptions, prompt: bool = True, smart_mode: bool = False, -) -> List[str]: +) -> List[Path]: if len(targets) > 0: - return targets + return [Path(t) for t in targets] _IDEClass = detect_ide(fuzzing_options) suggested_targets = sorted( - sol_files_by_directory(str(_IDEClass.get_default_sources_dir())) + sol_files_by_directory(_IDEClass.get_default_sources_dir()) ) data = "\n".join([f" ◦ {file_name}" for file_name in suggested_targets]) @@ -37,7 +39,7 @@ def handle_validation_errors( ): return suggested_targets click.secho(error_message) - return targets + return [Path(t) for t in targets] @click.command("arm") @@ -46,7 +48,7 @@ def handle_validation_errors( "--scribble-path", type=click.Path(), default=None, - help="Path to a custom scribble executable (beta)", + help="Path to a custom scribble executable", ) @click.option( "--remap-import", @@ -142,11 +144,7 @@ def fuzz_arm( raise ClickException( f"ScribbleError:\nThere was an error instrumenting your contracts with scribble:\n{err}" ) - except FileNotFoundError: - raise click.exceptions.UsageError( - f'Scribble not found at path "{options.scribble_path}". ' - f"Please provide scribble path using either `--scribble-path` option to `fuzz arm` command " - f"or set one in config" - ) - except Exception as e: + except ClickException: raise + except Exception as e: + raise ScribbleError(e) diff --git a/fuzzing_cli/fuzz/config/generate.py b/fuzzing_cli/fuzz/config/generate.py index b1d091b..1305a53 100644 --- a/fuzzing_cli/fuzz/config/generate.py +++ b/fuzzing_cli/fuzz/config/generate.py @@ -57,11 +57,11 @@ def determine_smart_mode(confirm: bool = False) -> bool: return use_smart_mode -def __select_targets(targets: List[str]) -> List[str]: +def __select_targets(targets: List[Path]) -> List[Path]: files = [] files_in_dirs = [] for target in targets: - if Path(target).is_dir(): + if target.is_dir(): files_in_dirs.extend(sorted(sol_files_by_directory(target))) else: files.append(target) @@ -86,30 +86,30 @@ def __select_targets(targets: List[str]) -> List[str]: click.secho( "⚠️ No targets are selected, please configure them manually in a config file" ) - targets = answers.get("targets", []) + files + targets = [Path(t) for t in answers.get("targets", [])] + files return targets -def __prompt_targets() -> List[str]: +def __prompt_targets() -> List[Path]: target = click.prompt( f"{QM} Specify folder(s) or smart-contract(s) (comma-separated) to fuzz" ) targets = [ - t.strip() + Path(t.strip()) if Path(t.strip()).is_absolute() - else str(Path.cwd().absolute().joinpath(t.strip())) + else Path.cwd().absolute().joinpath(t.strip()) for t in target.split(",") ] return targets -def determine_targets(ide: str) -> List[str]: +def determine_targets(ide: str) -> List[Path]: repo = IDERepository.get_instance() _IDEArtifactsClass = repo.get_ide(ide) target = _IDEArtifactsClass.get_default_sources_dir() ts = style(target, fg="yellow") - targets = [str(target)] + targets = [target] if target.exists() and target.is_dir(): if not click.confirm( @@ -188,17 +188,17 @@ def determine_campaign_name() -> str: return name -def determine_sources_dir(targets: List[str]) -> Optional[str]: +def determine_sources_dir(targets: List[Path]) -> Optional[Path]: if len(targets) == 0: return None if len(targets) == 1: - if Path(targets[0]).is_dir(): + if targets[0].is_dir(): # looks like contracts directory return targets[0] # return parent folder of the contract file - return str(Path(targets[0]).parent) + return targets[0].parent # return common parent of target files - return commonpath(targets) + return Path(commonpath(targets)) def recreate_config(config_file: str): @@ -240,8 +240,7 @@ def recreate_config(config_file: str): click.echo( f"⚡️ Alright! Generating config at {style(config_path, fg='yellow', italic=True)}" ) - - with config_path.open("w") as f: + with config_path.open("w", encoding="utf-8") as f: f.write( generate_yaml( { diff --git a/fuzzing_cli/fuzz/config/options.py b/fuzzing_cli/fuzz/config/options.py index 26169ac..c789890 100644 --- a/fuzzing_cli/fuzz/config/options.py +++ b/fuzzing_cli/fuzz/config/options.py @@ -57,11 +57,13 @@ def yaml_config_settings_source(key="fuzz"): def loader(_) -> Dict[str, Any]: # this env variable is set by -c option in the cli (e.g. fuzz -c .fuzz-test.yaml run, # or FUZZ_CONFIG_FILE=.fuzz-test.yaml) - config_path = os.environ.get("FUZZ_CONFIG_FILE", ".fuzz.yml") - if Path(config_path).is_file(): + config_path = Path(os.environ.get("FUZZ_CONFIG_FILE", ".fuzz.yml")) + if config_path.is_file(): LOGGER.debug(f"Parsing config at {config_path}") with open(config_path) as config_f: parsed_config = yaml.safe_load(config_f.read()) + if not parsed_config: + return {} return parsed_config.get(key, {}) or {} return {} @@ -104,8 +106,13 @@ class FuzzingOptions(BaseSettings): target_contracts: Optional[Dict[str, Set[str]]] = None dry_run: bool = False + dry_run_output: Optional[str] = Field(None, exclude=True) smart_mode: bool = False + include_library_contracts: bool = False + + check_updates: bool = True + ci_mode: bool = Field(False) no_build_directory: bool = Field(False, exclude=True) @@ -326,6 +333,7 @@ class AdditionalOptions(BaseSettings): ci_mode: bool = Field(False) report_crashes: bool = Field(True) allow_analytics: bool = Field(True) + check_updates: bool = Field(True) def __init__(self, *args, **data: Any): try: diff --git a/fuzzing_cli/fuzz/config/template.py b/fuzzing_cli/fuzz/config/template.py index da9e563..103d7c7 100644 --- a/fuzzing_cli/fuzz/config/template.py +++ b/fuzzing_cli/fuzz/config/template.py @@ -3,14 +3,14 @@ CONFIG_TEMPLATE = """analyze: # We need to know where the dependencies live # remappings: - # - "@openzeppelin=./node_modules/@openzeppelin" - # - "@ozUpgradesV3=OpenZeppelin/openzeppelin-contracts-upgradeable@3.3.0" + # - '@openzeppelin=./node_modules/@openzeppelin' + # - '@ozUpgradesV3=OpenZeppelin/openzeppelin-contracts-upgradeable@3.3.0' {% if remappings %}remappings: {% for rm in remappings %} - - "{{ rm }}"{% endfor %}{% endif %} + - '{{ rm }}'{% endfor %}{% endif %} # Sometimes you want to enforce a specific solidity version - # solc-version: "0.6.12" - {% if solc_version %}solc-version: "{{ solc_version }}"{% endif %} + # solc-version: '0.6.12' + {% if solc_version %}solc-version: '{{ solc_version }}'{% endif %} {% if scribble_path %}scribble-path: {{ scribble_path }}{% endif %} {% if assert %}assert: {{ assert }}{% endif %} @@ -18,7 +18,7 @@ ide: {{ ide }} # Change the chain ID that is used by the fuzzer. Default is 0x1 (1) - # chain_id: "0x2a" # (42) + # chain_id: '0x2a' # (42) # Enable/Disable "cheat codes" in fuzzer (as introduced by dapptools) # enable_cheat_codes: true @@ -43,12 +43,12 @@ {% endif %} # The following address is going to be the main target for the fuzzing campaign - # deployed_contract_address: "0x48b8050b4174f7871ce53AaF76BEAcA765037BFf" + # deployed_contract_address: '0x48b8050b4174f7871ce53AaF76BEAcA765037BFf' # This parameter tells the fuzzer to also fuzz these contracts # additional_contracts_addresses: - # - "0x0eb775F99A28cb591Fa449ca74eF8E7cEd3A609a" - # - "0x21C62e9c9Fcb6622602eBae83b41abb6b28d7256" + # - '0x0eb775F99A28cb591Fa449ca74eF8E7cEd3A609a' + # - '0x21C62e9c9Fcb6622602eBae83b41abb6b28d7256' # Number of CPU cores to run fuzzing number_of_cores: {{ number_of_cores }} @@ -57,7 +57,7 @@ campaign_name_prefix: {{ campaign_name_prefix }} # Set a default project to which your campaigns will be attached to - # project: "my project name" + # project: 'my project name' # Point to your ganache node which holds the seed 🌱 rpc_url: {{ rpc_url }} @@ -65,13 +65,13 @@ # This is the contract that the campaign will show coverage for, map issues to, etc. # It's a list of all the relevant contracts (don't worry about dependencies, we'll get those automatically 🙌){% if targets %} targets:{% for target in targets %} - - "{{ target }}"{% endfor %} + - '{{ target }}'{% endfor %} {% else %} # targets: # entire directory with contracts - # - "contracts/Proxy" + # - 'contracts/Proxy' # individual files - # - "contracts/Token.sol" + # - 'contracts/Token.sol' {% endif %} """ diff --git a/fuzzing_cli/fuzz/config/utils.py b/fuzzing_cli/fuzz/config/utils.py index f4521bf..2484fe8 100644 --- a/fuzzing_cli/fuzz/config/utils.py +++ b/fuzzing_cli/fuzz/config/utils.py @@ -19,16 +19,16 @@ def merge( def update_config(config_path: Path, update: Dict[str, any]): - with config_path.open("r") as f: + with config_path.open("r", encoding="utf-8") as f: config = yaml.load(f) config = merge(config, update) - with config_path.open("w") as f: + with config_path.open("w", encoding="utf-8") as f: yaml.dump(config, f) def parse_config(config_path: Path) -> Dict[str, any]: - with config_path.open("r") as f: + with config_path.open("r", encoding="utf-8") as f: config = yaml.load(f) return config diff --git a/fuzzing_cli/fuzz/corpus/repository.py b/fuzzing_cli/fuzz/corpus/repository.py index c927ad0..0f11f50 100644 --- a/fuzzing_cli/fuzz/corpus/repository.py +++ b/fuzzing_cli/fuzz/corpus/repository.py @@ -3,7 +3,7 @@ from collections import defaultdict from os.path import commonpath from pathlib import Path -from typing import Any, Dict, List, Optional, Set, Tuple +from typing import Any, Dict, List, Optional, Set, Tuple, Union import click @@ -20,7 +20,7 @@ class NoTransactionFound(Exception): pass -def _uniq(lst: List[str]) -> List[str]: +def _uniq(lst: List[Union[str, Path]]) -> List[Union[str, Path]]: """ Remove duplicates from a list while preserving order """ @@ -75,7 +75,8 @@ def apply_auto_fix(self, suggested_fixes: List[Dict[str, Any]]) -> None: addresses_under_test.extend(fix["data"]) continue if fix["type"] == "add_targets": - targets.extend(fix["data"]) + fix_paths = [Path(p) for p in fix["data"]] + targets.extend(fix_paths) continue if fix["type"] == "remove_addresses": addresses_under_test = [ @@ -85,7 +86,8 @@ def apply_auto_fix(self, suggested_fixes: List[Dict[str, Any]]) -> None: ] continue if fix["type"] == "remove_targets": - targets = [target for target in targets if target not in fix["data"]] + fix_paths = [Path(p) for p in fix["data"]] + targets = [target for target in targets if target not in fix_paths] continue # Re-initialize the repository with the new targets and addresses, and validate self._initialize(addresses_under_test, targets) @@ -145,7 +147,7 @@ def _contract_key(contract: Contract): def _construct_address_contract_mapping( self, - ) -> Tuple[Dict[str, Contract], Dict[Tuple[str, str], str], Dict[str, List[str]]]: + ) -> Tuple[Dict[str, Contract], Dict[Tuple[str, str], str], Dict[Path, List[str]]]: address_to_contract_mapping = {} contract_to_address_mapping = {} # source file to contract addresses mapping. One source file can have multiple contracts, so we need to @@ -158,7 +160,7 @@ def _construct_address_contract_mapping( continue address_to_contract_mapping[contract_address] = contract contract_to_address_mapping[self._contract_key(contract)] = contract_address - source_file_to_address_mapping[contract["mainSourceFile"]].append( + source_file_to_address_mapping[Path(contract["mainSourceFile"])].append( contract_address ) @@ -169,18 +171,18 @@ def _construct_address_contract_mapping( ) @staticmethod - def _path_inclusion_checker(paths: List[str]): + def _path_inclusion_checker(paths: List[Path]): """Construct a function that checks if a given path is in the list of paths. The paths can be files or folders""" - directory_paths: List[str] = [] - file_paths: List[str] = [] + directory_paths: List[Path] = [] + file_paths: List[Path] = [] for _path in paths: - if Path(_path).is_dir(): + if _path.is_dir(): directory_paths.append(_path) else: file_paths.append(_path) - def inner_checker(path: str): + def inner_checker(path: Union[str, Path]): if path in file_paths: # we have found exact file match return True @@ -197,7 +199,7 @@ def _construct_targets( self, addresses_under_test: Optional[List[str]] = None, targets: Optional[List[str]] = None, - ) -> Tuple[List[CONTRACT_ADDRESS], List[str]]: + ) -> Tuple[List[CONTRACT_ADDRESS], List[Path]]: """ Construct the targets from the addresses under test and the targets options or from provided addresses under test and targets (after prompting for automatic fixes). @@ -206,7 +208,7 @@ def _construct_targets( addresses_under_test = self._options.addresses_under_test if targets is None: # make a copy of the targets to not modify the original list - targets = self._options.targets[:] + targets = [Path(t) for t in self._options.targets] return _uniq(addresses_under_test), _uniq(targets) diff --git a/fuzzing_cli/fuzz/disarm.py b/fuzzing_cli/fuzz/disarm.py index adc2138..5298fae 100644 --- a/fuzzing_cli/fuzz/disarm.py +++ b/fuzzing_cli/fuzz/disarm.py @@ -1,4 +1,5 @@ import logging +from pathlib import Path from typing import Optional import click @@ -6,6 +7,7 @@ from fuzzing_cli.fuzz.analytics import trace from fuzzing_cli.fuzz.config import AnalyzeOptions, FuzzingOptions, omit_none +from fuzzing_cli.fuzz.exceptions import ScribbleError from fuzzing_cli.fuzz.scribble import ScribbleMixin LOGGER = logging.getLogger("fuzzing-cli") @@ -17,7 +19,7 @@ "--scribble-path", type=click.Path(), default=None, - help="Path to a custom scribble executable (beta)", + help="Path to a custom scribble executable", ) @trace("fuzz_disarm") def fuzz_disarm(targets, scribble_path: Optional[str]) -> None: @@ -61,7 +63,8 @@ def fuzz_disarm(targets, scribble_path: Optional[str]) -> None: try: return_code, out, err = ScribbleMixin.disarm_solc_in_place( - file_list=fuzzing_options.targets, scribble_path=options.scribble_path + file_list=[Path(t) for t in fuzzing_options.targets], + scribble_path=options.scribble_path, ) if return_code == 0: click.secho(out) @@ -70,11 +73,7 @@ def fuzz_disarm(targets, scribble_path: Optional[str]) -> None: raise ClickException( f"ScribbleError:\nThere was an error un-instrumenting your contracts with scribble:\n{err}" ) - except FileNotFoundError: - raise click.exceptions.UsageError( - f'Scribble not found at path "{options.scribble_path}". ' - f"Please provide scribble path using either `--scribble-path` option to `fuzz disarm` command " - f"or set one in config" - ) - except: + except ClickException: raise + except Exception as e: + raise ScribbleError(e) diff --git a/fuzzing_cli/fuzz/exceptions.py b/fuzzing_cli/fuzz/exceptions.py index 5e0af73..4bce7cb 100644 --- a/fuzzing_cli/fuzz/exceptions.py +++ b/fuzzing_cli/fuzz/exceptions.py @@ -52,6 +52,28 @@ class ScribbleMetaError(FaaSError): pass +class ScribbleError(click.exceptions.ClickException): + """Raised when `scribble` command fails""" + + def __init__(self, underlying_error: Exception): + self.message = f"""Scribble not installed or configured correctly. + +It appears that Scribble is not installed or configured correctly on your system. + +You may need to: + - install Scribble + - ensure that the Scribble executable is in your PATH + - consider providing Scribble executable path using `--scribble-path` argument to command or set it in the config (https://github.com/Consensys/diligence-fuzzing/blob/master/docs/configuration.md#arming-configuration-options) + - Note: Windows users may need to use the full path to the Scribble executable (e.g. "node .\\node_modules\\eth-scribble\\dist\\bin\\scribble.js") + +Please ensure that Scribble is installed and configured correctly before attempting to run the fuzzer again. If the issue persists, please consult the Scribble documentation at https://docs.scribble.codes/tool/installation. + +Underlying error: {underlying_error} +""" + + pass + + class CreateFaaSCampaignError(FaaSError): """Exception raised for errors creating the FaaS Campaign""" @@ -112,15 +134,25 @@ class ForgeError(click.exceptions.ClickException): pass +_windows_hint = ( + "Note: Windows users may need to use the full path to the " + 'Foundry executable (e.g. "C:\\AppData\\foundry\\forge")' +) + + class ForgeConfigError(ForgeError): """Raised when `forge config` command fails""" - def __init__(self): - self.message = """Foundry not installed or configured correctly. + def __init__(self, underlying_error: Exception): + self.message = f"""Foundry not installed or configured correctly. It appears that Foundry is not installed or configured correctly on your system. This error is preventing the fuzzer from running as expected. Please ensure that Foundry is installed and configured correctly before attempting to run the fuzzer again. If the issue persists, please consult the Foundry documentation or seek help from the Foundry community. + +{_windows_hint} + +Underlying error: {underlying_error} """ pass @@ -129,12 +161,17 @@ def __init__(self): class ForgeCompilationError(ForgeError): """Raised when `forge config` command fails""" - def __init__(self): - self.message = """Unable to compile Foundry project. + def __init__(self, underlying_error: Exception): + self.message = f"""Unable to compile Foundry project. It appears that there are issues with compiling the Foundry project. This error is likely related to the project's code or configuration. -Please check the project's compilation logs or consult the project's documentation or support resources for assistance with resolving any compilation issues. Once the project has been successfully compiled, you can attempt to run the fuzzer again.""" +Please check the project's compilation logs or consult the project's documentation or support resources for assistance with resolving any compilation issues. Once the project has been successfully compiled, you can attempt to run the fuzzer again. + +{_windows_hint} + +Underlying error: {underlying_error} +""" pass @@ -170,12 +207,16 @@ def __init__(self): class ForgeCollectTestsError(ForgeError): """Raised when `forge config` command fails""" - def __init__(self): - self.message = """Unable to collect Foundry tests. + def __init__(self, underlying_error: Exception): + self.message = f"""Unable to collect Foundry tests. It appears that there was an issue collecting Foundry tests with the 'forge test --list' command. This error may be related to issues with the Foundry project configuration or the command itself. Please ensure that the Foundry project is properly configured and that the 'forge test --list' command can be executed correctly. You may want to consult the Foundry documentation or seek help from the Foundry community for further assistance. + +{_windows_hint} + +Underlying error: {underlying_error} """ pass diff --git a/fuzzing_cli/fuzz/faas.py b/fuzzing_cli/fuzz/faas.py index 733d5b5..3227b92 100644 --- a/fuzzing_cli/fuzz/faas.py +++ b/fuzzing_cli/fuzz/faas.py @@ -170,7 +170,14 @@ def create_faas_campaign( if self.options.dry_run: # pragma: no cover # if the env var FUZZ_DRY_RUN_NO_PRINT is set, don't print the payload if os.environ.get("FUZZ_DRY_RUN_NO_PRINT") is None: - print(json.dumps(api_payload, indent=4)) + if self.options.dry_run_output is not None: + with open(self.options.dry_run_output, "w") as f: + f.write(json.dumps(api_payload, indent=4)) + print( + f"Dry run output written to file {self.options.dry_run_output}" + ) + else: + print(json.dumps(api_payload, indent=4)) else: print("Dry run enabled, not printing payload.") return "campaign not started due to --dry-run option" diff --git a/fuzzing_cli/fuzz/foundry_tests.py b/fuzzing_cli/fuzz/foundry_tests.py index e982a69..07870c0 100644 --- a/fuzzing_cli/fuzz/foundry_tests.py +++ b/fuzzing_cli/fuzz/foundry_tests.py @@ -22,6 +22,7 @@ prepare_seed_state as prepare_seed_state_base, ) from fuzzing_cli.fuzz.run import submit_campaign +from fuzzing_cli.util import executable_command LOGGER = logging.getLogger("fuzzing-cli") @@ -46,9 +47,13 @@ def prepare_seed_state( def parse_config() -> Dict[str, Any]: LOGGER.debug("Invoking `forge config` command") try: - result = subprocess.run(["forge", "config"], check=True, stdout=subprocess.PIPE) + result = subprocess.run( + [*executable_command("forge"), "config"], + check=True, + stdout=subprocess.PIPE, + ) except Exception as e: - raise ForgeConfigError() from e + raise ForgeConfigError(e) LOGGER.debug("Invoking `forge config` command succeeded. Parsing config ...") LOGGER.debug(f"Raw forge config {result.stdout.decode()}") return toml.loads(result.stdout.decode()) @@ -61,7 +66,13 @@ def run_build_command(cmd): def compile_tests(build_args): - cmd = ["forge", "build", "--build-info", "--force", *build_args] + cmd = [ + *executable_command("forge"), + "build", + "--build-info", + "--force", + *build_args, + ] LOGGER.debug(f"Invoking `forge build` command ({json.dumps(cmd)})") # we set the environment variables because passing a forge config @@ -85,18 +96,17 @@ def compile_tests(build_args): os.environ["FOUNDRY_CBOR_METADATA"] = "true" run_build_command(cmd) except Exception as e: - raise ForgeCompilationError() from e + raise ForgeCompilationError(e) LOGGER.debug("Invoking `forge build` command succeeded") def collect_tests( - test_dir: Path, match_path: Optional[str] = None, match_contract: Optional[str] = None, ) -> Tuple[List[str], Optional[Dict[str, Set[str]]], Dict[str, Dict[str, List[str]]]]: targets: List[str] = [] target_contracts: Optional[Dict[str, Set[str]]] = None - cmd = ["forge", "test", "--list", "--json"] + cmd = [*executable_command("forge"), "test", "--list", "--json"] if match_path: cmd += ["--match-path", match_path] @@ -112,7 +122,7 @@ def collect_tests( cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) except Exception as e: - raise ForgeCollectTestsError() from e + raise ForgeCollectTestsError(e) LOGGER.debug( f"Invoking `forge test --list --json` command succeeded. Parsing the list ..." ) @@ -208,7 +218,6 @@ def foundry_test( click.echo("🛠️ Collecting tests") targets, target_contracts, tests_list = collect_tests( - test_dir=Path(foundry_config["profile"][profile_name]["test"]), match_path=match_path, match_contract=match_contract, ) diff --git a/fuzzing_cli/fuzz/ide/brownie.py b/fuzzing_cli/fuzz/ide/brownie.py index 8298b77..c55e827 100644 --- a/fuzzing_cli/fuzz/ide/brownie.py +++ b/fuzzing_cli/fuzz/ide/brownie.py @@ -2,7 +2,7 @@ import os from functools import lru_cache from pathlib import Path -from typing import Dict, List, Optional, Tuple +from typing import Dict, List, Optional, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.exceptions import BuildArtifactsError @@ -121,3 +121,7 @@ def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source f"Build artifact did not contain expected key. Contract: {contract}: \n{e}" ) return result_contracts, result_sources + + def unlinked_libraries(self) -> List[Tuple[Contract, Set[str]]]: + # We'll deprecate Brownie in the future, so we don't implement this method + return [] diff --git a/fuzzing_cli/fuzz/ide/dapptools.py b/fuzzing_cli/fuzz/ide/dapptools.py index a8cc2b5..c19d998 100644 --- a/fuzzing_cli/fuzz/ide/dapptools.py +++ b/fuzzing_cli/fuzz/ide/dapptools.py @@ -3,7 +3,7 @@ import os from functools import lru_cache from pathlib import Path -from typing import Dict, List, Optional, Tuple +from typing import Dict, List, Optional, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.exceptions import BuildArtifactsError @@ -167,3 +167,7 @@ def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source ) return result_contracts, result_sources + + def unlinked_libraries(self) -> List[Tuple[Contract, Set[str]]]: + # We'll deprecate Dapptools in the future, so we don't implement this method + return [] diff --git a/fuzzing_cli/fuzz/ide/foundry.py b/fuzzing_cli/fuzz/ide/foundry.py index c0770ce..1c81431 100644 --- a/fuzzing_cli/fuzz/ide/foundry.py +++ b/fuzzing_cli/fuzz/ide/foundry.py @@ -3,7 +3,7 @@ import os from functools import lru_cache from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Optional, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.exceptions import BuildArtifactsError @@ -28,6 +28,7 @@ def __init__( super(FoundryArtifacts, self).__init__( options, build_dir, sources_dir, targets, map_to_original_source ) + self._unlinked_libraries: List[Tuple[Contract, Dict[str, Set[str]]]] = [] @classmethod def get_name(cls) -> str: @@ -132,37 +133,41 @@ def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source for source_file, contracts in self.build_info["output"]["contracts"].items(): result_contracts[source_file] = [] for contract_name, contract in contracts.items(): + unlinked_libs = self.detect_unlinked_libs(contract) + try: - result_contracts[source_file] += [ - { - "sourcePaths": self.get_used_sources( - source_paths, - contract["evm"]["deployedBytecode"]["sourceMap"], - ), - "deployedSourceMap": contract["evm"]["deployedBytecode"][ - "sourceMap" - ], - "deployedBytecode": contract["evm"]["deployedBytecode"][ - "object" - ], - "sourceMap": contract["evm"]["bytecode"]["sourceMap"], - "bytecode": contract["evm"]["bytecode"]["object"], - "contractName": contract_name, - "mainSourceFile": source_file, - "ignoredSources": self.get_ignored_sources( - generated_sources=contract["evm"][ - "deployedBytecode" - ].get("generatedSources"), - source_map=contract["evm"]["deployedBytecode"][ - "sourceMap" - ], - source_ids=source_ids, + contract_obj = { + "sourcePaths": self.get_used_sources( + source_paths, + contract["evm"]["deployedBytecode"]["sourceMap"], + ), + "deployedSourceMap": contract["evm"]["deployedBytecode"][ + "sourceMap" + ], + "deployedBytecode": contract["evm"]["deployedBytecode"][ + "object" + ], + "sourceMap": contract["evm"]["bytecode"]["sourceMap"], + "bytecode": contract["evm"]["bytecode"]["object"], + "contractName": contract_name, + "mainSourceFile": source_file, + "ignoredSources": self.get_ignored_sources( + generated_sources=contract["evm"]["deployedBytecode"].get( + "generatedSources" ), - } - ] + source_map=contract["evm"]["deployedBytecode"]["sourceMap"], + source_ids=source_ids, + ), + } + result_contracts[source_file].append(contract_obj) + if unlinked_libs: + self._unlinked_libraries.append((contract_obj, unlinked_libs)) except KeyError as e: raise BuildArtifactsError( f"Build artifact did not contain expected key. Contract: {contract}: \n{e}" ) return result_contracts, result_sources + + def unlinked_libraries(self) -> List[Tuple[Contract, Dict[str, Set[str]]]]: + return self._unlinked_libraries diff --git a/fuzzing_cli/fuzz/ide/generic.py b/fuzzing_cli/fuzz/ide/generic.py index e1c7996..5cc5730 100644 --- a/fuzzing_cli/fuzz/ide/generic.py +++ b/fuzzing_cli/fuzz/ide/generic.py @@ -1,9 +1,16 @@ import json +import re from abc import ABC, abstractmethod +from collections import defaultdict from copy import deepcopy from functools import lru_cache from pathlib import Path -from typing import Dict, List, Optional, Set, Tuple +from typing import Any, Dict, List, Optional, Set, Tuple, Union + +try: + from typing import Literal +except ImportError: + from typing_extensions import Literal import cbor2 @@ -12,6 +19,10 @@ from fuzzing_cli.fuzz.types import Contract, IDEPayload, Source from fuzzing_cli.util import LOGGER, sol_files_by_directory +ContractKind = Literal["contract", "interface", "library"] + +UNLINKED_LIB_HASH_REGEX = re.compile("__\$(\w{34})\$__") + class IDEArtifacts(ABC): def __init__( @@ -38,7 +49,7 @@ def set_targets(self, targets: List[str]): include = set([]) for target in targets: include.update( - [self.normalize_path(p) for p in sol_files_by_directory(target)] + [self.normalize_path(p) for p in sol_files_by_directory(Path(target))] ) self._include = include @@ -79,7 +90,7 @@ def get_default_sources_dir() -> Path: # pragma: no cover pass @staticmethod - def _get_build_artifacts(build_dir) -> Dict: + def _get_build_artifacts(build_dir: Path) -> Dict: # _get_build_artifacts goes through each .json build file and extracts the Source file it references # A source file may contain several contracts, so it is possible that a given source file # will be pointed to by multiple build artifacts @@ -87,8 +98,6 @@ def _get_build_artifacts(build_dir) -> Dict: # and the value is an array of build artifacts (contracts) build_files_by_source_file = {} - build_dir = Path(build_dir) - if not build_dir.is_dir(): raise BuildArtifactsError("Build directory doesn't exist") @@ -105,7 +114,8 @@ def _get_build_artifacts(build_dir) -> Dict: data = json.loads(child.read_text("utf-8")) - source_path = data["sourcePath"] + source_path = str(Path(data["sourcePath"]).as_posix()) + data["sourcePath"] = source_path if source_path not in build_files_by_source_file: # initialize the array of contracts with a list @@ -196,7 +206,41 @@ def get_contract(self, deployed_bytecode: str) -> Optional[Contract]: return contract return None + @lru_cache(1) + def _contracts_kind_mapping(self) -> Dict[str, Dict[str, ContractKind]]: + _result_contracts, _result_sources = self.process_artifacts() + types_mapping = defaultdict(dict) + for source_file_name, _ in _result_contracts.items(): + # we need to `get` `source_file_name` because it's possible that some source files + # are not present in the sources directory. + ast = _result_sources.get(source_file_name, {}).get("ast") + if not ast: + continue + for node in ast["nodes"]: + if node["nodeType"] != "ContractDefinition": + continue + contract_name = node["name"] + types_mapping[source_file_name][contract_name] = node["contractKind"] + return types_mapping + + def _get_contract_kind(self, contract: Contract) -> ContractKind: + return ( + self._contracts_kind_mapping().get(contract["mainSourceFile"], {}) + # if contract is not found in the mapping, we assume it's a contract + .get(contract["contractName"], "contract") + ) + def include_contract(self, contract: Contract) -> bool: + # if contract is library, we would not include it by default + # (because it will be included by default in the main contract). However, + # there are cases when we need to include libraries as well (because it supposed to be deployed), + # so we need to check `include_library_contracts` option. + if ( + self._get_contract_kind(contract) == "library" + and not self._options.include_library_contracts + ): + return False + if len(self._include) == 0: # for case when targets are not specified return True @@ -212,8 +256,29 @@ def include_contract(self, contract: Contract) -> bool: in self._options.target_contracts[source_path] ): return False + return True + @staticmethod + def fallback_check_unlinked_libraries( + contracts: List[Contract], + ) -> List[Tuple[Contract, Set[str]]]: + unlinked_libraries = [] + for contract in contracts: + libs_hashes = set( + UNLINKED_LIB_HASH_REGEX.findall(contract["bytecode"]) + + UNLINKED_LIB_HASH_REGEX.findall(contract["deployedBytecode"]) + ) + if len(libs_hashes) > 0: + unlinked_libraries.append((contract, libs_hashes)) + return unlinked_libraries + + @abstractmethod + def unlinked_libraries( + self, + ) -> List[Tuple[Contract, Dict[str, Set[str]]]]: # pragma: no cover + pass + @lru_cache(maxsize=1) def fetch_data(self) -> Tuple[List[Contract], Dict[str, Source]]: _result_contracts, _result_sources = self.process_artifacts() @@ -223,15 +288,48 @@ def fetch_data(self) -> Tuple[List[Contract], Dict[str, Source]]: if self.include_contract(contract) ] - used_file_ids = set() + unlinked_libs = self.unlinked_libraries() + + if len(unlinked_libs) > 0: + _details = [] + for contract, libs in unlinked_libs: + for lib_path, lib_names in libs.items(): + for lib_name in lib_names: + _details.append( + f" ◦ Contract: \"{contract['contractName']}\" " + f"Contract path: \"{contract['mainSourceFile']}\" Library: \"{lib_name}\" Library path: \"{lib_path}\"" + ) + + details = "\n".join(_details) + raise BuildArtifactsError( + f"Following contracts have unlinked libraries:\n{details}\n" + f"For more info on library linking please visit " + f"https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking" + ) + else: + unlinked_libs = self.fallback_check_unlinked_libraries(result_contracts) + if len(unlinked_libs) > 0: + details = "\n".join( + [ + f" ◦ Contract: {contract['contractName']} " + f"Contract path: {contract['mainSourceFile']} Library hash: {lib_hash}" + for contract, libs in unlinked_libs + for lib_hash in libs + ] + ) + raise BuildArtifactsError( + f"Following contracts have unlinked libraries:\n{details}\n" + f"Fuzzing CLI provides only library hashes because it wasn't able to one's name and path " + f"from compilation artifacts. Please check your IDE settings to enable full solc compiler output.\n" + f"For more info on library linking please visit " + f"https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking" + ) + + used_files = set() for contract in result_contracts: - used_file_ids.update(contract["sourcePaths"].keys()) + used_files.update(contract["sourcePaths"].values()) - result_sources = { - k: v - for k, v in _result_sources.items() - if str(v["fileIndex"]) in used_file_ids - } + result_sources = {k: v for k, v in _result_sources.items() if k in used_files} return result_contracts, result_sources @abstractmethod @@ -240,15 +338,19 @@ def process_artifacts( ) -> Tuple[Dict[str, List[Contract]], Dict[str, Source]]: # pragma: no cover pass - def normalize_path(self, path: str) -> str: + def normalize_path(self, path: Union[str, Path]) -> Path: if Path(path).is_absolute(): - return path - _path = str(self.sources_dir.parent.joinpath(path)) + return Path(path) + _path = self.sources_dir.parent.joinpath(path) LOGGER.debug( f'Normalizing path "{path}" relative to source_dir. Absolute path "{_path}"' ) return _path + @staticmethod + def as_posix(path: str) -> str: + return str(Path(path).as_posix()) + def validate(self) -> None: if len(self.sources.keys()) == 0 or len(self.contracts) == 0: raise EmptyArtifactsError() @@ -295,3 +397,25 @@ def get_used_sources( for file_id, name in source_paths.items() if file_id in all_file_ids } + + @staticmethod + def detect_unlinked_libs(contract: Dict[str, Any]) -> Dict[str, Set[str]]: + unlinked_libs: Dict[str, Set[str]] = defaultdict(set) + + bytecode_link_ref = contract["evm"]["bytecode"].get("linkReferences", {}) + deployed_bytecode_link_ref = contract["evm"]["deployedBytecode"].get( + "linkReferences", {} + ) + + if bytecode_link_ref: + # here we are collecting all the unlinked libraries for the contract + for lib_file_path in bytecode_link_ref.keys(): + for lib_name in bytecode_link_ref[lib_file_path].keys(): + unlinked_libs[lib_file_path].add(lib_name) + + if deployed_bytecode_link_ref: + for lib_file_path in deployed_bytecode_link_ref.keys(): + for lib_name in deployed_bytecode_link_ref[lib_file_path].keys(): + unlinked_libs[lib_file_path].add(lib_name) + + return unlinked_libs diff --git a/fuzzing_cli/fuzz/ide/hardhat.py b/fuzzing_cli/fuzz/ide/hardhat.py index 337a251..06e2593 100644 --- a/fuzzing_cli/fuzz/ide/hardhat.py +++ b/fuzzing_cli/fuzz/ide/hardhat.py @@ -1,12 +1,34 @@ +import json import os +from collections import defaultdict +from functools import lru_cache, partial from pathlib import Path +from typing import Dict, List, Optional, Set, Tuple -from .foundry import FoundryArtifacts +from fuzzing_cli.fuzz.analytics import Session +from fuzzing_cli.fuzz.exceptions import BuildArtifactsError +from fuzzing_cli.fuzz.types import Contract, Source +from fuzzing_cli.util import get_content_from_file +from . import IDEArtifacts -class HardhatArtifacts(FoundryArtifacts): + +class HardhatArtifacts(IDEArtifacts): add_compilation_hint = False + def __init__( + self, + options, + build_dir: Path, + sources_dir: Path, + targets: Optional[List[str]] = None, + map_to_original_source: bool = False, + ): + super().__init__( + options, build_dir, sources_dir, targets, map_to_original_source + ) + self._unlinked_libraries: List[Tuple[Contract, Dict[str, Set[str]]]] = [] + @classmethod def get_name(cls) -> str: return "hardhat" @@ -24,3 +46,189 @@ def get_default_build_dir() -> Path: @staticmethod def get_default_sources_dir() -> Path: return Path.cwd().joinpath("contracts") + + def _get_build_info(self, build_dir: Path) -> Dict[str, Dict[str, Path]]: + if not build_dir.is_dir(): + raise BuildArtifactsError("Build directory doesn't exist") + + # Here we need to resolve sources_dir relative to build_dir's parent + # because sources_dir can be provided as a relative or an absolute path deeply nested + # in the sources directory (which is `contracts` by default in Hardhat), and we need to + # resolve it to the same level as build_dir, because Hardhat stores build artifacts + # in the `artifacts` directory which is at the same level as the `contracts` directory + built_contracts = build_dir.joinpath( + self.sources_dir.relative_to(build_dir.parent) + ) + + result = defaultdict(dict) + + for child in built_contracts.glob("**/*.dbg.json"): + if not child.is_file(): + continue + + if child.name.startswith( + "." + ): # some hidden file (probably created by OS, especially the macOS) + continue + + source_file_rel_path = str(child.relative_to(build_dir).parent) + contract_name = child.name.split(".dbg.json")[0] + + with open(child, "r") as f: + try: + dbg_info = json.load(f) + except Exception: + continue + # buildInfo is relative to the artifacts directory (with symlinks, like ../), + # so we need to join the path with the build_dir and resolve it + result[source_file_rel_path][contract_name] = child.parent.joinpath( + Path(dbg_info["buildInfo"]) + ).resolve() + + return result + + @property + @lru_cache(maxsize=1) + def build_info(self) -> Dict[str, Dict[str, Path]]: + return self._get_build_info(self.build_dir) + + def get_source(self, source_path: str, sources: Dict[str, Dict[str, str]]) -> str: + if ( + self.map_to_original_source + and Path(self.normalize_path(source_path) + ".original").is_file() + ): + return get_content_from_file(self.normalize_path(source_path) + ".original") + return sources[source_path]["content"] + + @lru_cache(maxsize=1) + def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source]]: + result_contracts = defaultdict(list) + result_sources = {} + + _seen_source_files = defaultdict(set) + # here we reverse the build_info to have a mapping from build_info_path to source_file (along with contracts) + build_info_paths: Dict[Path, Dict[str, List[str]]] = defaultdict( + partial(defaultdict, list) + ) + for source_file_name, contracts in self.build_info.items(): + for contract_name, build_info_path in contracts.items(): + _seen_source_files[source_file_name].add(build_info_path) + build_info_paths[build_info_path][source_file_name].append( + contract_name + ) + + _sources_in_multiple_build_info = {} + for source_file_name, _build_info_paths in _seen_source_files.items(): + if len(_build_info_paths) > 1: + _sources_in_multiple_build_info[source_file_name] = _build_info_paths + + if _sources_in_multiple_build_info: + # This is a special (maybe never occurring) case where the same source file is present in multiple + # build_info files. If this happens, we want to catch that and try to handle it gracefully (for + # proper handling), so for now we need to add them to the function's context to submit to the analytics + # server for further investigation. + # NOTE: this info will be sent to the analytics server only if the user has opted in + Session.set_context( + sources_in_multiple_build_info=_sources_in_multiple_build_info + ) + + project_sources = list(_seen_source_files.keys()) + + # each build_info file has a list of source files and their contracts + # we need to process each build_info_path separately, as each build_info file has its own source_ids + # and ast nodes + for build_info_path, source_files in build_info_paths.items(): + # TODO: handle case when different build_info_path has different source_ids for the same source file + with open(build_info_path, "r") as f: + build_info = json.load(f) + + source_ids: List[int] = [] + source_paths = {} + + for source_name, source in build_info["output"]["sources"].items(): + source_ids.append(source["id"]) + source_paths[str(source["id"])] = source_name + + source_name_path = str(Path(source_name)) + + if ( + source_name_path not in project_sources + and source_name not in result_sources + ): + # If the source_name isn't in project sources, it's some dependency outside the contracts dir. + # Add one to result sources if it wasn't already. + result_sources[source_name] = { + "fileIndex": source["id"], + "source": self.get_source( + source_name, build_info["input"]["sources"] + ), + "ast": source["ast"], + } + + if ( + source_name_path in project_sources + and source_name_path in source_files + ): + # we need to store the source file content and ast node for each source file + # belonging to the current build_info file. Same source file can be present in multiple + # build_info files, so we need to store the source file content and ast only from + # the appropriate build_info file. + result_sources[source_name] = { + "fileIndex": source["id"], + "source": self.get_source( + source_name, build_info["input"]["sources"] + ), + "ast": source["ast"], + } + + for source_file, contracts in source_files.items(): + source_file_posix = self.as_posix(source_file) + for contract_name in contracts: + # solidity build info files use posix paths, and if we are on Windows, we need to + # normalize paths to posix style. + contract = build_info["output"]["contracts"][source_file_posix][ + contract_name + ] + + unlinked_libs = self.detect_unlinked_libs(contract) + + try: + contract_obj = { + "sourcePaths": self.get_used_sources( + source_paths, + contract["evm"]["deployedBytecode"]["sourceMap"], + ), + "deployedSourceMap": contract["evm"]["deployedBytecode"][ + "sourceMap" + ], + "deployedBytecode": contract["evm"]["deployedBytecode"][ + "object" + ], + "sourceMap": contract["evm"]["bytecode"]["sourceMap"], + "bytecode": contract["evm"]["bytecode"]["object"], + "contractName": contract_name, + "mainSourceFile": source_file_posix, + "ignoredSources": self.get_ignored_sources( + generated_sources=contract["evm"][ + "deployedBytecode" + ].get("generatedSources"), + source_map=contract["evm"]["deployedBytecode"][ + "sourceMap" + ], + source_ids=source_ids, + ), + } + result_contracts[source_file_posix].append(contract_obj) + if unlinked_libs: + self._unlinked_libraries.append( + (contract_obj, unlinked_libs) + ) + except KeyError as e: + raise BuildArtifactsError( + f"Build artifact did not contain expected key. Contract: {contract}: \n{e}" + ) + + return result_contracts, result_sources + + def unlinked_libraries(self) -> List[Tuple[Contract, Dict[str, Set[str]]]]: + return self._unlinked_libraries diff --git a/fuzzing_cli/fuzz/ide/truffle.py b/fuzzing_cli/fuzz/ide/truffle.py index 7505432..75701f7 100644 --- a/fuzzing_cli/fuzz/ide/truffle.py +++ b/fuzzing_cli/fuzz/ide/truffle.py @@ -5,7 +5,7 @@ from json import JSONDecodeError from pathlib import Path from subprocess import PIPE, CompletedProcess, TimeoutExpired, run -from typing import Any, Dict, List, Optional, Tuple +from typing import Any, Dict, List, Optional, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.exceptions import BuildArtifactsError @@ -222,7 +222,7 @@ def _get_project_sources(self, project_dir: str) -> Dict[str, List[str]]: for contract in result["project"]["contracts"]: contracts[contract["name"]] = list( map( - lambda x: x["source"]["sourcePath"], + lambda x: str(Path(x["source"]["sourcePath"]).as_posix()), contract["compilation"]["processedSources"], ) ) @@ -235,3 +235,7 @@ def get_default_build_dir() -> Path: @staticmethod def get_default_sources_dir() -> Path: return Path.cwd().joinpath("contracts") + + def unlinked_libraries(self) -> List[Tuple[Contract, Set[str]]]: + # We'll deprecate Truffle in the future, so we don't implement this method + return [] diff --git a/fuzzing_cli/fuzz/quickcheck.py b/fuzzing_cli/fuzz/quickcheck.py index 88b5f7e..c083ce4 100644 --- a/fuzzing_cli/fuzz/quickcheck.py +++ b/fuzzing_cli/fuzz/quickcheck.py @@ -29,7 +29,7 @@ def create_config( no_assert: Optional[bool] = None, ) -> Path: config_path = Path().cwd().joinpath(config_name) - with config_path.open("w") as f: + with config_path.open("w", encoding="utf-8") as f: f.write( generate_yaml( { diff --git a/fuzzing_cli/fuzz/quickcheck_lib/quickcheck.py b/fuzzing_cli/fuzz/quickcheck_lib/quickcheck.py index 1e8231b..8f18108 100644 --- a/fuzzing_cli/fuzz/quickcheck_lib/quickcheck.py +++ b/fuzzing_cli/fuzz/quickcheck_lib/quickcheck.py @@ -2,7 +2,7 @@ import subprocess from functools import lru_cache from pathlib import Path -from typing import Dict, List, Optional, Tuple +from typing import Dict, List, Optional, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.exceptions import QuickCheckError @@ -10,21 +10,18 @@ from fuzzing_cli.fuzz.scribble import ScribbleMixin from fuzzing_cli.fuzz.solidity import SolidityJob from fuzzing_cli.fuzz.types import Contract, Source -from fuzzing_cli.util import get_content_from_file +from fuzzing_cli.util import executable_command, get_content_from_file LOGGER = logging.getLogger("fuzzing-cli") BASE_ADDRESS = "affeaffeaffeaffeaffeaffeaffeaffeaffeaffe" -def annotate_contracts(targets: List[str], scribble_generator_path: str) -> List[Path]: +def annotate_contracts(targets: List[Path], scribble_generator_path: str) -> List[Path]: LOGGER.debug( f"Annotating targets: {str(targets)} using scribble-generator at path: {scribble_generator_path}" ) - _targets = [Path(t) for t in targets] - # for cases when it's complex command. e.g.: npx scribble-generate - _scribble_generator_path = scribble_generator_path.split(" ") - command = _scribble_generator_path + ["--targets"] + targets + command = executable_command(scribble_generator_path) + ["--targets"] + targets annotated_files: List[Path] = [] @@ -38,7 +35,7 @@ def annotate_contracts(targets: List[str], scribble_generator_path: str) -> List f"QuickCheckError: Annotating failed\nDetail: {reason}" ) - for target in _targets: + for target in targets: if target.is_dir(): # find all annotated contracts _changed_files = [x for x in target.rglob("*.sol.sg_original")] _files = [f.parent.joinpath(f.stem) for f in _changed_files] @@ -155,7 +152,7 @@ def get_default_sources_dir() -> Path: # pragma: no cover def arm_contracts(self): ScribbleMixin.instrument_solc_in_place( - file_list=self.targets, + file_list=[Path(t) for t in self.targets], scribble_path=self.scribble_path, remappings=self.remappings, solc_version=self.solc_version, @@ -265,3 +262,6 @@ def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source ) return result_contracts, result_sources + + def unlinked_libraries(self) -> List[Tuple[Contract, Set[str]]]: + return [] diff --git a/fuzzing_cli/fuzz/run.py b/fuzzing_cli/fuzz/run.py index 34d40e9..cf2ba4b 100644 --- a/fuzzing_cli/fuzz/run.py +++ b/fuzzing_cli/fuzz/run.py @@ -231,7 +231,7 @@ def handle_validation_errors( "-s", "--map-to-original-source", is_flag=True, - default=None, + default=False, required=False, help="Map the analyses results to the original source code, instead of the instrumented one. " "This is meant to be used with Scribble.", @@ -242,6 +242,14 @@ def handle_validation_errors( default=False, help="Outputs the data to be sent to the FaaS API without making the request.", ) +@click.option( + "-o", + "--output", + type=click.STRING, + help="Output file for --dry-run output. If not provided, the data will be printed to stdout.", + default=None, + required=False, +) @click.option( "-k", "--key", @@ -271,10 +279,11 @@ def fuzz_run( address: str, more_addresses: str, corpus_target: str, - dry_run, - key, - map_to_original_source, - project, + dry_run: bool, + output: Optional[str], + key: Optional[str], + map_to_original_source: bool, + project: Optional[str], truffle_path: Optional[str], ): """Submit contracts to the Diligence Fuzzing API""" @@ -289,6 +298,7 @@ def fuzz_run( "map_to_original_source": map_to_original_source, "corpus_target": corpus_target, "dry_run": dry_run, + "dry_run_output": output, "key": key, "project": project, "truffle_executable_path": truffle_path, diff --git a/fuzzing_cli/fuzz/scribble.py b/fuzzing_cli/fuzz/scribble.py index 2bd5844..a39654b 100644 --- a/fuzzing_cli/fuzz/scribble.py +++ b/fuzzing_cli/fuzz/scribble.py @@ -1,9 +1,10 @@ import json import os import subprocess +from pathlib import Path from typing import List, Optional, Tuple -from fuzzing_cli.util import sol_files_by_directory +from fuzzing_cli.util import executable_command, sol_files_by_directory SCRIBBLE_ARMING_META_FILE = ".scribble-arming.meta.json" @@ -38,7 +39,8 @@ def instrument_solc_file( :return: The deserialized scribble JSON output object """ process = subprocess.run( - [scribble_path, "--input-mode=source", "--output-mode=json"] + executable_command(scribble_path) + + ["--input-mode=source", "--output-mode=json"] + ([f"--path-remapping={';'.join(remappings)}"] if remappings else []) + [target], stdout=subprocess.PIPE, @@ -51,7 +53,7 @@ def instrument_solc_file( @staticmethod def instrument_solc_in_place( - file_list: List[str], + file_list: List[Path], scribble_path: str, remappings: List[str] = None, solc_version: str = None, @@ -66,7 +68,7 @@ def instrument_solc_in_place( :param solc_version: The solc compiler version to use """ command = [ - scribble_path, + *executable_command(scribble_path), "--arm", "--output-mode=files", f"--instrumentation-metadata-file={SCRIBBLE_ARMING_META_FILE}", @@ -94,7 +96,7 @@ def instrument_solc_in_place( if len(sol_files) == 0: return 1, None, "No files to instrument at provided targets" - command.extend(sol_files) + command.extend([str(f) for f in sol_files]) process = subprocess.run( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE @@ -104,14 +106,14 @@ def instrument_solc_in_place( @staticmethod def disarm_solc_in_place( - file_list: List[str], scribble_path: str + file_list: List[Path], scribble_path: str ) -> Tuple[int, Optional[str], Optional[str]]: """Un-instrument a collection of Solidity files in place. :param scribble_path: The path to the scribble executable """ command = [ - scribble_path, + *executable_command(scribble_path), "--disarm", f"--instrumentation-metadata-file={SCRIBBLE_ARMING_META_FILE}", ] @@ -123,7 +125,7 @@ def disarm_solc_in_place( if len(sol_files) == 0: return 1, None, "No files to instrument at provided targets" - command.extend(sol_files) + command.extend([str(f) for f in sol_files]) process = subprocess.run( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE diff --git a/fuzzing_cli/fuzz/solidity.py b/fuzzing_cli/fuzz/solidity.py index fc9a498..1935eec 100644 --- a/fuzzing_cli/fuzz/solidity.py +++ b/fuzzing_cli/fuzz/solidity.py @@ -54,7 +54,9 @@ def solcx_compile( input_data={ "language": "Solidity", "sources": { - str(target): {"urls": [str(target)]} for target in self.targets + # here we specifically, provide paths in posix-style, even on Windows + str(target.as_posix()): {"urls": [str(target.as_posix())]} + for target in self.targets }, "settings": { "remappings": [r.format(pwd=path) for r in remappings] @@ -79,11 +81,9 @@ def solcx_compile( }, allow_paths=[path], ) - base_path = Path() + base_path = Path().cwd() for source_name, data in result.get("sources", {}).items(): - data["source"] = get_content_from_file( - str(base_path.cwd().joinpath(source_name)) - ) + data["source"] = get_content_from_file(base_path.joinpath(source_name)) for contract_path, data in result.get("contracts", {}).items(): for contract, contract_data in data.items(): diff --git a/fuzzing_cli/fuzz/storage/__init__.py b/fuzzing_cli/fuzz/storage/__init__.py index 3f54177..c37e1cd 100644 --- a/fuzzing_cli/fuzz/storage/__init__.py +++ b/fuzzing_cli/fuzz/storage/__init__.py @@ -1,6 +1,7 @@ import json import os -from typing import Any, Optional +from contextlib import contextmanager +from typing import Any, Dict, Generator, Optional from appdirs import user_config_dir @@ -21,6 +22,14 @@ def get_instance(cls): def set_instance(cls, instance): cls.instance = instance + @contextmanager + def config(self) -> Generator[Dict[str, Any], None, None]: + # this is a context manager that allows you to read and write to the config file. + # it will automatically save the config file when the context manager is exited + _config = self._config + yield _config + self._update_config(_config) + @property def _config(self): try: @@ -37,7 +46,7 @@ def _update_config(self, config): with open(self.path + "/config.json", "w") as f: json.dump(config, f) - def get(self, key: str, default: Any) -> Optional[Any]: + def get(self, key: str, default: Any = None) -> Optional[Any]: return self._config.get(key, default) def set(self, key: str, value: str) -> None: diff --git a/fuzzing_cli/fuzz/utils/__init__.py b/fuzzing_cli/fuzz/utils/__init__.py index fcac9bb..ef7b5f3 100644 --- a/fuzzing_cli/fuzz/utils/__init__.py +++ b/fuzzing_cli/fuzz/utils/__init__.py @@ -1,10 +1,17 @@ +import datetime import logging -from typing import Type +from datetime import timezone +from typing import Any, Dict, Optional, Type +import click +import requests from click import UsageError +from requests import Response -from fuzzing_cli.fuzz.config import FuzzingOptions +import fuzzing_cli +from fuzzing_cli.fuzz.config import AdditionalOptions, FuzzingOptions from fuzzing_cli.fuzz.ide import IDEArtifacts, IDERepository +from fuzzing_cli.fuzz.storage import LocalStorage LOGGER = logging.getLogger("fuzzing-cli") @@ -22,3 +29,81 @@ def detect_ide(options: FuzzingOptions) -> Type[IDEArtifacts]: raise UsageError(f"No supported IDE was detected") LOGGER.debug(f'"{_IDEClass.get_name()}" IDE detected') return _IDEClass + + +def _process_version_info(response: Response, config: Dict[str, Any]) -> None: + result = response.json() + content_tag = response.headers.get("ETag") + latest_version = result["info"]["version"] + + config["latest_version"] = latest_version + config["latest_version_etag"] = content_tag + config["latest_version_checked_at"] = datetime.datetime.now( + timezone.utc + ).timestamp() + + +def get_latest_version() -> Optional[str]: + local_storage = LocalStorage.get_instance() + with local_storage.config() as config: + if ( + config.get("latest_version") is None + or config.get("latest_version_etag") is None + ): + try: + resp = requests.get("https://pypi.org/pypi/diligence-fuzzing/json") + if resp.status_code != 200: + return None + + _process_version_info(resp, config) + except Exception: + return None + elif ( + config.get("latest_version_checked_at") is None + or datetime.datetime.now(timezone.utc).timestamp() + - config["latest_version_checked_at"] + > 86400 + ): + try: + resp = requests.get( + "https://pypi.org/pypi/diligence-fuzzing/json", + headers={"If-None-Match": config["latest_version_etag"]}, + ) + if resp.status_code == 304 or resp.status_code != 200: + # latest version has not changed or failed to get the latest version + # so return the cached version + return config["latest_version"] + _process_version_info(resp, config) + except Exception: + return None + + return config["latest_version"] + + +def check_latest_version(options: AdditionalOptions) -> None: + if not options.check_updates or options.ci_mode: + return + current_version = fuzzing_cli.__version__ + latest_version = get_latest_version() + if latest_version is None: + # failed to get the latest version, so skip the check this time + return + elif latest_version != current_version: + msg = click.style( + f"New version of fuzzing-cli is available: {latest_version}", + "green", + italic=True, + ) + hint = click.style( + "Please upgrade using `pip install --upgrade diligence-fuzzing` to get the latest features", + "green", + bold=True, + ) + click.secho(f"{msg}\n{hint}") + + +__all__ = [ + "detect_ide", + "get_latest_version", + "check_latest_version", +] diff --git a/fuzzing_cli/util.py b/fuzzing_cli/util.py index 8cc0829..80aee60 100644 --- a/fuzzing_cli/util.py +++ b/fuzzing_cli/util.py @@ -1,5 +1,7 @@ import logging import os +import shutil +from pathlib import Path from typing import AnyStr, List import click @@ -7,7 +9,7 @@ LOGGER = logging.getLogger("fuzzing-cli") -def sol_files_by_directory(target_path: AnyStr) -> List: +def sol_files_by_directory(target_path: Path) -> List[Path]: """Gathers all the .sol files inside the target path including sub-directories and returns them as a List. Non .sol files are ignored. @@ -18,7 +20,7 @@ def sol_files_by_directory(target_path: AnyStr) -> List: return files_by_directory(target_path, ".sol") -def files_by_directory(target_path: AnyStr, extension: AnyStr) -> List: +def files_by_directory(target_path: Path, extension: AnyStr) -> List[Path]: """Gathers all the target extension files inside the target path including sub-directories and returns them as a List. Non target extension files are ignored. @@ -28,9 +30,9 @@ def files_by_directory(target_path: AnyStr, extension: AnyStr) -> List: """ target_files = [] # We start by checking if the target_path is potentially a target extension file - if target_path.endswith(extension): + if target_path.name.endswith(extension): # If target extension file we check if the target exists or if it's a user input error - if not os.path.isfile(target_path): + if not target_path.is_file(): raise click.exceptions.UsageError( "Could not find " + str(target_path) @@ -40,7 +42,9 @@ def files_by_directory(target_path: AnyStr, extension: AnyStr) -> List: """If it's a valid target extension file there is no need to search further and we just append it to our list to be returned, removing the .original extension, leaving only the .sol """ - target_files.append(target_path.replace(".original", "")) + target_files.append( + target_path.parent.joinpath(target_path.name.replace(".original", "")) + ) source_dir = os.walk(target_path) for sub_dir in source_dir: if len(sub_dir[2]) > 0: @@ -57,17 +61,44 @@ def files_by_directory(target_path: AnyStr, extension: AnyStr) -> List: LOGGER.debug(f"Skipped for not being a solidity file: {file}") continue - file_name = file_prefix + "/" + file + file_name = Path(file_prefix).joinpath(file) LOGGER.debug(f"Found target extension file: {file_name}") # We remove the .original extension, added by Scribble - target_files.append(file_name.replace(".original", "")) + + target_files.append( + file_name.parent.joinpath(file_name.name.replace(".original", "")) + ) return target_files -def get_content_from_file(file_path: AnyStr) -> AnyStr: +def get_content_from_file(file_path: Path) -> AnyStr: reader = open(file_path) try: source_code = reader.read() finally: reader.close() return source_code + + +def executable_command(exec_path: str) -> List[str]: + """Get the executable command + + :param exec_path: The path to the executable + """ + if Path(exec_path).is_file(): + # it's a full path to the executable + return [exec_path] + + # exec_path can be an executable in the PATH or a command with arguments + resolved_exec_path = shutil.which(exec_path) + if resolved_exec_path is not None: + # it's a command in the PATH resolved by shutil + return [resolved_exec_path] + + if exec_path.count(" ") > 0: + # it's a command with arguments. Split it and return the list + return [c.strip() for c in exec_path.split(" ")] + + # we can't resolve the full executable path, so we assume + # it's a command in the PATH and return the list + return [exec_path] diff --git a/requirements.txt b/requirements.txt index 868df70..9958f97 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,11 +2,11 @@ Click==8.1.3 Jinja2==3.1.2 PyYAML==6.0.1 inquirer==2.10.1 -typing_extensions==4.5.0 +typing_extensions>=4.5.0 ruamel.yaml==0.17.2 requests==2.31.0 -pycryptodome==3.17 -rlp==3.0.0 +pycryptodome==3.20.0 +rlp==4.0.1 py-solc-x==1.1.1 cbor2==5.4.6 toml==0.10.2 diff --git a/requirements_deploy.txt b/requirements_deploy.txt new file mode 100644 index 0000000..af6a231 --- /dev/null +++ b/requirements_deploy.txt @@ -0,0 +1,6 @@ +-r requirements_dev.txt +# move twine and cryptography to a separate file to avoid issues on windows installations +# pin cryptography version to allow installation on PyPy 3.7 (v7.3.9) +cryptography==40.0.2 +# cryptography is a dependency of twine +twine==4.0.2 diff --git a/requirements_dev.txt b/requirements_dev.txt index b076207..eda7636 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -3,10 +3,6 @@ deepdiff==6.3.0 bumpversion==0.6.0 -# pin cryptography version to allow installation on PyPy 3.7 (v7.3.9) -cryptography==40.0.2 -# cryptography is a dependency of twine -twine==4.0.2 black==24.3.0 isort==5.11.0 diff --git a/setup.cfg b/setup.cfg index 8e6e862..5292c79 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.12.1 +current_version = 0.13.3 commit = True tag = True diff --git a/setup.py b/setup.py index 4e766a6..fe5cb05 100644 --- a/setup.py +++ b/setup.py @@ -35,13 +35,13 @@ "Topic :: Utilities", "Typing :: Typed", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: PyPy", ], + python_requires=">=3.8,<4", description="A command line interface for the Diligence Fuzzing API", entry_points={"console_scripts": ["fuzz=fuzzing_cli.cli:cli"]}, install_requires=requirements, @@ -56,6 +56,6 @@ test_suite="tests", tests_require=test_requirements, url="https://github.com/ConsenSys/diligence-fuzzing", - version="0.12.1", + version="0.13.3", zip_safe=False, ) diff --git a/tests/common.py b/tests/common.py index c775538..513fbda 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,4 +1,5 @@ import json +import pathlib import platform import sys from contextlib import contextmanager @@ -66,7 +67,7 @@ def generate_fuzz_config( ): config_file = "analyze:" if remappings: - _data = "\n".join([f' - "{r}"' for r in remappings]) + _data = "\n".join([f" - '{r}'" for r in remappings]) config_file += f"\n remappings:\n{_data}" if solc_version: config_file += f"\n solc-version: {solc_version}" @@ -79,30 +80,32 @@ def generate_fuzz_config( if ide: config_file += f"\n ide: {ide}" if "deployed_contract_address" not in not_include: - config_file += f'\n deployed_contract_address: "{deployed_contract_address}"' + config_file += f"\n deployed_contract_address: '{deployed_contract_address}'" if "number_of_cores" not in not_include: config_file += "\n number_of_cores: 1" if "campaign_name_prefix" not in not_include: - config_file += '\n campaign_name_prefix: "ide_test"' + config_file += "\n campaign_name_prefix: 'ide_test'" if "rpc_url" not in not_include: - config_file += f'\n rpc_url: "http://localhost:9898"' + config_file += f"\n rpc_url: http://localhost:9898" if "faas_url" not in not_include: - config_file += f'\n faas_url: "http://localhost:9899"' + config_file += f"\n faas_url: http://localhost:9899" if "build_directory" not in not_include: if absolute_build_directory: - config_file += f"\n build_directory: {base_path}/{build_directory}" + config_file += f"\n build_directory: '{pathlib.Path(base_path).joinpath(build_directory)}'" else: - config_file += f"\n build_directory: {build_directory}" + config_file += f"\n build_directory: '{pathlib.Path(build_directory)}'" if "sources_directory" not in not_include: if absolute_sources_directory: - config_file += f"\n sources_directory: {base_path}/{sources_directory}" + config_file += f"\n sources_directory: '{pathlib.Path(base_path).joinpath(sources_directory)}'" else: - config_file += f"\n sources_directory: {sources_directory}" + config_file += f"\n sources_directory: '{pathlib.Path(sources_directory)}'" if "targets" not in not_include: if absolute_targets: - _data = "\n".join([f' - "{base_path}/{t}"' for t in targets]) + _data = "\n".join( + [f" - '{pathlib.Path(base_path).joinpath(t)}'" for t in targets] + ) else: - _data = "\n".join([f' - "{t}"' for t in targets]) + _data = "\n".join([f" - '{pathlib.Path(t)}'" for t in targets]) config_file += f"\n targets:\n{_data}" if project is not None: @@ -124,12 +127,12 @@ def generate_fuzz_config( config_file += f"\n suggested_seed_seqs:{mapping_str}" if additional_addresses: - _data = "\n".join([f' - "{a}"' for a in additional_addresses]) + _data = "\n".join([f" - '{a}'" for a in additional_addresses]) config_file += f"\n additional_contracts_addresses:\n{_data}" if add_refresh_token: config_file += ( - f'\n refresh_token: "dGVzdC1jbGllbnQtMTIzOjpleGFtcGxlLXVzLmNvbQ==::2"' + f"\n refresh_token: 'dGVzdC1jbGllbnQtMTIzOjpleGFtcGxlLXVzLmNvbQ==::2'" ) if time_limit: config_file += f"\n time_limit: 15min" @@ -148,7 +151,7 @@ def generate_fuzz_config( if chain_id is not None: if string_chain_id: - config_file += f'\n chain_id: "{chain_id}"' + config_file += f"\n chain_id: '{chain_id}'" else: config_file += ( f"\n chain_id: {chain_id}" # hex will be converted to number @@ -263,3 +266,20 @@ def construct_output( def omit_keys(d: Dict[str, any], keys: List[str]) -> Dict[str, any]: return {k: v for k, v in d.items() if k not in keys} + + +def _construct_scribble_error_message(underlying_error: str) -> str: + return f"""Error: Scribble not installed or configured correctly. + +It appears that Scribble is not installed or configured correctly on your system. + +You may need to: + - install Scribble + - ensure that the Scribble executable is in your PATH + - consider providing Scribble executable path using `--scribble-path` argument to command or set it in the config (https://github.com/Consensys/diligence-fuzzing/blob/master/docs/configuration.md#arming-configuration-options) + - Note: Windows users may need to use the full path to the Scribble executable (e.g. "node .\\node_modules\\eth-scribble\\dist\\bin\\scribble.js") + +Please ensure that Scribble is installed and configured correctly before attempting to run the fuzzer again. If the issue persists, please consult the Scribble documentation at https://docs.scribble.codes/tool/installation. + +Underlying error: {underlying_error} +""" diff --git a/tests/conftest.py b/tests/conftest.py index 7a6c350..b455876 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -72,6 +72,32 @@ def hardhat_fuzzing_lessons_project(tmp_path): os.chdir(tmp_path) +@pytest.fixture() +def hardhat_project_with_unlinked_libraries(tmp_path): + with tarfile.open( + Path(__file__).parent.joinpath( + "testdata", "hardhat_project_with_unlinked_libraries", "artifacts.tar.gz" + ) + ) as f: + f.extractall(tmp_path) + os.chdir(tmp_path) + yield { + "ide": "hardhat", + "build_directory": "artifacts", + "sources_directory": "contracts", + "targets": [ + "contracts/ABC.sol", + "contracts/Bar.sol", + "contracts/Foo.sol", + ], + "deployed_contract_address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", + "additional_addresses": [ + "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", + "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", + ], + } + + @pytest.fixture() def hardhat_project(tmp_path): with tarfile.open( @@ -220,6 +246,28 @@ def foundry_project(tmp_path): } +@pytest.fixture() +def foundry_project_with_unlinked_libraries(tmp_path): + with tarfile.open( + Path(__file__).parent.joinpath( + "testdata", "foundry_project_with_unlinked_libraries", "artifacts.tar.gz" + ) + ) as f: + f.extractall(tmp_path) + os.chdir(tmp_path) + yield { + "ide": "foundry", + "build_directory": "out", + "sources_directory": "src", + "targets": ["src/Foo.sol", "src/Bar.sol", "src/ABC.sol"], + "deployed_contract_address": "0x0c91f9338228f19315BE34E5CA5307DF586CBD99", + "additional_addresses": [ + "0x9B92063B8B94A9EF8b5fDE3Df8D375B39bC9fC10", + "0x694D08b77D2499E161635005Fd4A77233cedD761", + ], + } + + @pytest.fixture() def foundry_tests_project(tmp_path): with tarfile.open( @@ -282,3 +330,17 @@ def no_analytics(monkeypatch): @pytest.fixture() def ci_mode(monkeypatch): monkeypatch.setenv("FUZZ_CI_MODE", "true") + + +@pytest.fixture(autouse=True) +def no_updates_check(monkeypatch): + monkeypatch.setenv("FUZZ_CHECK_UPDATES", "false") + yield + monkeypatch.delenv("FUZZ_CHECK_UPDATES", raising=False) + + +@pytest.fixture() +def allow_updates_check(monkeypatch): + monkeypatch.setenv("FUZZ_CHECK_UPDATES", "true") + yield + monkeypatch.delenv("FUZZ_CHECK_UPDATES", raising=False) diff --git a/tests/test_check_updates.py b/tests/test_check_updates.py new file mode 100644 index 0000000..5f30d5e --- /dev/null +++ b/tests/test_check_updates.py @@ -0,0 +1,149 @@ +import datetime + +from click.testing import CliRunner +from requests_mock import mock + +from fuzzing_cli import __version__ as current_version +from fuzzing_cli.cli import cli +from fuzzing_cli.fuzz.storage import LocalStorage +from tests.common import write_config + + +def test_check_updates( + api_key, tmp_path, fake_process, scribble_project, allow_updates_check +): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), **scribble_project + ) + fake_process.register_subprocess([fake_process.any()], stdout="", occurrences=10) + with mock() as m: + m.register_uri( + "GET", + "https://pypi.org/pypi/diligence-fuzzing/json", + json={"info": {"version": "0.0.1"}}, + headers={"ETag": "test-123"}, + ) + runner = CliRunner() + runner.invoke(cli, ["arm"]) + # check for updates should not happen more than once in 1 day even if there are new versions + result = runner.invoke(cli, ["arm"]) + + assert m.call_count == 1 + + assert result.exit_code == 0 + assert result.output == ( + "New version of fuzzing-cli is available: 0.0.1\n" + "Please upgrade using `pip install --upgrade diligence-fuzzing` " + "to get the latest features\n\n" + ) + + +def test_check_updates_etag( + api_key, tmp_path, fake_process, scribble_project, allow_updates_check +): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), **scribble_project + ) + fake_process.register_subprocess([fake_process.any()], stdout="", occurrences=10) + LocalStorage.get_instance().set("latest_version", "0.0.1") + LocalStorage.get_instance().set("latest_version_etag", "test-123") + LocalStorage.get_instance().set( + "latest_version_checked_at", + ( + datetime.datetime.now(datetime.timezone.utc) + - datetime.timedelta(days=1, seconds=1) + ).timestamp(), + ) + with mock() as m: + m.register_uri( + "GET", + "https://pypi.org/pypi/diligence-fuzzing/json", + status_code=304, # not modified + ) + runner = CliRunner() + result = runner.invoke(cli, ["arm"]) + + assert m.call_count == 1 + + assert result.exit_code == 0 + assert result.output == ( + "New version of fuzzing-cli is available: 0.0.1\n" + "Please upgrade using `pip install --upgrade diligence-fuzzing` " + "to get the latest features\n\n" + ) + + assert LocalStorage.get_instance().get("latest_version") == "0.0.1" + assert LocalStorage.get_instance().get("latest_version_etag") == "test-123" + + +def test_check_updates_etag_current_version( + api_key, tmp_path, fake_process, scribble_project, allow_updates_check +): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), **scribble_project + ) + fake_process.register_subprocess([fake_process.any()], stdout="", occurrences=10) + LocalStorage.get_instance().set("latest_version", current_version) + LocalStorage.get_instance().set("latest_version_etag", "test-123") + LocalStorage.get_instance().set( + "latest_version_checked_at", + ( + datetime.datetime.now(datetime.timezone.utc) + - datetime.timedelta(days=1, seconds=1) + ).timestamp(), + ) + with mock() as m: + m.register_uri( + "GET", + "https://pypi.org/pypi/diligence-fuzzing/json", + status_code=304, # not modified + ) + runner = CliRunner() + result = runner.invoke(cli, ["arm"]) + + assert m.call_count == 1 + + assert result.exit_code == 0 + assert result.output == "\n" + + assert LocalStorage.get_instance().get("latest_version") == current_version + assert LocalStorage.get_instance().get("latest_version_etag") == "test-123" + + +def test_check_updates_etag_new_version( + api_key, tmp_path, fake_process, scribble_project, allow_updates_check +): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), **scribble_project + ) + fake_process.register_subprocess([fake_process.any()], stdout="", occurrences=10) + LocalStorage.get_instance().set("latest_version", "0.0.1") + LocalStorage.get_instance().set("latest_version_etag", "test-123") + LocalStorage.get_instance().set( + "latest_version_checked_at", + ( + datetime.datetime.now(datetime.timezone.utc) + - datetime.timedelta(days=1, seconds=1) + ).timestamp(), + ) + with mock() as m: + m.register_uri( + "GET", + "https://pypi.org/pypi/diligence-fuzzing/json", + json={"info": {"version": "0.0.2"}}, + headers={"ETag": "test-456"}, + ) + runner = CliRunner() + result = runner.invoke(cli, ["arm"]) + + assert m.call_count == 1 + + assert result.exit_code == 0 + assert result.output == ( + "New version of fuzzing-cli is available: 0.0.2\n" + "Please upgrade using `pip install --upgrade diligence-fuzzing` " + "to get the latest features\n\n" + ) + + assert LocalStorage.get_instance().get("latest_version") == "0.0.2" + assert LocalStorage.get_instance().get("latest_version_etag") == "test-456" diff --git a/tests/test_common_errors.py b/tests/test_common_errors.py new file mode 100644 index 0000000..92eead6 --- /dev/null +++ b/tests/test_common_errors.py @@ -0,0 +1,157 @@ +import json +from unittest.mock import Mock, patch + +import pytest +from click.testing import CliRunner +from pytest_lazyfixture import lazy_fixture + +from fuzzing_cli.cli import cli +from fuzzing_cli.fuzz.faas import FaasClient +from tests.common import get_test_case, mocked_rpc_client, write_config + + +@pytest.mark.parametrize( + "ide,unlinked_contracts", + [ + ( + lazy_fixture("hardhat_project_with_unlinked_libraries"), + [ + ("TestLib", "contracts/TestLib.sol", "Bar", "contracts/Bar.sol"), + ("TestLib", "contracts/TestLib.sol", "Foo", "contracts/Foo.sol"), + ], + ), + ( + lazy_fixture("foundry_project_with_unlinked_libraries"), + [ + ("TestLib", "src/lib/TestLib.sol", "ABC", "src/ABC.sol"), + ("TestLib", "src/lib/TestLib.sol", "Bar", "src/Bar.sol"), + ], + ), + ], +) +def test_unlinked_libraries(api_key, tmp_path, ide, unlinked_contracts): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", + base_path=str(tmp_path), + **ide, + ) + blocks = get_test_case( + f"testdata/{ide['ide']}_project_with_unlinked_libraries/blocks.json" + ) + contracts = get_test_case( + f"testdata/{ide['ide']}_project_with_unlinked_libraries/contracts.json" + ) + codes = { + contract["address"].lower(): contract["deployedBytecode"] + for contract in contracts.values() + } + + with mocked_rpc_client(blocks, codes), patch.object( + FaasClient, "start_faas_campaign" + ) as start_faas_campaign_mock, patch.object( + FaasClient, "generate_campaign_name", new=Mock(return_value="test-campaign-1") + ): + campaign_id = "560ba03a-8744-4da6-aeaa-a62568ccbf44" + start_faas_campaign_mock.return_value = campaign_id + runner = CliRunner() + result = runner.invoke(cli, ["run"]) + + details = "\n".join( + [ + f' ◦ Contract: "{contract_name}" Contract path: "{contract_path}" ' + f'Library: "{lib}" Library path: "{lib_path}"' + for lib, lib_path, contract_name, contract_path in unlinked_contracts + ] + ) + + assert result.exit_code == 1 + assert ( + f"Error: Following contracts have unlinked libraries:\n{details}\n" + f"For more info on library linking please visit " + f"https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking\n" + == result.output + ) + + +@pytest.mark.parametrize( + "ide,build_info_path,unlinked_contracts", + [ + ( + lazy_fixture("hardhat_project_with_unlinked_libraries"), + "artifacts/build-info/231cb8d74cc32d8d28f8278fd2bd34a6.json", + [ + ("154d8911a162d9fe8513835584d2c10b72", "Bar", "contracts/Bar.sol"), + ("154d8911a162d9fe8513835584d2c10b72", "Foo", "contracts/Foo.sol"), + ], + ), + ( + lazy_fixture("foundry_project_with_unlinked_libraries"), + "out/build-info/e9a554f23646e3a59be290d9d1a021fb.json", + [ + ("a6697e97c84a48a247184558696f600b66", "ABC", "src/ABC.sol"), + ("a6697e97c84a48a247184558696f600b66", "Bar", "src/Bar.sol"), + ], + ), + ], +) +def test_unlinked_libraries_detection_fallback( + api_key, tmp_path, ide, build_info_path, unlinked_contracts +): + write_config( + config_path=f"{tmp_path}/.fuzz.yml", + base_path=str(tmp_path), + **ide, + ) + + # here we purposefully remove the linkReferences from the build-info file + # to force the fallback detection of unlinked libraries + with open(f"{tmp_path}/{build_info_path}", "r") as f: + build_info = json.load(f) + for p in build_info["output"]["contracts"].keys(): + for contract_name in build_info["output"]["contracts"][p].keys(): + build_info["output"]["contracts"][p][contract_name]["evm"]["bytecode"][ + "linkReferences" + ] = {} + build_info["output"]["contracts"][p][contract_name]["evm"][ + "deployedBytecode" + ]["linkReferences"] = {} + with open(f"{tmp_path}/{build_info_path}", "w") as f: + json.dump(build_info, f) + + blocks = get_test_case( + f"testdata/{ide['ide']}_project_with_unlinked_libraries/blocks.json" + ) + contracts = get_test_case( + f"testdata/{ide['ide']}_project_with_unlinked_libraries/contracts.json" + ) + codes = { + contract["address"].lower(): contract["deployedBytecode"] + for contract in contracts.values() + } + + with mocked_rpc_client(blocks, codes), patch.object( + FaasClient, "start_faas_campaign" + ) as start_faas_campaign_mock, patch.object( + FaasClient, "generate_campaign_name", new=Mock(return_value="test-campaign-1") + ): + campaign_id = "560ba03a-8744-4da6-aeaa-a62568ccbf44" + start_faas_campaign_mock.return_value = campaign_id + runner = CliRunner() + result = runner.invoke(cli, ["run"]) + + details = "\n".join( + [ + f" ◦ Contract: {contract_name} Contract path: {contract_path} Library hash: {lib_hash}" + for lib_hash, contract_name, contract_path in unlinked_contracts + ] + ) + + assert result.exit_code == 1 + assert ( + f"Error: Following contracts have unlinked libraries:\n{details}\n" + f"Fuzzing CLI provides only library hashes because it wasn't able to one's name and path " + f"from compilation artifacts. Please check your IDE settings to enable full solc compiler output.\n" + f"For more info on library linking please visit " + f"https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking\n" + == result.output + ) diff --git a/tests/test_foundry_tests.py b/tests/test_foundry_tests.py index 8fb1b22..5fcf456 100644 --- a/tests/test_foundry_tests.py +++ b/tests/test_foundry_tests.py @@ -6,9 +6,10 @@ from fuzzing_cli.cli import cli from fuzzing_cli.fuzz.faas import FaasClient +from fuzzing_cli.util import executable_command from tests.common import assert_is_equal, get_test_case, write_config -empty_build_command = ["forge", "build", "--build-info", "--force"] +empty_build_command = [*executable_command("forge"), "build", "--build-info", "--force"] build_command = empty_build_command + [ "--contracts", @@ -30,7 +31,7 @@ def filter_keys(d: Dict[str, Any], keys: List[str]) -> Dict[str, Any]: [ ( None, - ["forge", "build", "--build-info", "--force"], + [*executable_command("forge"), "build", "--build-info", "--force"], [], lambda p: p["corpus"], lambda p: p["contracts"], @@ -130,11 +131,11 @@ def test_foundry_tests( assert ( foundry_test_list_mock.call_count( - ["forge", "test", "--list", "--json"] + list_args + [*executable_command("forge"), "test", "--list", "--json"] + list_args ) == 1 ) - assert foundry_config_mock.call_count(["forge", "config"]) == 1 + assert foundry_config_mock.call_count([*executable_command("forge"), "config"]) == 1 assert foundry_build_mock.calls[0] == build_cmd assert foundry_build_mock.call_count(build_cmd) == 1 diff --git a/tests/test_fuzz_arm.py b/tests/test_fuzz_arm.py index 7b397ef..3e93a0e 100644 --- a/tests/test_fuzz_arm.py +++ b/tests/test_fuzz_arm.py @@ -1,4 +1,6 @@ +import shutil import subprocess +from pathlib import Path from typing import List, Optional from unittest.mock import Mock, patch @@ -6,7 +8,12 @@ from click.testing import CliRunner from fuzzing_cli.cli import cli -from tests.common import assert_is_equal, write_config +from fuzzing_cli.util import executable_command +from tests.common import ( + _construct_scribble_error_message, + assert_is_equal, + write_config, +) @pytest.mark.parametrize( @@ -37,12 +44,12 @@ def test_fuzz_arm( params_in_config: bool, ): cmd = [ - "scribble", + *executable_command("scribble"), "--arm", "--output-mode=files", "--instrumentation-metadata-file=.scribble-arming.meta.json", fake_process.any(), - f"{tmp_path}/contracts/VulnerableToken.sol", + str(Path(f"{tmp_path}/contracts/VulnerableToken.sol")), ] if params_in_config: write_config( @@ -100,7 +107,7 @@ def test_fuzz_arm( @patch("pathlib.Path.exists", new=Mock(return_value=True)) -def test_fuzz_arm_no_targets(tmp_path, scribble_project, fake_process, ci_mode): +def test_fuzz_arm_no_targets(tmp_path: Path, scribble_project, fake_process, ci_mode): write_config( config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), @@ -117,7 +124,7 @@ def test_fuzz_arm_no_targets(tmp_path, scribble_project, fake_process, ci_mode): assert ( result.output == "⚠️ Targets were not provided but the following files can " "be set as targets to be armed:\n" - f" ◦ {tmp_path}/contracts/Migrations.sol\n ◦ {tmp_path}/contracts/VulnerableToken.sol\n" + f" ◦ {tmp_path.joinpath('contracts/Migrations.sol')}\n ◦ {tmp_path.joinpath('contracts/VulnerableToken.sol')}\n" "Error: ScribbleError:\nThere was an error instrumenting your contracts with scribble:\n" "No files to instrument at provided targets\n" ) @@ -152,8 +159,8 @@ def test_fuzz_arm_process_error(tmp_path, scribble_project, fake_process, error: assert result.exit_code == 1 assert ( - f"Error: ScribbleError:\nThere was an error instrumenting your contracts with scribble:\n{error}" - in result.output + f"Error: ScribbleError:\nThere was an error instrumenting your contracts with scribble:\n{error}\n" + == result.output ) assert len(fake_process.calls) == 1 @@ -191,16 +198,12 @@ def cb(*args, **kwargs): run_mock.side_effect = cb result = runner.invoke(cli, command) - assert ( - f"Scribble not found at path \"{(scribble_path or 'scribble')}\". " - f"Please provide scribble path using either `--scribble-path` option to `fuzz arm` command " - f"or set one in config" in result.output - ) - assert result.exit_code == 2 + assert _construct_scribble_error_message(f"executable not found\n") in result.output + assert result.exit_code == 1 @patch("pathlib.Path.exists", new=Mock(return_value=True)) -def test_fuzz_arm_folder_targets(tmp_path, scribble_project, fake_process): +def test_fuzz_arm_folder_targets(tmp_path: Path, scribble_project, fake_process): write_config( config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), @@ -218,14 +221,14 @@ def test_fuzz_arm_folder_targets(tmp_path, scribble_project, fake_process): assert_is_equal( fake_process.calls[0], [ - "scribble", + *executable_command("scribble"), "--arm", "--output-mode=files", "--instrumentation-metadata-file=.scribble-arming.meta.json", "--debug-events", "--no-assert", - f"{tmp_path}/contracts/Migrations.sol", - f"{tmp_path}/contracts/VulnerableToken.sol", + f"{tmp_path.joinpath('contracts/Migrations.sol')}", + f"{tmp_path.joinpath('contracts/VulnerableToken.sol')}", ], ) @@ -246,8 +249,8 @@ def test_fuzz_arm_empty_folder_targets(tmp_path, scribble_project, fake_process) assert result.exit_code == 1 assert ( f"Error: ScribbleError:\nThere was an error instrumenting your contracts with scribble:\n" - f"No files to instrument at provided targets" - ) + f"No files to instrument at provided targets\n" + ) == result.output assert len(fake_process.calls) == 0 @@ -269,12 +272,12 @@ def test_fuzz_arm_smart_mode( monkeypatch.setenv("FUZZ_CI_MODE", "true" if ci_mode_flag else "false") cmd = [ - "scribble", + *executable_command("scribble"), "--arm", "--output-mode=files", "--instrumentation-metadata-file=.scribble-arming.meta.json", fake_process.any(), - f"{tmp_path}/contracts/VulnerableToken.sol", + f"{tmp_path.joinpath('contracts/VulnerableToken.sol')}", ] out = ( @@ -289,8 +292,8 @@ def test_fuzz_arm_smart_mode( if not smart_mode: suggestion = ( "⚠️ Targets were not provided but the following files can be set as targets to be armed:\n" - f" ◦ {tmp_path}/contracts/Migrations.sol\n" - f" ◦ {tmp_path}/contracts/VulnerableToken.sol" + f" ◦ {tmp_path.joinpath('contracts/Migrations.sol')}\n" + f" ◦ {tmp_path.joinpath('contracts/VulnerableToken.sol')}" ) warnings = ( "Warning: Build directory not specified. Using IDE defaults. " diff --git a/tests/test_fuzz_disarm.py b/tests/test_fuzz_disarm.py index 91db086..75ee4a9 100644 --- a/tests/test_fuzz_disarm.py +++ b/tests/test_fuzz_disarm.py @@ -1,4 +1,5 @@ import subprocess +from pathlib import Path from typing import Optional from unittest.mock import Mock, patch @@ -6,16 +7,21 @@ from click.testing import CliRunner from fuzzing_cli.cli import cli -from tests.common import assert_is_equal, write_config +from fuzzing_cli.util import executable_command +from tests.common import ( + _construct_scribble_error_message, + assert_is_equal, + write_config, +) @patch("pathlib.Path.exists", new=Mock(return_value=True)) -def test_fuzz_disarm(tmp_path, scribble_project, fake_process): +def test_fuzz_disarm(tmp_path: Path, scribble_project, fake_process): cmd = [ - "scribble", + *executable_command("scribble"), "--disarm", "--instrumentation-metadata-file=.scribble-arming.meta.json", - f"{tmp_path}/contracts/VulnerableToken.sol", + f"{tmp_path.joinpath('contracts/VulnerableToken.sol')}", ] write_config( config_path=f"{tmp_path}/.fuzz.yml", base_path=str(tmp_path), **scribble_project @@ -82,8 +88,8 @@ def test_fuzz_disarm_process_error( assert result.exit_code == 1 assert ( - f"Error: ScribbleError:\nThere was an error un-instrumenting your contracts with scribble:\n{error}" - in result.output + f"Error: ScribbleError:\nThere was an error un-instrumenting your contracts with scribble:\n{error}\n" + == result.output ) assert len(fake_process.calls) == 1 @@ -121,12 +127,8 @@ def cb(*args, **kwargs): run_mock.side_effect = cb result = runner.invoke(cli, command) - assert ( - f"Scribble not found at path \"{(scribble_path or 'scribble')}\". " - f"Please provide scribble path using either `--scribble-path` option to `fuzz disarm` command " - f"or set one in config" in result.output - ) - assert result.exit_code == 2 + assert _construct_scribble_error_message("executable not found\n") in result.output + assert result.exit_code == 1 @patch("pathlib.Path.exists", new=Mock(return_value=True)) @@ -148,11 +150,11 @@ def test_fuzz_disarm_folder_targets(tmp_path, scribble_project, fake_process): assert_is_equal( fake_process.calls[0], [ - "scribble", + *executable_command("scribble"), "--disarm", "--instrumentation-metadata-file=.scribble-arming.meta.json", - f"{tmp_path}/contracts/Migrations.sol", - f"{tmp_path}/contracts/VulnerableToken.sol", + f"{tmp_path.joinpath('contracts/Migrations.sol')}", + f"{tmp_path.joinpath('contracts/VulnerableToken.sol')}", ], ) diff --git a/tests/test_fuzz_generate_config.py b/tests/test_fuzz_generate_config.py index 7a2d153..adffaec 100644 --- a/tests/test_fuzz_generate_config.py +++ b/tests/test_fuzz_generate_config.py @@ -31,7 +31,6 @@ def test_generate_config(tmp_path, hardhat_project): - os.chdir(tmp_path) actions = ["y", "n", "y", "n", "y", "http://localhost:1111/", "4", "\n"] runner = CliRunner() result = runner.invoke(cli, ["config", "generate"], input="\n".join(actions)) @@ -190,13 +189,13 @@ def test_determine_targets(tmp_path, truffle_project): inquirer_prompt.assert_not_called() assert click_confirm.call_count == 2 assert click_confirm.call_args_list[0][0] == ( - f"{QM} Is {style(f'{tmp_path}/contracts', fg='yellow')} correct directory to fuzz contracts from?", + f"{QM} Is {style(tmp_path.joinpath('contracts'), fg='yellow')} correct directory to fuzz contracts from?", ) assert click_confirm.call_args_list[1][0] == ( f"{QM} Directories contain source files. Do you want to select them individually?", ) - assert targets == [f"{tmp_path}/contracts"] + assert targets == [tmp_path.joinpath("contracts")] @pytest.mark.parametrize( @@ -214,7 +213,9 @@ def test_determine_targets_manual_targets_selection( ): custom_targets_processed = ( [ - t.strip() if t.strip().startswith("/") else f"{tmp_path}/{t.strip()}" + Path(t.strip()) + if Path(t.strip()).is_absolute() + else tmp_path.joinpath(t.strip()) for t in custom_targets.split(",") ] if custom_targets @@ -243,15 +244,27 @@ def test_determine_targets_manual_targets_selection( "targets", message="Please select target files (SPACE to select, RETURN to finish)", choices=[ - ("contracts/ABC.sol", f"{tmp_path}/contracts/ABC.sol"), - ("contracts/Bar.sol", f"{tmp_path}/contracts/Bar.sol"), - ("contracts/Foo.sol", f"{tmp_path}/contracts/Foo.sol"), - ("contracts/Migrations.sol", f"{tmp_path}/contracts/Migrations.sol"), + ( + str(Path("contracts/ABC.sol")), + tmp_path.joinpath("contracts/ABC.sol"), + ), + ( + str(Path("contracts/Bar.sol")), + tmp_path.joinpath("contracts/Bar.sol"), + ), + ( + str(Path("contracts/Foo.sol")), + tmp_path.joinpath("contracts/Foo.sol"), + ), + ( + str(Path("contracts/Migrations.sol")), + tmp_path.joinpath("contracts/Migrations.sol"), + ), ], ) assert click_confirm.call_count == 2 assert click_confirm.call_args_list[0][0] == ( - f"{QM} Is {style(f'{tmp_path}/contracts', fg='yellow')} correct directory to fuzz contracts from?", + f"{QM} Is {style(tmp_path.joinpath('contracts'), fg='yellow')} correct directory to fuzz contracts from?", ) assert click_confirm.call_args_list[1][0] == ( f"{QM} Directories contain source files. Do you want to select them individually?", @@ -270,8 +283,8 @@ def test_determine_targets_manual_targets_selection( else: click_secho.assert_not_called() - assert targets == [f"{tmp_path}/{t}" for t in (targets_return or [])] + [ - t for t in custom_targets_processed if t.endswith(".sol") + assert targets == [tmp_path.joinpath(t) for t in (targets_return or [])] + [ + t for t in custom_targets_processed if t.name.endswith(".sol") ] @@ -290,7 +303,7 @@ def test_determine_targets_source_dir_not_exists( assert click_confirm.call_count == 2 assert click_confirm.call_args_list[0][0] == ( - f"{QM} We couldn't find any contracts at {style(f'{tmp_path}/contracts', fg='yellow')}. " + f"{QM} We couldn't find any contracts at {style(tmp_path.joinpath('contracts'), fg='yellow')}. " f"Have you configured a custom contracts sources directory?", ) assert click_confirm.call_args_list[1][0] == ( @@ -304,7 +317,7 @@ def test_determine_targets_source_dir_not_exists( else: click_prompt.assert_not_called() - assert targets == [f"{tmp_path}/contracts"] + assert targets == [tmp_path.joinpath("contracts")] @pytest.mark.parametrize("custom_build_dir", ["build_test", None]) @@ -333,7 +346,7 @@ def test_determine_build_dir( build_dir = determine_build_dir(ide["ide"]) - bds = style(f'{tmp_path}/{ide["build_directory"]}', fg="yellow") + bds = style(tmp_path.joinpath(ide["build_directory"]), fg="yellow") assert click_confirm.call_count == 1 assert click_confirm.call_args_list[0][0] == ( f"{QM} Is {bds} correct build directory for the project?" @@ -347,9 +360,9 @@ def test_determine_build_dir( click_prompt.assert_not_called() assert ( - build_dir == f"{tmp_path}/{custom_build_dir}" + build_dir == str(tmp_path.joinpath(custom_build_dir)) if custom_build_dir - else f"{tmp_path}/{ide['build_directory']}" + else str(tmp_path.joinpath(ide["build_directory"])) ) @@ -393,22 +406,22 @@ def test_determine_campaign_name(tmp_path: Path, truffle_project): def test_determine_sources_dir(tmp_path, truffle_project): assert determine_sources_dir([]) is None - assert determine_sources_dir([str(tmp_path.joinpath("contracts"))]) == str( + assert determine_sources_dir([tmp_path.joinpath("contracts")]) == ( tmp_path.joinpath("contracts") ) assert determine_sources_dir( - [str(tmp_path.joinpath("contracts", "ABC.sol"))] - ) == str(tmp_path.joinpath("contracts")) + [tmp_path.joinpath("contracts", "ABC.sol")] + ) == tmp_path.joinpath("contracts") assert determine_sources_dir( [ - str(tmp_path.joinpath("contracts")), - str(tmp_path.joinpath("contracts", "Foo.sol")), - str(tmp_path.joinpath("contracts", "ABC.sol")), + tmp_path.joinpath("contracts"), + tmp_path.joinpath("contracts", "Foo.sol"), + tmp_path.joinpath("contracts", "ABC.sol"), ] - ) == str(tmp_path.joinpath("contracts")) + ) == tmp_path.joinpath("contracts") assert determine_sources_dir( [ - str(tmp_path.joinpath("contracts", "Foo.sol")), - str(tmp_path.joinpath("contracts", "Bar.sol")), + tmp_path.joinpath("contracts", "Foo.sol"), + tmp_path.joinpath("contracts", "Bar.sol"), ] - ) == str(tmp_path.joinpath("contracts")) + ) == tmp_path.joinpath("contracts") diff --git a/tests/test_fuzz_login.py b/tests/test_fuzz_login.py index dd12987..dc01067 100644 --- a/tests/test_fuzz_login.py +++ b/tests/test_fuzz_login.py @@ -181,7 +181,7 @@ def test_retrieving_api_key( else: assert result.exit_code == 0 assert "You can view campaign here:" in result.output - req = requests_mock.request_history[1] + req = requests_mock.request_history[2] assert req.method == "POST" assert req.url == "https://example-us.com/oauth/token" diff --git a/tests/test_fuzz_quickcheck.py b/tests/test_fuzz_quickcheck.py index a53c46c..5750544 100644 --- a/tests/test_fuzz_quickcheck.py +++ b/tests/test_fuzz_quickcheck.py @@ -10,6 +10,7 @@ from fuzzing_cli.cli import cli from fuzzing_cli.fuzz.config.utils import parse_config from fuzzing_cli.fuzz.faas import FaasClient +from fuzzing_cli.util import executable_command from tests.common import assert_is_equal, write_config from tests.testdata.quickcheck_project.echidna.utils import ( get_compilation_artifacts, @@ -40,7 +41,7 @@ def test_fuzz_auto(tmp_path: Path, truffle_echidna_project, fake_process, target "fuzzing_cli.fuzz.quickcheck.determine_campaign_name" ) as determine_campaign_name_mock: determine_ide_mock.return_value = truffle_echidna_project["ide"] - determine_targets_mock.return_value = [f"{tmp_path}/{t}" for t in targets] + determine_targets_mock.return_value = [tmp_path.joinpath(t) for t in targets] determine_cpu_cores_mock.return_value = 1 determine_campaign_name_mock.return_value = "test-campaign" @@ -51,7 +52,7 @@ def test_fuzz_auto(tmp_path: Path, truffle_echidna_project, fake_process, target assert len(fake_process.calls) == 1 assert fake_process.calls[0] == ["scribble-generate", "--targets"] + [ - f"{tmp_path}/{t}" for t in targets + tmp_path.joinpath(t) for t in targets ] config = parse_config( @@ -61,8 +62,8 @@ def test_fuzz_auto(tmp_path: Path, truffle_echidna_project, fake_process, target assert_is_equal( list(config["fuzz"].get("targets")), [ - f"{tmp_path}/contracts/SecondVulnerableTokenTest.sol", - f"{tmp_path}/contracts/VulnerableTokenTest.sol", + str(tmp_path.joinpath("contracts/SecondVulnerableTokenTest.sol")), + str(tmp_path.joinpath("contracts/VulnerableTokenTest.sol")), ], ) assert config["fuzz"].get("quick_check") == True @@ -89,7 +90,7 @@ def test_no_annotated_contracts(tmp_path, truffle_echidna_project, fake_process) new=Mock(return_value="test-campaign"), ): determine_targets_mock.return_value = [ - f"{tmp_path}/contracts/VulnerableToken.sol" + tmp_path.joinpath("contracts/VulnerableToken.sol"), ] runner = CliRunner() result = runner.invoke(cli, ["auto"]) @@ -101,7 +102,7 @@ def test_no_annotated_contracts(tmp_path, truffle_echidna_project, fake_process) assert fake_process.calls[0] == [ "scribble-generate", "--targets", - f"{tmp_path}/contracts/VulnerableToken.sol", + tmp_path.joinpath("contracts/VulnerableToken.sol"), ] @@ -148,7 +149,7 @@ def test_annotation_errors( "fuzzing_cli.fuzz.quickcheck.determine_campaign_name", new=Mock(return_value="test-campaign"), ): - determine_targets_mock.return_value = [f"{tmp_path}/contracts"] + determine_targets_mock.return_value = [tmp_path.joinpath("contracts")] if exc: with patch.object(subprocess, "run", new=Mock(side_effect=exc)): runner = CliRunner() @@ -160,7 +161,7 @@ def test_annotation_errors( assert fake_process.calls[0] == [ "scribble-generate", "--targets", - f"{tmp_path}/contracts", + tmp_path.joinpath("contracts"), ] assert result.exit_code == 1 @@ -226,7 +227,12 @@ def test_fuzz_run( set_solc_version_mock.assert_called_once_with("v0.8.1", silent=True) - _sources = {f"{tmp_path}/{t}": {"urls": [f"{tmp_path}/{t}"]} for t in targets} + _sources = { + str(tmp_path.joinpath(t).as_posix()): { + "urls": [str(tmp_path.joinpath(t).as_posix())] + } + for t in targets + } compile_standard_mock.assert_called_once_with( solc_binary=None, input_data={ @@ -258,14 +264,14 @@ def test_fuzz_run( assert len(fake_process.calls) == 1 assert fake_process.calls[0] == ( [ - "scribble", + *executable_command("scribble"), "--arm", "--output-mode=files", "--instrumentation-metadata-file=.scribble-arming.meta.json", "--debug-events", "--no-assert", ] - + [f"{tmp_path}/{t}" for t in targets] + + [str(tmp_path.joinpath(t)) for t in targets] ) start_faas_campaign_mock.assert_called_once() diff --git a/tests/test_fuzz_run.py b/tests/test_fuzz_run.py index 29b4658..d8323c0 100644 --- a/tests/test_fuzz_run.py +++ b/tests/test_fuzz_run.py @@ -257,17 +257,17 @@ def test_fuzz( # and there's no way to hardcode `tmp_path` related paths if IDE_NAME == "truffle": processed_payload["sources"] = { - name.replace("artifacts", str(tmp_path)): data + str(tmp_path.joinpath(name[10:]).as_posix()): data for name, data in processed_payload["sources"].items() } processed_payload["contracts"] = [ { **c, - "mainSourceFile": c["mainSourceFile"].replace( - "artifacts", str(tmp_path) + "mainSourceFile": str( + tmp_path.joinpath(c["mainSourceFile"][10:]).as_posix() ), "sourcePaths": { - k: v.replace("artifacts", str(tmp_path)) + k: str(tmp_path.joinpath(v[10:]).as_posix()) for k, v in c["sourcePaths"].items() }, } diff --git a/tests/test_fuzz_run_smart_mode.py b/tests/test_fuzz_run_smart_mode.py index ea23924..d55fe41 100644 --- a/tests/test_fuzz_run_smart_mode.py +++ b/tests/test_fuzz_run_smart_mode.py @@ -75,17 +75,17 @@ def test_fuzz_run( # and there's no way to hardcode `tmp_path` related paths if IDE_NAME == "truffle": processed_payload["sources"] = { - name.replace("artifacts", str(tmp_path)): data + str(tmp_path.joinpath(name[10:]).as_posix()): data for name, data in processed_payload["sources"].items() } processed_payload["contracts"] = [ { **c, - "mainSourceFile": c["mainSourceFile"].replace( - "artifacts", str(tmp_path) + "mainSourceFile": str( + tmp_path.joinpath(c["mainSourceFile"][10:]).as_posix() ), "sourcePaths": { - k: v.replace("artifacts", str(tmp_path)) + k: str(tmp_path.joinpath(v[10:]).as_posix()) for k, v in c["sourcePaths"].items() }, } @@ -170,7 +170,7 @@ def test_fuzz_run_with_auto_fixes( if contract["address"] == address: data.append( f" ◦ Address: {address.lower()}" - f" Target: {tmp_path}/{contract['contractPath']}" + f" Target: {tmp_path.joinpath(contract['contractPath'])}" ) break data = "\n".join(data) @@ -186,7 +186,7 @@ def test_fuzz_run_with_auto_fixes( if contract["contractPath"] == target: data.append( f" ◦ Address: {contract['address'].lower()}" - f" Source File: {tmp_path}/{contract['contractPath']}" + f" Source File: {tmp_path.joinpath(contract['contractPath'])}" f" Contract Name: {contract_name}" ) break @@ -203,7 +203,7 @@ def test_fuzz_run_with_auto_fixes( if contract["contractPath"] == target: data.append( f" ◦ Address: {contract['address'].lower()}" - f" Source File: {tmp_path}/{contract['contractPath']}" + f" Source File: {tmp_path.joinpath(contract['contractPath'])}" f" Contract Name: {contract_name}" ) break @@ -231,17 +231,17 @@ def test_fuzz_run_with_auto_fixes( # and there's no way to hardcode `tmp_path` related paths if IDE_NAME == "truffle": processed_payload["sources"] = { - name.replace("artifacts", str(tmp_path)): data + str(tmp_path.joinpath(name[10:]).as_posix()): data for name, data in processed_payload["sources"].items() } processed_payload["contracts"] = [ { **c, - "mainSourceFile": c["mainSourceFile"].replace( - "artifacts", str(tmp_path) + "mainSourceFile": str( + tmp_path.joinpath(c["mainSourceFile"][10:]).as_posix() ), "sourcePaths": { - k: v.replace("artifacts", str(tmp_path)) + k: str(tmp_path.joinpath(v[10:]).as_posix()) for k, v in c["sourcePaths"].items() }, } diff --git a/tests/test_get_corpus.py b/tests/test_get_corpus.py index 5630d44..6a0d1ca 100644 --- a/tests/test_get_corpus.py +++ b/tests/test_get_corpus.py @@ -270,9 +270,9 @@ def test_not_targeted_contracts( output = ( f"⚠️ Following contracts were not included into the seed state:\n" - f" ◦ Address: 0x07d9fb5736cd151c8561798dfbda5dbcf54cb9e6 Source File: {tmp_path}/contracts/Migrations.sol Contract Name: Migrations\n" - f" ◦ Address: 0x6a432c13a2e980a78f941c136ec804e7cb67e0d9 Source File: {tmp_path}/contracts/Bar.sol Contract Name: Bar\n" - f" ◦ Address: 0x6bcb21de38753e485f7678c7ada2a63f688b8579 Source File: {tmp_path}/contracts/ABC.sol Contract Name: ABC" + f" ◦ Address: 0x07d9fb5736cd151c8561798dfbda5dbcf54cb9e6 Source File: {tmp_path.joinpath('contracts/Migrations.sol')} Contract Name: Migrations\n" + f" ◦ Address: 0x6a432c13a2e980a78f941c136ec804e7cb67e0d9 Source File: {tmp_path.joinpath('contracts/Bar.sol')} Contract Name: Bar\n" + f" ◦ Address: 0x6bcb21de38753e485f7678c7ada2a63f688b8579 Source File: {tmp_path.joinpath('contracts/ABC.sol')} Contract Name: ABC" ) prompt = "Add them to targets" cmd_result = "You can view campaign here: http://localhost:9899/campaigns/cmp_0" @@ -323,7 +323,7 @@ def test_contract_target_not_set( "The following targets were provided without providing addresses of " f"respective contracts as addresses under test:\n" f" ◦ Address: 0x6bcb21de38753e485f7678c7ada2a63f688b8579 " - f"Source File: {tmp_path}/contracts/ABC.sol Contract Name: ABC" + f"Source File: {tmp_path.joinpath('contracts/ABC.sol')} Contract Name: ABC" ) prompt = "Add them to addresses under test" cmd_result = "You can view campaign here: http://localhost:9899/campaigns/cmp_0" @@ -393,7 +393,7 @@ def test_source_target_not_set( output = ( "Following contract's addresses were provided as addresses under test without specifying " f"them as a target prior to `fuzz run`:\n" - f" ◦ Address: 0x6a432c13a2e980a78f941c136ec804e7cb67e0d9 Target: {tmp_path}/contracts/Bar.sol" + f" ◦ Address: 0x6a432c13a2e980a78f941c136ec804e7cb67e0d9 Target: {tmp_path.joinpath('contracts/Bar.sol')}" ) prompt = "Add them to targets" cmd_result = "You can view campaign here: http://localhost:9899/campaigns/cmp_0" @@ -531,7 +531,7 @@ def test_not_deployed_contracts( output = ( "⚠️ Following contracts were not deployed to RPC node:\n" - f" ◦ Source File: {tmp_path}/contracts/Migrations.sol Contract Name: Migrations" + f" ◦ Source File: {tmp_path.joinpath('contracts/Migrations.sol').as_posix()} Contract Name: Migrations" ) prompt = "Remove them from targets" cmd_result = "You can view campaign here: http://localhost:9899/campaigns/cmp_0" diff --git a/tests/test_ide.py b/tests/test_ide.py index ff78568..311c523 100644 --- a/tests/test_ide.py +++ b/tests/test_ide.py @@ -1,5 +1,5 @@ from pathlib import Path -from typing import Dict, List, Tuple +from typing import Dict, List, Set, Tuple from fuzzing_cli.fuzz.config import FuzzingOptions from fuzzing_cli.fuzz.ide import IDEArtifacts @@ -31,6 +31,9 @@ def get_default_sources_dir() -> Path: def process_artifacts(self) -> Tuple[Dict[str, List[Contract]], Dict[str, Source]]: return self.__contracts, {} + def unlinked_libraries(self) -> List[Tuple[Contract, Set[str]]]: + return [] + def test_get_contract(): options = FuzzingOptions( diff --git a/tests/test_options_parsing.py b/tests/test_options_parsing.py index 2d9dea4..b1273e3 100644 --- a/tests/test_options_parsing.py +++ b/tests/test_options_parsing.py @@ -95,8 +95,8 @@ def test_config_show(tmp_path, monkeypatch, json: bool, give_analytics_consent: faas_options_json = { "ide": "hardhat", - "build_directory": f"{tmp_path}/build", - "sources_directory": f"{tmp_path}/contracts", + "build_directory": f"{tmp_path.joinpath('build')}", + "sources_directory": f"{tmp_path.joinpath('contracts')}", "key": "dGVzdC1jbGllbnQtMTIzOjpleGFtcGxlLXVzLmNvbQ==::2", "project": None, "corpus_target": None, @@ -122,6 +122,8 @@ def test_config_show(tmp_path, monkeypatch, json: bool, give_analytics_consent: "target_contracts": None, "dry_run": False, "smart_mode": False, + "include_library_contracts": False, + "check_updates": False, "ci_mode": False, } diff --git a/tests/testdata/foundry_project/artifacts/cache/solidity-files-cache.json b/tests/testdata/foundry_project/artifacts/cache/solidity-files-cache.json new file mode 100644 index 0000000..1b996c9 --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/cache/solidity-files-cache.json @@ -0,0 +1,135 @@ +{ + "_format": "ethers-rs-sol-cache-3", + "paths": { + "artifacts": "out", + "build_infos": "out/build-info", + "sources": "src", + "tests": "test", + "scripts": "script", + "libraries": [ + "lib" + ] + }, + "files": { + "src/ABC.sol": { + "lastModificationDate": 1643883808251, + "contentHash": "6f77db216e59a5957a42532e7f7afa44", + "sourceName": "src/ABC.sol", + "solcConfig": { + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs", + "appendCBOR": true + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ] + } + }, + "evmVersion": "london", + "libraries": {} + } + }, + "imports": [], + "versionRequirement": ">=0.8.1", + "artifacts": { + "ABC": { + "0.8.13+commit.abaa5c0e.Darwin.appleclang": "ABC.sol/ABC.json" + } + } + }, + "src/Bar.sol": { + "lastModificationDate": 1643883761614, + "contentHash": "f907bd270015c7ec4f8abdc20d4cc737", + "sourceName": "src/Bar.sol", + "solcConfig": { + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs", + "appendCBOR": true + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ] + } + }, + "evmVersion": "london", + "libraries": {} + } + }, + "imports": [], + "versionRequirement": ">=0.8.1", + "artifacts": { + "Bar": { + "0.8.13+commit.abaa5c0e.Darwin.appleclang": "Bar.sol/Bar.json" + } + } + }, + "src/Foo.sol": { + "lastModificationDate": 1643883831936, + "contentHash": "0541e3260b35700f4c517637370a40b1", + "sourceName": "src/Foo.sol", + "solcConfig": { + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs", + "appendCBOR": true + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ] + } + }, + "evmVersion": "london", + "libraries": {} + } + }, + "imports": [], + "versionRequirement": ">=0.8.1", + "artifacts": { + "Foo": { + "0.8.13+commit.abaa5c0e.Darwin.appleclang": "Foo.sol/Foo.json" + } + } + } + } +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/foundry.toml b/tests/testdata/foundry_project/artifacts/foundry.toml new file mode 100644 index 0000000..4cae707 --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/foundry.toml @@ -0,0 +1,8 @@ +[profile.default] +src = 'src' +out = 'out' +libs = ['lib'] +solc = "0.8.13" +eth-rpc-url = "http://localhost:7545" + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/out/ABC.sol/ABC.json b/tests/testdata/foundry_project/artifacts/out/ABC.sol/ABC.json new file mode 100644 index 0000000..670e5ba --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/out/ABC.sol/ABC.json @@ -0,0 +1,2296 @@ +{ + "abi": [ + { + "inputs": [], + "name": "ABCD", + "outputs": [ + { + "internalType": "int256", + "name": "y", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b5061030f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033", + "sourceMap": "25:1257:0:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033", + "sourceMap": "25:1257:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1186:94;;;;;;:::i;:::-;;:::i;:::-;;109:1072;;;:::i;:::-;;;436:25:3;;;424:2;409:18;109:1072:0;;;;;;;1186:94;1247:1;:25;;1270:1;1247:25;;;1258:1;1247:25;1242:1;;1232:11;;1239:1;1232:11;:::i;:::-;:41;;;;:::i;:::-;1228:1;:45;-1:-1:-1;1186:94:0:o;109:1072::-;146:8;170:1;;175:2;170:7;166:73;;193:13;;:::i;:::-;-1:-1:-1;227:1:0;;109:1072::o;166:73::-;252:1;;257:2;252:7;248:73;;275:13;;:::i;:::-;-1:-1:-1;309:1:0;;109:1072::o;248:73::-;334:1;;339:2;334:7;330:73;;357:13;;:::i;:::-;-1:-1:-1;391:1:0;;109:1072::o;330:73::-;416:1;;421:2;416:7;412:73;;439:13;;:::i;:::-;-1:-1:-1;473:1:0;;109:1072::o;412:73::-;498:1;;503:3;498:8;494:75;;522:13;;:::i;:::-;-1:-1:-1;556:2:0;;109:1072::o;494:75::-;582:1;;587:3;582:8;578:75;;606:13;;:::i;:::-;-1:-1:-1;640:2:0;;109:1072::o;578:75::-;666:1;;671:3;666:8;662:75;;690:13;;:::i;:::-;-1:-1:-1;724:2:0;;109:1072::o;662:75::-;750:1;;755:3;750:8;746:75;;774:13;;:::i;:::-;-1:-1:-1;808:2:0;;109:1072::o;746:75::-;834:1;;839:3;834:8;830:75;;858:13;;:::i;:::-;-1:-1:-1;892:2:0;;109:1072::o;830:75::-;918:1;;923:3;918:8;914:75;;942:13;;:::i;:::-;-1:-1:-1;976:2:0;;109:1072::o;914:75::-;1002:1;;1007:3;1002:8;998:75;;1026:13;;:::i;:::-;-1:-1:-1;1060:2:0;;109:1072::o;998:75::-;1086:1;;1091:3;1086:8;1082:75;;1110:13;;:::i;:::-;-1:-1:-1;1144:2:0;;109:1072::o;1082:75::-;-1:-1:-1;1173:1:0;;109:1072::o;14:273:3:-;70:6;123:2;111:9;102:7;98:23;94:32;91:52;;;139:1;136;129:12;91:52;178:9;165:23;231:5;224:13;217:21;210:5;207:32;197:60;;253:1;250;243:12;197:60;276:5;14:273;-1:-1:-1;;;14:273:3:o;472:127::-;533:10;528:3;524:20;521:1;514:31;564:4;561:1;554:15;588:4;585:1;578:15;604:553;643:7;-1:-1:-1;;;;;713:9:3;;;741;;;766:11;;;785:10;;;779:17;;762:35;759:61;;;800:18;;:::i;:::-;-1:-1:-1;;;876:1:3;869:9;;894:11;;;914;;;907:19;;890:37;887:63;;;930:18;;:::i;:::-;976:1;973;969:9;959:19;;1023:1;1019:2;1014:11;1011:1;1007:19;1002:2;998;994:11;990:37;987:63;;;1030:18;;:::i;:::-;1095:1;1091:2;1086:11;1083:1;1079:19;1074:2;1070;1066:11;1062:37;1059:63;;;1102:18;;:::i;:::-;-1:-1:-1;;;1142:9:3;;;;;604:553;-1:-1:-1;;;604:553:3:o;1162:265::-;1201:3;1229:9;;;1254:10;;-1:-1:-1;;;;;1273:27:3;;;1266:35;;1250:52;1247:78;;;1305:18;;:::i;:::-;-1:-1:-1;;;1352:19:3;;;1345:27;;1337:36;;1334:62;;;1376:18;;:::i;:::-;-1:-1:-1;;1412:9:3;;1162:265::o;1432:127::-;1493:10;1488:3;1484:20;1481:1;1474:31;1524:4;1521:1;1514:15;1548:4;1545:1;1538:15", + "linkReferences": {} + }, + "methodIdentifiers": { + "ABCD()": "e88184ca", + "SetNext(bool)": "df5b7227" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ABCD\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"y\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"ABCD()\":{\"notice\":\"#if_succeeds {:msg \\\"P1\\\"} y == 30; \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ABC.sol\":\"ABC\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/ABC.sol\":{\"keccak256\":\"0xdc61693ae9f9207458851d944e3279c66fdba13e1f7e01a23ba47a075943076a\",\"urls\":[\"bzz-raw://466551296a0e6fbbc5467786e77122801d3f10fe95b5c5c116e774f648d4d63c\",\"dweb:/ipfs/QmZHc4AGKi7pHTP4afcMxQSEfyKxvoEF8gAWXGc2GToVJx\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.13+commit.abaa5c0e" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "ABCD", + "outputs": [ + { + "internalType": "int256", + "name": "y", + "type": "int256" + } + ] + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "SetNext" + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "ABCD()": { + "notice": "#if_succeeds {:msg \"P1\"} y == 30; " + } + }, + "version": 1 + } + }, + "settings": { + "remappings": [ + ":ds-test/=lib/forge-std/lib/ds-test/src/", + ":forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/ABC.sol": "ABC" + }, + "libraries": {} + }, + "sources": { + "src/ABC.sol": { + "keccak256": "0xdc61693ae9f9207458851d944e3279c66fdba13e1f7e01a23ba47a075943076a", + "urls": [ + "bzz-raw://466551296a0e6fbbc5467786e77122801d3f10fe95b5c5c116e774f648d4d63c", + "dweb:/ipfs/QmZHc4AGKi7pHTP4afcMxQSEfyKxvoEF8gAWXGc2GToVJx" + ], + "license": null + } + }, + "version": 1 + }, + "ast": { + "absolutePath": "src/ABC.sol", + "id": 173, + "exportedSymbols": { + "ABC": [ + 172 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1282:0", + "nodes": [ + { + "id": 1, + "nodeType": "PragmaDirective", + "src": "0:24:0", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 172, + "nodeType": "ContractDefinition", + "src": "25:1257:0", + "nodes": [ + { + "id": 3, + "nodeType": "VariableDeclaration", + "src": "44:16:0", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "59:1:0", + "scope": 172, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 2, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "44:6:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "private" + }, + { + "id": 144, + "nodeType": "FunctionDefinition", + "src": "109:1072:0", + "nodes": [], + "body": { + "id": 143, + "nodeType": "Block", + "src": "156:1025:0", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "170:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "175:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "170:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 19, + "nodeType": "IfStatement", + "src": "166:73:0", + "trueBody": { + "id": 18, + "nodeType": "Block", + "src": "179:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 13, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "200:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 12, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 14, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "193:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15, + "nodeType": "ExpressionStatement", + "src": "193:13:0" + }, + { + "expression": { + "hexValue": "33", + "id": 16, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "227:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 8, + "id": 17, + "nodeType": "Return", + "src": "220:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 22, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 20, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "252:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "257:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "252:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 30, + "nodeType": "IfStatement", + "src": "248:73:0", + "trueBody": { + "id": 29, + "nodeType": "Block", + "src": "261:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 24, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "282:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 23, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "275:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "275:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 26, + "nodeType": "ExpressionStatement", + "src": "275:13:0" + }, + { + "expression": { + "hexValue": "35", + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "309:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 8, + "id": 28, + "nodeType": "Return", + "src": "302:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 33, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 31, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "334:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 32, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "339:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "334:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 41, + "nodeType": "IfStatement", + "src": "330:73:0", + "trueBody": { + "id": 40, + "nodeType": "Block", + "src": "343:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 35, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "364:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 34, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "357:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 36, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "357:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 37, + "nodeType": "ExpressionStatement", + "src": "357:13:0" + }, + { + "expression": { + "hexValue": "37", + "id": 38, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "391:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 8, + "id": 39, + "nodeType": "Return", + "src": "384:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 44, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 42, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "416:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 43, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "421:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "416:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 52, + "nodeType": "IfStatement", + "src": "412:73:0", + "trueBody": { + "id": 51, + "nodeType": "Block", + "src": "425:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "446:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 45, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "439:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 47, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "439:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 48, + "nodeType": "ExpressionStatement", + "src": "439:13:0" + }, + { + "expression": { + "hexValue": "39", + "id": 49, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "473:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 8, + "id": 50, + "nodeType": "Return", + "src": "466:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 55, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 53, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "498:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 54, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "503:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "498:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 63, + "nodeType": "IfStatement", + "src": "494:75:0", + "trueBody": { + "id": 62, + "nodeType": "Block", + "src": "508:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 57, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "529:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 56, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "522:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 58, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "522:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 59, + "nodeType": "ExpressionStatement", + "src": "522:13:0" + }, + { + "expression": { + "hexValue": "3131", + "id": 60, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "556:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 8, + "id": 61, + "nodeType": "Return", + "src": "549:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 66, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 64, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "582:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 65, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "587:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "582:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 74, + "nodeType": "IfStatement", + "src": "578:75:0", + "trueBody": { + "id": 73, + "nodeType": "Block", + "src": "592:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 68, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "613:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 67, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "606:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 69, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "606:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 70, + "nodeType": "ExpressionStatement", + "src": "606:13:0" + }, + { + "expression": { + "hexValue": "3133", + "id": 71, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "640:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 8, + "id": 72, + "nodeType": "Return", + "src": "633:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 75, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "666:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 76, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "671:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "666:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 85, + "nodeType": "IfStatement", + "src": "662:75:0", + "trueBody": { + "id": 84, + "nodeType": "Block", + "src": "676:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "697:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 78, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "690:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "690:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 81, + "nodeType": "ExpressionStatement", + "src": "690:13:0" + }, + { + "expression": { + "hexValue": "3135", + "id": 82, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "724:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 8, + "id": 83, + "nodeType": "Return", + "src": "717:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 86, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "750:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 87, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "755:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "750:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 96, + "nodeType": "IfStatement", + "src": "746:75:0", + "trueBody": { + "id": 95, + "nodeType": "Block", + "src": "760:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "781:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 89, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "774:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 91, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "774:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 92, + "nodeType": "ExpressionStatement", + "src": "774:13:0" + }, + { + "expression": { + "hexValue": "3137", + "id": 93, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "808:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 8, + "id": 94, + "nodeType": "Return", + "src": "801:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 97, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "834:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "839:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "834:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 107, + "nodeType": "IfStatement", + "src": "830:75:0", + "trueBody": { + "id": 106, + "nodeType": "Block", + "src": "844:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "865:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 100, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "858:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "858:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 103, + "nodeType": "ExpressionStatement", + "src": "858:13:0" + }, + { + "expression": { + "hexValue": "3139", + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "892:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 8, + "id": 105, + "nodeType": "Return", + "src": "885:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 108, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "918:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "923:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "918:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 118, + "nodeType": "IfStatement", + "src": "914:75:0", + "trueBody": { + "id": 117, + "nodeType": "Block", + "src": "928:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 112, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "949:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 111, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "942:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "942:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 114, + "nodeType": "ExpressionStatement", + "src": "942:13:0" + }, + { + "expression": { + "hexValue": "3231", + "id": 115, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "976:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_21_by_1", + "typeString": "int_const 21" + }, + "value": "21" + }, + "functionReturnParameters": 8, + "id": 116, + "nodeType": "Return", + "src": "969:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 119, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1002:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323330", + "id": 120, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1007:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_230_by_1", + "typeString": "int_const 230" + }, + "value": "230" + }, + "src": "1002:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 129, + "nodeType": "IfStatement", + "src": "998:75:0", + "trueBody": { + "id": 128, + "nodeType": "Block", + "src": "1012:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1033:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 122, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "1026:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1026:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 125, + "nodeType": "ExpressionStatement", + "src": "1026:13:0" + }, + { + "expression": { + "hexValue": "3233", + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1060:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_23_by_1", + "typeString": "int_const 23" + }, + "value": "23" + }, + "functionReturnParameters": 8, + "id": 127, + "nodeType": "Return", + "src": "1053:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 130, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1086:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323530", + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_250_by_1", + "typeString": "int_const 250" + }, + "value": "250" + }, + "src": "1086:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 140, + "nodeType": "IfStatement", + "src": "1082:75:0", + "trueBody": { + "id": 139, + "nodeType": "Block", + "src": "1096:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 134, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 133, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "1110:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1110:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 136, + "nodeType": "ExpressionStatement", + "src": "1110:13:0" + }, + { + "expression": { + "hexValue": "3235", + "id": 137, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1144:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + }, + "value": "25" + }, + "functionReturnParameters": 8, + "id": 138, + "nodeType": "Return", + "src": "1137:9:0" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1173:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 8, + "id": 142, + "nodeType": "Return", + "src": "1166:8:0" + } + ] + }, + "documentation": { + "id": 4, + "nodeType": "StructuredDocumentation", + "src": "66:38:0", + "text": "#if_succeeds {:msg \"P1\"} y == 30; " + }, + "functionSelector": "e88184ca", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ABCD", + "nameLocation": "118:4:0", + "parameters": { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "122:2:0" + }, + "returnParameters": { + "id": 8, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "y", + "nameLocation": "153:1:0", + "nodeType": "VariableDeclaration", + "scope": 144, + "src": "146:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 6, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "145:10:0" + }, + "scope": 172, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 171, + "nodeType": "FunctionDefinition", + "src": "1186:94:0", + "nodes": [], + "body": { + "id": 170, + "nodeType": "Block", + "src": "1218:62:0", + "nodes": [], + "statements": [ + { + "expression": { + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 149, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1228:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "hexValue": "32", + "id": 152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1239:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1232:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 150, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1232:6:0", + "typeDescriptions": {} + } + }, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1232:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 154, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1242:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1232:11:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 156, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "1247:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1270:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1263:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 161, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1263:6:0", + "typeDescriptions": {} + } + }, + "id": 164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1263:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1247:25:0", + "trueExpression": { + "arguments": [ + { + "hexValue": "31", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1258:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1251:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 157, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1251:6:0", + "typeDescriptions": {} + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1251:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 166, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1246:27:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1232:41:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1228:45:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1228:45:0" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1195:7:0", + "parameters": { + "id": 147, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 146, + "mutability": "mutable", + "name": "b", + "nameLocation": "1208:1:0", + "nodeType": "VariableDeclaration", + "scope": 171, + "src": "1203:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 145, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1203:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1202:8:0" + }, + "returnParameters": { + "id": 148, + "nodeType": "ParameterList", + "parameters": [], + "src": "1218:0:0" + }, + "scope": 172, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "ABC", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 172 + ], + "name": "ABC", + "nameLocation": "34:3:0", + "scope": 173, + "usedErrors": [] + } + ] + }, + "id": 0 +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/out/Bar.sol/Bar.json b/tests/testdata/foundry_project/artifacts/out/Bar.sol/Bar.json new file mode 100644 index 0000000..b9eabd8 --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/out/Bar.sol/Bar.json @@ -0,0 +1,2017 @@ +{ + "abi": [ + { + "inputs": [], + "name": "AAB", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b50610266806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033", + "sourceMap": "26:1105:1:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033", + "sourceMap": "26:1105:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70:984;;;:::i;:::-;;;160:25:3;;;148:2;133:18;70:984:1;;;;;;;1059:70;;;;;;:::i;:::-;;:::i;:::-;;70:984;106:7;129:1;;134:2;129:7;125:73;;152:13;;:::i;:::-;-1:-1:-1;186:1:1;;70:984::o;125:73::-;211:1;;216:2;211:7;207:73;;234:13;;:::i;:::-;-1:-1:-1;268:1:1;;70:984::o;207:73::-;293:1;;298:2;293:7;289:73;;316:13;;:::i;:::-;-1:-1:-1;350:1:1;;70:984::o;289:73::-;375:1;;380:2;375:7;371:73;;398:13;;:::i;:::-;-1:-1:-1;432:1:1;;70:984::o;371:73::-;457:1;;462:2;457:7;453:73;;480:13;;:::i;:::-;-1:-1:-1;514:1:1;;70:984::o;453:73::-;539:1;;544:3;539:8;535:75;;563:13;;:::i;:::-;-1:-1:-1;597:2:1;;70:984::o;535:75::-;623:1;;628:3;623:8;619:75;;647:13;;:::i;:::-;-1:-1:-1;681:2:1;;70:984::o;619:75::-;707:1;;712:3;707:8;703:75;;731:13;;:::i;:::-;-1:-1:-1;765:2:1;;70:984::o;703:75::-;791:1;;796:3;791:8;787:75;;815:13;;:::i;:::-;-1:-1:-1;849:2:1;;70:984::o;787:75::-;875:1;;880:3;875:8;871:75;;899:13;;:::i;:::-;-1:-1:-1;933:2:1;;70:984::o;871:75::-;959:1;;964:3;959:8;955:75;;983:13;;:::i;955:75::-;-1:-1:-1;1046:1:1;;70:984::o;1059:70::-;1112:1;:9;;1120:1;1112:9;;;1116:1;1112:9;1105:17;;1107:1;;1105;:3;;;;:::i;:::-;:17;;;;:::i;:::-;1101:1;:21;-1:-1:-1;1059:70:1:o;196:273:3:-;252:6;305:2;293:9;284:7;280:23;276:32;273:52;;;321:1;318;311:12;273:52;360:9;347:23;413:5;406:13;399:21;392:5;389:32;379:60;;435:1;432;425:12;379:60;458:5;196:273;-1:-1:-1;;;196:273:3:o;474:127::-;535:10;530:3;526:20;523:1;516:31;566:4;563:1;556:15;590:4;587:1;580:15;606:127;667:10;662:3;658:20;655:1;648:31;698:4;695:1;688:15;722:4;719:1;712:15;738:168;778:7;844:1;840;836:6;832:14;829:1;826:21;821:1;814:9;807:17;803:45;800:71;;;851:18;;:::i;:::-;-1:-1:-1;891:9:3;;738:168::o;911:128::-;951:3;982:1;978:6;975:1;972:13;969:39;;;988:18;;:::i;:::-;-1:-1:-1;1024:9:3;;911:128::o", + "linkReferences": {} + }, + "methodIdentifiers": { + "AAB()": "43c10ff1", + "SetNext(bool)": "df5b7227" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AAB\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Bar.sol\":\"Bar\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/Bar.sol\":{\"keccak256\":\"0x36ce0329d6e41eb2ffa87a181b303dc85f1d771b974c4b8cbe4b8e50d891edc4\",\"urls\":[\"bzz-raw://988171982d1c708124cb34a43d030e4f86b3b9d0073631386d4d64612af3398e\",\"dweb:/ipfs/Qmd1WNq5eBpCHvXRMHcwB6Ph76MbRdCs8nfzg6i7FuGT5B\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.13+commit.abaa5c0e" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "AAB", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "SetNext" + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } + }, + "settings": { + "remappings": [ + ":ds-test/=lib/forge-std/lib/ds-test/src/", + ":forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/Bar.sol": "Bar" + }, + "libraries": {} + }, + "sources": { + "src/Bar.sol": { + "keccak256": "0x36ce0329d6e41eb2ffa87a181b303dc85f1d771b974c4b8cbe4b8e50d891edc4", + "urls": [ + "bzz-raw://988171982d1c708124cb34a43d030e4f86b3b9d0073631386d4d64612af3398e", + "dweb:/ipfs/Qmd1WNq5eBpCHvXRMHcwB6Ph76MbRdCs8nfzg6i7FuGT5B" + ], + "license": null + } + }, + "version": 1 + }, + "ast": { + "absolutePath": "src/Bar.sol", + "id": 325, + "exportedSymbols": { + "Bar": [ + 324 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1131:1", + "nodes": [ + { + "id": 174, + "nodeType": "PragmaDirective", + "src": "0:24:1", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 324, + "nodeType": "ContractDefinition", + "src": "26:1105:1", + "nodes": [ + { + "id": 176, + "nodeType": "VariableDeclaration", + "src": "46:17:1", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "62:1:1", + "scope": 324, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 175, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "46:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "id": 305, + "nodeType": "FunctionDefinition", + "src": "70:984:1", + "nodes": [], + "body": { + "id": 304, + "nodeType": "Block", + "src": "115:939:1", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 181, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "129:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3130", + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "134:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "129:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 191, + "nodeType": "IfStatement", + "src": "125:73:1", + "trueBody": { + "id": 190, + "nodeType": "Block", + "src": "138:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "159:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 184, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "152:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "152:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "152:13:1" + }, + { + "expression": { + "hexValue": "31", + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "186:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "functionReturnParameters": 180, + "id": 189, + "nodeType": "Return", + "src": "179:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 192, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "211:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 193, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "216:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "211:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 202, + "nodeType": "IfStatement", + "src": "207:73:1", + "trueBody": { + "id": 201, + "nodeType": "Block", + "src": "220:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 196, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "241:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 195, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "234:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "234:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 198, + "nodeType": "ExpressionStatement", + "src": "234:13:1" + }, + { + "expression": { + "hexValue": "33", + "id": 199, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "268:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 180, + "id": 200, + "nodeType": "Return", + "src": "261:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 203, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "293:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "298:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "293:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 213, + "nodeType": "IfStatement", + "src": "289:73:1", + "trueBody": { + "id": 212, + "nodeType": "Block", + "src": "302:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "323:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 206, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "316:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "316:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "316:13:1" + }, + { + "expression": { + "hexValue": "35", + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "350:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 180, + "id": 211, + "nodeType": "Return", + "src": "343:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 214, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "375:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "380:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "375:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 224, + "nodeType": "IfStatement", + "src": "371:73:1", + "trueBody": { + "id": 223, + "nodeType": "Block", + "src": "384:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "405:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 217, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "398:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "398:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 220, + "nodeType": "ExpressionStatement", + "src": "398:13:1" + }, + { + "expression": { + "hexValue": "37", + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "432:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 180, + "id": 222, + "nodeType": "Return", + "src": "425:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 225, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "457:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 226, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "462:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "457:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 235, + "nodeType": "IfStatement", + "src": "453:73:1", + "trueBody": { + "id": 234, + "nodeType": "Block", + "src": "466:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "487:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 228, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "480:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "480:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 231, + "nodeType": "ExpressionStatement", + "src": "480:13:1" + }, + { + "expression": { + "hexValue": "39", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "514:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 180, + "id": 233, + "nodeType": "Return", + "src": "507:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 236, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "539:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 237, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "544:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "539:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 246, + "nodeType": "IfStatement", + "src": "535:75:1", + "trueBody": { + "id": 245, + "nodeType": "Block", + "src": "549:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "570:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 239, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "563:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "563:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 242, + "nodeType": "ExpressionStatement", + "src": "563:13:1" + }, + { + "expression": { + "hexValue": "3131", + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "597:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 180, + "id": 244, + "nodeType": "Return", + "src": "590:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 247, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "623:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "628:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "623:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 257, + "nodeType": "IfStatement", + "src": "619:75:1", + "trueBody": { + "id": 256, + "nodeType": "Block", + "src": "633:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "654:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 250, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "647:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "647:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 253, + "nodeType": "ExpressionStatement", + "src": "647:13:1" + }, + { + "expression": { + "hexValue": "3133", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "681:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 180, + "id": 255, + "nodeType": "Return", + "src": "674:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 258, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "707:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 259, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "712:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "707:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 268, + "nodeType": "IfStatement", + "src": "703:75:1", + "trueBody": { + "id": 267, + "nodeType": "Block", + "src": "717:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "738:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 261, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "731:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "731:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 264, + "nodeType": "ExpressionStatement", + "src": "731:13:1" + }, + { + "expression": { + "hexValue": "3135", + "id": 265, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "765:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 180, + "id": 266, + "nodeType": "Return", + "src": "758:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 269, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "791:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "796:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "791:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 279, + "nodeType": "IfStatement", + "src": "787:75:1", + "trueBody": { + "id": 278, + "nodeType": "Block", + "src": "801:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "822:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 272, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "815:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "815:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 275, + "nodeType": "ExpressionStatement", + "src": "815:13:1" + }, + { + "expression": { + "hexValue": "3137", + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "849:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 180, + "id": 277, + "nodeType": "Return", + "src": "842:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 280, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "875:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "880:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "875:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 290, + "nodeType": "IfStatement", + "src": "871:75:1", + "trueBody": { + "id": 289, + "nodeType": "Block", + "src": "885:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 284, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "906:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 283, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "899:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "899:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 286, + "nodeType": "ExpressionStatement", + "src": "899:13:1" + }, + { + "expression": { + "hexValue": "3139", + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "933:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 180, + "id": 288, + "nodeType": "Return", + "src": "926:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 291, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "959:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "964:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "959:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 301, + "nodeType": "IfStatement", + "src": "955:75:1", + "trueBody": { + "id": 300, + "nodeType": "Block", + "src": "969:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "990:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 294, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "983:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 296, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "983:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 297, + "nodeType": "ExpressionStatement", + "src": "983:13:1" + }, + { + "expression": { + "hexValue": "3139", + "id": 298, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1017:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 180, + "id": 299, + "nodeType": "Return", + "src": "1010:9:1" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1046:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 180, + "id": 303, + "nodeType": "Return", + "src": "1039:8:1" + } + ] + }, + "functionSelector": "43c10ff1", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "AAB", + "nameLocation": "79:3:1", + "parameters": { + "id": 177, + "nodeType": "ParameterList", + "parameters": [], + "src": "82:2:1" + }, + "returnParameters": { + "id": 180, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 179, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 305, + "src": "106:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 178, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "106:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "105:9:1" + }, + "scope": 324, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 323, + "nodeType": "FunctionDefinition", + "src": "1059:70:1", + "nodes": [], + "body": { + "id": 322, + "nodeType": "Block", + "src": "1091:38:1", + "nodes": [], + "statements": [ + { + "expression": { + "id": 320, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 310, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "1101:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 311, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1105:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 312, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "1107:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1105:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 314, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 307, + "src": "1112:1:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1120:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1112:9:1", + "trueExpression": { + "hexValue": "31", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1116:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 318, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1111:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "1105:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1101:21:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 321, + "nodeType": "ExpressionStatement", + "src": "1101:21:1" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1068:7:1", + "parameters": { + "id": 308, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 307, + "mutability": "mutable", + "name": "b", + "nameLocation": "1081:1:1", + "nodeType": "VariableDeclaration", + "scope": 323, + "src": "1076:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 306, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1076:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1075:8:1" + }, + "returnParameters": { + "id": 309, + "nodeType": "ParameterList", + "parameters": [], + "src": "1091:0:1" + }, + "scope": 324, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "Bar", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 324 + ], + "name": "Bar", + "nameLocation": "35:3:1", + "scope": 325, + "usedErrors": [] + } + ] + }, + "id": 1 +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/out/Foo.sol/Foo.json b/tests/testdata/foundry_project/artifacts/out/Foo.sol/Foo.json new file mode 100644 index 0000000..3ddda8c --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/out/Foo.sol/Foo.json @@ -0,0 +1,2149 @@ +{ + "abi": [ + { + "inputs": [], + "name": "Bar", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b506102f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033", + "sourceMap": "25:1125:2:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033", + "sourceMap": "25:1125:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66:983;;;:::i;:::-;;;158:25:3;;;146:2;131:18;66:983:2;;;;;;;1054:94;;;;;;:::i;:::-;;:::i;:::-;;66:983;102:6;124:1;;129:2;124:7;120:73;;147:13;;:::i;:::-;-1:-1:-1;181:1:2;;66:983::o;120:73::-;206:1;;211:2;206:7;202:73;;229:13;;:::i;:::-;-1:-1:-1;263:1:2;;66:983::o;202:73::-;288:1;;293:2;288:7;284:73;;311:13;;:::i;:::-;-1:-1:-1;345:1:2;;66:983::o;284:73::-;370:1;;375:2;370:7;366:73;;393:13;;:::i;:::-;-1:-1:-1;427:1:2;;66:983::o;366:73::-;452:1;;457:2;452:7;448:73;;475:13;;:::i;:::-;-1:-1:-1;509:1:2;;66:983::o;448:73::-;534:1;;539:3;534:8;530:75;;558:13;;:::i;:::-;-1:-1:-1;592:2:2;;66:983::o;530:75::-;618:1;;623:3;618:8;614:75;;642:13;;:::i;:::-;-1:-1:-1;676:2:2;;66:983::o;614:75::-;702:1;;707:3;702:8;698:75;;726:13;;:::i;:::-;-1:-1:-1;760:2:2;;66:983::o;698:75::-;786:1;;791:3;786:8;782:75;;810:13;;:::i;:::-;-1:-1:-1;844:2:2;;66:983::o;782:75::-;870:1;;875:3;870:8;866:75;;894:13;;:::i;:::-;-1:-1:-1;928:2:2;;66:983::o;866:75::-;954:1;;959:3;954:8;950:75;;978:13;;:::i;:::-;-1:-1:-1;1012:2:2;;66:983::o;950:75::-;-1:-1:-1;1041:1:2;;66:983::o;1054:94::-;1115:1;:25;;1138:1;1115:25;;;1126:1;1115:25;1110:1;;1100:11;;1107:1;1100:11;:::i;:::-;:41;;;;:::i;:::-;1096:1;:45;-1:-1:-1;1054:94:2:o;194:273:3:-;250:6;303:2;291:9;282:7;278:23;274:32;271:52;;;319:1;316;309:12;271:52;358:9;345:23;411:5;404:13;397:21;390:5;387:32;377:60;;433:1;430;423:12;377:60;456:5;194:273;-1:-1:-1;;;194:273:3:o;472:127::-;533:10;528:3;524:20;521:1;514:31;564:4;561:1;554:15;588:4;585:1;578:15;604:127;665:10;660:3;656:20;653:1;646:31;696:4;693:1;686:15;720:4;717:1;710:15;736:553;775:7;-1:-1:-1;;;;;845:9:3;;;873;;;898:11;;;917:10;;;911:17;;894:35;891:61;;;932:18;;:::i;:::-;-1:-1:-1;;;1008:1:3;1001:9;;1026:11;;;1046;;;1039:19;;1022:37;1019:63;;;1062:18;;:::i;:::-;1108:1;1105;1101:9;1091:19;;1155:1;1151:2;1146:11;1143:1;1139:19;1134:2;1130;1126:11;1122:37;1119:63;;;1162:18;;:::i;:::-;1227:1;1223:2;1218:11;1215:1;1211:19;1206:2;1202;1198:11;1194:37;1191:63;;;1234:18;;:::i;:::-;-1:-1:-1;;;1274:9:3;;;;;736:553;-1:-1:-1;;;736:553:3:o;1294:265::-;1333:3;1361:9;;;1386:10;;-1:-1:-1;;;;;1405:27:3;;;1398:35;;1382:52;1379:78;;;1437:18;;:::i;:::-;-1:-1:-1;;;1484:19:3;;;1477:27;;1469:36;;1466:62;;;1508:18;;:::i;:::-;-1:-1:-1;;1544:9:3;;1294:265::o", + "linkReferences": {} + }, + "methodIdentifiers": { + "Bar()": "b0a378b0", + "SetNext(bool)": "df5b7227" + }, + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"Bar\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Foo.sol\":\"Foo\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/Foo.sol\":{\"keccak256\":\"0x79514bc3378c34d9543df3a499a2b256d2f7fd52a71255be8135eb4b173ece8c\",\"urls\":[\"bzz-raw://3487e0061ffd25780b7d0329c51f6a0c2ba5c9fa8dd26478439463cbbf57ed68\",\"dweb:/ipfs/QmVdNRmRceNxweUscLF88gUxCWDEDejybw8UV66cZKPn6j\"]}},\"version\":1}", + "metadata": { + "compiler": { + "version": "0.8.13+commit.abaa5c0e" + }, + "language": "Solidity", + "output": { + "abi": [ + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "Bar", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ] + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function", + "name": "SetNext" + } + ], + "devdoc": { + "kind": "dev", + "methods": {}, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + } + }, + "settings": { + "remappings": [ + ":ds-test/=lib/forge-std/lib/ds-test/src/", + ":forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "compilationTarget": { + "src/Foo.sol": "Foo" + }, + "libraries": {} + }, + "sources": { + "src/Foo.sol": { + "keccak256": "0x79514bc3378c34d9543df3a499a2b256d2f7fd52a71255be8135eb4b173ece8c", + "urls": [ + "bzz-raw://3487e0061ffd25780b7d0329c51f6a0c2ba5c9fa8dd26478439463cbbf57ed68", + "dweb:/ipfs/QmVdNRmRceNxweUscLF88gUxCWDEDejybw8UV66cZKPn6j" + ], + "license": null + } + }, + "version": 1 + }, + "ast": { + "absolutePath": "src/Foo.sol", + "id": 486, + "exportedSymbols": { + "Foo": [ + 485 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1150:2", + "nodes": [ + { + "id": 326, + "nodeType": "PragmaDirective", + "src": "0:24:2", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 485, + "nodeType": "ContractDefinition", + "src": "25:1125:2", + "nodes": [ + { + "id": 328, + "nodeType": "VariableDeclaration", + "src": "44:16:2", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "59:1:2", + "scope": 485, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 327, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "44:6:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "private" + }, + { + "id": 457, + "nodeType": "FunctionDefinition", + "src": "66:983:2", + "nodes": [], + "body": { + "id": 456, + "nodeType": "Block", + "src": "110:939:2", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 333, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "124:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3130", + "id": 334, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "129:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "124:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 343, + "nodeType": "IfStatement", + "src": "120:73:2", + "trueBody": { + "id": 342, + "nodeType": "Block", + "src": "133:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "154:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 336, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "147:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "147:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 339, + "nodeType": "ExpressionStatement", + "src": "147:13:2" + }, + { + "expression": { + "hexValue": "31", + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "181:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "functionReturnParameters": 332, + "id": 341, + "nodeType": "Return", + "src": "174:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 344, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "206:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "211:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "206:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 354, + "nodeType": "IfStatement", + "src": "202:73:2", + "trueBody": { + "id": 353, + "nodeType": "Block", + "src": "215:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 348, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "236:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 347, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "229:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "229:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 350, + "nodeType": "ExpressionStatement", + "src": "229:13:2" + }, + { + "expression": { + "hexValue": "33", + "id": 351, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "263:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 332, + "id": 352, + "nodeType": "Return", + "src": "256:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 355, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "288:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 356, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "293:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "288:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 365, + "nodeType": "IfStatement", + "src": "284:73:2", + "trueBody": { + "id": 364, + "nodeType": "Block", + "src": "297:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "318:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 358, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "311:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 360, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "311:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 361, + "nodeType": "ExpressionStatement", + "src": "311:13:2" + }, + { + "expression": { + "hexValue": "35", + "id": 362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "345:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 332, + "id": 363, + "nodeType": "Return", + "src": "338:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 366, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "370:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 367, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "375:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "370:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 376, + "nodeType": "IfStatement", + "src": "366:73:2", + "trueBody": { + "id": 375, + "nodeType": "Block", + "src": "379:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 370, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "400:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 369, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "393:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 371, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "393:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 372, + "nodeType": "ExpressionStatement", + "src": "393:13:2" + }, + { + "expression": { + "hexValue": "37", + "id": 373, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "427:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 332, + "id": 374, + "nodeType": "Return", + "src": "420:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 377, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "452:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "457:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "452:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 387, + "nodeType": "IfStatement", + "src": "448:73:2", + "trueBody": { + "id": 386, + "nodeType": "Block", + "src": "461:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "482:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 380, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "475:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "475:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 383, + "nodeType": "ExpressionStatement", + "src": "475:13:2" + }, + { + "expression": { + "hexValue": "39", + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "509:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 332, + "id": 385, + "nodeType": "Return", + "src": "502:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 388, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "534:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "539:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "534:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 398, + "nodeType": "IfStatement", + "src": "530:75:2", + "trueBody": { + "id": 397, + "nodeType": "Block", + "src": "544:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 392, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "565:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 391, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "558:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "558:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 394, + "nodeType": "ExpressionStatement", + "src": "558:13:2" + }, + { + "expression": { + "hexValue": "3131", + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "592:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 332, + "id": 396, + "nodeType": "Return", + "src": "585:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 399, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "618:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 400, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "623:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "618:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 409, + "nodeType": "IfStatement", + "src": "614:75:2", + "trueBody": { + "id": 408, + "nodeType": "Block", + "src": "628:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 403, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "649:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 402, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "642:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "642:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "642:13:2" + }, + { + "expression": { + "hexValue": "3133", + "id": 406, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "676:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 332, + "id": 407, + "nodeType": "Return", + "src": "669:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 412, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 410, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "702:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "707:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "702:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 420, + "nodeType": "IfStatement", + "src": "698:75:2", + "trueBody": { + "id": 419, + "nodeType": "Block", + "src": "712:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "733:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 413, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "726:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "726:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 416, + "nodeType": "ExpressionStatement", + "src": "726:13:2" + }, + { + "expression": { + "hexValue": "3135", + "id": 417, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "760:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 332, + "id": 418, + "nodeType": "Return", + "src": "753:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 421, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "786:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "791:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "786:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 431, + "nodeType": "IfStatement", + "src": "782:75:2", + "trueBody": { + "id": 430, + "nodeType": "Block", + "src": "796:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "817:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 424, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "810:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "810:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 427, + "nodeType": "ExpressionStatement", + "src": "810:13:2" + }, + { + "expression": { + "hexValue": "3137", + "id": 428, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "844:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 332, + "id": 429, + "nodeType": "Return", + "src": "837:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 432, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "870:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "875:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "870:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 442, + "nodeType": "IfStatement", + "src": "866:75:2", + "trueBody": { + "id": 441, + "nodeType": "Block", + "src": "880:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "901:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 435, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "894:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "894:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "894:13:2" + }, + { + "expression": { + "hexValue": "3139", + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "928:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 332, + "id": 440, + "nodeType": "Return", + "src": "921:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 443, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "954:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 444, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "959:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "954:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 453, + "nodeType": "IfStatement", + "src": "950:75:2", + "trueBody": { + "id": 452, + "nodeType": "Block", + "src": "964:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "985:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 446, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "978:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 448, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "978:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 449, + "nodeType": "ExpressionStatement", + "src": "978:13:2" + }, + { + "expression": { + "hexValue": "3231", + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1012:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_21_by_1", + "typeString": "int_const 21" + }, + "value": "21" + }, + "functionReturnParameters": 332, + "id": 451, + "nodeType": "Return", + "src": "1005:9:2" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 454, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1041:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 332, + "id": 455, + "nodeType": "Return", + "src": "1034:8:2" + } + ] + }, + "functionSelector": "b0a378b0", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "Bar", + "nameLocation": "75:3:2", + "parameters": { + "id": 329, + "nodeType": "ParameterList", + "parameters": [], + "src": "78:2:2" + }, + "returnParameters": { + "id": 332, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 331, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 457, + "src": "102:6:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 330, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "102:6:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "101:8:2" + }, + "scope": 485, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 484, + "nodeType": "FunctionDefinition", + "src": "1054:94:2", + "nodes": [], + "body": { + "id": 483, + "nodeType": "Block", + "src": "1086:62:2", + "nodes": [], + "statements": [ + { + "expression": { + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 462, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "1096:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 468, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "hexValue": "32", + "id": 465, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1107:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "id": 464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1100:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 463, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1100:6:2", + "typeDescriptions": {} + } + }, + "id": 466, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1100:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 467, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "1110:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1100:11:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 469, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 459, + "src": "1115:1:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1138:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1131:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 474, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1131:6:2", + "typeDescriptions": {} + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1131:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1115:25:2", + "trueExpression": { + "arguments": [ + { + "hexValue": "31", + "id": 472, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1126:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 471, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1119:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 470, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1119:6:2", + "typeDescriptions": {} + } + }, + "id": 473, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1119:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 479, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1114:27:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1100:41:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1096:45:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 482, + "nodeType": "ExpressionStatement", + "src": "1096:45:2" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1063:7:2", + "parameters": { + "id": 460, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 459, + "mutability": "mutable", + "name": "b", + "nameLocation": "1076:1:2", + "nodeType": "VariableDeclaration", + "scope": 484, + "src": "1071:6:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 458, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1071:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1070:8:2" + }, + "returnParameters": { + "id": 461, + "nodeType": "ParameterList", + "parameters": [], + "src": "1086:0:2" + }, + "scope": 485, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "Foo", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 485 + ], + "name": "Foo", + "nameLocation": "34:3:2", + "scope": 486, + "usedErrors": [] + } + ] + }, + "id": 2 +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/out/build-info/035e6a793441ce12cc390e0cd008a242.json b/tests/testdata/foundry_project/artifacts/out/build-info/035e6a793441ce12cc390e0cd008a242.json new file mode 100644 index 0000000..2ddd28b --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/out/build-info/035e6a793441ce12cc390e0cd008a242.json @@ -0,0 +1,10570 @@ +{ + "_format": "ethers-rs-sol-build-info-1", + "solcVersion": "0.8.13", + "solcLongVersion": "0.8.13+commit.abaa5c0e.Darwin.appleclang", + "input": { + "language": "Solidity", + "sources": { + "src/ABC.sol": { + "content": "pragma solidity >=0.8.1;\ncontract ABC {\n int256 private x;\n /// #if_succeeds {:msg \"P1\"} y == 30; \n function ABCD() public view returns (int256 y) {\n if (x == 30) {\n assert(false);\n return 3;\n }\n if (x == 50) {\n assert(false);\n return 5;\n }\n if (x == 70) {\n assert(false);\n return 7;\n }\n if (x == 90) {\n assert(false);\n return 9;\n }\n if (x == 110) {\n assert(false);\n return 11;\n }\n if (x == 130) {\n assert(false);\n return 13;\n }\n if (x == 150) {\n assert(false);\n return 15;\n }\n if (x == 170) {\n assert(false);\n return 17;\n }\n if (x == 190) {\n assert(false);\n return 19;\n }\n if (x == 210) {\n assert(false);\n return 21;\n }\n if (x == 230) {\n assert(false);\n return 23;\n }\n if (x == 250) {\n assert(false);\n return 25;\n }\n return 0;\n }\n function SetNext(bool b) public {\n x = int256(2)*x + (b ? int256(1) : int256(0));\n }\n}" + }, + "src/Bar.sol": { + "content": "pragma solidity >=0.8.1;\n\ncontract Bar {\n\n uint256 private x;\n\n function AAB() public view returns (uint256) {\n if (x == 10) {\n assert(false);\n return 1;\n }\n if (x == 30) {\n assert(false);\n return 3;\n }\n if (x == 50) {\n assert(false);\n return 5;\n }\n if (x == 70) {\n assert(false);\n return 7;\n }\n if (x == 90) {\n assert(false);\n return 9;\n }\n if (x == 110) {\n assert(false);\n return 11;\n }\n if (x == 130) {\n assert(false);\n return 13;\n }\n if (x == 150) {\n assert(false);\n return 15;\n }\n if (x == 170) {\n assert(false);\n return 17;\n }\n if (x == 190) {\n assert(false);\n return 19;\n }\n if (x == 210) {\n assert(false);\n return 19;\n }\n return 0;\n }\n function SetNext(bool b) public {\n x = 2*x + (b ? 1 : 0);\n }\n}" + }, + "src/Foo.sol": { + "content": "pragma solidity >=0.8.1;\ncontract Foo {\n int256 private x;\n function Bar() public view returns (int256) {\n if (x == 10) {\n assert(false);\n return 1;\n }\n if (x == 30) {\n assert(false);\n return 3;\n }\n if (x == 50) {\n assert(false);\n return 5;\n }\n if (x == 70) {\n assert(false);\n return 7;\n }\n if (x == 90) {\n assert(false);\n return 9;\n }\n if (x == 110) {\n assert(false);\n return 11;\n }\n if (x == 130) {\n assert(false);\n return 13;\n }\n if (x == 150) {\n assert(false);\n return 15;\n }\n if (x == 170) {\n assert(false);\n return 17;\n }\n if (x == 190) {\n assert(false);\n return 19;\n }\n if (x == 210) {\n assert(false);\n return 21;\n }\n return 0;\n }\n function SetNext(bool b) public {\n x = int256(2)*x + (b ? int256(1) : int256(0));\n }\n}" + } + }, + "settings": { + "remappings": [ + "ds-test/=lib/forge-std/lib/ds-test/src/", + "forge-std/=lib/forge-std/src/" + ], + "optimizer": { + "enabled": true, + "runs": 200 + }, + "metadata": { + "bytecodeHash": "ipfs" + }, + "outputSelection": { + "*": { + "": [ + "ast" + ], + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ] + } + }, + "evmVersion": "london", + "libraries": {} + } + }, + "id": "035e6a793441ce12cc390e0cd008a242", + "output": { + "errors": [ + { + "sourceLocation": { + "file": "src/ABC.sol", + "start": -1, + "end": -1 + }, + "type": "Warning", + "component": "general", + "severity": "warning", + "errorCode": "1878", + "message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.", + "formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> src/ABC.sol\n\n" + }, + { + "sourceLocation": { + "file": "src/Bar.sol", + "start": -1, + "end": -1 + }, + "type": "Warning", + "component": "general", + "severity": "warning", + "errorCode": "1878", + "message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.", + "formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> src/Bar.sol\n\n" + }, + { + "sourceLocation": { + "file": "src/Foo.sol", + "start": -1, + "end": -1 + }, + "type": "Warning", + "component": "general", + "severity": "warning", + "errorCode": "1878", + "message": "SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.", + "formattedMessage": "Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing \"SPDX-License-Identifier: \" to each source file. Use \"SPDX-License-Identifier: UNLICENSED\" for non-open-source code. Please see https://spdx.org for more information.\n--> src/Foo.sol\n\n" + } + ], + "sources": { + "src/ABC.sol": { + "id": 0, + "ast": { + "absolutePath": "src/ABC.sol", + "id": 173, + "exportedSymbols": { + "ABC": [ + 172 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1282:0", + "nodes": [ + { + "id": 1, + "nodeType": "PragmaDirective", + "src": "0:24:0", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 172, + "nodeType": "ContractDefinition", + "src": "25:1257:0", + "nodes": [ + { + "id": 3, + "nodeType": "VariableDeclaration", + "src": "44:16:0", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "59:1:0", + "scope": 172, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 2, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "44:6:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "private" + }, + { + "id": 144, + "nodeType": "FunctionDefinition", + "src": "109:1072:0", + "nodes": [], + "body": { + "id": 143, + "nodeType": "Block", + "src": "156:1025:0", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 11, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 9, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "170:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 10, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "175:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "170:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 19, + "nodeType": "IfStatement", + "src": "166:73:0", + "trueBody": { + "id": 18, + "nodeType": "Block", + "src": "179:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 13, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "200:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 12, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "193:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 14, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "193:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 15, + "nodeType": "ExpressionStatement", + "src": "193:13:0" + }, + { + "expression": { + "hexValue": "33", + "id": 16, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "227:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 8, + "id": 17, + "nodeType": "Return", + "src": "220:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 22, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 20, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "252:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 21, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "257:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "252:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 30, + "nodeType": "IfStatement", + "src": "248:73:0", + "trueBody": { + "id": 29, + "nodeType": "Block", + "src": "261:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 24, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "282:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 23, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "275:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 25, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "275:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 26, + "nodeType": "ExpressionStatement", + "src": "275:13:0" + }, + { + "expression": { + "hexValue": "35", + "id": 27, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "309:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 8, + "id": 28, + "nodeType": "Return", + "src": "302:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 33, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 31, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "334:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 32, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "339:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "334:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 41, + "nodeType": "IfStatement", + "src": "330:73:0", + "trueBody": { + "id": 40, + "nodeType": "Block", + "src": "343:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 35, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "364:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 34, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "357:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 36, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "357:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 37, + "nodeType": "ExpressionStatement", + "src": "357:13:0" + }, + { + "expression": { + "hexValue": "37", + "id": 38, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "391:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 8, + "id": 39, + "nodeType": "Return", + "src": "384:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 44, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 42, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "416:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 43, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "421:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "416:7:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 52, + "nodeType": "IfStatement", + "src": "412:73:0", + "trueBody": { + "id": 51, + "nodeType": "Block", + "src": "425:60:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 46, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "446:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 45, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "439:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 47, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "439:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 48, + "nodeType": "ExpressionStatement", + "src": "439:13:0" + }, + { + "expression": { + "hexValue": "39", + "id": 49, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "473:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 8, + "id": 50, + "nodeType": "Return", + "src": "466:8:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 55, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 53, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "498:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 54, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "503:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "498:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 63, + "nodeType": "IfStatement", + "src": "494:75:0", + "trueBody": { + "id": 62, + "nodeType": "Block", + "src": "508:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 57, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "529:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 56, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "522:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 58, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "522:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 59, + "nodeType": "ExpressionStatement", + "src": "522:13:0" + }, + { + "expression": { + "hexValue": "3131", + "id": 60, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "556:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 8, + "id": 61, + "nodeType": "Return", + "src": "549:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 66, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 64, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "582:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 65, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "587:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "582:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 74, + "nodeType": "IfStatement", + "src": "578:75:0", + "trueBody": { + "id": 73, + "nodeType": "Block", + "src": "592:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 68, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "613:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 67, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "606:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 69, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "606:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 70, + "nodeType": "ExpressionStatement", + "src": "606:13:0" + }, + { + "expression": { + "hexValue": "3133", + "id": 71, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "640:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 8, + "id": 72, + "nodeType": "Return", + "src": "633:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 77, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 75, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "666:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 76, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "671:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "666:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 85, + "nodeType": "IfStatement", + "src": "662:75:0", + "trueBody": { + "id": 84, + "nodeType": "Block", + "src": "676:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 79, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "697:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 78, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "690:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 80, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "690:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 81, + "nodeType": "ExpressionStatement", + "src": "690:13:0" + }, + { + "expression": { + "hexValue": "3135", + "id": 82, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "724:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 8, + "id": 83, + "nodeType": "Return", + "src": "717:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 88, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 86, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "750:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 87, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "755:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "750:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 96, + "nodeType": "IfStatement", + "src": "746:75:0", + "trueBody": { + "id": 95, + "nodeType": "Block", + "src": "760:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 90, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "781:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 89, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "774:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 91, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "774:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 92, + "nodeType": "ExpressionStatement", + "src": "774:13:0" + }, + { + "expression": { + "hexValue": "3137", + "id": 93, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "808:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 8, + "id": 94, + "nodeType": "Return", + "src": "801:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 99, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 97, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "834:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 98, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "839:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "834:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 107, + "nodeType": "IfStatement", + "src": "830:75:0", + "trueBody": { + "id": 106, + "nodeType": "Block", + "src": "844:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 101, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "865:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 100, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "858:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 102, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "858:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 103, + "nodeType": "ExpressionStatement", + "src": "858:13:0" + }, + { + "expression": { + "hexValue": "3139", + "id": 104, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "892:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 8, + "id": 105, + "nodeType": "Return", + "src": "885:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 110, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 108, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "918:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 109, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "923:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "918:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 118, + "nodeType": "IfStatement", + "src": "914:75:0", + "trueBody": { + "id": 117, + "nodeType": "Block", + "src": "928:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 112, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "949:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 111, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "942:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 113, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "942:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 114, + "nodeType": "ExpressionStatement", + "src": "942:13:0" + }, + { + "expression": { + "hexValue": "3231", + "id": 115, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "976:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_21_by_1", + "typeString": "int_const 21" + }, + "value": "21" + }, + "functionReturnParameters": 8, + "id": 116, + "nodeType": "Return", + "src": "969:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 121, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 119, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1002:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323330", + "id": 120, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1007:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_230_by_1", + "typeString": "int_const 230" + }, + "value": "230" + }, + "src": "1002:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 129, + "nodeType": "IfStatement", + "src": "998:75:0", + "trueBody": { + "id": 128, + "nodeType": "Block", + "src": "1012:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 123, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1033:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 122, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "1026:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 124, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1026:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 125, + "nodeType": "ExpressionStatement", + "src": "1026:13:0" + }, + { + "expression": { + "hexValue": "3233", + "id": 126, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1060:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_23_by_1", + "typeString": "int_const 23" + }, + "value": "23" + }, + "functionReturnParameters": 8, + "id": 127, + "nodeType": "Return", + "src": "1053:9:0" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 132, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 130, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1086:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323530", + "id": 131, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1091:3:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_250_by_1", + "typeString": "int_const 250" + }, + "value": "250" + }, + "src": "1086:8:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 140, + "nodeType": "IfStatement", + "src": "1082:75:0", + "trueBody": { + "id": 139, + "nodeType": "Block", + "src": "1096:61:0", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 134, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1117:5:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 133, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "1110:6:0", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 135, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1110:13:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 136, + "nodeType": "ExpressionStatement", + "src": "1110:13:0" + }, + { + "expression": { + "hexValue": "3235", + "id": 137, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1144:2:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_25_by_1", + "typeString": "int_const 25" + }, + "value": "25" + }, + "functionReturnParameters": 8, + "id": 138, + "nodeType": "Return", + "src": "1137:9:0" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 141, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1173:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 8, + "id": 142, + "nodeType": "Return", + "src": "1166:8:0" + } + ] + }, + "documentation": { + "id": 4, + "nodeType": "StructuredDocumentation", + "src": "66:38:0", + "text": "#if_succeeds {:msg \"P1\"} y == 30; " + }, + "functionSelector": "e88184ca", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "ABCD", + "nameLocation": "118:4:0", + "parameters": { + "id": 5, + "nodeType": "ParameterList", + "parameters": [], + "src": "122:2:0" + }, + "returnParameters": { + "id": 8, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 7, + "mutability": "mutable", + "name": "y", + "nameLocation": "153:1:0", + "nodeType": "VariableDeclaration", + "scope": 144, + "src": "146:8:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 6, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "146:6:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "145:10:0" + }, + "scope": 172, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 171, + "nodeType": "FunctionDefinition", + "src": "1186:94:0", + "nodes": [], + "body": { + "id": 170, + "nodeType": "Block", + "src": "1218:62:0", + "nodes": [], + "statements": [ + { + "expression": { + "id": 168, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 149, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1228:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 167, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 155, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "hexValue": "32", + "id": 152, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1239:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "id": 151, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1232:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 150, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1232:6:0", + "typeDescriptions": {} + } + }, + "id": 153, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1232:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 154, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 3, + "src": "1242:1:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1232:11:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 156, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 146, + "src": "1247:1:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 163, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1270:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 162, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1263:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 161, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1263:6:0", + "typeDescriptions": {} + } + }, + "id": 164, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1263:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 165, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1247:25:0", + "trueExpression": { + "arguments": [ + { + "hexValue": "31", + "id": 159, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1258:1:0", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 158, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1251:6:0", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 157, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1251:6:0", + "typeDescriptions": {} + } + }, + "id": 160, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1251:9:0", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 166, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1246:27:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1232:41:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1228:45:0", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 169, + "nodeType": "ExpressionStatement", + "src": "1228:45:0" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1195:7:0", + "parameters": { + "id": 147, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 146, + "mutability": "mutable", + "name": "b", + "nameLocation": "1208:1:0", + "nodeType": "VariableDeclaration", + "scope": 171, + "src": "1203:6:0", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 145, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1203:4:0", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1202:8:0" + }, + "returnParameters": { + "id": 148, + "nodeType": "ParameterList", + "parameters": [], + "src": "1218:0:0" + }, + "scope": 172, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "ABC", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 172 + ], + "name": "ABC", + "nameLocation": "34:3:0", + "scope": 173, + "usedErrors": [] + } + ] + } + }, + "src/Bar.sol": { + "id": 1, + "ast": { + "absolutePath": "src/Bar.sol", + "id": 325, + "exportedSymbols": { + "Bar": [ + 324 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1131:1", + "nodes": [ + { + "id": 174, + "nodeType": "PragmaDirective", + "src": "0:24:1", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 324, + "nodeType": "ContractDefinition", + "src": "26:1105:1", + "nodes": [ + { + "id": 176, + "nodeType": "VariableDeclaration", + "src": "46:17:1", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "62:1:1", + "scope": 324, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 175, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "46:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "private" + }, + { + "id": 305, + "nodeType": "FunctionDefinition", + "src": "70:984:1", + "nodes": [], + "body": { + "id": 304, + "nodeType": "Block", + "src": "115:939:1", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 183, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 181, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "129:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3130", + "id": 182, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "134:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "129:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 191, + "nodeType": "IfStatement", + "src": "125:73:1", + "trueBody": { + "id": 190, + "nodeType": "Block", + "src": "138:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 185, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "159:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 184, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "152:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 186, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "152:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 187, + "nodeType": "ExpressionStatement", + "src": "152:13:1" + }, + { + "expression": { + "hexValue": "31", + "id": 188, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "186:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "functionReturnParameters": 180, + "id": 189, + "nodeType": "Return", + "src": "179:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 194, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 192, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "211:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 193, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "216:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "211:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 202, + "nodeType": "IfStatement", + "src": "207:73:1", + "trueBody": { + "id": 201, + "nodeType": "Block", + "src": "220:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 196, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "241:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 195, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "234:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 197, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "234:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 198, + "nodeType": "ExpressionStatement", + "src": "234:13:1" + }, + { + "expression": { + "hexValue": "33", + "id": 199, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "268:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 180, + "id": 200, + "nodeType": "Return", + "src": "261:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 205, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 203, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "293:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 204, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "298:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "293:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 213, + "nodeType": "IfStatement", + "src": "289:73:1", + "trueBody": { + "id": 212, + "nodeType": "Block", + "src": "302:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 207, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "323:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 206, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "316:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 208, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "316:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 209, + "nodeType": "ExpressionStatement", + "src": "316:13:1" + }, + { + "expression": { + "hexValue": "35", + "id": 210, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "350:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 180, + "id": 211, + "nodeType": "Return", + "src": "343:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 216, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 214, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "375:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 215, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "380:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "375:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 224, + "nodeType": "IfStatement", + "src": "371:73:1", + "trueBody": { + "id": 223, + "nodeType": "Block", + "src": "384:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 218, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "405:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 217, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "398:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 219, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "398:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 220, + "nodeType": "ExpressionStatement", + "src": "398:13:1" + }, + { + "expression": { + "hexValue": "37", + "id": 221, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "432:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 180, + "id": 222, + "nodeType": "Return", + "src": "425:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 227, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 225, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "457:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 226, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "462:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "457:7:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 235, + "nodeType": "IfStatement", + "src": "453:73:1", + "trueBody": { + "id": 234, + "nodeType": "Block", + "src": "466:60:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 229, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "487:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 228, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "480:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 230, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "480:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 231, + "nodeType": "ExpressionStatement", + "src": "480:13:1" + }, + { + "expression": { + "hexValue": "39", + "id": 232, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "514:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 180, + "id": 233, + "nodeType": "Return", + "src": "507:8:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 238, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 236, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "539:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 237, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "544:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "539:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 246, + "nodeType": "IfStatement", + "src": "535:75:1", + "trueBody": { + "id": 245, + "nodeType": "Block", + "src": "549:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 240, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "570:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 239, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "563:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 241, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "563:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 242, + "nodeType": "ExpressionStatement", + "src": "563:13:1" + }, + { + "expression": { + "hexValue": "3131", + "id": 243, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "597:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 180, + "id": 244, + "nodeType": "Return", + "src": "590:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 249, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 247, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "623:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 248, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "628:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "623:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 257, + "nodeType": "IfStatement", + "src": "619:75:1", + "trueBody": { + "id": 256, + "nodeType": "Block", + "src": "633:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 251, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "654:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 250, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "647:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 252, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "647:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 253, + "nodeType": "ExpressionStatement", + "src": "647:13:1" + }, + { + "expression": { + "hexValue": "3133", + "id": 254, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "681:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 180, + "id": 255, + "nodeType": "Return", + "src": "674:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 260, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 258, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "707:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 259, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "712:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "707:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 268, + "nodeType": "IfStatement", + "src": "703:75:1", + "trueBody": { + "id": 267, + "nodeType": "Block", + "src": "717:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 262, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "738:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 261, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "731:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 263, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "731:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 264, + "nodeType": "ExpressionStatement", + "src": "731:13:1" + }, + { + "expression": { + "hexValue": "3135", + "id": 265, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "765:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 180, + "id": 266, + "nodeType": "Return", + "src": "758:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 271, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 269, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "791:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 270, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "796:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "791:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 279, + "nodeType": "IfStatement", + "src": "787:75:1", + "trueBody": { + "id": 278, + "nodeType": "Block", + "src": "801:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 273, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "822:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 272, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "815:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 274, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "815:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 275, + "nodeType": "ExpressionStatement", + "src": "815:13:1" + }, + { + "expression": { + "hexValue": "3137", + "id": 276, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "849:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 180, + "id": 277, + "nodeType": "Return", + "src": "842:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 282, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 280, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "875:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 281, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "880:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "875:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 290, + "nodeType": "IfStatement", + "src": "871:75:1", + "trueBody": { + "id": 289, + "nodeType": "Block", + "src": "885:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 284, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "906:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 283, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "899:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 285, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "899:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 286, + "nodeType": "ExpressionStatement", + "src": "899:13:1" + }, + { + "expression": { + "hexValue": "3139", + "id": 287, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "933:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 180, + "id": 288, + "nodeType": "Return", + "src": "926:9:1" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 293, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 291, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "959:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 292, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "964:3:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "959:8:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 301, + "nodeType": "IfStatement", + "src": "955:75:1", + "trueBody": { + "id": 300, + "nodeType": "Block", + "src": "969:61:1", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 295, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "990:5:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 294, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "983:6:1", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 296, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "983:13:1", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 297, + "nodeType": "ExpressionStatement", + "src": "983:13:1" + }, + { + "expression": { + "hexValue": "3139", + "id": 298, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1017:2:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 180, + "id": 299, + "nodeType": "Return", + "src": "1010:9:1" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 302, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1046:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 180, + "id": 303, + "nodeType": "Return", + "src": "1039:8:1" + } + ] + }, + "functionSelector": "43c10ff1", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "AAB", + "nameLocation": "79:3:1", + "parameters": { + "id": 177, + "nodeType": "ParameterList", + "parameters": [], + "src": "82:2:1" + }, + "returnParameters": { + "id": 180, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 179, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 305, + "src": "106:7:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 178, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "106:7:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "105:9:1" + }, + "scope": 324, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 323, + "nodeType": "FunctionDefinition", + "src": "1059:70:1", + "nodes": [], + "body": { + "id": 322, + "nodeType": "Block", + "src": "1091:38:1", + "nodes": [], + "statements": [ + { + "expression": { + "id": 320, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 310, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "1101:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 319, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 313, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "hexValue": "32", + "id": 311, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1105:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 312, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 176, + "src": "1107:1:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1105:3:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 314, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 307, + "src": "1112:1:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "hexValue": "30", + "id": 316, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1120:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "id": 317, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1112:9:1", + "trueExpression": { + "hexValue": "31", + "id": 315, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1116:1:1", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + } + ], + "id": 318, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1111:11:1", + "typeDescriptions": { + "typeIdentifier": "t_uint8", + "typeString": "uint8" + } + }, + "src": "1105:17:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "1101:21:1", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 321, + "nodeType": "ExpressionStatement", + "src": "1101:21:1" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1068:7:1", + "parameters": { + "id": 308, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 307, + "mutability": "mutable", + "name": "b", + "nameLocation": "1081:1:1", + "nodeType": "VariableDeclaration", + "scope": 323, + "src": "1076:6:1", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 306, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1076:4:1", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1075:8:1" + }, + "returnParameters": { + "id": 309, + "nodeType": "ParameterList", + "parameters": [], + "src": "1091:0:1" + }, + "scope": 324, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "Bar", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 324 + ], + "name": "Bar", + "nameLocation": "35:3:1", + "scope": 325, + "usedErrors": [] + } + ] + } + }, + "src/Foo.sol": { + "id": 2, + "ast": { + "absolutePath": "src/Foo.sol", + "id": 486, + "exportedSymbols": { + "Foo": [ + 485 + ] + }, + "nodeType": "SourceUnit", + "src": "0:1150:2", + "nodes": [ + { + "id": 326, + "nodeType": "PragmaDirective", + "src": "0:24:2", + "nodes": [], + "literals": [ + "solidity", + ">=", + "0.8", + ".1" + ] + }, + { + "id": 485, + "nodeType": "ContractDefinition", + "src": "25:1125:2", + "nodes": [ + { + "id": 328, + "nodeType": "VariableDeclaration", + "src": "44:16:2", + "nodes": [], + "constant": false, + "mutability": "mutable", + "name": "x", + "nameLocation": "59:1:2", + "scope": 485, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 327, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "44:6:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "private" + }, + { + "id": 457, + "nodeType": "FunctionDefinition", + "src": "66:983:2", + "nodes": [], + "body": { + "id": 456, + "nodeType": "Block", + "src": "110:939:2", + "nodes": [], + "statements": [ + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 335, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 333, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "124:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3130", + "id": 334, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "129:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_10_by_1", + "typeString": "int_const 10" + }, + "value": "10" + }, + "src": "124:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 343, + "nodeType": "IfStatement", + "src": "120:73:2", + "trueBody": { + "id": 342, + "nodeType": "Block", + "src": "133:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 337, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "154:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 336, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "147:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 338, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "147:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 339, + "nodeType": "ExpressionStatement", + "src": "147:13:2" + }, + { + "expression": { + "hexValue": "31", + "id": 340, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "181:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "functionReturnParameters": 332, + "id": 341, + "nodeType": "Return", + "src": "174:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 346, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 344, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "206:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3330", + "id": 345, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "211:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_30_by_1", + "typeString": "int_const 30" + }, + "value": "30" + }, + "src": "206:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 354, + "nodeType": "IfStatement", + "src": "202:73:2", + "trueBody": { + "id": 353, + "nodeType": "Block", + "src": "215:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 348, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "236:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 347, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "229:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 349, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "229:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 350, + "nodeType": "ExpressionStatement", + "src": "229:13:2" + }, + { + "expression": { + "hexValue": "33", + "id": 351, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "263:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_3_by_1", + "typeString": "int_const 3" + }, + "value": "3" + }, + "functionReturnParameters": 332, + "id": 352, + "nodeType": "Return", + "src": "256:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 357, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 355, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "288:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3530", + "id": 356, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "293:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_50_by_1", + "typeString": "int_const 50" + }, + "value": "50" + }, + "src": "288:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 365, + "nodeType": "IfStatement", + "src": "284:73:2", + "trueBody": { + "id": 364, + "nodeType": "Block", + "src": "297:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 359, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "318:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 358, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "311:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 360, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "311:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 361, + "nodeType": "ExpressionStatement", + "src": "311:13:2" + }, + { + "expression": { + "hexValue": "35", + "id": 362, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "345:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_5_by_1", + "typeString": "int_const 5" + }, + "value": "5" + }, + "functionReturnParameters": 332, + "id": 363, + "nodeType": "Return", + "src": "338:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 368, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 366, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "370:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3730", + "id": 367, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "375:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_70_by_1", + "typeString": "int_const 70" + }, + "value": "70" + }, + "src": "370:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 376, + "nodeType": "IfStatement", + "src": "366:73:2", + "trueBody": { + "id": 375, + "nodeType": "Block", + "src": "379:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 370, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "400:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 369, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "393:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 371, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "393:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 372, + "nodeType": "ExpressionStatement", + "src": "393:13:2" + }, + { + "expression": { + "hexValue": "37", + "id": 373, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "427:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_7_by_1", + "typeString": "int_const 7" + }, + "value": "7" + }, + "functionReturnParameters": 332, + "id": 374, + "nodeType": "Return", + "src": "420:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 379, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 377, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "452:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "3930", + "id": 378, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "457:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_90_by_1", + "typeString": "int_const 90" + }, + "value": "90" + }, + "src": "452:7:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 387, + "nodeType": "IfStatement", + "src": "448:73:2", + "trueBody": { + "id": 386, + "nodeType": "Block", + "src": "461:60:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 381, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "482:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 380, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "475:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 382, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "475:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 383, + "nodeType": "ExpressionStatement", + "src": "475:13:2" + }, + { + "expression": { + "hexValue": "39", + "id": 384, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "509:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_9_by_1", + "typeString": "int_const 9" + }, + "value": "9" + }, + "functionReturnParameters": 332, + "id": 385, + "nodeType": "Return", + "src": "502:8:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 390, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 388, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "534:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313130", + "id": 389, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "539:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_110_by_1", + "typeString": "int_const 110" + }, + "value": "110" + }, + "src": "534:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 398, + "nodeType": "IfStatement", + "src": "530:75:2", + "trueBody": { + "id": 397, + "nodeType": "Block", + "src": "544:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 392, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "565:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 391, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "558:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 393, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "558:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 394, + "nodeType": "ExpressionStatement", + "src": "558:13:2" + }, + { + "expression": { + "hexValue": "3131", + "id": 395, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "592:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_11_by_1", + "typeString": "int_const 11" + }, + "value": "11" + }, + "functionReturnParameters": 332, + "id": 396, + "nodeType": "Return", + "src": "585:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 401, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 399, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "618:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313330", + "id": 400, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "623:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_130_by_1", + "typeString": "int_const 130" + }, + "value": "130" + }, + "src": "618:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 409, + "nodeType": "IfStatement", + "src": "614:75:2", + "trueBody": { + "id": 408, + "nodeType": "Block", + "src": "628:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 403, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "649:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 402, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "642:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "642:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 405, + "nodeType": "ExpressionStatement", + "src": "642:13:2" + }, + { + "expression": { + "hexValue": "3133", + "id": 406, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "676:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_13_by_1", + "typeString": "int_const 13" + }, + "value": "13" + }, + "functionReturnParameters": 332, + "id": 407, + "nodeType": "Return", + "src": "669:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 412, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 410, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "702:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313530", + "id": 411, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "707:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_150_by_1", + "typeString": "int_const 150" + }, + "value": "150" + }, + "src": "702:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 420, + "nodeType": "IfStatement", + "src": "698:75:2", + "trueBody": { + "id": 419, + "nodeType": "Block", + "src": "712:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 414, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "733:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 413, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "726:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 415, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "726:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 416, + "nodeType": "ExpressionStatement", + "src": "726:13:2" + }, + { + "expression": { + "hexValue": "3135", + "id": 417, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "760:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_15_by_1", + "typeString": "int_const 15" + }, + "value": "15" + }, + "functionReturnParameters": 332, + "id": 418, + "nodeType": "Return", + "src": "753:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 423, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 421, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "786:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313730", + "id": 422, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "791:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_170_by_1", + "typeString": "int_const 170" + }, + "value": "170" + }, + "src": "786:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 431, + "nodeType": "IfStatement", + "src": "782:75:2", + "trueBody": { + "id": 430, + "nodeType": "Block", + "src": "796:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 425, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "817:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 424, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "810:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 426, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "810:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 427, + "nodeType": "ExpressionStatement", + "src": "810:13:2" + }, + { + "expression": { + "hexValue": "3137", + "id": 428, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "844:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_17_by_1", + "typeString": "int_const 17" + }, + "value": "17" + }, + "functionReturnParameters": 332, + "id": 429, + "nodeType": "Return", + "src": "837:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 434, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 432, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "870:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "313930", + "id": 433, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "875:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_190_by_1", + "typeString": "int_const 190" + }, + "value": "190" + }, + "src": "870:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 442, + "nodeType": "IfStatement", + "src": "866:75:2", + "trueBody": { + "id": 441, + "nodeType": "Block", + "src": "880:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 436, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "901:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 435, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "894:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 437, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "894:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 438, + "nodeType": "ExpressionStatement", + "src": "894:13:2" + }, + { + "expression": { + "hexValue": "3139", + "id": 439, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "928:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_19_by_1", + "typeString": "int_const 19" + }, + "value": "19" + }, + "functionReturnParameters": 332, + "id": 440, + "nodeType": "Return", + "src": "921:9:2" + } + ] + } + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 445, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 443, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "954:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "==", + "rightExpression": { + "hexValue": "323130", + "id": 444, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "959:3:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_210_by_1", + "typeString": "int_const 210" + }, + "value": "210" + }, + "src": "954:8:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 453, + "nodeType": "IfStatement", + "src": "950:75:2", + "trueBody": { + "id": 452, + "nodeType": "Block", + "src": "964:61:2", + "statements": [ + { + "expression": { + "arguments": [ + { + "hexValue": "66616c7365", + "id": 447, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "bool", + "lValueRequested": false, + "nodeType": "Literal", + "src": "985:5:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "value": "false" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + ], + "id": 446, + "name": "assert", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": -3, + "src": "978:6:2", + "typeDescriptions": { + "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", + "typeString": "function (bool) pure" + } + }, + "id": 448, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "978:13:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 449, + "nodeType": "ExpressionStatement", + "src": "978:13:2" + }, + { + "expression": { + "hexValue": "3231", + "id": 450, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1012:2:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_21_by_1", + "typeString": "int_const 21" + }, + "value": "21" + }, + "functionReturnParameters": 332, + "id": 451, + "nodeType": "Return", + "src": "1005:9:2" + } + ] + } + }, + { + "expression": { + "hexValue": "30", + "id": 454, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1041:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 332, + "id": 455, + "nodeType": "Return", + "src": "1034:8:2" + } + ] + }, + "functionSelector": "b0a378b0", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "Bar", + "nameLocation": "75:3:2", + "parameters": { + "id": 329, + "nodeType": "ParameterList", + "parameters": [], + "src": "78:2:2" + }, + "returnParameters": { + "id": 332, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 331, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 457, + "src": "102:6:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "typeName": { + "id": 330, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "102:6:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "visibility": "internal" + } + ], + "src": "101:8:2" + }, + "scope": 485, + "stateMutability": "view", + "virtual": false, + "visibility": "public" + }, + { + "id": 484, + "nodeType": "FunctionDefinition", + "src": "1054:94:2", + "nodes": [], + "body": { + "id": 483, + "nodeType": "Block", + "src": "1086:62:2", + "nodes": [], + "statements": [ + { + "expression": { + "id": 481, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 462, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "1096:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 480, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_int256", + "typeString": "int256" + }, + "id": 468, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "arguments": [ + { + "hexValue": "32", + "id": 465, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1107:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + } + ], + "id": 464, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1100:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 463, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1100:6:2", + "typeDescriptions": {} + } + }, + "id": 466, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1100:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "id": 467, + "name": "x", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 328, + "src": "1110:1:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1100:11:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "components": [ + { + "condition": { + "id": 469, + "name": "b", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 459, + "src": "1115:1:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "falseExpression": { + "arguments": [ + { + "hexValue": "30", + "id": 476, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1138:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 475, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1131:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 474, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1131:6:2", + "typeDescriptions": {} + } + }, + "id": 477, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1131:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 478, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "Conditional", + "src": "1115:25:2", + "trueExpression": { + "arguments": [ + { + "hexValue": "31", + "id": 472, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "1126:1:2", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + } + ], + "id": 471, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "1119:6:2", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_int256_$", + "typeString": "type(int256)" + }, + "typeName": { + "id": 470, + "name": "int256", + "nodeType": "ElementaryTypeName", + "src": "1119:6:2", + "typeDescriptions": {} + } + }, + "id": 473, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "1119:9:2", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + } + ], + "id": 479, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "1114:27:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1100:41:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "src": "1096:45:2", + "typeDescriptions": { + "typeIdentifier": "t_int256", + "typeString": "int256" + } + }, + "id": 482, + "nodeType": "ExpressionStatement", + "src": "1096:45:2" + } + ] + }, + "functionSelector": "df5b7227", + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "SetNext", + "nameLocation": "1063:7:2", + "parameters": { + "id": 460, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 459, + "mutability": "mutable", + "name": "b", + "nameLocation": "1076:1:2", + "nodeType": "VariableDeclaration", + "scope": 484, + "src": "1071:6:2", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + "typeName": { + "id": 458, + "name": "bool", + "nodeType": "ElementaryTypeName", + "src": "1071:4:2", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "visibility": "internal" + } + ], + "src": "1070:8:2" + }, + "returnParameters": { + "id": 461, + "nodeType": "ParameterList", + "parameters": [], + "src": "1086:0:2" + }, + "scope": 485, + "stateMutability": "nonpayable", + "virtual": false, + "visibility": "public" + } + ], + "abstract": false, + "baseContracts": [], + "canonicalName": "Foo", + "contractDependencies": [], + "contractKind": "contract", + "fullyImplemented": true, + "linearizedBaseContracts": [ + 485 + ], + "name": "Foo", + "nameLocation": "34:3:2", + "scope": 486, + "usedErrors": [] + } + ] + } + } + }, + "contracts": { + "src/ABC.sol": { + "ABC": { + "abi": [ + { + "inputs": [], + "name": "ABCD", + "outputs": [ + { + "internalType": "int256", + "name": "y", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"ABCD\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"y\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"ABCD()\":{\"notice\":\"#if_succeeds {:msg \\\"P1\\\"} y == 30; \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/ABC.sol\":\"ABC\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/ABC.sol\":{\"keccak256\":\"0xdc61693ae9f9207458851d944e3279c66fdba13e1f7e01a23ba47a075943076a\",\"urls\":[\"bzz-raw://466551296a0e6fbbc5467786e77122801d3f10fe95b5c5c116e774f648d4d63c\",\"dweb:/ipfs/QmZHc4AGKi7pHTP4afcMxQSEfyKxvoEF8gAWXGc2GToVJx\"]}},\"version\":1}", + "userdoc": {}, + "devdoc": {}, + "evm": { + "bytecode": { + "object": "608060405234801561001057600080fd5b5061030f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x30F DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xE88184CA EQ PUSH2 0x50 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x49 CALLDATASIZE PUSH1 0x4 PUSH2 0x1BE JUMP JUMPDEST PUSH2 0x6A JUMP JUMPDEST STOP JUMPDEST PUSH2 0x58 PUSH2 0x97 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH2 0x76 JUMPI PUSH1 0x0 PUSH2 0x79 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0x0 SLOAD PUSH2 0x87 SWAP1 PUSH1 0x2 PUSH2 0x1FD JUMP JUMPDEST PUSH2 0x91 SWAP2 SWAP1 PUSH2 0x282 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1E SUB PUSH2 0xB0 JUMPI PUSH2 0xAA PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xC8 JUMPI PUSH2 0xC2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xE0 JUMPI PUSH2 0xDA PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xF8 JUMPI PUSH2 0xF2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0x110 JUMPI PUSH2 0x10A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x128 JUMPI PUSH2 0x122 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x140 JUMPI PUSH2 0x13A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x158 JUMPI PUSH2 0x152 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x170 JUMPI PUSH2 0x16A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x188 JUMPI PUSH2 0x182 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x15 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xE6 SUB PUSH2 0x1A0 JUMPI PUSH2 0x19A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x17 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFA SUB PUSH2 0x1B8 JUMPI PUSH2 0x1B2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x19 SWAP1 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1D0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP2 DUP5 SGT DUP3 DUP5 SGT DUP1 DUP3 AND DUP7 DUP5 DIV DUP7 GT AND ISZERO PUSH2 0x223 JUMPI PUSH2 0x223 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL PUSH1 0x0 DUP8 SLT DUP3 DUP2 AND DUP8 DUP4 SDIV DUP10 SLT AND ISZERO PUSH2 0x242 JUMPI PUSH2 0x242 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x0 DUP8 SLT SWAP3 POP DUP8 DUP3 SDIV DUP8 SLT DUP5 DUP5 AND AND ISZERO PUSH2 0x25E JUMPI PUSH2 0x25E PUSH2 0x1E7 JUMP JUMPDEST DUP8 DUP6 SDIV DUP8 SLT DUP2 DUP5 AND AND ISZERO PUSH2 0x274 JUMPI PUSH2 0x274 PUSH2 0x1E7 JUMP JUMPDEST POP POP POP SWAP3 SWAP1 SWAP4 MUL SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 SLT DUP1 ISZERO PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 SWAP1 SUB DUP6 SGT AND ISZERO PUSH2 0x2A4 JUMPI PUSH2 0x2A4 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL DUP4 SWAP1 SUB DUP5 SLT DUP2 AND ISZERO PUSH2 0x2BD JUMPI PUSH2 0x2BD PUSH2 0x1E7 JUMP JUMPDEST POP POP ADD SWAP1 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 ADDRESS MSTORE 0x28 0xEB PUSH3 0x2814E4 0x5E NOT 0xE7 0xF9 DUP1 POP 0x25 0xD8 RETURNDATACOPY EQ 0xEC PUSH10 0x4DDE980CB7B4FC268D95 SWAP5 LOG1 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "25:1257:0:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "functionDebugData": { + "@ABCD_144": { + "entryPoint": 151, + "id": 144, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@SetNext_171": { + "entryPoint": 106, + "id": 171, + "parameterSlots": 1, + "returnSlots": 0 + }, + "abi_decode_tuple_t_bool": { + "entryPoint": 446, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_add_t_int256": { + "entryPoint": 642, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_mul_t_int256": { + "entryPoint": 509, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "panic_error_0x01": { + "entryPoint": 707, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x11": { + "entryPoint": 487, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + } + }, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xE88184CA EQ PUSH2 0x50 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x4E PUSH2 0x49 CALLDATASIZE PUSH1 0x4 PUSH2 0x1BE JUMP JUMPDEST PUSH2 0x6A JUMP JUMPDEST STOP JUMPDEST PUSH2 0x58 PUSH2 0x97 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST DUP1 PUSH2 0x76 JUMPI PUSH1 0x0 PUSH2 0x79 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0x0 SLOAD PUSH2 0x87 SWAP1 PUSH1 0x2 PUSH2 0x1FD JUMP JUMPDEST PUSH2 0x91 SWAP2 SWAP1 PUSH2 0x282 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0x1E SUB PUSH2 0xB0 JUMPI PUSH2 0xAA PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xC8 JUMPI PUSH2 0xC2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xE0 JUMPI PUSH2 0xDA PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xF8 JUMPI PUSH2 0xF2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0x110 JUMPI PUSH2 0x10A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x128 JUMPI PUSH2 0x122 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x140 JUMPI PUSH2 0x13A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x158 JUMPI PUSH2 0x152 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x170 JUMPI PUSH2 0x16A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x188 JUMPI PUSH2 0x182 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x15 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xE6 SUB PUSH2 0x1A0 JUMPI PUSH2 0x19A PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x17 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xFA SUB PUSH2 0x1B8 JUMPI PUSH2 0x1B2 PUSH2 0x2C3 JUMP JUMPDEST POP PUSH1 0x19 SWAP1 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1D0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1E0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP2 DUP5 SGT DUP3 DUP5 SGT DUP1 DUP3 AND DUP7 DUP5 DIV DUP7 GT AND ISZERO PUSH2 0x223 JUMPI PUSH2 0x223 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL PUSH1 0x0 DUP8 SLT DUP3 DUP2 AND DUP8 DUP4 SDIV DUP10 SLT AND ISZERO PUSH2 0x242 JUMPI PUSH2 0x242 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x0 DUP8 SLT SWAP3 POP DUP8 DUP3 SDIV DUP8 SLT DUP5 DUP5 AND AND ISZERO PUSH2 0x25E JUMPI PUSH2 0x25E PUSH2 0x1E7 JUMP JUMPDEST DUP8 DUP6 SDIV DUP8 SLT DUP2 DUP5 AND AND ISZERO PUSH2 0x274 JUMPI PUSH2 0x274 PUSH2 0x1E7 JUMP JUMPDEST POP POP POP SWAP3 SWAP1 SWAP4 MUL SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 SLT DUP1 ISZERO PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 SWAP1 SUB DUP6 SGT AND ISZERO PUSH2 0x2A4 JUMPI PUSH2 0x2A4 PUSH2 0x1E7 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL DUP4 SWAP1 SUB DUP5 SLT DUP2 AND ISZERO PUSH2 0x2BD JUMPI PUSH2 0x2BD PUSH2 0x1E7 JUMP JUMPDEST POP POP ADD SWAP1 JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 ADDRESS MSTORE 0x28 0xEB PUSH3 0x2814E4 0x5E NOT 0xE7 0xF9 DUP1 POP 0x25 0xD8 RETURNDATACOPY EQ 0xEC PUSH10 0x4DDE980CB7B4FC268D95 SWAP5 LOG1 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "25:1257:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1186:94;;;;;;:::i;:::-;;:::i;:::-;;109:1072;;;:::i;:::-;;;436:25:3;;;424:2;409:18;109:1072:0;;;;;;;1186:94;1247:1;:25;;1270:1;1247:25;;;1258:1;1247:25;1242:1;;1232:11;;1239:1;1232:11;:::i;:::-;:41;;;;:::i;:::-;1228:1;:45;-1:-1:-1;1186:94:0:o;109:1072::-;146:8;170:1;;175:2;170:7;166:73;;193:13;;:::i;:::-;-1:-1:-1;227:1:0;;109:1072::o;166:73::-;252:1;;257:2;252:7;248:73;;275:13;;:::i;:::-;-1:-1:-1;309:1:0;;109:1072::o;248:73::-;334:1;;339:2;334:7;330:73;;357:13;;:::i;:::-;-1:-1:-1;391:1:0;;109:1072::o;330:73::-;416:1;;421:2;416:7;412:73;;439:13;;:::i;:::-;-1:-1:-1;473:1:0;;109:1072::o;412:73::-;498:1;;503:3;498:8;494:75;;522:13;;:::i;:::-;-1:-1:-1;556:2:0;;109:1072::o;494:75::-;582:1;;587:3;582:8;578:75;;606:13;;:::i;:::-;-1:-1:-1;640:2:0;;109:1072::o;578:75::-;666:1;;671:3;666:8;662:75;;690:13;;:::i;:::-;-1:-1:-1;724:2:0;;109:1072::o;662:75::-;750:1;;755:3;750:8;746:75;;774:13;;:::i;:::-;-1:-1:-1;808:2:0;;109:1072::o;746:75::-;834:1;;839:3;834:8;830:75;;858:13;;:::i;:::-;-1:-1:-1;892:2:0;;109:1072::o;830:75::-;918:1;;923:3;918:8;914:75;;942:13;;:::i;:::-;-1:-1:-1;976:2:0;;109:1072::o;914:75::-;1002:1;;1007:3;1002:8;998:75;;1026:13;;:::i;:::-;-1:-1:-1;1060:2:0;;109:1072::o;998:75::-;1086:1;;1091:3;1086:8;1082:75;;1110:13;;:::i;:::-;-1:-1:-1;1144:2:0;;109:1072::o;1082:75::-;-1:-1:-1;1173:1:0;;109:1072::o;14:273:3:-;70:6;123:2;111:9;102:7;98:23;94:32;91:52;;;139:1;136;129:12;91:52;178:9;165:23;231:5;224:13;217:21;210:5;207:32;197:60;;253:1;250;243:12;197:60;276:5;14:273;-1:-1:-1;;;14:273:3:o;472:127::-;533:10;528:3;524:20;521:1;514:31;564:4;561:1;554:15;588:4;585:1;578:15;604:553;643:7;-1:-1:-1;;;;;713:9:3;;;741;;;766:11;;;785:10;;;779:17;;762:35;759:61;;;800:18;;:::i;:::-;-1:-1:-1;;;876:1:3;869:9;;894:11;;;914;;;907:19;;890:37;887:63;;;930:18;;:::i;:::-;976:1;973;969:9;959:19;;1023:1;1019:2;1014:11;1011:1;1007:19;1002:2;998;994:11;990:37;987:63;;;1030:18;;:::i;:::-;1095:1;1091:2;1086:11;1083:1;1079:19;1074:2;1070;1066:11;1062:37;1059:63;;;1102:18;;:::i;:::-;-1:-1:-1;;;1142:9:3;;;;;604:553;-1:-1:-1;;;604:553:3:o;1162:265::-;1201:3;1229:9;;;1254:10;;-1:-1:-1;;;;;1273:27:3;;;1266:35;;1250:52;1247:78;;;1305:18;;:::i;:::-;-1:-1:-1;;;1352:19:3;;;1345:27;;1337:36;;1334:62;;;1376:18;;:::i;:::-;-1:-1:-1;;1412:9:3;;1162:265::o;1432:127::-;1493:10;1488:3;1484:20;1481:1;1474:31;1524:4;1521:1;1514:15;1548:4;1545:1;1538:15", + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1561:3", + "statements": [ + { + "nodeType": "YulBlock", + "src": "6:3:3", + "statements": [] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "81:206:3", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "127:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "136:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "139:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "129:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "129:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "129:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "102:7:3" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "111:9:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "98:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "98:23:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "123:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "94:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "94:32:3" + }, + "nodeType": "YulIf", + "src": "91:52:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "152:36:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "178:9:3" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "165:12:3" + }, + "nodeType": "YulFunctionCall", + "src": "165:23:3" + }, + "variables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "156:5:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "241:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "250:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "253:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "243:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "243:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "243:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "210:5:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "231:5:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "224:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "224:13:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "217:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "217:21:3" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "207:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "207:32:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "200:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "200:40:3" + }, + "nodeType": "YulIf", + "src": "197:60:3" + }, + { + "nodeType": "YulAssignment", + "src": "266:15:3", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "276:5:3" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "266:6:3" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "47:9:3", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "58:7:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "70:6:3", + "type": "" + } + ], + "src": "14:273:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "391:76:3", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "401:26:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "413:9:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "424:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "409:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "409:18:3" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "401:4:3" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "443:9:3" + }, + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "454:6:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "436:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "436:25:3" + }, + "nodeType": "YulExpressionStatement", + "src": "436:25:3" + } + ] + }, + "name": "abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "360:9:3", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "371:6:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "382:4:3", + "type": "" + } + ], + "src": "292:175:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "504:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "521:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "528:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "533:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "524:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "524:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "514:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "514:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "514:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "561:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "564:4:3", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "554:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "554:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "554:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "585:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "588:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "578:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "578:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "578:15:3" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "472:127:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "655:502:3", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "665:29:3", + "value": { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "683:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "688:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "679:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "679:11:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "692:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "675:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "675:19:3" + }, + "variables": [ + { + "name": "_1", + "nodeType": "YulTypedName", + "src": "669:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "703:19:3", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "717:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "720:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "713:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "713:9:3" + }, + "variables": [ + { + "name": "_2", + "nodeType": "YulTypedName", + "src": "707:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "731:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "745:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "748:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "741:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "741:9:3" + }, + "variables": [ + { + "name": "_3", + "nodeType": "YulTypedName", + "src": "735:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "798:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "800:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "800:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "800:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_3", + "nodeType": "YulIdentifier", + "src": "770:2:3" + }, + { + "name": "_2", + "nodeType": "YulIdentifier", + "src": "774:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "766:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "766:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "782:1:3" + }, + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "789:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "793:1:3" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "785:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "785:10:3" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "779:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "779:17:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "762:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "762:35:3" + }, + "nodeType": "YulIf", + "src": "759:61:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "829:21:3", + "value": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "843:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "848:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "839:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "839:11:3" + }, + "variables": [ + { + "name": "_4", + "nodeType": "YulTypedName", + "src": "833:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "859:19:3", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "873:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "876:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "869:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "869:9:3" + }, + "variables": [ + { + "name": "_5", + "nodeType": "YulTypedName", + "src": "863:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "928:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "930:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "930:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "930:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_3", + "nodeType": "YulIdentifier", + "src": "898:2:3" + }, + { + "name": "_5", + "nodeType": "YulIdentifier", + "src": "902:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "894:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "894:11:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "911:1:3" + }, + { + "arguments": [ + { + "name": "_4", + "nodeType": "YulIdentifier", + "src": "919:2:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "923:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "914:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "914:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "907:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "907:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "890:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "890:37:3" + }, + "nodeType": "YulIf", + "src": "887:63:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "959:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "973:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "976:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "969:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "969:9:3" + }, + "variables": [ + { + "name": "_6", + "nodeType": "YulTypedName", + "src": "963:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1028:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1030:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1030:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1030:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_6", + "nodeType": "YulIdentifier", + "src": "998:2:3" + }, + { + "name": "_2", + "nodeType": "YulIdentifier", + "src": "1002:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "994:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "994:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1011:1:3" + }, + { + "arguments": [ + { + "name": "_4", + "nodeType": "YulIdentifier", + "src": "1019:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1023:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "1014:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "1014:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1007:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1007:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "990:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "990:37:3" + }, + "nodeType": "YulIf", + "src": "987:63:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1100:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1102:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1102:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1102:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_6", + "nodeType": "YulIdentifier", + "src": "1070:2:3" + }, + { + "name": "_5", + "nodeType": "YulIdentifier", + "src": "1074:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1066:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1066:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1083:1:3" + }, + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1091:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1095:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "1086:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "1086:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1079:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1079:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1062:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1062:37:3" + }, + "nodeType": "YulIf", + "src": "1059:63:3" + }, + { + "nodeType": "YulAssignment", + "src": "1131:20:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1146:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1149:1:3" + } + ], + "functionName": { + "name": "mul", + "nodeType": "YulIdentifier", + "src": "1142:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1142:9:3" + }, + "variableNames": [ + { + "name": "product", + "nodeType": "YulIdentifier", + "src": "1131:7:3" + } + ] + } + ] + }, + "name": "checked_mul_t_int256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "634:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "637:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nodeType": "YulTypedName", + "src": "643:7:3", + "type": "" + } + ], + "src": "604:553:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1209:218:3", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1219:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1233:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1236:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1229:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1229:9:3" + }, + "variables": [ + { + "name": "_1", + "nodeType": "YulTypedName", + "src": "1223:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1303:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1305:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1305:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1305:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1261:2:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1254:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "1254:10:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1270:1:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1285:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1290:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "1281:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1281:11:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1294:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1277:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1277:19:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1298:1:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1273:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1273:27:3" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "1266:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1266:35:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1250:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1250:52:3" + }, + "nodeType": "YulIf", + "src": "1247:78:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1374:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1376:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1376:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1376:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1341:2:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1349:1:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1360:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1365:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "1356:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1356:11:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1369:1:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1352:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1352:19:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1345:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1345:27:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1337:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1337:36:3" + }, + "nodeType": "YulIf", + "src": "1334:62:3" + }, + { + "nodeType": "YulAssignment", + "src": "1405:16:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1416:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1419:1:3" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1412:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1412:9:3" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "1405:3:3" + } + ] + } + ] + }, + "name": "checked_add_t_int256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "1192:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "1195:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "1201:3:3", + "type": "" + } + ], + "src": "1162:265:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1464:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1481:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1488:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1493:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "1484:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1484:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1474:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "1474:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1474:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1521:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1524:4:3", + "type": "", + "value": "0x01" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "1514:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "1514:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1514:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1545:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1548:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "1538:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "1538:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1538:15:3" + } + ] + }, + "name": "panic_error_0x01", + "nodeType": "YulFunctionDefinition", + "src": "1432:127:3" + } + ] + }, + "contents": "{\n { }\n function abi_decode_tuple_t_bool(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n value0 := value\n }\n function abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function panic_error_0x11()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n function checked_mul_t_int256(x, y) -> product\n {\n let _1 := sub(shl(255, 1), 1)\n let _2 := sgt(y, 0)\n let _3 := sgt(x, 0)\n if and(and(_3, _2), gt(x, div(_1, y))) { panic_error_0x11() }\n let _4 := shl(255, 1)\n let _5 := slt(y, 0)\n if and(and(_3, _5), slt(y, sdiv(_4, x))) { panic_error_0x11() }\n let _6 := slt(x, 0)\n if and(and(_6, _2), slt(x, sdiv(_4, y))) { panic_error_0x11() }\n if and(and(_6, _5), slt(x, sdiv(_1, y))) { panic_error_0x11() }\n product := mul(x, y)\n }\n function checked_add_t_int256(x, y) -> sum\n {\n let _1 := slt(x, 0)\n if and(iszero(_1), sgt(y, sub(sub(shl(255, 1), 1), x))) { panic_error_0x11() }\n if and(_1, slt(y, sub(shl(255, 1), x))) { panic_error_0x11() }\n sum := add(x, y)\n }\n function panic_error_0x01()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x01)\n revert(0, 0x24)\n }\n}", + "id": 3, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {} + }, + "methodIdentifiers": { + "ABCD()": "e88184ca", + "SetNext(bool)": "df5b7227" + } + } + } + }, + "src/Bar.sol": { + "Bar": { + "abi": [ + { + "inputs": [], + "name": "AAB", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AAB\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Bar.sol\":\"Bar\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/Bar.sol\":{\"keccak256\":\"0x36ce0329d6e41eb2ffa87a181b303dc85f1d771b974c4b8cbe4b8e50d891edc4\",\"urls\":[\"bzz-raw://988171982d1c708124cb34a43d030e4f86b3b9d0073631386d4d64612af3398e\",\"dweb:/ipfs/Qmd1WNq5eBpCHvXRMHcwB6Ph76MbRdCs8nfzg6i7FuGT5B\"]}},\"version\":1}", + "userdoc": {}, + "devdoc": {}, + "evm": { + "bytecode": { + "object": "608060405234801561001057600080fd5b50610266806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x266 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x43C10FF1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x55 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x6A JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x68 PUSH2 0x63 CALLDATASIZE PUSH1 0x4 PUSH2 0x1A4 JUMP JUMPDEST PUSH2 0x173 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xA SUB PUSH2 0x83 JUMPI PUSH2 0x7D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x1 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1E SUB PUSH2 0x9B JUMPI PUSH2 0x95 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xB3 JUMPI PUSH2 0xAD PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xCB JUMPI PUSH2 0xC5 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xE3 JUMPI PUSH2 0xDD PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0xFB JUMPI PUSH2 0xF5 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x113 JUMPI PUSH2 0x10D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x12B JUMPI PUSH2 0x125 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x143 JUMPI PUSH2 0x13D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x15B JUMPI PUSH2 0x155 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x16D JUMPI PUSH2 0x155 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x17F JUMPI PUSH1 0x0 PUSH2 0x182 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND PUSH1 0x0 SLOAD PUSH1 0x2 PUSH2 0x194 SWAP2 SWAP1 PUSH2 0x1F9 JUMP JUMPDEST PUSH2 0x19E SWAP2 SWAP1 PUSH2 0x218 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 NOT DIV DUP4 GT DUP3 ISZERO ISZERO AND ISZERO PUSH2 0x213 JUMPI PUSH2 0x213 PUSH2 0x1E3 JUMP JUMPDEST POP MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH2 0x22B JUMPI PUSH2 0x22B PUSH2 0x1E3 JUMP JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH27 0x46352C6F97EDFE01E7D632555C39F22902F3548793B50890640B22 0x28 MLOAD MLOAD 0xD5 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "26:1105:1:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "functionDebugData": { + "@AAB_305": { + "entryPoint": 106, + "id": 305, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@SetNext_323": { + "entryPoint": 371, + "id": 323, + "parameterSlots": 1, + "returnSlots": 0 + }, + "abi_decode_tuple_t_bool": { + "entryPoint": 420, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_add_t_uint256": { + "entryPoint": 536, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_mul_t_uint256": { + "entryPoint": 505, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "panic_error_0x01": { + "entryPoint": 461, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x11": { + "entryPoint": 483, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + } + }, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x43C10FF1 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x55 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x6A JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x68 PUSH2 0x63 CALLDATASIZE PUSH1 0x4 PUSH2 0x1A4 JUMP JUMPDEST PUSH2 0x173 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xA SUB PUSH2 0x83 JUMPI PUSH2 0x7D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x1 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1E SUB PUSH2 0x9B JUMPI PUSH2 0x95 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xB3 JUMPI PUSH2 0xAD PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xCB JUMPI PUSH2 0xC5 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xE3 JUMPI PUSH2 0xDD PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0xFB JUMPI PUSH2 0xF5 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x113 JUMPI PUSH2 0x10D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x12B JUMPI PUSH2 0x125 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x143 JUMPI PUSH2 0x13D PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x15B JUMPI PUSH2 0x155 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x16D JUMPI PUSH2 0x155 PUSH2 0x1CD JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x17F JUMPI PUSH1 0x0 PUSH2 0x182 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0xFF AND PUSH1 0x0 SLOAD PUSH1 0x2 PUSH2 0x194 SWAP2 SWAP1 PUSH2 0x1F9 JUMP JUMPDEST PUSH2 0x19E SWAP2 SWAP1 PUSH2 0x218 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1C6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 DUP2 PUSH1 0x0 NOT DIV DUP4 GT DUP3 ISZERO ISZERO AND ISZERO PUSH2 0x213 JUMPI PUSH2 0x213 PUSH2 0x1E3 JUMP JUMPDEST POP MUL SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP3 NOT DUP3 GT ISZERO PUSH2 0x22B JUMPI PUSH2 0x22B PUSH2 0x1E3 JUMP JUMPDEST POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH27 0x46352C6F97EDFE01E7D632555C39F22902F3548793B50890640B22 0x28 MLOAD MLOAD 0xD5 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "26:1105:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;70:984;;;:::i;:::-;;;160:25:3;;;148:2;133:18;70:984:1;;;;;;;1059:70;;;;;;:::i;:::-;;:::i;:::-;;70:984;106:7;129:1;;134:2;129:7;125:73;;152:13;;:::i;:::-;-1:-1:-1;186:1:1;;70:984::o;125:73::-;211:1;;216:2;211:7;207:73;;234:13;;:::i;:::-;-1:-1:-1;268:1:1;;70:984::o;207:73::-;293:1;;298:2;293:7;289:73;;316:13;;:::i;:::-;-1:-1:-1;350:1:1;;70:984::o;289:73::-;375:1;;380:2;375:7;371:73;;398:13;;:::i;:::-;-1:-1:-1;432:1:1;;70:984::o;371:73::-;457:1;;462:2;457:7;453:73;;480:13;;:::i;:::-;-1:-1:-1;514:1:1;;70:984::o;453:73::-;539:1;;544:3;539:8;535:75;;563:13;;:::i;:::-;-1:-1:-1;597:2:1;;70:984::o;535:75::-;623:1;;628:3;623:8;619:75;;647:13;;:::i;:::-;-1:-1:-1;681:2:1;;70:984::o;619:75::-;707:1;;712:3;707:8;703:75;;731:13;;:::i;:::-;-1:-1:-1;765:2:1;;70:984::o;703:75::-;791:1;;796:3;791:8;787:75;;815:13;;:::i;:::-;-1:-1:-1;849:2:1;;70:984::o;787:75::-;875:1;;880:3;875:8;871:75;;899:13;;:::i;:::-;-1:-1:-1;933:2:1;;70:984::o;871:75::-;959:1;;964:3;959:8;955:75;;983:13;;:::i;955:75::-;-1:-1:-1;1046:1:1;;70:984::o;1059:70::-;1112:1;:9;;1120:1;1112:9;;;1116:1;1112:9;1105:17;;1107:1;;1105;:3;;;;:::i;:::-;:17;;;;:::i;:::-;1101:1;:21;-1:-1:-1;1059:70:1:o;196:273:3:-;252:6;305:2;293:9;284:7;280:23;276:32;273:52;;;321:1;318;311:12;273:52;360:9;347:23;413:5;406:13;399:21;392:5;389:32;379:60;;435:1;432;425:12;379:60;458:5;196:273;-1:-1:-1;;;196:273:3:o;474:127::-;535:10;530:3;526:20;523:1;516:31;566:4;563:1;556:15;590:4;587:1;580:15;606:127;667:10;662:3;658:20;655:1;648:31;698:4;695:1;688:15;722:4;719:1;712:15;738:168;778:7;844:1;840;836:6;832:14;829:1;826:21;821:1;814:9;807:17;803:45;800:71;;;851:18;;:::i;:::-;-1:-1:-1;891:9:3;;738:168::o;911:128::-;951:3;982:1;978:6;975:1;972:13;969:39;;;988:18;;:::i;:::-;-1:-1:-1;1024:9:3;;911:128::o", + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1041:3", + "statements": [ + { + "nodeType": "YulBlock", + "src": "6:3:3", + "statements": [] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "115:76:3", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "125:26:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "137:9:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "148:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "133:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "133:18:3" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "125:4:3" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "167:9:3" + }, + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "178:6:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "160:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "160:25:3" + }, + "nodeType": "YulExpressionStatement", + "src": "160:25:3" + } + ] + }, + "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "84:9:3", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "95:6:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "106:4:3", + "type": "" + } + ], + "src": "14:177:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "263:206:3", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "309:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "318:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "321:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "311:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "311:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "311:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "284:7:3" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "293:9:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "280:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "280:23:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "305:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "276:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "276:32:3" + }, + "nodeType": "YulIf", + "src": "273:52:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "334:36:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "360:9:3" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "347:12:3" + }, + "nodeType": "YulFunctionCall", + "src": "347:23:3" + }, + "variables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "338:5:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "423:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "432:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "435:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "425:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "425:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "425:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "392:5:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "413:5:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "406:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "406:13:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "399:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "399:21:3" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "389:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "389:32:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "382:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "382:40:3" + }, + "nodeType": "YulIf", + "src": "379:60:3" + }, + { + "nodeType": "YulAssignment", + "src": "448:15:3", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "458:5:3" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "448:6:3" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "229:9:3", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "240:7:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "252:6:3", + "type": "" + } + ], + "src": "196:273:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "506:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "523:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "530:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "535:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "526:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "526:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "516:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "516:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "516:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "563:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "566:4:3", + "type": "", + "value": "0x01" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "556:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "556:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "556:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "587:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "590:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "580:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "580:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "580:15:3" + } + ] + }, + "name": "panic_error_0x01", + "nodeType": "YulFunctionDefinition", + "src": "474:127:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "638:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "655:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "662:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "667:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "658:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "658:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "648:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "648:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "648:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "695:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "698:4:3", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "688:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "688:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "688:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "719:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "722:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "712:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "712:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "712:15:3" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "606:127:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "790:116:3", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "849:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "851:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "851:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "851:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "821:1:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "814:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "814:9:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "807:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "807:17:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "829:1:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "840:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "not", + "nodeType": "YulIdentifier", + "src": "836:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "836:6:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "844:1:3" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "832:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "832:14:3" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "826:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "826:21:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "803:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "803:45:3" + }, + "nodeType": "YulIf", + "src": "800:71:3" + }, + { + "nodeType": "YulAssignment", + "src": "880:20:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "895:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "898:1:3" + } + ], + "functionName": { + "name": "mul", + "nodeType": "YulIdentifier", + "src": "891:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "891:9:3" + }, + "variableNames": [ + { + "name": "product", + "nodeType": "YulIdentifier", + "src": "880:7:3" + } + ] + } + ] + }, + "name": "checked_mul_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "769:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "772:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nodeType": "YulTypedName", + "src": "778:7:3", + "type": "" + } + ], + "src": "738:168:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "959:80:3", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "986:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "988:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "988:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "988:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "975:1:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "982:1:3" + } + ], + "functionName": { + "name": "not", + "nodeType": "YulIdentifier", + "src": "978:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "978:6:3" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "972:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "972:13:3" + }, + "nodeType": "YulIf", + "src": "969:39:3" + }, + { + "nodeType": "YulAssignment", + "src": "1017:16:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1028:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1031:1:3" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1024:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1024:9:3" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "1017:3:3" + } + ] + } + ] + }, + "name": "checked_add_t_uint256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "942:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "945:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "951:3:3", + "type": "" + } + ], + "src": "911:128:3" + } + ] + }, + "contents": "{\n { }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_decode_tuple_t_bool(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n value0 := value\n }\n function panic_error_0x01()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x01)\n revert(0, 0x24)\n }\n function panic_error_0x11()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n function checked_mul_t_uint256(x, y) -> product\n {\n if and(iszero(iszero(x)), gt(y, div(not(0), x))) { panic_error_0x11() }\n product := mul(x, y)\n }\n function checked_add_t_uint256(x, y) -> sum\n {\n if gt(x, not(y)) { panic_error_0x11() }\n sum := add(x, y)\n }\n}", + "id": 3, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {} + }, + "methodIdentifiers": { + "AAB()": "43c10ff1", + "SetNext(bool)": "df5b7227" + } + } + } + }, + "src/Foo.sol": { + "Foo": { + "abi": [ + { + "inputs": [], + "name": "Bar", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "b", + "type": "bool" + } + ], + "name": "SetNext", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"Bar\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"b\",\"type\":\"bool\"}],\"name\":\"SetNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/Foo.sol\":\"Foo\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/Foo.sol\":{\"keccak256\":\"0x79514bc3378c34d9543df3a499a2b256d2f7fd52a71255be8135eb4b173ece8c\",\"urls\":[\"bzz-raw://3487e0061ffd25780b7d0329c51f6a0c2ba5c9fa8dd26478439463cbbf57ed68\",\"dweb:/ipfs/QmVdNRmRceNxweUscLF88gUxCWDEDejybw8UV66cZKPn6j\"]}},\"version\":1}", + "userdoc": {}, + "devdoc": {}, + "evm": { + "bytecode": { + "object": "608060405234801561001057600080fd5b506102f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x2F7 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xB0A378B0 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x55 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x6A JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x68 PUSH2 0x63 CALLDATASIZE PUSH1 0x4 PUSH2 0x1A6 JUMP JUMPDEST PUSH2 0x179 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xA SUB PUSH2 0x83 JUMPI PUSH2 0x7D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x1 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1E SUB PUSH2 0x9B JUMPI PUSH2 0x95 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xB3 JUMPI PUSH2 0xAD PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xCB JUMPI PUSH2 0xC5 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xE3 JUMPI PUSH2 0xDD PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0xFB JUMPI PUSH2 0xF5 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x113 JUMPI PUSH2 0x10D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x12B JUMPI PUSH2 0x125 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x143 JUMPI PUSH2 0x13D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x15B JUMPI PUSH2 0x155 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x173 JUMPI PUSH2 0x16D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x15 SWAP1 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x185 JUMPI PUSH1 0x0 PUSH2 0x188 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0x0 SLOAD PUSH2 0x196 SWAP1 PUSH1 0x2 PUSH2 0x1FB JUMP JUMPDEST PUSH2 0x1A0 SWAP2 SWAP1 PUSH2 0x280 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP2 DUP5 SGT DUP3 DUP5 SGT DUP1 DUP3 AND DUP7 DUP5 DIV DUP7 GT AND ISZERO PUSH2 0x221 JUMPI PUSH2 0x221 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL PUSH1 0x0 DUP8 SLT DUP3 DUP2 AND DUP8 DUP4 SDIV DUP10 SLT AND ISZERO PUSH2 0x240 JUMPI PUSH2 0x240 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x0 DUP8 SLT SWAP3 POP DUP8 DUP3 SDIV DUP8 SLT DUP5 DUP5 AND AND ISZERO PUSH2 0x25C JUMPI PUSH2 0x25C PUSH2 0x1E5 JUMP JUMPDEST DUP8 DUP6 SDIV DUP8 SLT DUP2 DUP5 AND AND ISZERO PUSH2 0x272 JUMPI PUSH2 0x272 PUSH2 0x1E5 JUMP JUMPDEST POP POP POP SWAP3 SWAP1 SWAP4 MUL SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 SLT DUP1 ISZERO PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 SWAP1 SUB DUP6 SGT AND ISZERO PUSH2 0x2A2 JUMPI PUSH2 0x2A2 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL DUP4 SWAP1 SUB DUP5 SLT DUP2 AND ISZERO PUSH2 0x2BB JUMPI PUSH2 0x2BB PUSH2 0x1E5 JUMP JUMPDEST POP POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SDIV 0xA8 PUSH13 0x72700D9CCB2087302E6D531DE1 GASPRICE EXTCODEHASH 0xAD NOT LOG2 SIGNEXTEND CALLDATALOAD CALLVALUE DUP1 0xD8 BALANCE 0xEF 0x4D 0x2B ISZERO 0xE7 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "25:1125:2:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "functionDebugData": { + "@Bar_457": { + "entryPoint": 106, + "id": 457, + "parameterSlots": 0, + "returnSlots": 1 + }, + "@SetNext_484": { + "entryPoint": 377, + "id": 484, + "parameterSlots": 1, + "returnSlots": 0 + }, + "abi_decode_tuple_t_bool": { + "entryPoint": 422, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed": { + "entryPoint": null, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_add_t_int256": { + "entryPoint": 640, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "checked_mul_t_int256": { + "entryPoint": 507, + "id": null, + "parameterSlots": 2, + "returnSlots": 1 + }, + "panic_error_0x01": { + "entryPoint": 463, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + }, + "panic_error_0x11": { + "entryPoint": 485, + "id": null, + "parameterSlots": 0, + "returnSlots": 0 + } + }, + "object": "608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033", + "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x36 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xB0A378B0 EQ PUSH2 0x3B JUMPI DUP1 PUSH4 0xDF5B7227 EQ PUSH2 0x55 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x6A JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH2 0x68 PUSH2 0x63 CALLDATASIZE PUSH1 0x4 PUSH2 0x1A6 JUMP JUMPDEST PUSH2 0x179 JUMP JUMPDEST STOP JUMPDEST PUSH1 0x0 DUP1 SLOAD PUSH1 0xA SUB PUSH2 0x83 JUMPI PUSH2 0x7D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x1 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x1E SUB PUSH2 0x9B JUMPI PUSH2 0x95 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x3 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x32 SUB PUSH2 0xB3 JUMPI PUSH2 0xAD PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x5 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x46 SUB PUSH2 0xCB JUMPI PUSH2 0xC5 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x7 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x5A SUB PUSH2 0xE3 JUMPI PUSH2 0xDD PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x9 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x6E SUB PUSH2 0xFB JUMPI PUSH2 0xF5 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xB SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x82 SUB PUSH2 0x113 JUMPI PUSH2 0x10D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xD SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0x96 SUB PUSH2 0x12B JUMPI PUSH2 0x125 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0xF SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xAA SUB PUSH2 0x143 JUMPI PUSH2 0x13D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x11 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xBE SUB PUSH2 0x15B JUMPI PUSH2 0x155 PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x13 SWAP1 JUMP JUMPDEST PUSH1 0x0 SLOAD PUSH1 0xD2 SUB PUSH2 0x173 JUMPI PUSH2 0x16D PUSH2 0x1CF JUMP JUMPDEST POP PUSH1 0x15 SWAP1 JUMP JUMPDEST POP PUSH1 0x0 SWAP1 JUMP JUMPDEST DUP1 PUSH2 0x185 JUMPI PUSH1 0x0 PUSH2 0x188 JUMP JUMPDEST PUSH1 0x1 JUMPDEST PUSH1 0x0 SLOAD PUSH2 0x196 SWAP1 PUSH1 0x2 PUSH2 0x1FB JUMP JUMPDEST PUSH2 0x1A0 SWAP2 SWAP1 PUSH2 0x280 JUMP JUMPDEST PUSH1 0x0 SSTORE POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x20 DUP3 DUP5 SUB SLT ISZERO PUSH2 0x1B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP1 ISZERO ISZERO DUP2 EQ PUSH2 0x1C8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x1 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x11 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP2 DUP5 SGT DUP3 DUP5 SGT DUP1 DUP3 AND DUP7 DUP5 DIV DUP7 GT AND ISZERO PUSH2 0x221 JUMPI PUSH2 0x221 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL PUSH1 0x0 DUP8 SLT DUP3 DUP2 AND DUP8 DUP4 SDIV DUP10 SLT AND ISZERO PUSH2 0x240 JUMPI PUSH2 0x240 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x0 DUP8 SLT SWAP3 POP DUP8 DUP3 SDIV DUP8 SLT DUP5 DUP5 AND AND ISZERO PUSH2 0x25C JUMPI PUSH2 0x25C PUSH2 0x1E5 JUMP JUMPDEST DUP8 DUP6 SDIV DUP8 SLT DUP2 DUP5 AND AND ISZERO PUSH2 0x272 JUMPI PUSH2 0x272 PUSH2 0x1E5 JUMP JUMPDEST POP POP POP SWAP3 SWAP1 SWAP4 MUL SWAP4 SWAP3 POP POP POP JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 SLT DUP1 ISZERO PUSH1 0x1 PUSH1 0x1 PUSH1 0xFF SHL SUB DUP5 SWAP1 SUB DUP6 SGT AND ISZERO PUSH2 0x2A2 JUMPI PUSH2 0x2A2 PUSH2 0x1E5 JUMP JUMPDEST PUSH1 0x1 PUSH1 0xFF SHL DUP4 SWAP1 SUB DUP5 SLT DUP2 AND ISZERO PUSH2 0x2BB JUMPI PUSH2 0x2BB PUSH2 0x1E5 JUMP JUMPDEST POP POP ADD SWAP1 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SDIV 0xA8 PUSH13 0x72700D9CCB2087302E6D531DE1 GASPRICE EXTCODEHASH 0xAD NOT LOG2 SIGNEXTEND CALLDATALOAD CALLVALUE DUP1 0xD8 BALANCE 0xEF 0x4D 0x2B ISZERO 0xE7 PUSH5 0x736F6C6343 STOP ADDMOD 0xD STOP CALLER ", + "sourceMap": "25:1125:2:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;66:983;;;:::i;:::-;;;158:25:3;;;146:2;131:18;66:983:2;;;;;;;1054:94;;;;;;:::i;:::-;;:::i;:::-;;66:983;102:6;124:1;;129:2;124:7;120:73;;147:13;;:::i;:::-;-1:-1:-1;181:1:2;;66:983::o;120:73::-;206:1;;211:2;206:7;202:73;;229:13;;:::i;:::-;-1:-1:-1;263:1:2;;66:983::o;202:73::-;288:1;;293:2;288:7;284:73;;311:13;;:::i;:::-;-1:-1:-1;345:1:2;;66:983::o;284:73::-;370:1;;375:2;370:7;366:73;;393:13;;:::i;:::-;-1:-1:-1;427:1:2;;66:983::o;366:73::-;452:1;;457:2;452:7;448:73;;475:13;;:::i;:::-;-1:-1:-1;509:1:2;;66:983::o;448:73::-;534:1;;539:3;534:8;530:75;;558:13;;:::i;:::-;-1:-1:-1;592:2:2;;66:983::o;530:75::-;618:1;;623:3;618:8;614:75;;642:13;;:::i;:::-;-1:-1:-1;676:2:2;;66:983::o;614:75::-;702:1;;707:3;702:8;698:75;;726:13;;:::i;:::-;-1:-1:-1;760:2:2;;66:983::o;698:75::-;786:1;;791:3;786:8;782:75;;810:13;;:::i;:::-;-1:-1:-1;844:2:2;;66:983::o;782:75::-;870:1;;875:3;870:8;866:75;;894:13;;:::i;:::-;-1:-1:-1;928:2:2;;66:983::o;866:75::-;954:1;;959:3;954:8;950:75;;978:13;;:::i;:::-;-1:-1:-1;1012:2:2;;66:983::o;950:75::-;-1:-1:-1;1041:1:2;;66:983::o;1054:94::-;1115:1;:25;;1138:1;1115:25;;;1126:1;1115:25;1110:1;;1100:11;;1107:1;1100:11;:::i;:::-;:41;;;;:::i;:::-;1096:1;:45;-1:-1:-1;1054:94:2:o;194:273:3:-;250:6;303:2;291:9;282:7;278:23;274:32;271:52;;;319:1;316;309:12;271:52;358:9;345:23;411:5;404:13;397:21;390:5;387:32;377:60;;433:1;430;423:12;377:60;456:5;194:273;-1:-1:-1;;;194:273:3:o;472:127::-;533:10;528:3;524:20;521:1;514:31;564:4;561:1;554:15;588:4;585:1;578:15;604:127;665:10;660:3;656:20;653:1;646:31;696:4;693:1;686:15;720:4;717:1;710:15;736:553;775:7;-1:-1:-1;;;;;845:9:3;;;873;;;898:11;;;917:10;;;911:17;;894:35;891:61;;;932:18;;:::i;:::-;-1:-1:-1;;;1008:1:3;1001:9;;1026:11;;;1046;;;1039:19;;1022:37;1019:63;;;1062:18;;:::i;:::-;1108:1;1105;1101:9;1091:19;;1155:1;1151:2;1146:11;1143:1;1139:19;1134:2;1130;1126:11;1122:37;1119:63;;;1162:18;;:::i;:::-;1227:1;1223:2;1218:11;1215:1;1211:19;1206:2;1202;1198:11;1194:37;1191:63;;;1234:18;;:::i;:::-;-1:-1:-1;;;1274:9:3;;;;;736:553;-1:-1:-1;;;736:553:3:o;1294:265::-;1333:3;1361:9;;;1386:10;;-1:-1:-1;;;;;1405:27:3;;;1398:35;;1382:52;1379:78;;;1437:18;;:::i;:::-;-1:-1:-1;;;1484:19:3;;;1477:27;;1469:36;;1466:62;;;1508:18;;:::i;:::-;-1:-1:-1;;1544:9:3;;1294:265::o", + "generatedSources": [ + { + "ast": { + "nodeType": "YulBlock", + "src": "0:1561:3", + "statements": [ + { + "nodeType": "YulBlock", + "src": "6:3:3", + "statements": [] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "113:76:3", + "statements": [ + { + "nodeType": "YulAssignment", + "src": "123:26:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "135:9:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "146:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "131:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "131:18:3" + }, + "variableNames": [ + { + "name": "tail", + "nodeType": "YulIdentifier", + "src": "123:4:3" + } + ] + }, + { + "expression": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "165:9:3" + }, + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "176:6:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "158:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "158:25:3" + }, + "nodeType": "YulExpressionStatement", + "src": "158:25:3" + } + ] + }, + "name": "abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "82:9:3", + "type": "" + }, + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "93:6:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "tail", + "nodeType": "YulTypedName", + "src": "104:4:3", + "type": "" + } + ], + "src": "14:175:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "261:206:3", + "statements": [ + { + "body": { + "nodeType": "YulBlock", + "src": "307:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "316:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "319:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "309:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "309:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "309:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "dataEnd", + "nodeType": "YulIdentifier", + "src": "282:7:3" + }, + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "291:9:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "278:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "278:23:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "303:2:3", + "type": "", + "value": "32" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "274:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "274:32:3" + }, + "nodeType": "YulIf", + "src": "271:52:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "332:36:3", + "value": { + "arguments": [ + { + "name": "headStart", + "nodeType": "YulIdentifier", + "src": "358:9:3" + } + ], + "functionName": { + "name": "calldataload", + "nodeType": "YulIdentifier", + "src": "345:12:3" + }, + "nodeType": "YulFunctionCall", + "src": "345:23:3" + }, + "variables": [ + { + "name": "value", + "nodeType": "YulTypedName", + "src": "336:5:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "421:16:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "430:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "433:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "423:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "423:12:3" + }, + "nodeType": "YulExpressionStatement", + "src": "423:12:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "390:5:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "name": "value", + "nodeType": "YulIdentifier", + "src": "411:5:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "404:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "404:13:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "397:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "397:21:3" + } + ], + "functionName": { + "name": "eq", + "nodeType": "YulIdentifier", + "src": "387:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "387:32:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "380:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "380:40:3" + }, + "nodeType": "YulIf", + "src": "377:60:3" + }, + { + "nodeType": "YulAssignment", + "src": "446:15:3", + "value": { + "name": "value", + "nodeType": "YulIdentifier", + "src": "456:5:3" + }, + "variableNames": [ + { + "name": "value0", + "nodeType": "YulIdentifier", + "src": "446:6:3" + } + ] + } + ] + }, + "name": "abi_decode_tuple_t_bool", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "headStart", + "nodeType": "YulTypedName", + "src": "227:9:3", + "type": "" + }, + { + "name": "dataEnd", + "nodeType": "YulTypedName", + "src": "238:7:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "value0", + "nodeType": "YulTypedName", + "src": "250:6:3", + "type": "" + } + ], + "src": "194:273:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "504:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "521:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "528:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "533:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "524:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "524:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "514:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "514:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "514:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "561:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "564:4:3", + "type": "", + "value": "0x01" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "554:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "554:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "554:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "585:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "588:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "578:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "578:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "578:15:3" + } + ] + }, + "name": "panic_error_0x01", + "nodeType": "YulFunctionDefinition", + "src": "472:127:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "636:95:3", + "statements": [ + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "653:1:3", + "type": "", + "value": "0" + }, + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "660:3:3", + "type": "", + "value": "224" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "665:10:3", + "type": "", + "value": "0x4e487b71" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "656:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "656:20:3" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "646:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "646:31:3" + }, + "nodeType": "YulExpressionStatement", + "src": "646:31:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "693:1:3", + "type": "", + "value": "4" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "696:4:3", + "type": "", + "value": "0x11" + } + ], + "functionName": { + "name": "mstore", + "nodeType": "YulIdentifier", + "src": "686:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "686:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "686:15:3" + }, + { + "expression": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "717:1:3", + "type": "", + "value": "0" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "720:4:3", + "type": "", + "value": "0x24" + } + ], + "functionName": { + "name": "revert", + "nodeType": "YulIdentifier", + "src": "710:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "710:15:3" + }, + "nodeType": "YulExpressionStatement", + "src": "710:15:3" + } + ] + }, + "name": "panic_error_0x11", + "nodeType": "YulFunctionDefinition", + "src": "604:127:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "787:502:3", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "797:29:3", + "value": { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "815:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "820:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "811:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "811:11:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "824:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "807:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "807:19:3" + }, + "variables": [ + { + "name": "_1", + "nodeType": "YulTypedName", + "src": "801:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "835:19:3", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "849:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "852:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "845:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "845:9:3" + }, + "variables": [ + { + "name": "_2", + "nodeType": "YulTypedName", + "src": "839:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "863:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "877:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "880:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "873:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "873:9:3" + }, + "variables": [ + { + "name": "_3", + "nodeType": "YulTypedName", + "src": "867:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "930:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "932:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "932:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "932:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_3", + "nodeType": "YulIdentifier", + "src": "902:2:3" + }, + { + "name": "_2", + "nodeType": "YulIdentifier", + "src": "906:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "898:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "898:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "914:1:3" + }, + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "921:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "925:1:3" + } + ], + "functionName": { + "name": "div", + "nodeType": "YulIdentifier", + "src": "917:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "917:10:3" + } + ], + "functionName": { + "name": "gt", + "nodeType": "YulIdentifier", + "src": "911:2:3" + }, + "nodeType": "YulFunctionCall", + "src": "911:17:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "894:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "894:35:3" + }, + "nodeType": "YulIf", + "src": "891:61:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "961:21:3", + "value": { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "975:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "980:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "971:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "971:11:3" + }, + "variables": [ + { + "name": "_4", + "nodeType": "YulTypedName", + "src": "965:2:3", + "type": "" + } + ] + }, + { + "nodeType": "YulVariableDeclaration", + "src": "991:19:3", + "value": { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1005:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1008:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1001:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1001:9:3" + }, + "variables": [ + { + "name": "_5", + "nodeType": "YulTypedName", + "src": "995:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1060:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1062:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1062:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1062:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_3", + "nodeType": "YulIdentifier", + "src": "1030:2:3" + }, + { + "name": "_5", + "nodeType": "YulIdentifier", + "src": "1034:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1026:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1026:11:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1043:1:3" + }, + { + "arguments": [ + { + "name": "_4", + "nodeType": "YulIdentifier", + "src": "1051:2:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1055:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "1046:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "1046:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1039:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1039:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1022:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1022:37:3" + }, + "nodeType": "YulIf", + "src": "1019:63:3" + }, + { + "nodeType": "YulVariableDeclaration", + "src": "1091:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1105:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1108:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1101:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1101:9:3" + }, + "variables": [ + { + "name": "_6", + "nodeType": "YulTypedName", + "src": "1095:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1160:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1162:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1162:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1162:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_6", + "nodeType": "YulIdentifier", + "src": "1130:2:3" + }, + { + "name": "_2", + "nodeType": "YulIdentifier", + "src": "1134:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1126:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1126:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1143:1:3" + }, + { + "arguments": [ + { + "name": "_4", + "nodeType": "YulIdentifier", + "src": "1151:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1155:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "1146:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "1146:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1139:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1139:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1122:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1122:37:3" + }, + "nodeType": "YulIf", + "src": "1119:63:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1232:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1234:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1234:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1234:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_6", + "nodeType": "YulIdentifier", + "src": "1202:2:3" + }, + { + "name": "_5", + "nodeType": "YulIdentifier", + "src": "1206:2:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1198:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1198:11:3" + }, + { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1215:1:3" + }, + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1223:2:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1227:1:3" + } + ], + "functionName": { + "name": "sdiv", + "nodeType": "YulIdentifier", + "src": "1218:4:3" + }, + "nodeType": "YulFunctionCall", + "src": "1218:11:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1211:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1211:19:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1194:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1194:37:3" + }, + "nodeType": "YulIf", + "src": "1191:63:3" + }, + { + "nodeType": "YulAssignment", + "src": "1263:20:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1278:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1281:1:3" + } + ], + "functionName": { + "name": "mul", + "nodeType": "YulIdentifier", + "src": "1274:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1274:9:3" + }, + "variableNames": [ + { + "name": "product", + "nodeType": "YulIdentifier", + "src": "1263:7:3" + } + ] + } + ] + }, + "name": "checked_mul_t_int256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "766:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "769:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "product", + "nodeType": "YulTypedName", + "src": "775:7:3", + "type": "" + } + ], + "src": "736:553:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1341:218:3", + "statements": [ + { + "nodeType": "YulVariableDeclaration", + "src": "1351:19:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1365:1:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1368:1:3", + "type": "", + "value": "0" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1361:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1361:9:3" + }, + "variables": [ + { + "name": "_1", + "nodeType": "YulTypedName", + "src": "1355:2:3", + "type": "" + } + ] + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1435:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1437:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1437:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1437:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1393:2:3" + } + ], + "functionName": { + "name": "iszero", + "nodeType": "YulIdentifier", + "src": "1386:6:3" + }, + "nodeType": "YulFunctionCall", + "src": "1386:10:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1402:1:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1417:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1422:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "1413:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1413:11:3" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1426:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1409:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1409:19:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1430:1:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1405:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1405:27:3" + } + ], + "functionName": { + "name": "sgt", + "nodeType": "YulIdentifier", + "src": "1398:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1398:35:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1382:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1382:52:3" + }, + "nodeType": "YulIf", + "src": "1379:78:3" + }, + { + "body": { + "nodeType": "YulBlock", + "src": "1506:22:3", + "statements": [ + { + "expression": { + "arguments": [], + "functionName": { + "name": "panic_error_0x11", + "nodeType": "YulIdentifier", + "src": "1508:16:3" + }, + "nodeType": "YulFunctionCall", + "src": "1508:18:3" + }, + "nodeType": "YulExpressionStatement", + "src": "1508:18:3" + } + ] + }, + "condition": { + "arguments": [ + { + "name": "_1", + "nodeType": "YulIdentifier", + "src": "1473:2:3" + }, + { + "arguments": [ + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1481:1:3" + }, + { + "arguments": [ + { + "arguments": [ + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1492:3:3", + "type": "", + "value": "255" + }, + { + "kind": "number", + "nodeType": "YulLiteral", + "src": "1497:1:3", + "type": "", + "value": "1" + } + ], + "functionName": { + "name": "shl", + "nodeType": "YulIdentifier", + "src": "1488:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1488:11:3" + }, + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1501:1:3" + } + ], + "functionName": { + "name": "sub", + "nodeType": "YulIdentifier", + "src": "1484:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1484:19:3" + } + ], + "functionName": { + "name": "slt", + "nodeType": "YulIdentifier", + "src": "1477:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1477:27:3" + } + ], + "functionName": { + "name": "and", + "nodeType": "YulIdentifier", + "src": "1469:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1469:36:3" + }, + "nodeType": "YulIf", + "src": "1466:62:3" + }, + { + "nodeType": "YulAssignment", + "src": "1537:16:3", + "value": { + "arguments": [ + { + "name": "x", + "nodeType": "YulIdentifier", + "src": "1548:1:3" + }, + { + "name": "y", + "nodeType": "YulIdentifier", + "src": "1551:1:3" + } + ], + "functionName": { + "name": "add", + "nodeType": "YulIdentifier", + "src": "1544:3:3" + }, + "nodeType": "YulFunctionCall", + "src": "1544:9:3" + }, + "variableNames": [ + { + "name": "sum", + "nodeType": "YulIdentifier", + "src": "1537:3:3" + } + ] + } + ] + }, + "name": "checked_add_t_int256", + "nodeType": "YulFunctionDefinition", + "parameters": [ + { + "name": "x", + "nodeType": "YulTypedName", + "src": "1324:1:3", + "type": "" + }, + { + "name": "y", + "nodeType": "YulTypedName", + "src": "1327:1:3", + "type": "" + } + ], + "returnVariables": [ + { + "name": "sum", + "nodeType": "YulTypedName", + "src": "1333:3:3", + "type": "" + } + ], + "src": "1294:265:3" + } + ] + }, + "contents": "{\n { }\n function abi_encode_tuple_t_int256__to_t_int256__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n function abi_decode_tuple_t_bool(headStart, dataEnd) -> value0\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let value := calldataload(headStart)\n if iszero(eq(value, iszero(iszero(value)))) { revert(0, 0) }\n value0 := value\n }\n function panic_error_0x01()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x01)\n revert(0, 0x24)\n }\n function panic_error_0x11()\n {\n mstore(0, shl(224, 0x4e487b71))\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n function checked_mul_t_int256(x, y) -> product\n {\n let _1 := sub(shl(255, 1), 1)\n let _2 := sgt(y, 0)\n let _3 := sgt(x, 0)\n if and(and(_3, _2), gt(x, div(_1, y))) { panic_error_0x11() }\n let _4 := shl(255, 1)\n let _5 := slt(y, 0)\n if and(and(_3, _5), slt(y, sdiv(_4, x))) { panic_error_0x11() }\n let _6 := slt(x, 0)\n if and(and(_6, _2), slt(x, sdiv(_4, y))) { panic_error_0x11() }\n if and(and(_6, _5), slt(x, sdiv(_1, y))) { panic_error_0x11() }\n product := mul(x, y)\n }\n function checked_add_t_int256(x, y) -> sum\n {\n let _1 := slt(x, 0)\n if and(iszero(_1), sgt(y, sub(sub(shl(255, 1), 1), x))) { panic_error_0x11() }\n if and(_1, slt(y, sub(shl(255, 1), x))) { panic_error_0x11() }\n sum := add(x, y)\n }\n}", + "id": 3, + "language": "Yul", + "name": "#utility.yul" + } + ], + "linkReferences": {} + }, + "methodIdentifiers": { + "Bar()": "b0a378b0", + "SetNext(bool)": "df5b7227" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/src/ABC.sol b/tests/testdata/foundry_project/artifacts/src/ABC.sol new file mode 100644 index 0000000..2025d72 --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/src/ABC.sol @@ -0,0 +1,59 @@ +pragma solidity >=0.8.1; +contract ABC { + int256 private x; + /// #if_succeeds {:msg "P1"} y == 30; + function ABCD() public view returns (int256 y) { + if (x == 30) { + assert(false); + return 3; + } + if (x == 50) { + assert(false); + return 5; + } + if (x == 70) { + assert(false); + return 7; + } + if (x == 90) { + assert(false); + return 9; + } + if (x == 110) { + assert(false); + return 11; + } + if (x == 130) { + assert(false); + return 13; + } + if (x == 150) { + assert(false); + return 15; + } + if (x == 170) { + assert(false); + return 17; + } + if (x == 190) { + assert(false); + return 19; + } + if (x == 210) { + assert(false); + return 21; + } + if (x == 230) { + assert(false); + return 23; + } + if (x == 250) { + assert(false); + return 25; + } + return 0; + } + function SetNext(bool b) public { + x = int256(2)*x + (b ? int256(1) : int256(0)); + } +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/src/Bar.sol b/tests/testdata/foundry_project/artifacts/src/Bar.sol new file mode 100644 index 0000000..d6ffbfa --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/src/Bar.sol @@ -0,0 +1,57 @@ +pragma solidity >=0.8.1; + +contract Bar { + + uint256 private x; + + function AAB() public view returns (uint256) { + if (x == 10) { + assert(false); + return 1; + } + if (x == 30) { + assert(false); + return 3; + } + if (x == 50) { + assert(false); + return 5; + } + if (x == 70) { + assert(false); + return 7; + } + if (x == 90) { + assert(false); + return 9; + } + if (x == 110) { + assert(false); + return 11; + } + if (x == 130) { + assert(false); + return 13; + } + if (x == 150) { + assert(false); + return 15; + } + if (x == 170) { + assert(false); + return 17; + } + if (x == 190) { + assert(false); + return 19; + } + if (x == 210) { + assert(false); + return 19; + } + return 0; + } + function SetNext(bool b) public { + x = 2*x + (b ? 1 : 0); + } +} \ No newline at end of file diff --git a/tests/testdata/foundry_project/artifacts/src/Foo.sol b/tests/testdata/foundry_project/artifacts/src/Foo.sol new file mode 100644 index 0000000..0fbe342 --- /dev/null +++ b/tests/testdata/foundry_project/artifacts/src/Foo.sol @@ -0,0 +1,54 @@ +pragma solidity >=0.8.1; +contract Foo { + int256 private x; + function Bar() public view returns (int256) { + if (x == 10) { + assert(false); + return 1; + } + if (x == 30) { + assert(false); + return 3; + } + if (x == 50) { + assert(false); + return 5; + } + if (x == 70) { + assert(false); + return 7; + } + if (x == 90) { + assert(false); + return 9; + } + if (x == 110) { + assert(false); + return 11; + } + if (x == 130) { + assert(false); + return 13; + } + if (x == 150) { + assert(false); + return 15; + } + if (x == 170) { + assert(false); + return 17; + } + if (x == 190) { + assert(false); + return 19; + } + if (x == 210) { + assert(false); + return 21; + } + return 0; + } + function SetNext(bool b) public { + x = int256(2)*x + (b ? int256(1) : int256(0)); + } +} \ No newline at end of file diff --git a/tests/testdata/foundry_project_with_unlinked_libraries/README.md b/tests/testdata/foundry_project_with_unlinked_libraries/README.md new file mode 100644 index 0000000..8bea9fe --- /dev/null +++ b/tests/testdata/foundry_project_with_unlinked_libraries/README.md @@ -0,0 +1,13 @@ +# Sample Foundry Project +## Description +It's purpose to create a foundry project environment to make unit tests upon. sample project is stored in `artifacts.tar.gz`. +## Notes +This sample project could be used as a standalone project to perform manual tests. In order to use it in standalone mode, please follow these steps: +1) Unpack the `artifacts.tar.gz` with `mkdir foundry-project && tar -xzvf artifacts.tar.gz --directory ./foundry-project && cd foundry-project` +2) Install foundry +3) Run `forge build --build-info` to compile contracts +4) Run `forge create --unlocked --from --legacy` to deploy contracts to a local ganache node. + * You should deploy each contract separately, i.e. invoke this command 3 times with different contract names + * `CONTRACT NAME` is the name of the contract to be deployed. In this case - the list `(ABC, Foo, Bar)` + * `ACCOUNT` is one of the accounts Ganache creates at start (e.g. `0xDcD6A03FE66f8Ed4012554A6193819398Ba7495b`) +5) Have fun 🥳 diff --git a/tests/testdata/foundry_project_with_unlinked_libraries/artifacts.tar.gz b/tests/testdata/foundry_project_with_unlinked_libraries/artifacts.tar.gz new file mode 100644 index 0000000..65d6814 Binary files /dev/null and b/tests/testdata/foundry_project_with_unlinked_libraries/artifacts.tar.gz differ diff --git a/tests/testdata/foundry_project_with_unlinked_libraries/blocks.json b/tests/testdata/foundry_project_with_unlinked_libraries/blocks.json new file mode 100644 index 0000000..cad7a3f --- /dev/null +++ b/tests/testdata/foundry_project_with_unlinked_libraries/blocks.json @@ -0,0 +1,141 @@ +[ + { + "number": "0x0", + "hash": "0x6972f27eee8510be1ca67c8a51ba8b44e54c9b3061c50d7614e7001f4992da71", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot": "0x7e10b18c79a239fee3fd11f60f775b367e96f7412471f3d481618dd90aca593e", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x6691b7", + "gasUsed": "0x0", + "timestamp": "0x635fb334", + "transactions": [], + "uncles": [] + }, + { + "number": "0x1", + "hash": "0xadbefc0f1c5e093a9365c595c242cab542b4856dd1e6370e9822a4d8ef7dea4d", + "parentHash": "0x6972f27eee8510be1ca67c8a51ba8b44e54c9b3061c50d7614e7001f4992da71", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0xf6072990d8765d7666fcc1fa726d82ec127629793c42fd4b314d57218d70fa00", + "stateRoot": "0x9f3c737384b9a8e3d56ed184a67410dde7af15610c49c2d65bc14326b99beb2d", + "receiptsRoot": "0x09d0d27c3e27912974f9cfa98d1ba551646fcfb20d2fb8f7217ab53508d30473", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x6691b7", + "gasUsed": "0x34f88", + "timestamp": "0x635fb381", + "transactions": [ + { + "hash": "0x03be0ec287c6b09e2a86d84b62b9391d74778a7dda7714ee72e3bf93a886f97c", + "nonce": "0x0", + "blockHash": "0xadbefc0f1c5e093a9365c595c242cab542b4856dd1e6370e9822a4d8ef7dea4d", + "blockNumber": "0x1", + "transactionIndex": "0x0", + "from": "0xdcd6a03fe66f8ed4012554a6193819398ba7495b", + "to": null, + "value": "0x0", + "gas": "0x34f88", + "gasPrice": "0x4a817c800", + "input": "0x608060405234801561001057600080fd5b506102f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033", + "v": "0x25", + "r": "0xde5ea187b566c151fc015c90afdaf659a35fe7ba0eb2d3ac4a03741e9aebf0e9", + "s": "0x782362adb30453595233cff7a9580483c400d16b18ea6a3f8edb67a71eb9f445" + } + ], + "uncles": [] + }, + { + "number": "0x2", + "hash": "0xaac582ab4b0d52490a78e7ab6cca32219552627dd5df39dffdfa0c16cf0f3b02", + "parentHash": "0xadbefc0f1c5e093a9365c595c242cab542b4856dd1e6370e9822a4d8ef7dea4d", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0xcd5f7809c71f2fb483780a8caf906db37055ca31d0e6a173b631a8c662a408cd", + "stateRoot": "0xa7a566239a103e0454302a5e51ef71193910b391bdf7a4a53eec93c2a46559f1", + "receiptsRoot": "0xada67d8396593c6f540831552d5f4d9248a341574546cc37b494ab9875989d10", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x6691b7", + "gasUsed": "0x2d523", + "timestamp": "0x635fb3a8", + "transactions": [ + { + "hash": "0x5baf9acce8fc1e8f55341ea4953382915c073abecc7b88bd93d3a45af52868a8", + "nonce": "0x1", + "blockHash": "0xaac582ab4b0d52490a78e7ab6cca32219552627dd5df39dffdfa0c16cf0f3b02", + "blockNumber": "0x2", + "transactionIndex": "0x0", + "from": "0xdcd6a03fe66f8ed4012554a6193819398ba7495b", + "to": null, + "value": "0x0", + "gas": "0x2d523", + "gasPrice": "0x4a817c800", + "input": "0x608060405234801561001057600080fd5b50610266806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033", + "v": "0x25", + "r": "0x8ae26355842c7f0f82f7b9f29e32c6235d745b8e2ef146ff42fcd25b84bbe975", + "s": "0x6e7641474fab8db61701a9df635b5c2b4f6c1ce19fda3c11e54367e4a4920e4" + } + ], + "uncles": [] + }, + { + "number": "0x3", + "hash": "0x47c4efc663eac66f2dea894d304e5e32c7a5f46a3771744072121e66e32688e6", + "parentHash": "0xaac582ab4b0d52490a78e7ab6cca32219552627dd5df39dffdfa0c16cf0f3b02", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x6c2513c974ccb092ddcb0e4aa4f7f1b00dca13e0b326f17bfc3c26bf22a9fdee", + "stateRoot": "0x505b1f8411303601198a7a1431764a68542b13d1f0e0dc129726d6d1b0b9813f", + "receiptsRoot": "0x0462612a32e3b45c02945e3068aa0f716287ff50e81883cdc88c78e283630dd9", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x3e8", + "gasLimit": "0x6691b7", + "gasUsed": "0x363b6", + "timestamp": "0x635fb3b1", + "transactions": [ + { + "hash": "0x7f1af47c2a620c63056c6c5d026a0c1ac4268e6bf636a60f7f5f23725d2a6574", + "nonce": "0x2", + "blockHash": "0x47c4efc663eac66f2dea894d304e5e32c7a5f46a3771744072121e66e32688e6", + "blockNumber": "0x3", + "transactionIndex": "0x0", + "from": "0xdcd6a03fe66f8ed4012554a6193819398ba7495b", + "to": null, + "value": "0x0", + "gas": "0x363b6", + "gasPrice": "0x4a817c800", + "input": "0x608060405234801561001057600080fd5b5061030f806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033", + "v": "0x25", + "r": "0x718d9357784b5db9ac963121b50d07fc57e042559c9c09c1eb2764a907f08354", + "s": "0xc66ff82c91bf6d9c8c71f37e5bab73f7088c2d61fdb8b0777864fad37d0b20" + } + ], + "uncles": [] + } +] diff --git a/tests/testdata/foundry_project_with_unlinked_libraries/contracts.json b/tests/testdata/foundry_project_with_unlinked_libraries/contracts.json new file mode 100644 index 0000000..62a29c1 --- /dev/null +++ b/tests/testdata/foundry_project_with_unlinked_libraries/contracts.json @@ -0,0 +1,17 @@ +{ + "Foo": { + "address": "0x0c91f9338228f19315BE34E5CA5307DF586CBD99", + "contractPath": "src/Foo.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a6565b610179565b005b60008054600a036100835761007d6101cf565b50600190565b600054601e0361009b576100956101cf565b50600390565b6000546032036100b3576100ad6101cf565b50600590565b6000546046036100cb576100c56101cf565b50600790565b600054605a036100e3576100dd6101cf565b50600990565b600054606e036100fb576100f56101cf565b50600b90565b6000546082036101135761010d6101cf565b50600d90565b60005460960361012b576101256101cf565b50600f90565b60005460aa036101435761013d6101cf565b50601190565b60005460be0361015b576101556101cf565b50601390565b60005460d2036101735761016d6101cf565b50601590565b50600090565b80610185576000610188565b60015b6000546101969060026101fb565b6101a09190610280565b60005550565b6000602082840312156101b857600080fd5b813580151581146101c857600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610221576102216101e5565b600160ff1b6000871282811687830589121615610240576102406101e5565b6000871292508782058712848416161561025c5761025c6101e5565b87850587128184161615610272576102726101e5565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a2576102a26101e5565b600160ff1b83900384128116156102bb576102bb6101e5565b5050019056fea264697066735822122005a86c72700d9ccb2087302e6d531de13a3fad19a20b353480d831ef4d2b15e764736f6c634300080d0033" + }, + "Bar": { + "address": "0x9B92063B8B94A9EF8b5fDE3Df8D375B39bC9fC10", + "contractPath": "src/Bar.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610055575b600080fd5b61004361006a565b60405190815260200160405180910390f35b6100686100633660046101a4565b610173565b005b60008054600a036100835761007d6101cd565b50600190565b600054601e0361009b576100956101cd565b50600390565b6000546032036100b3576100ad6101cd565b50600590565b6000546046036100cb576100c56101cd565b50600790565b600054605a036100e3576100dd6101cd565b50600990565b600054606e036100fb576100f56101cd565b50600b90565b6000546082036101135761010d6101cd565b50600d90565b60005460960361012b576101256101cd565b50600f90565b60005460aa036101435761013d6101cd565b50601190565b60005460be0361015b576101556101cd565b50601390565b60005460d20361016d576101556101cd565b50600090565b8061017f576000610182565b60015b60ff16600054600261019491906101f9565b61019e9190610218565b60005550565b6000602082840312156101b657600080fd5b813580151581146101c657600080fd5b9392505050565b634e487b7160e01b600052600160045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610213576102136101e3565b500290565b6000821982111561022b5761022b6101e3565b50019056fea26469706673582212207a46352c6f97edfe01e7d632555c39f22902f3548793b50890640b22285151d564736f6c634300080d0033" + }, + "ABC": { + "address": "0x694D08b77D2499E161635005Fd4A77233cedD761", + "contractPath": "src/ABC.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610050575b600080fd5b61004e6100493660046101be565b61006a565b005b610058610097565b60405190815260200160405180910390f35b80610076576000610079565b60015b6000546100879060026101fd565b6100919190610282565b60005550565b60008054601e036100b0576100aa6102c3565b50600390565b6000546032036100c8576100c26102c3565b50600590565b6000546046036100e0576100da6102c3565b50600790565b600054605a036100f8576100f26102c3565b50600990565b600054606e036101105761010a6102c3565b50600b90565b600054608203610128576101226102c3565b50600d90565b6000546096036101405761013a6102c3565b50600f90565b60005460aa03610158576101526102c3565b50601190565b60005460be036101705761016a6102c3565b50601390565b60005460d203610188576101826102c3565b50601590565b60005460e6036101a05761019a6102c3565b50601790565b60005460fa036101b8576101b26102c3565b50601990565b50600090565b6000602082840312156101d057600080fd5b813580151581146101e057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b60006001600160ff1b0381841382841380821686840486111615610223576102236101e7565b600160ff1b6000871282811687830589121615610242576102426101e7565b6000871292508782058712848416161561025e5761025e6101e7565b87850587128184161615610274576102746101e7565b505050929093029392505050565b600080821280156001600160ff1b03849003851316156102a4576102a46101e7565b600160ff1b83900384128116156102bd576102bd6101e7565b50500190565b634e487b7160e01b600052600160045260246000fdfea2646970667358221220305228eb622814e45e19e7f9805025d83e14ec694dde980cb7b4fc268d9594a164736f6c634300080d0033" + } +} diff --git a/tests/testdata/foundry_tests_project/mocks.py b/tests/testdata/foundry_tests_project/mocks.py index 19efa94..96a7958 100644 --- a/tests/testdata/foundry_tests_project/mocks.py +++ b/tests/testdata/foundry_tests_project/mocks.py @@ -2,6 +2,8 @@ import pytest +from fuzzing_cli.util import executable_command + list_output = """ [⠒] Compiling... No files changed, compilation skipped @@ -48,7 +50,7 @@ def foundry_config_mock(fp): """ with fp.context() as proc: proc.keep_last_process(True) - proc.register(["forge", "config"], stdout=result) + proc.register([*executable_command("forge"), "config"], stdout=result) yield proc @@ -60,7 +62,8 @@ def foundry_test_list_mock(fp): with fp.context() as proc: proc.keep_last_process(True) proc.register( - ["forge", "test", "--list", "--json", fp.any()], callback=list_callback + [*executable_command("forge"), "test", "--list", "--json", fp.any()], + callback=list_callback, ) yield proc @@ -69,5 +72,5 @@ def foundry_test_list_mock(fp): def foundry_build_mock(fp): with fp.context() as proc: proc.keep_last_process(True) - proc.register(["forge", "build", fp.any()], stdout="") + proc.register([*executable_command("forge"), "build", fp.any()], stdout="") yield proc diff --git a/tests/testdata/hardhat_project_with_unlinked_libraries/artifacts.tar.gz b/tests/testdata/hardhat_project_with_unlinked_libraries/artifacts.tar.gz new file mode 100644 index 0000000..e1183e2 Binary files /dev/null and b/tests/testdata/hardhat_project_with_unlinked_libraries/artifacts.tar.gz differ diff --git a/tests/testdata/hardhat_project_with_unlinked_libraries/blocks.json b/tests/testdata/hardhat_project_with_unlinked_libraries/blocks.json new file mode 100644 index 0000000..f839ef4 --- /dev/null +++ b/tests/testdata/hardhat_project_with_unlinked_libraries/blocks.json @@ -0,0 +1,184 @@ +[ + { + "number": "0x0", + "hash": "0x1ffd03dc7a0e698bb77f8b8a242c91b1b319863cfa4696f7d7269bdbb0877b5b", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot": "0x66a80b61b29ec044d14c4c8c613e762ba1fb8eeb0c454d1ee00ed6dedaa5b5c5", + "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "miner": "0x0000000000000000000000000000000000000000", + "difficulty": "0x1", + "totalDifficulty": "0x1", + "extraData": "0x1234", + "size": "0x1fe", + "gasLimit": "0xbdf8d0", + "gasUsed": "0x0", + "timestamp": "0x664b1feb", + "transactions": [], + "uncles": [] + }, + { + "number": "0x1", + "hash": "0xef1e5e3bab0653e692d79495935b5692c6d399dad4d16879d750f57fd1f3da27", + "parentHash": "0x1ffd03dc7a0e698bb77f8b8a242c91b1b319863cfa4696f7d7269bdbb0877b5b", + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x53ea859b7fc9c02833ab1e6e310c970def08490a4c93064f0d63ebdaa9a23881", + "stateRoot": "0x705ea7625cbcb5daf4d3dc5d0322e7b3adbe32227dc52234035881407825dbaf", + "receiptsRoot": "0xe756cfa5d18f5fcfee70f378ce81e4e02ccc77e2acc09dc2517fe9b440fab1ab", + "miner": "0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e", + "difficulty": "0x20000", + "totalDifficulty": "0x20001", + "extraData": "0x", + "size": "0x3fc", + "gasLimit": "0xbdf8d0", + "gasUsed": "0x1e992", + "timestamp": "0x664b2042", + "transactions": [ + { + "blockHash": "0xef1e5e3bab0653e692d79495935b5692c6d399dad4d16879d750f57fd1f3da27", + "blockNumber": "0x1", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "gas": "0x1e992", + "gasPrice": "0x1dcd65000", + "hash": "0x735877688363e61be832a8d5d03f792d97fc2020a88802ea96ff8244c4eb9f02", + "input": "0x61014d610053600b82828239805160001a607314610046577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063601f16ca1461003a575b600080fd5b81801561004657600080fd5b50610061600480360381019061005c9190610097565b610077565b60405161006e91906100cf565b60405180910390f35b600060019050919050565b60008135905061009181610100565b92915050565b6000602082840312156100a957600080fd5b60006100b784828501610082565b91505092915050565b6100c9816100ea565b82525050565b60006020820190506100e460008301846100c0565b92915050565b60008115159050919050565b6000819050919050565b610109816100f6565b811461011457600080fd5b5056fea2646970667358221220d2c9389225adf29582452df2dccd926943829f3de565d70a518206468e5ac74864736f6c63430008010033", + "nonce": "0x0", + "to": null, + "transactionIndex": "0x0", + "value": "0x0", + "v": "0xf4f6", + "r": "0x8989fc8a580738255ea87e1f74be08550e79eab07bdb8c28c6270942bb2c9d07", + "s": "0xba254d22b9aa214ec5519bc8562c64ba950bd750b14578f5b7c4213cf077796", + "type": "0x0" + } + ], + "uncles": [] + }, + { + "number": "0x2", + "hash": "0x5f5c3970eb53b22eb652e3cabad47cb00479405139fe25b536f519701444e7c8", + "parentHash": "0xef1e5e3bab0653e692d79495935b5692c6d399dad4d16879d750f57fd1f3da27", + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x803fde9ec2e9bd39bdcb611805956c00cd23dfb53325e48d7ad5f9cdebe29a8a", + "stateRoot": "0x49c756d15bbf811f532811dba19f5fda9df678bcdd4017024ef4daded412af7d", + "receiptsRoot": "0xfaec3b06c5875e284112a3e07b242a560492d4a4db1efdcdab84f577aca630a7", + "miner": "0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e", + "difficulty": "0x20040", + "totalDifficulty": "0x40041", + "extraData": "0x", + "size": "0x8f4", + "gasLimit": "0xbdf8d0", + "gasUsed": "0x62ef8", + "timestamp": "0x664b2043", + "transactions": [ + { + "blockHash": "0x5f5c3970eb53b22eb652e3cabad47cb00479405139fe25b536f519701444e7c8", + "blockNumber": "0x2", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "gas": "0x62ef8", + "gasPrice": "0x1dcd65000", + "hash": "0xa354e2ffc05229a5a0432551ef08f79d9fc200eadbe706c57e9f7758cdc25d6a", + "input": "0x608060405234801561001057600080fd5b50610678806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610057575b600080fd5b610055600480360381019061005091906103e8565b610075565b005b61005f6100a6565b60405161006c9190610420565b60405180910390f35b80610081576000610084565b60015b600054600261009391906104cf565b61009d919061043b565b60008190555050565b6000601e60005414156100f15760006100e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600390506103d0565b6032600054141561013a576000610131577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600590506103d0565b6046600054141561018357600061017a577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600790506103d0565b605a60005414156101cc5760006101c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600990506103d0565b606e600054141561021557600061020c577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b90506103d0565b6082600054141561025e576000610255577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d90506103d0565b609660005414156102a757600061029e577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f90506103d0565b60aa60005414156102f05760006102e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601190506103d0565b60be6000541415610339576000610330577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601390506103d0565b60d26000541415610382576000610379577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601590506103d0565b60e660005414156103cb5760006103c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601790506103d0565b600090505b90565b6000813590506103e28161062b565b92915050565b6000602082840312156103fa57600080fd5b6000610408848285016103d3565b91505092915050565b61041a816105f2565b82525050565b60006020820190506104356000830184610411565b92915050565b6000610446826105f2565b9150610451836105f2565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0383136000831215161561048c5761048b6105fc565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156104c4576104c36105fc565b5b828201905092915050565b60006104da826105f2565b91506104e5836105f2565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482116000841360008413161615610524576105236105fc565b5b817f80000000000000000000000000000000000000000000000000000000000000000583126000841260008413161615610561576105606105fc565b5b827f8000000000000000000000000000000000000000000000000000000000000000058212600084136000841216161561059e5761059d6105fc565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff05821260008412600084121616156105db576105da6105fc565b5b828202905092915050565b60008115159050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610634816105e6565b811461063f57600080fd5b5056fea2646970667358221220e13bd51f489607613fe434a32440a5eb8940a4782f8955c14d346d28e8128a9764736f6c63430008010033", + "nonce": "0x1", + "to": null, + "transactionIndex": "0x0", + "value": "0x0", + "v": "0xf4f5", + "r": "0xa5829fde4853b31dd90bfe263fe1b1a4d1719c8f01a0a0c866eaaa5b35666e73", + "s": "0x5a1dcc92e98ded721500b3d4eec5a38428476084f01ce3ac6553420819790e06", + "type": "0x0" + } + ], + "uncles": [] + }, + { + "number": "0x3", + "hash": "0xe0159231b6148c7a75eb58f4ea4df881f59bca8f8a27be998ca53a00c56a9778", + "parentHash": "0x5f5c3970eb53b22eb652e3cabad47cb00479405139fe25b536f519701444e7c8", + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x5f620e09996a9839fcb916d3970b71403a3cd601b0e6fcb950c2734562044206", + "stateRoot": "0x42d1c99dccb35f9afa170ee24eb146903819160985f2460d7785ac4381ca037c", + "receiptsRoot": "0xffb365781e65e93a56f0ea899e4e071f6814b1b5e9da390ddb5cf539925392f5", + "miner": "0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e", + "difficulty": "0x20080", + "totalDifficulty": "0x600c1", + "extraData": "0x", + "size": "0xa01", + "gasLimit": "0xbdf8d0", + "gasUsed": "0x711c8", + "timestamp": "0x664b2044", + "transactions": [ + { + "blockHash": "0xe0159231b6148c7a75eb58f4ea4df881f59bca8f8a27be998ca53a00c56a9778", + "blockNumber": "0x3", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "gas": "0x711c8", + "gasPrice": "0x1dcd65000", + "hash": "0x77a3f58cca29cc92561d30ea86b9ddad286b5d955b3881d572838995d9285dd4", + "input": "0x608060405234801561001057600080fd5b50610785806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610059575b600080fd5b610043610075565b60405161005091906104f6565b60405180910390f35b610073600480360381019061006e9190610486565b6103a2565b005b6000600a60005414156100c05760006100b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6001905061039f565b601e6000541415610109576000610100577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6003905061039f565b60326000541415610152576000610149577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6005905061039f565b6046600054141561019b576000610192577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6007905061039f565b605a60005414156101e45760006101db577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6009905061039f565b606e600054141561022d576000610224577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b905061039f565b6082600054141561027657600061026d577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d905061039f565b609660005414156102bf5760006102b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f905061039f565b60aa60005414156103085760006102ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6011905061039f565b60be6000541415610351576000610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6013905061039f565b60d2600054141561039a576000610391577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6013905061039f565b600090505b90565b806103ae5760006103b1565b60015b60005460026103c091906105c0565b6103ca919061052c565b600081905550735fbdb2315678afecb367f032d93f642f64180aa363601f16ca60016040518263ffffffff1660e01b81526004016104089190610511565b60206040518083038186803b15801561042057600080fd5b505af4158015610434573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045891906104af565b5050565b60008135905061046b81610738565b92915050565b60008151905061048081610738565b92915050565b60006020828403121561049857600080fd5b60006104a68482850161045c565b91505092915050565b6000602082840312156104c157600080fd5b60006104cf84828501610471565b91505092915050565b6104e1816106e3565b82525050565b6104f0816106f7565b82525050565b600060208201905061050b60008301846104d8565b92915050565b600060208201905061052660008301846104e7565b92915050565b6000610537826106e3565b9150610542836106e3565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0383136000831215161561057d5761057c610709565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156105b5576105b4610709565b5b828201905092915050565b60006105cb826106e3565b91506105d6836106e3565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211600084136000841316161561061557610614610709565b5b817f8000000000000000000000000000000000000000000000000000000000000000058312600084126000841316161561065257610651610709565b5b827f8000000000000000000000000000000000000000000000000000000000000000058212600084136000841216161561068f5761068e610709565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff05821260008412600084121616156106cc576106cb610709565b5b828202905092915050565b60008115159050919050565b6000819050919050565b6000819050919050565b6000610702826106ed565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610741816106d7565b811461074c57600080fd5b5056fea26469706673582212209454df480366eb81f85a00a00c6fa41c4719c90b38e0333f8aa136803dbc17eb64736f6c63430008010033", + "nonce": "0x2", + "to": null, + "transactionIndex": "0x0", + "value": "0x0", + "v": "0xf4f6", + "r": "0x7ba8f562d0910cb7f7a0065733c0b7af5c84ae8701df90a3b4aeef13405660de", + "s": "0x5f841ad254e589a84842ef6450c7a73a5bd926263e0c5bfe1e96f1da8f76e843", + "type": "0x0" + } + ], + "uncles": [] + }, + { + "number": "0x4", + "hash": "0xf67b08478bd5d97be15ea80ad5682d72a062aea1d0cbebe746ef97cf4c2896a0", + "parentHash": "0xe0159231b6148c7a75eb58f4ea4df881f59bca8f8a27be998ca53a00c56a9778", + "nonce": "0x0000000000000042", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x48033c74071de2fa5a69add96e240a32a331490ffbb7d33e62a74fbe55c84d4d", + "stateRoot": "0x33269ebd4d0f0a2874a217899b11a13361d262c1be48f2a46e6b132f897a5ac4", + "receiptsRoot": "0xf373b03146560e7b577b7e38c7a69ee4ca517622a510c7c64382256d6e2d3977", + "miner": "0xc014ba5ec014ba5ec014ba5ec014ba5ec014ba5e", + "difficulty": "0x200c0", + "totalDifficulty": "0x80181", + "extraData": "0x", + "size": "0x9b8", + "gasLimit": "0xbdf8d0", + "gasUsed": "0x6d5a9", + "timestamp": "0x664b2045", + "transactions": [ + { + "blockHash": "0xf67b08478bd5d97be15ea80ad5682d72a062aea1d0cbebe746ef97cf4c2896a0", + "blockNumber": "0x4", + "from": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266", + "gas": "0x6d5a9", + "gasPrice": "0x1dcd65000", + "hash": "0xee258702619465e46768520a60993a05e69c1442765b7e2ce8aeeed708af56b0", + "input": "0x608060405234801561001057600080fd5b5061073c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610059575b600080fd5b610043610075565b60405161005091906104ad565b60405180910390f35b610073600480360381019061006e919061043d565b610359565b005b6000600a60005414156100c05760006100b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60019050610356565b601e6000541415610109576000610100577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60039050610356565b60326000541415610152576000610149577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60059050610356565b6046600054141561019b576000610192577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60079050610356565b605a60005414156101e45760006101db577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60099050610356565b606e600054141561022d576000610224577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b9050610356565b6082600054141561027657600061026d577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d9050610356565b609660005414156102bf5760006102b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f9050610356565b60aa60005414156103085760006102ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60119050610356565b60be6000541415610351576000610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60139050610356565b600090505b90565b80610365576000610368565b60015b60005460026103779190610577565b61038191906104e3565b600081905550735fbdb2315678afecb367f032d93f642f64180aa363601f16ca60016040518263ffffffff1660e01b81526004016103bf91906104c8565b60206040518083038186803b1580156103d757600080fd5b505af41580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190610466565b5050565b600081359050610422816106ef565b92915050565b600081519050610437816106ef565b92915050565b60006020828403121561044f57600080fd5b600061045d84828501610413565b91505092915050565b60006020828403121561047857600080fd5b600061048684828501610428565b91505092915050565b6104988161069a565b82525050565b6104a7816106ae565b82525050565b60006020820190506104c2600083018461048f565b92915050565b60006020820190506104dd600083018461049e565b92915050565b60006104ee8261069a565b91506104f98361069a565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03831360008312151615610534576105336106c0565b5b817f800000000000000000000000000000000000000000000000000000000000000003831260008312161561056c5761056b6106c0565b5b828201905092915050565b60006105828261069a565b915061058d8361069a565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821160008413600084131616156105cc576105cb6106c0565b5b817f80000000000000000000000000000000000000000000000000000000000000000583126000841260008413161615610609576106086106c0565b5b827f80000000000000000000000000000000000000000000000000000000000000000582126000841360008412161615610646576106456106c0565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0582126000841260008412161615610683576106826106c0565b5b828202905092915050565b60008115159050919050565b6000819050919050565b6000819050919050565b60006106b9826106a4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6106f88161068e565b811461070357600080fd5b5056fea2646970667358221220161c90b13b90659779b8ca7fbd21eb3a36e90e56aef63a0fc71dc8bd1cb7265164736f6c63430008010033", + "nonce": "0x3", + "to": null, + "transactionIndex": "0x0", + "value": "0x0", + "v": "0xf4f5", + "r": "0x2307b58e8ea87d9503a198b6260445fdc0ad2147044a6dbe672e9a6bda3b31b5", + "s": "0x65a009f8ad3e260170685f79cfc188586233bc889b755e716392ca1c156fcf13", + "type": "0x0" + } + ], + "uncles": [] + } +] diff --git a/tests/testdata/hardhat_project_with_unlinked_libraries/contracts.json b/tests/testdata/hardhat_project_with_unlinked_libraries/contracts.json new file mode 100644 index 0000000..6c8af38 --- /dev/null +++ b/tests/testdata/hardhat_project_with_unlinked_libraries/contracts.json @@ -0,0 +1,22 @@ +{ + "TestLib": { + "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3", + "contractPath": "contracts/TestLib.sol", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063601f16ca1461003a575b600080fd5b81801561004657600080fd5b50610061600480360381019061005c9190610097565b610077565b60405161006e91906100cf565b60405180910390f35b600060019050919050565b60008135905061009181610100565b92915050565b6000602082840312156100a957600080fd5b60006100b784828501610082565b91505092915050565b6100c9816100ea565b82525050565b60006020820190506100e460008301846100c0565b92915050565b60008115159050919050565b6000819050919050565b610109816100f6565b811461011457600080fd5b5056fea2646970667358221220d2c9389225adf29582452df2dccd926943829f3de565d70a518206468e5ac74864736f6c63430008010033" + }, + "Foo": { + "address": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", + "contractPath": "contracts/Foo.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063b0a378b01461003b578063df5b722714610059575b600080fd5b610043610075565b60405161005091906104ad565b60405180910390f35b610073600480360381019061006e919061043d565b610359565b005b6000600a60005414156100c05760006100b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60019050610356565b601e6000541415610109576000610100577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60039050610356565b60326000541415610152576000610149577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60059050610356565b6046600054141561019b576000610192577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60079050610356565b605a60005414156101e45760006101db577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60099050610356565b606e600054141561022d576000610224577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b9050610356565b6082600054141561027657600061026d577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d9050610356565b609660005414156102bf5760006102b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f9050610356565b60aa60005414156103085760006102ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60119050610356565b60be6000541415610351576000610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b60139050610356565b600090505b90565b80610365576000610368565b60015b60005460026103779190610577565b61038191906104e3565b60008190555073__$154d8911a162d9fe8513835584d2c10b72$__63601f16ca60016040518263ffffffff1660e01b81526004016103bf91906104c8565b60206040518083038186803b1580156103d757600080fd5b505af41580156103eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040f9190610466565b5050565b600081359050610422816106ef565b92915050565b600081519050610437816106ef565b92915050565b60006020828403121561044f57600080fd5b600061045d84828501610413565b91505092915050565b60006020828403121561047857600080fd5b600061048684828501610428565b91505092915050565b6104988161069a565b82525050565b6104a7816106ae565b82525050565b60006020820190506104c2600083018461048f565b92915050565b60006020820190506104dd600083018461049e565b92915050565b60006104ee8261069a565b91506104f98361069a565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03831360008312151615610534576105336106c0565b5b817f800000000000000000000000000000000000000000000000000000000000000003831260008312161561056c5761056b6106c0565b5b828201905092915050565b60006105828261069a565b915061058d8361069a565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821160008413600084131616156105cc576105cb6106c0565b5b817f80000000000000000000000000000000000000000000000000000000000000000583126000841260008413161615610609576106086106c0565b5b827f80000000000000000000000000000000000000000000000000000000000000000582126000841360008412161615610646576106456106c0565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0582126000841260008412161615610683576106826106c0565b5b828202905092915050565b60008115159050919050565b6000819050919050565b6000819050919050565b60006106b9826106a4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6106f88161068e565b811461070357600080fd5b5056fea2646970667358221220161c90b13b90659779b8ca7fbd21eb3a36e90e56aef63a0fc71dc8bd1cb7265164736f6c63430008010033" + }, + "Bar": { + "address": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0", + "contractPath": "contracts/Bar.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806343c10ff11461003b578063df5b722714610059575b600080fd5b610043610075565b60405161005091906104f6565b60405180910390f35b610073600480360381019061006e9190610486565b6103a2565b005b6000600a60005414156100c05760006100b7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6001905061039f565b601e6000541415610109576000610100577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6003905061039f565b60326000541415610152576000610149577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6005905061039f565b6046600054141561019b576000610192577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6007905061039f565b605a60005414156101e45760006101db577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6009905061039f565b606e600054141561022d576000610224577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b905061039f565b6082600054141561027657600061026d577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d905061039f565b609660005414156102bf5760006102b6577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f905061039f565b60aa60005414156103085760006102ff577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6011905061039f565b60be6000541415610351576000610348577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6013905061039f565b60d2600054141561039a576000610391577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6013905061039f565b600090505b90565b806103ae5760006103b1565b60015b60005460026103c091906105c0565b6103ca919061052c565b60008190555073__$154d8911a162d9fe8513835584d2c10b72$__63601f16ca60016040518263ffffffff1660e01b81526004016104089190610511565b60206040518083038186803b15801561042057600080fd5b505af4158015610434573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045891906104af565b5050565b60008135905061046b81610738565b92915050565b60008151905061048081610738565b92915050565b60006020828403121561049857600080fd5b60006104a68482850161045c565b91505092915050565b6000602082840312156104c157600080fd5b60006104cf84828501610471565b91505092915050565b6104e1816106e3565b82525050565b6104f0816106f7565b82525050565b600060208201905061050b60008301846104d8565b92915050565b600060208201905061052660008301846104e7565b92915050565b6000610537826106e3565b9150610542836106e3565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0383136000831215161561057d5761057c610709565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156105b5576105b4610709565b5b828201905092915050565b60006105cb826106e3565b91506105d6836106e3565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211600084136000841316161561061557610614610709565b5b817f8000000000000000000000000000000000000000000000000000000000000000058312600084126000841316161561065257610651610709565b5b827f8000000000000000000000000000000000000000000000000000000000000000058212600084136000841216161561068f5761068e610709565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff05821260008412600084121616156106cc576106cb610709565b5b828202905092915050565b60008115159050919050565b6000819050919050565b6000819050919050565b6000610702826106ed565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610741816106d7565b811461074c57600080fd5b5056fea26469706673582212209454df480366eb81f85a00a00c6fa41c4719c90b38e0333f8aa136803dbc17eb64736f6c63430008010033" + }, + "ABC": { + "address": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", + "contractPath": "contracts/ABC.sol", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063df5b72271461003b578063e88184ca14610057575b600080fd5b610055600480360381019061005091906103e8565b610075565b005b61005f6100a6565b60405161006c9190610420565b60405180910390f35b80610081576000610084565b60015b600054600261009391906104cf565b61009d919061043b565b60008190555050565b6000601e60005414156100f15760006100e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600390506103d0565b6032600054141561013a576000610131577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600590506103d0565b6046600054141561018357600061017a577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600790506103d0565b605a60005414156101cc5760006101c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600990506103d0565b606e600054141561021557600061020c577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600b90506103d0565b6082600054141561025e576000610255577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600d90506103d0565b609660005414156102a757600061029e577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b600f90506103d0565b60aa60005414156102f05760006102e7577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601190506103d0565b60be6000541415610339576000610330577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601390506103d0565b60d26000541415610382576000610379577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601590506103d0565b60e660005414156103cb5760006103c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b601790506103d0565b600090505b90565b6000813590506103e28161062b565b92915050565b6000602082840312156103fa57600080fd5b6000610408848285016103d3565b91505092915050565b61041a816105f2565b82525050565b60006020820190506104356000830184610411565b92915050565b6000610446826105f2565b9150610451836105f2565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0383136000831215161561048c5761048b6105fc565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156104c4576104c36105fc565b5b828201905092915050565b60006104da826105f2565b91506104e5836105f2565b9250827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482116000841360008413161615610524576105236105fc565b5b817f80000000000000000000000000000000000000000000000000000000000000000583126000841260008413161615610561576105606105fc565b5b827f8000000000000000000000000000000000000000000000000000000000000000058212600084136000841216161561059e5761059d6105fc565b5b827f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff05821260008412600084121616156105db576105da6105fc565b5b828202905092915050565b60008115159050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b610634816105e6565b811461063f57600080fd5b5056fea2646970667358221220e13bd51f489607613fe434a32440a5eb8940a4782f8955c14d346d28e8128a9764736f6c63430008010033" + } +}