diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc58ab718..1ae5326a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ jobs: type: ["cli", "dapp", "data_dependency", + "path_filtering", # "embark", "erc", # "etherlime", diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml index 7414e9ebe..49db14793 100644 --- a/.github/workflows/features.yml +++ b/.github/workflows/features.yml @@ -45,7 +45,7 @@ jobs: - name: Test with pytest run: | pytest tests/test_features.py - pytest tests/test_constant_folding_unary.py + pytest tests/test_constant_folding.py pytest tests/slithir/test_ternary_expressions.py pytest tests/test_functions_ids.py pytest tests/test_function.py diff --git a/Dockerfile b/Dockerfile index 2f3251592..71bb9f57f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,14 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get install -y --no-install-recommends python3-pip \ && rm -rf /var/lib/apt/lists/* +# improve compatibility with amd64 solc in non-amd64 environments (e.g. Docker Desktop on M1 Mac) +ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu +RUN if [ ! "$(uname -m)" = "x86_64" ]; then \ + export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get install -y --no-install-recommends libc6-amd64-cross \ + && rm -rf /var/lib/apt/lists/*; fi + RUN useradd -m slither USER slither diff --git a/plugin_example/slither_my_plugin/__init__.py b/plugin_example/slither_my_plugin/__init__.py index eabdb147e..9379ac833 100644 --- a/plugin_example/slither_my_plugin/__init__.py +++ b/plugin_example/slither_my_plugin/__init__.py @@ -1,8 +1,13 @@ +from typing import Tuple, List, Type + from slither_my_plugin.detectors.example import Example +from slither.detectors.abstract_detector import AbstractDetector +from slither.printers.abstract_printer import AbstractPrinter + -def make_plugin(): +def make_plugin() -> Tuple[List[Type[AbstractDetector]], List[Type[AbstractPrinter]]]: plugin_detectors = [Example] - plugin_printers = [] + plugin_printers: List[Type[AbstractPrinter]] = [] return plugin_detectors, plugin_printers diff --git a/scripts/ci_test_cli.sh b/scripts/ci_test_cli.sh index 56e6ff0a4..e35bf3ff5 100755 --- a/scripts/ci_test_cli.sh +++ b/scripts/ci_test_cli.sh @@ -4,17 +4,17 @@ solc-select use 0.7.0 -if ! slither "tests/config/test.sol" --solc-ast; then +if ! slither "tests/config/test.sol" --solc-ast --no-fail-pedantic; then echo "--solc-ast failed" exit 1 fi -if ! slither "tests/config/test.sol" --solc-disable-warnings; then +if ! slither "tests/config/test.sol" --solc-disable-warnings --no-fail-pedantic; then echo "--solc-disable-warnings failed" exit 1 fi -if ! slither "tests/config/test.sol" --disable-color; then +if ! slither "tests/config/test.sol" --disable-color --no-fail-pedantic; then echo "--disable-color failed" exit 1 fi diff --git a/scripts/ci_test_path_filtering.sh b/scripts/ci_test_path_filtering.sh new file mode 100644 index 000000000..fb2a18842 --- /dev/null +++ b/scripts/ci_test_path_filtering.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +### Test path filtering across POSIX and Windows + +solc-select use 0.8.0 +slither "tests/test_path_filtering/test_path_filtering.sol" --config "tests/test_path_filtering/slither.config.json" > "output.txt" 2>&1 + +if ! grep -q "0 result(s) found" "output.txt" +then + echo "Path filtering across POSIX and Windows failed" + rm output.txt + exit 5 +else + rm output.txt +fi diff --git a/scripts/ci_test_truffle.sh b/scripts/ci_test_truffle.sh index da1a350c9..0246470f8 100755 --- a/scripts/ci_test_truffle.sh +++ b/scripts/ci_test_truffle.sh @@ -14,9 +14,9 @@ nvm use --lts npm install -g truffle truffle unbox metacoin -if ! slither .; then +if ! slither . --no-fail-pedantic; then echo "Truffle test failed" exit 1 fi -exit 0 \ No newline at end of file +exit 0 diff --git a/slither/__main__.py b/slither/__main__.py index b27c8ae75..98320c76a 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -10,11 +10,11 @@ import os import pstats import sys import traceback -from typing import Tuple, Optional, List, Dict +from typing import Tuple, Optional, List, Dict, Type, Union, Any, Sequence from pkg_resources import iter_entry_points, require -from crytic_compile import cryticparser +from crytic_compile import cryticparser, CryticCompile from crytic_compile.platform.standard import generate_standard_export from crytic_compile.platform.etherscan import SUPPORTED_NETWORK from crytic_compile import compile_all, is_supported @@ -55,10 +55,10 @@ logger = logging.getLogger("Slither") def process_single( - target: str, + target: Union[str, CryticCompile], args: argparse.Namespace, - detector_classes: List[AbstractDetector], - printer_classes: List[AbstractPrinter], + detector_classes: List[Type[AbstractDetector]], + printer_classes: List[Type[AbstractPrinter]], ) -> Tuple[Slither, List[Dict], List[Dict], int]: """ The core high-level code for running Slither static analysis. @@ -80,8 +80,8 @@ def process_single( def process_all( target: str, args: argparse.Namespace, - detector_classes: List[AbstractDetector], - printer_classes: List[AbstractPrinter], + detector_classes: List[Type[AbstractDetector]], + printer_classes: List[Type[AbstractPrinter]], ) -> Tuple[List[Slither], List[Dict], List[Dict], int]: compilations = compile_all(target, **vars(args)) slither_instances = [] @@ -109,8 +109,8 @@ def process_all( def _process( slither: Slither, - detector_classes: List[AbstractDetector], - printer_classes: List[AbstractPrinter], + detector_classes: List[Type[AbstractDetector]], + printer_classes: List[Type[AbstractPrinter]], ) -> Tuple[Slither, List[Dict], List[Dict], int]: for detector_cls in detector_classes: slither.register_detector(detector_cls) @@ -137,13 +137,14 @@ def _process( return slither, results_detectors, results_printers, analyzed_contracts_count +# TODO: delete me? def process_from_asts( filenames: List[str], args: argparse.Namespace, - detector_classes: List[AbstractDetector], - printer_classes: List[AbstractPrinter], -): - all_contracts = [] + detector_classes: List[Type[AbstractDetector]], + printer_classes: List[Type[AbstractPrinter]], +) -> Tuple[Slither, List[Dict], List[Dict], int]: + all_contracts: List[str] = [] for filename in filenames: with open(filename, encoding="utf8") as file_open: @@ -162,13 +163,15 @@ def process_from_asts( ################################################################################### -def get_detectors_and_printers(): +def get_detectors_and_printers() -> Tuple[ + List[Type[AbstractDetector]], List[Type[AbstractPrinter]] +]: - detectors = [getattr(all_detectors, name) for name in dir(all_detectors)] - detectors = [d for d in detectors if inspect.isclass(d) and issubclass(d, AbstractDetector)] + detectors_ = [getattr(all_detectors, name) for name in dir(all_detectors)] + detectors = [d for d in detectors_ if inspect.isclass(d) and issubclass(d, AbstractDetector)] - printers = [getattr(all_printers, name) for name in dir(all_printers)] - printers = [p for p in printers if inspect.isclass(p) and issubclass(p, AbstractPrinter)] + printers_ = [getattr(all_printers, name) for name in dir(all_printers)] + printers = [p for p in printers_ if inspect.isclass(p) and issubclass(p, AbstractPrinter)] # Handle plugins! for entry_point in iter_entry_points(group="slither_analyzer.plugin", name=None): @@ -194,8 +197,8 @@ def get_detectors_and_printers(): # pylint: disable=too-many-branches def choose_detectors( - args: argparse.Namespace, all_detector_classes: List[AbstractDetector] -) -> List[AbstractDetector]: + args: argparse.Namespace, all_detector_classes: List[Type[AbstractDetector]] +) -> List[Type[AbstractDetector]]: # If detectors are specified, run only these ones detectors_to_run = [] @@ -245,8 +248,8 @@ def choose_detectors( def choose_printers( - args: argparse.Namespace, all_printer_classes: List[AbstractPrinter] -) -> List[AbstractPrinter]: + args: argparse.Namespace, all_printer_classes: List[Type[AbstractPrinter]] +) -> List[Type[AbstractPrinter]]: printers_to_run = [] # disable default printer @@ -273,13 +276,16 @@ def choose_printers( ################################################################################### -def parse_filter_paths(args): +def parse_filter_paths(args: argparse.Namespace) -> List[str]: if args.filter_paths: return args.filter_paths.split(",") return [] -def parse_args(detector_classes, printer_classes): # pylint: disable=too-many-statements +# pylint: disable=too-many-statements +def parse_args( + detector_classes: List[Type[AbstractDetector]], printer_classes: List[Type[AbstractPrinter]] +) -> argparse.Namespace: usage = "slither target [flag]\n" usage += "\ntarget can be:\n" @@ -397,11 +403,19 @@ def parse_args(detector_classes, printer_classes): # pylint: disable=too-many-s group_detector.add_argument( "--fail-pedantic", - help="Fail if any finding is detected", + help="Return the number of findings in the exit code", action="store_true", default=defaults_flag_in_config["fail_pedantic"], ) + group_detector.add_argument( + "--no-fail-pedantic", + help="Do not return the number of findings in the exit code. Opposite of --fail-pedantic", + dest="fail_pedantic", + action="store_false", + required=False, + ) + group_detector.add_argument( "--fail-low", help="Fail if low or greater impact finding is detected", @@ -614,7 +628,9 @@ class ListDetectors(argparse.Action): # pylint: disable=too-few-public-methods class ListDetectorsJson(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs detectors, _ = get_detectors_and_printers() detector_types_json = output_detectors_json(detectors) print(json.dumps(detector_types_json)) @@ -622,22 +638,38 @@ class ListDetectorsJson(argparse.Action): # pylint: disable=too-few-public-meth class ListPrinters(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs _, printers = get_detectors_and_printers() output_printers(printers) parser.exit() class OutputMarkdown(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, args, values, option_string=None): + def __call__( + self, + parser: Any, + args: Any, + values: Optional[Union[str, Sequence[Any]]], + option_string: Any = None, + ) -> None: detectors, printers = get_detectors_and_printers() + assert isinstance(values, str) output_to_markdown(detectors, printers, values) parser.exit() class OutputWiki(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, args, values, option_string=None): + def __call__( + self, + parser: Any, + args: Any, + values: Optional[Union[str, Sequence[Any]]], + option_string: Any = None, + ) -> None: detectors, _ = get_detectors_and_printers() + assert isinstance(values, str) output_wiki(detectors, values) parser.exit() @@ -670,7 +702,7 @@ class FormatterCryticCompile(logging.Formatter): ################################################################################### -def main(): +def main() -> None: # Codebase with complex domninators can lead to a lot of SSA recursive call sys.setrecursionlimit(1500) @@ -681,8 +713,9 @@ def main(): # pylint: disable=too-many-statements,too-many-branches,too-many-locals def main_impl( - all_detector_classes: List[AbstractDetector], all_printer_classes: List[AbstractPrinter] -): + all_detector_classes: List[Type[AbstractDetector]], + all_printer_classes: List[Type[AbstractPrinter]], +) -> None: """ :param all_detector_classes: A list of all detectors that can be included/excluded. :param all_printer_classes: A list of all printers that can be included. @@ -748,8 +781,8 @@ def main_impl( crytic_compile_error.propagate = False crytic_compile_error.setLevel(logging.INFO) - results_detectors = [] - results_printers = [] + results_detectors: List[Dict] = [] + results_printers: List[Dict] = [] try: filename = args.filename @@ -798,6 +831,7 @@ def main_impl( if "compilations" in args.json_types: compilation_results = [] for slither_instance in slither_instances: + assert slither_instance.crytic_compile compilation_results.append( generate_standard_export(slither_instance.crytic_compile) ) @@ -848,7 +882,7 @@ def main_impl( except Exception: # pylint: disable=broad-except output_error = traceback.format_exc() - logging.error(traceback.print_exc()) + traceback.print_exc() logging.error(f"Error in {args.filename}") # pylint: disable=logging-fstring-interpolation logging.error(output_error) @@ -871,7 +905,7 @@ def main_impl( if outputting_zip: output_to_zip(args.zip, output_error, json_results, args.zip_type) - if args.perf: + if args.perf and cp: cp.disable() stats = pstats.Stats(cp).sort_stats("cumtime") stats.print_stats() diff --git a/slither/core/declarations/structure.py b/slither/core/declarations/structure.py index 39b1948ee..8f6d8c50a 100644 --- a/slither/core/declarations/structure.py +++ b/slither/core/declarations/structure.py @@ -8,10 +8,10 @@ if TYPE_CHECKING: class Structure(SourceMapping): - def __init__(self, compilation_unit: "SlitherCompilationUnit"): + def __init__(self, compilation_unit: "SlitherCompilationUnit") -> None: super().__init__() self._name: Optional[str] = None - self._canonical_name = None + self._canonical_name: Optional[str] = None self._elems: Dict[str, "StructureVariable"] = {} # Name of the elements in the order of declaration self._elems_ordered: List[str] = [] @@ -19,25 +19,27 @@ class Structure(SourceMapping): @property def canonical_name(self) -> str: + assert self._canonical_name return self._canonical_name @canonical_name.setter - def canonical_name(self, name: str): + def canonical_name(self, name: str) -> None: self._canonical_name = name @property def name(self) -> str: + assert self._name return self._name @name.setter - def name(self, new_name: str): + def name(self, new_name: str) -> None: self._name = new_name @property def elems(self) -> Dict[str, "StructureVariable"]: return self._elems - def add_elem_in_order(self, s: str): + def add_elem_in_order(self, s: str) -> None: self._elems_ordered.append(s) @property @@ -47,5 +49,5 @@ class Structure(SourceMapping): ret.append(self._elems[e]) return ret - def __str__(self): + def __str__(self) -> str: return self.name diff --git a/slither/core/expressions/literal.py b/slither/core/expressions/literal.py index 3303a9aa8..87090b93f 100644 --- a/slither/core/expressions/literal.py +++ b/slither/core/expressions/literal.py @@ -1,7 +1,9 @@ from typing import Optional, Union, TYPE_CHECKING from slither.core.expressions.expression import Expression +from slither.core.solidity_types.elementary_type import Fixed, Int, Ufixed, Uint from slither.utils.arithmetic import convert_subdenomination +from slither.utils.integer_conversion import convert_string_to_int if TYPE_CHECKING: from slither.core.solidity_types.type import Type @@ -29,6 +31,10 @@ class Literal(Expression): def __str__(self): if self.subdenomination: return str(convert_subdenomination(self._value, self.subdenomination)) + + if self.type in Int + Uint + Fixed + Ufixed + ["address"]: + return str(convert_string_to_int(self._value)) + # be sure to handle any character return str(self._value) diff --git a/slither/core/expressions/tuple_expression.py b/slither/core/expressions/tuple_expression.py index 7f14601f4..1fd8fc795 100644 --- a/slither/core/expressions/tuple_expression.py +++ b/slither/core/expressions/tuple_expression.py @@ -4,7 +4,7 @@ from slither.core.expressions.expression import Expression class TupleExpression(Expression): - def __init__(self, expressions): + def __init__(self, expressions: List[Expression]) -> None: assert all(isinstance(x, Expression) for x in expressions if x) super().__init__() self._expressions = expressions @@ -13,6 +13,6 @@ class TupleExpression(Expression): def expressions(self) -> List[Expression]: return self._expressions - def __str__(self): + def __str__(self) -> str: expressions_str = [str(e) for e in self.expressions] return "(" + ",".join(expressions_str) + ")" diff --git a/slither/core/solidity_types/array_type.py b/slither/core/solidity_types/array_type.py index 97d735c89..59a15dcc6 100644 --- a/slither/core/solidity_types/array_type.py +++ b/slither/core/solidity_types/array_type.py @@ -53,7 +53,7 @@ class ArrayType(Type): def storage_size(self) -> Tuple[int, bool]: if self._length_value: elem_size, _ = self._type.storage_size - return elem_size * int(self._length_value.value), True + return elem_size * int(str(self._length_value)), True return 32, True def __str__(self): diff --git a/slither/core/source_mapping/source_mapping.py b/slither/core/source_mapping/source_mapping.py index 7ceabd568..ee5211c7c 100644 --- a/slither/core/source_mapping/source_mapping.py +++ b/slither/core/source_mapping/source_mapping.py @@ -162,13 +162,15 @@ def _convert_source_mapping( class SourceMapping(Context, metaclass=ABCMeta): - def __init__(self): + def __init__(self) -> None: super().__init__() # self._source_mapping: Optional[Dict] = None self.source_mapping: Source = Source() self.references: List[Source] = [] - def set_offset(self, offset: Union["Source", str], compilation_unit: "SlitherCompilationUnit"): + def set_offset( + self, offset: Union["Source", str], compilation_unit: "SlitherCompilationUnit" + ) -> None: if isinstance(offset, Source): self.source_mapping.start = offset.start self.source_mapping.length = offset.length @@ -184,6 +186,6 @@ class SourceMapping(Context, metaclass=ABCMeta): def add_reference_from_raw_source( self, offset: str, compilation_unit: "SlitherCompilationUnit" - ): + ) -> None: s = _convert_source_mapping(offset, compilation_unit) self.references.append(s) diff --git a/slither/detectors/attributes/incorrect_solc.py b/slither/detectors/attributes/incorrect_solc.py index 5292c19e3..4f1675b19 100644 --- a/slither/detectors/attributes/incorrect_solc.py +++ b/slither/detectors/attributes/incorrect_solc.py @@ -43,7 +43,14 @@ Deploy with any of the following Solidity versions: - 0.5.16 - 0.5.17 - 0.6.11 - 0.6.12 - 0.7.5 - 0.7.6 -- 0.8.4 - 0.8.7 +- 0.8.16 + +The recommendations take into account: +- Risks related to recent releases +- Risks of complex code generation changes +- Risks of new language features +- Risks of known bugs + Use a simple pragma version that allows any of these versions. Consider using the latest version of Solidity for testing.""" # endregion wiki_recommendation @@ -58,18 +65,7 @@ Consider using the latest version of Solidity for testing.""" ) # Indicates the allowed versions. Must be formatted in increasing order. - ALLOWED_VERSIONS = [ - "0.5.16", - "0.5.17", - "0.6.11", - "0.6.12", - "0.7.5", - "0.7.6", - "0.8.4", - "0.8.5", - "0.8.6", - "0.8.7", - ] + ALLOWED_VERSIONS = ["0.5.16", "0.5.17", "0.6.11", "0.6.12", "0.7.5", "0.7.6", "0.8.16"] # Indicates the versions that should not be used. BUGGY_VERSIONS = [ diff --git a/slither/slither.py b/slither/slither.py index 59bbf8a5f..dcfc0ad7e 100644 --- a/slither/slither.py +++ b/slither/slither.py @@ -1,5 +1,5 @@ import logging -from typing import Union, List, ValuesView +from typing import Union, List, ValuesView, Type, Dict from crytic_compile import CryticCompile, InvalidCompilation @@ -19,7 +19,9 @@ logger_detector = logging.getLogger("Detectors") logger_printer = logging.getLogger("Printers") -def _check_common_things(thing_name, cls, base_cls, instances_list): +def _check_common_things( + thing_name: str, cls: Type, base_cls: Type, instances_list: List[Type[AbstractDetector]] +) -> None: if not issubclass(cls, base_cls) or cls is base_cls: raise Exception( @@ -178,7 +180,7 @@ class Slither(SlitherCore): # pylint: disable=too-many-instance-attributes def detectors_optimization(self): return [d for d in self.detectors if d.IMPACT == DetectorClassification.OPTIMIZATION] - def register_detector(self, detector_class): + def register_detector(self, detector_class: Type[AbstractDetector]) -> None: """ :param detector_class: Class inheriting from `AbstractDetector`. """ @@ -188,7 +190,7 @@ class Slither(SlitherCore): # pylint: disable=too-many-instance-attributes instance = detector_class(compilation_unit, self, logger_detector) self._detectors.append(instance) - def register_printer(self, printer_class): + def register_printer(self, printer_class: Type[AbstractPrinter]) -> None: """ :param printer_class: Class inheriting from `AbstractPrinter`. """ @@ -197,7 +199,7 @@ class Slither(SlitherCore): # pylint: disable=too-many-instance-attributes instance = printer_class(self, logger_printer) self._printers.append(instance) - def run_detectors(self): + def run_detectors(self) -> List[Dict]: """ :return: List of registered detectors results. """ diff --git a/slither/slithir/operations/call.py b/slither/slithir/operations/call.py index cff2767cd..07304fa99 100644 --- a/slither/slithir/operations/call.py +++ b/slither/slithir/operations/call.py @@ -1,8 +1,10 @@ +from typing import Optional, List + from slither.slithir.operations.operation import Operation class Call(Operation): - def __init__(self): + def __init__(self) -> None: super().__init__() self._arguments = [] @@ -14,14 +16,14 @@ class Call(Operation): def arguments(self, v): self._arguments = v - def can_reenter(self, _callstack=None): # pylint: disable=no-self-use + def can_reenter(self, _callstack: Optional[List] = None) -> bool: # pylint: disable=no-self-use """ Must be called after slithIR analysis pass :return: bool """ return False - def can_send_eth(self): # pylint: disable=no-self-use + def can_send_eth(self) -> bool: # pylint: disable=no-self-use """ Must be called after slithIR analysis pass :return: bool diff --git a/slither/slithir/tmp_operations/tmp_call.py b/slither/slithir/tmp_operations/tmp_call.py index e9562b1c1..fb6641139 100644 --- a/slither/slithir/tmp_operations/tmp_call.py +++ b/slither/slithir/tmp_operations/tmp_call.py @@ -63,14 +63,14 @@ class TmpCall(OperationWithLValue): # pylint: disable=too-many-instance-attribu def call_id(self): return self._callid - @property - def read(self): - return [self.called] - @call_id.setter def call_id(self, c): self._callid = c + @property + def read(self): + return [self.called] + @property def called(self): return self._called diff --git a/slither/slithir/tmp_operations/tmp_new_elementary_type.py b/slither/slithir/tmp_operations/tmp_new_elementary_type.py index 357c063a7..d7a4f5e1b 100644 --- a/slither/slithir/tmp_operations/tmp_new_elementary_type.py +++ b/slither/slithir/tmp_operations/tmp_new_elementary_type.py @@ -1,21 +1,23 @@ +from typing import List + from slither.slithir.operations.lvalue import OperationWithLValue from slither.core.solidity_types.elementary_type import ElementaryType class TmpNewElementaryType(OperationWithLValue): - def __init__(self, new_type, lvalue): + def __init__(self, new_type: ElementaryType, lvalue): assert isinstance(new_type, ElementaryType) super().__init__() - self._type = new_type + self._type: ElementaryType = new_type self._lvalue = lvalue @property - def read(self): + def read(self) -> List: return [] @property - def type(self): + def type(self) -> ElementaryType: return self._type - def __str__(self): + def __str__(self) -> str: return f"{self.lvalue} = new {self._type}" diff --git a/slither/slithir/variables/constant.py b/slither/slithir/variables/constant.py index 09a5ee34f..5da2d9cc0 100644 --- a/slither/slithir/variables/constant.py +++ b/slither/slithir/variables/constant.py @@ -1,4 +1,3 @@ -from decimal import Decimal from functools import total_ordering from slither.core.solidity_types.elementary_type import ElementaryType, Int, Uint @@ -33,7 +32,7 @@ class Constant(SlithIRVariable): else: if val.isdigit(): self._type = ElementaryType("uint256") - self._val = int(Decimal(val)) + self._val = convert_string_to_int(val) else: self._type = ElementaryType("string") self._val = val diff --git a/slither/solc_parsing/declarations/modifier.py b/slither/solc_parsing/declarations/modifier.py index 3fdc22d4e..a3f07da7f 100644 --- a/slither/solc_parsing/declarations/modifier.py +++ b/slither/solc_parsing/declarations/modifier.py @@ -62,7 +62,7 @@ class ModifierSolc(FunctionSolc): self._content_was_analyzed = True if self.is_compact_ast: - body = self._functionNotParsed["body"] + body = self._functionNotParsed.get("body", None) if body and body[self.get_key()] == "Block": self._function.is_implemented = True diff --git a/slither/tools/demo/__main__.py b/slither/tools/demo/__main__.py index 37d265bb1..5bc2c7c8e 100644 --- a/slither/tools/demo/__main__.py +++ b/slither/tools/demo/__main__.py @@ -9,7 +9,7 @@ logging.getLogger("Slither").setLevel(logging.INFO) logger = logging.getLogger("Slither-demo") -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -26,7 +26,7 @@ def parse_args(): return parser.parse_args() -def main(): +def main() -> None: args = parse_args() # Perform slither analysis on the given filename diff --git a/slither/tools/erc_conformance/__main__.py b/slither/tools/erc_conformance/__main__.py index 45e57b55c..ef594a7c6 100644 --- a/slither/tools/erc_conformance/__main__.py +++ b/slither/tools/erc_conformance/__main__.py @@ -1,6 +1,7 @@ import argparse import logging from collections import defaultdict +from typing import Any, Dict, List from crytic_compile import cryticparser from slither import Slither @@ -26,7 +27,7 @@ logger.propagate = False ADDITIONAL_CHECKS = {"ERC20": check_erc20, "ERC1155": check_erc1155} -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -63,20 +64,20 @@ def parse_args(): return parser.parse_args() -def _log_error(err, args): +def _log_error(err: Any, args: argparse.Namespace) -> None: if args.json: output_to_json(args.json, str(err), {"upgradeability-check": []}) logger.error(err) -def main(): +def main() -> None: args = parse_args() # Perform slither analysis on the given filename slither = Slither(args.project, **vars(args)) - ret = defaultdict(list) + ret: Dict[str, List] = defaultdict(list) if args.erc.upper() in ERCS: diff --git a/slither/tools/erc_conformance/erc/ercs.py b/slither/tools/erc_conformance/erc/ercs.py index ef459eef9..a6b9050ae 100644 --- a/slither/tools/erc_conformance/erc/ercs.py +++ b/slither/tools/erc_conformance/erc/ercs.py @@ -1,7 +1,10 @@ import logging +from typing import Dict, List, Optional, Set +from slither.core.declarations import Contract from slither.slithir.operations import EventCall from slither.utils import output +from slither.utils.erc import ERC, ERC_EVENT from slither.utils.type import ( export_nested_types_from_variable, export_return_type_from_variable, @@ -11,7 +14,7 @@ logger = logging.getLogger("Slither-conformance") # pylint: disable=too-many-locals,too-many-branches,too-many-statements -def _check_signature(erc_function, contract, ret): +def _check_signature(erc_function: ERC, contract: Contract, ret: Dict) -> None: name = erc_function.name parameters = erc_function.parameters return_type = erc_function.return_type @@ -146,7 +149,7 @@ def _check_signature(erc_function, contract, ret): ret["missing_event_emmited"].append(missing_event_emmited.data) -def _check_events(erc_event, contract, ret): +def _check_events(erc_event: ERC_EVENT, contract: Contract, ret: Dict[str, List]) -> None: name = erc_event.name parameters = erc_event.parameters indexes = erc_event.indexes @@ -180,7 +183,13 @@ def _check_events(erc_event, contract, ret): ret["missing_event_index"].append(missing_event_index.data) -def generic_erc_checks(contract, erc_functions, erc_events, ret, explored=None): +def generic_erc_checks( + contract: Contract, + erc_functions: List[ERC], + erc_events: List[ERC_EVENT], + ret: Dict[str, List], + explored: Optional[Set[Contract]] = None, +) -> None: if explored is None: explored = set() diff --git a/slither/tools/flattening/__main__.py b/slither/tools/flattening/__main__.py index 977b84896..bf9856fe8 100644 --- a/slither/tools/flattening/__main__.py +++ b/slither/tools/flattening/__main__.py @@ -18,7 +18,7 @@ logger = logging.getLogger("Slither") logger.setLevel(logging.INFO) -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -106,7 +106,7 @@ def parse_args(): return parser.parse_args() -def main(): +def main() -> None: args = parse_args() slither = Slither(args.filename, **vars(args)) diff --git a/slither/tools/kspec_coverage/__main__.py b/slither/tools/kspec_coverage/__main__.py index b6ce0f81b..19933e0fe 100644 --- a/slither/tools/kspec_coverage/__main__.py +++ b/slither/tools/kspec_coverage/__main__.py @@ -16,7 +16,7 @@ logger.handlers[0].setFormatter(formatter) logger.propagate = False -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -56,7 +56,7 @@ def parse_args(): return parser.parse_args() -def main(): +def main() -> None: # ------------------------------ # Usage: slither-kspec-coverage contract kspec # Example: slither-kspec-coverage contract.sol kspec.md diff --git a/slither/tools/kspec_coverage/kspec_coverage.py b/slither/tools/kspec_coverage/kspec_coverage.py index 569a35cf1..f8c2d8cf2 100755 --- a/slither/tools/kspec_coverage/kspec_coverage.py +++ b/slither/tools/kspec_coverage/kspec_coverage.py @@ -1,8 +1,10 @@ +import argparse + from slither.tools.kspec_coverage.analysis import run_analysis from slither import Slither -def kspec_coverage(args): +def kspec_coverage(args: argparse.Namespace) -> None: contract = args.contract kspec = args.kspec diff --git a/slither/tools/mutator/__main__.py b/slither/tools/mutator/__main__.py index 442b4849d..78b86d681 100644 --- a/slither/tools/mutator/__main__.py +++ b/slither/tools/mutator/__main__.py @@ -2,6 +2,7 @@ import argparse import inspect import logging import sys +from typing import Type, List, Any from crytic_compile import cryticparser @@ -22,7 +23,7 @@ logger.setLevel(logging.INFO) ################################################################################### -def parse_args(): +def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser( description="Experimental smart contract mutator. Based on https://arxiv.org/abs/2006.11597", usage="slither-mutate target", @@ -48,14 +49,16 @@ def parse_args(): return parser.parse_args() -def _get_mutators(): - detectors = [getattr(all_mutators, name) for name in dir(all_mutators)] - detectors = [c for c in detectors if inspect.isclass(c) and issubclass(c, AbstractMutator)] +def _get_mutators() -> List[Type[AbstractMutator]]: + detectors_ = [getattr(all_mutators, name) for name in dir(all_mutators)] + detectors = [c for c in detectors_ if inspect.isclass(c) and issubclass(c, AbstractMutator)] return detectors class ListMutators(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs checks = _get_mutators() output_mutators(checks) parser.exit() diff --git a/slither/tools/possible_paths/__main__.py b/slither/tools/possible_paths/__main__.py index 29cd05c46..b993d266a 100644 --- a/slither/tools/possible_paths/__main__.py +++ b/slither/tools/possible_paths/__main__.py @@ -5,6 +5,7 @@ from argparse import ArgumentParser, Namespace from crytic_compile import cryticparser from slither import Slither +from slither.core.declarations import FunctionContract from slither.utils.colors import red from slither.tools.possible_paths.possible_paths import ( find_target_paths, @@ -58,7 +59,11 @@ def main() -> None: # Print out all target functions. print("Target functions:") for target in targets: - print(f"- {target.contract_declarer.name}.{target.full_name}") + if isinstance(target, FunctionContract): + print(f"- {target.contract_declarer.name}.{target.full_name}") + else: + pass + # TODO implement me print("\n") # Obtain all paths which reach the target functions. diff --git a/slither/tools/possible_paths/possible_paths.py b/slither/tools/possible_paths/possible_paths.py index 9e52ed6b7..6e836e76a 100644 --- a/slither/tools/possible_paths/possible_paths.py +++ b/slither/tools/possible_paths/possible_paths.py @@ -1,8 +1,15 @@ +from typing import List, Tuple, Union, Optional, Set + +from slither import Slither +from slither.core.declarations import Function, FunctionContract +from slither.core.slither_core import SlitherCore + + class ResolveFunctionException(Exception): pass -def resolve_function(slither, contract_name, function_name): +def resolve_function(slither: SlitherCore, contract_name: str, function_name: str) -> Function: """ Resolves a function instance, given a contract name and function. :param contract_name: The name of the contract the function is declared in. @@ -32,7 +39,9 @@ def resolve_function(slither, contract_name, function_name): return target_function -def resolve_functions(slither, functions): +def resolve_functions( + slither: Slither, functions: List[Union[str, Tuple[str, str]]] +) -> List[Function]: """ Resolves the provided function descriptors. :param functions: A list of tuples (contract_name, function_name) or str (of form "ContractName.FunctionName") @@ -40,7 +49,7 @@ def resolve_functions(slither, functions): :return: Returns a list of resolved functions. """ # Create the resolved list. - resolved = [] + resolved: List[Function] = [] # Verify that the provided argument is a list. if not isinstance(functions, list): @@ -72,24 +81,31 @@ def resolve_functions(slither, functions): return resolved -def all_function_definitions(function): +def all_function_definitions(function: Function) -> List[Function]: """ Obtains a list of representing this function and any base definitions :param function: The function to obtain all definitions at and beneath. :return: Returns a list composed of the provided function definition and any base definitions. """ - return [function] + [ + # TODO implement me + if not isinstance(function, FunctionContract): + return [] + ret: List[Function] = [function] + ret += [ f for c in function.contract.inheritance for f in c.functions_and_modifiers_declared if f.full_name == function.full_name ] + return ret -def __find_target_paths(slither, target_function, current_path=None): +def __find_target_paths( + slither: SlitherCore, target_function: Function, current_path: Optional[List[Function]] = None +) -> Set[Tuple[Function, ...]]: current_path = current_path if current_path else [] # Create our results list - results = set() + results: Set[Tuple[Function, ...]] = set() # Add our current function to the path. current_path = [target_function] + current_path @@ -106,9 +122,12 @@ def __find_target_paths(slither, target_function, current_path=None): continue # Find all function calls in this function (except for low level) - called_functions = [f for (_, f) in function.high_level_calls + function.library_calls] - called_functions += function.internal_calls - called_functions = set(called_functions) + called_functions_list = [ + f for (_, f) in function.high_level_calls if isinstance(f, Function) + ] + called_functions_list += [f for (_, f) in function.library_calls] + called_functions_list += [f for f in function.internal_calls if isinstance(f, Function)] + called_functions = set(called_functions_list) # If any of our target functions are reachable from this function, it's a result. if all_target_functions.intersection(called_functions): @@ -123,14 +142,16 @@ def __find_target_paths(slither, target_function, current_path=None): return results -def find_target_paths(slither, target_functions): +def find_target_paths( + slither: SlitherCore, target_functions: List[Function] +) -> Set[Tuple[Function, ...]]: """ Obtains all functions which can lead to any of the target functions being called. :param target_functions: The functions we are interested in reaching. :return: Returns a list of all functions which can reach any of the target_functions. """ # Create our results list - results = set() + results: Set[Tuple[Function, ...]] = set() # Loop for each target function for target_function in target_functions: diff --git a/slither/tools/properties/__main__.py b/slither/tools/properties/__main__.py index 91c990669..10837bb4b 100644 --- a/slither/tools/properties/__main__.py +++ b/slither/tools/properties/__main__.py @@ -1,6 +1,7 @@ import argparse import logging import sys +from typing import Any from crytic_compile import cryticparser @@ -26,7 +27,7 @@ logger.handlers[0].setFormatter(formatter) logger.propagate = False -def _all_scenarios(): +def _all_scenarios() -> str: txt = "\n" txt += "#################### ERC20 ####################\n" for k, value in ERC20_PROPERTIES.items(): @@ -35,29 +36,33 @@ def _all_scenarios(): return txt -def _all_properties(): +def _all_properties() -> MyPrettyTable: table = MyPrettyTable(["Num", "Description", "Scenario"]) idx = 0 for scenario, value in ERC20_PROPERTIES.items(): for prop in value.properties: - table.add_row([idx, prop.description, scenario]) + table.add_row([str(idx), prop.description, scenario]) idx = idx + 1 return table class ListScenarios(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs logger.info(_all_scenarios()) parser.exit() class ListProperties(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs logger.info(_all_properties()) parser.exit() -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -120,7 +125,7 @@ def parse_args(): return parser.parse_args() -def main(): +def main() -> None: args = parse_args() # Perform slither analysis on the given filename diff --git a/slither/tools/properties/platforms/truffle.py b/slither/tools/properties/platforms/truffle.py index dc83eb273..7d2f3d9b6 100644 --- a/slither/tools/properties/platforms/truffle.py +++ b/slither/tools/properties/platforms/truffle.py @@ -15,7 +15,7 @@ PATTERN_TRUFFLE_MIGRATION = re.compile("^[0-9]*_") logger = logging.getLogger("Slither") -def _extract_caller(p: PropertyCaller): +def _extract_caller(p: PropertyCaller) -> List[str]: if p == PropertyCaller.OWNER: return ["owner"] if p == PropertyCaller.SENDER: @@ -28,7 +28,7 @@ def _extract_caller(p: PropertyCaller): return ["user"] -def _helpers(): +def _helpers() -> str: """ Generate two functions: - catchRevertThrowReturnFalse: check if the call revert/throw or return false @@ -75,7 +75,7 @@ def generate_unit_test( # pylint: disable=too-many-arguments,too-many-branches output_dir: Path, addresses: Addresses, assert_message: str = "", -): +) -> Path: """ Generate unit tests files :param test_contract: @@ -134,7 +134,7 @@ def generate_unit_test( # pylint: disable=too-many-arguments,too-many-branches return output_dir -def generate_migration(test_contract: str, output_dir: Path, owner_address: str): +def generate_migration(test_contract: str, output_dir: Path, owner_address: str) -> None: """ Generate migration file :param test_contract: diff --git a/slither/tools/properties/utils.py b/slither/tools/properties/utils.py index bdc5bdd68..5a0153211 100644 --- a/slither/tools/properties/utils.py +++ b/slither/tools/properties/utils.py @@ -12,7 +12,7 @@ def write_file( content: str, allow_overwrite: bool = True, discard_if_exist: bool = False, -): +) -> None: """ Write the content into output_dir/filename :param output_dir: diff --git a/slither/tools/read_storage/README.md b/slither/tools/read_storage/README.md index 91491a364..82381c527 100644 --- a/slither/tools/read_storage/README.md +++ b/slither/tools/read_storage/README.md @@ -18,7 +18,7 @@ optional arguments: --struct-var STRUCT_VAR The name of the variable whose value will be returned from a struct. --storage-address STORAGE_ADDRESS The address of the storage contract (if a proxy pattern is used). --contract-name CONTRACT_NAME The name of the logic contract. - --layout Toggle used to write a JSON file with the entire storage layout. + --json FILE Write the entire storage layout in JSON format to the specified FILE --value Toggle used to include values in output. --max-depth MAX_DEPTH Max depth to search in data structure. ``` @@ -28,19 +28,19 @@ optional arguments: Retrieve the storage slots of a local contract: ```shell -slither-read-storage file.sol 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout +slither-read-storage file.sol 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json ``` Retrieve the storage slots of a contract verified on an Etherscan-like platform: ```shell -slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout +slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json ``` To retrieve the values as well, pass `--value` and `--rpc-url $RPC_URL`: ```shell -slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --layout --rpc-url $RPC_URL --value +slither-read-storage 0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8 --json storage_layout.json --rpc-url $RPC_URL --value ``` To view only the slot of the `slot0` structure variable, pass `--variable-name slot0`: @@ -79,7 +79,7 @@ slither-read-storage 0xa2327a938Febf5FEC13baCFb16Ae10EcBc4cbDCF --variable-name Take Avalanche, for instance: ```shell - slither-read-storage avax:0x0000000000000000000000000000000000000000 --layout --value --rpc-url $AVAX_RPC_URL + slither-read-storage avax:0x0000000000000000000000000000000000000000 --json storage_layout.json --value --rpc-url $AVAX_RPC_URL ``` ## Limitations diff --git a/slither/tools/read_storage/__main__.py b/slither/tools/read_storage/__main__.py index f3cc90efc..c899b9eb7 100644 --- a/slither/tools/read_storage/__main__.py +++ b/slither/tools/read_storage/__main__.py @@ -21,9 +21,9 @@ def parse_args() -> argparse.Namespace: "\nTo retrieve a single variable's value:\n" + "\tslither-read-storage $TARGET address --variable-name $NAME\n" + "To retrieve a contract's storage layout:\n" - + "\tslither-read-storage $TARGET address --contract-name $NAME --layout\n" + + "\tslither-read-storage $TARGET address --contract-name $NAME --json storage_layout.json\n" + "To retrieve a contract's storage layout and values:\n" - + "\tslither-read-storage $TARGET address --contract-name $NAME --layout --value\n" + + "\tslither-read-storage $TARGET address --contract-name $NAME --json storage_layout.json --value\n" + "TARGET can be a contract address or project directory" ), ) diff --git a/slither/tools/similarity/__main__.py b/slither/tools/similarity/__main__.py index 21ba88681..86673fccd 100755 --- a/slither/tools/similarity/__main__.py +++ b/slither/tools/similarity/__main__.py @@ -17,7 +17,7 @@ logger = logging.getLogger("Slither-simil") modes = ["info", "test", "train", "plot"] -def parse_args(): +def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser( description="Code similarity detection tool. For usage, see https://github.com/crytic/slither/wiki/Code-Similarity-detector" ) @@ -78,7 +78,7 @@ def parse_args(): ################################################################################### -def main(): +def main() -> None: args = parse_args() default_log = logging.INFO diff --git a/slither/tools/similarity/encode.py b/slither/tools/similarity/encode.py index c69de91b8..9889644fb 100644 --- a/slither/tools/similarity/encode.py +++ b/slither/tools/similarity/encode.py @@ -74,7 +74,7 @@ def parse_target(target): return None -def load_and_encode(infile, vmodel, ext=None, nsamples=None, **kwargs): +def load_and_encode(infile: str, vmodel, ext=None, nsamples=None, **kwargs): r = {} if infile.endswith(".npz"): r = load_cache(infile, nsamples=nsamples) diff --git a/slither/tools/similarity/info.py b/slither/tools/similarity/info.py index 95aadea6a..c9f9753d1 100644 --- a/slither/tools/similarity/info.py +++ b/slither/tools/similarity/info.py @@ -1,3 +1,4 @@ +import argparse import logging import sys import os.path @@ -10,7 +11,7 @@ logging.basicConfig() logger = logging.getLogger("Slither-simil") -def info(args): +def info(args: argparse.Namespace) -> None: try: diff --git a/slither/tools/similarity/plot.py b/slither/tools/similarity/plot.py index bbdeec2cf..f11e92129 100644 --- a/slither/tools/similarity/plot.py +++ b/slither/tools/similarity/plot.py @@ -1,3 +1,4 @@ +import argparse import logging import random import sys @@ -23,7 +24,7 @@ except ImportError: logger = logging.getLogger("Slither-simil") -def plot(args): # pylint: disable=too-many-locals +def plot(args: argparse.Namespace) -> None: # pylint: disable=too-many-locals if decomposition is None or plt is None: logger.error( diff --git a/slither/tools/similarity/train.py b/slither/tools/similarity/train.py index a0d06c944..ccadf4926 100755 --- a/slither/tools/similarity/train.py +++ b/slither/tools/similarity/train.py @@ -1,3 +1,4 @@ +import argparse import logging import os import sys @@ -10,7 +11,7 @@ from slither.tools.similarity.model import train_unsupervised logger = logging.getLogger("Slither-simil") -def train(args): # pylint: disable=too-many-locals +def train(args: argparse.Namespace) -> None: # pylint: disable=too-many-locals try: last_data_train_filename = "last_data_train.txt" diff --git a/slither/tools/slither_format/__main__.py b/slither/tools/slither_format/__main__.py index a3d63d922..85c0a3917 100644 --- a/slither/tools/slither_format/__main__.py +++ b/slither/tools/slither_format/__main__.py @@ -23,7 +23,7 @@ available_detectors = [ ] -def parse_args(): +def parse_args() -> argparse.Namespace: """ Parse the underlying arguments for the program. :return: Returns the arguments for the program. @@ -90,7 +90,7 @@ def parse_args(): return parser.parse_args() -def main(): +def main() -> None: # ------------------------------ # Usage: python3 -m slither_format filename # Example: python3 -m slither_format contract.sol diff --git a/slither/tools/slither_format/slither_format.py b/slither/tools/slither_format/slither_format.py index 794307100..c165b3fbb 100644 --- a/slither/tools/slither_format/slither_format.py +++ b/slither/tools/slither_format/slither_format.py @@ -1,5 +1,9 @@ import logging from pathlib import Path +from typing import Type, List, Dict + +from slither import Slither +from slither.detectors.abstract_detector import AbstractDetector from slither.detectors.variables.unused_state_variables import UnusedStateVars from slither.detectors.attributes.incorrect_solc import IncorrectSolc from slither.detectors.attributes.constant_pragma import ConstantPragma @@ -13,7 +17,7 @@ from slither.utils.colors import yellow logging.basicConfig(level=logging.INFO) logger = logging.getLogger("Slither.Format") -all_detectors = { +all_detectors: Dict[str, Type[AbstractDetector]] = { "unused-state": UnusedStateVars, "solc-version": IncorrectSolc, "pragma": ConstantPragma, @@ -25,7 +29,7 @@ all_detectors = { } -def slither_format(slither, **kwargs): # pylint: disable=too-many-locals +def slither_format(slither: Slither, **kwargs: Dict) -> None: # pylint: disable=too-many-locals """' Keyword Args: detectors_to_run (str): Comma-separated list of detectors, defaults to all @@ -85,9 +89,11 @@ def slither_format(slither, **kwargs): # pylint: disable=too-many-locals ################################################################################### -def choose_detectors(detectors_to_run, detectors_to_exclude): +def choose_detectors( + detectors_to_run: str, detectors_to_exclude: str +) -> List[Type[AbstractDetector]]: # If detectors are specified, run only these ones - cls_detectors_to_run = [] + cls_detectors_to_run: List[Type[AbstractDetector]] = [] exclude = detectors_to_exclude.split(",") if detectors_to_run == "all": for key, detector in all_detectors.items(): @@ -114,7 +120,7 @@ def choose_detectors(detectors_to_run, detectors_to_exclude): ################################################################################### -def print_patches(number_of_slither_results, patches): +def print_patches(number_of_slither_results: int, patches: Dict) -> None: logger.info("Number of Slither results: " + str(number_of_slither_results)) number_of_patches = 0 for file in patches: @@ -130,7 +136,7 @@ def print_patches(number_of_slither_results, patches): logger.info("Location end: " + str(patch["end"])) -def print_patches_json(number_of_slither_results, patches): +def print_patches_json(number_of_slither_results: int, patches: Dict) -> None: print("{", end="") print('"Number of Slither results":' + '"' + str(number_of_slither_results) + '",') print('"Number of patchlets":' + '"' + str(len(patches)) + '"', ",") diff --git a/slither/tools/upgradeability/__main__.py b/slither/tools/upgradeability/__main__.py index 6cc953015..414a4c175 100644 --- a/slither/tools/upgradeability/__main__.py +++ b/slither/tools/upgradeability/__main__.py @@ -3,10 +3,13 @@ import inspect import json import logging import sys +from typing import List, Any, Type, Dict, Tuple, Union, Sequence, Optional from crytic_compile import cryticparser + from slither import Slither +from slither.core.declarations import Contract from slither.exceptions import SlitherException from slither.utils.colors import red from slither.utils.output import output_to_json @@ -24,7 +27,7 @@ logger: logging.Logger = logging.getLogger("Slither") logger.setLevel(logging.INFO) -def parse_args(): +def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser( description="Slither Upgradeability Checks. For usage information see https://github.com/crytic/slither/wiki/Upgradeability-Checks.", usage="slither-check-upgradeability contract.sol ContractName", @@ -93,21 +96,27 @@ def parse_args(): ################################################################################### -def _get_checks(): - detectors = [getattr(all_checks, name) for name in dir(all_checks)] - detectors = [c for c in detectors if inspect.isclass(c) and issubclass(c, AbstractCheck)] +def _get_checks() -> List[Type[AbstractCheck]]: + detectors_ = [getattr(all_checks, name) for name in dir(all_checks)] + detectors: List[Type[AbstractCheck]] = [ + c for c in detectors_ if inspect.isclass(c) and issubclass(c, AbstractCheck) + ] return detectors class ListDetectors(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs checks = _get_checks() output_detectors(checks) parser.exit() class ListDetectorsJson(argparse.Action): # pylint: disable=too-few-public-methods - def __call__(self, parser, *args, **kwargs): # pylint: disable=signature-differs + def __call__( + self, parser: Any, *args: Any, **kwargs: Any + ) -> None: # pylint: disable=signature-differs checks = _get_checks() detector_types_json = output_detectors_json(checks) print(json.dumps(detector_types_json)) @@ -116,48 +125,64 @@ class ListDetectorsJson(argparse.Action): # pylint: disable=too-few-public-meth class OutputMarkdown(argparse.Action): # pylint: disable=too-few-public-methods def __call__( - self, parser, args, values, option_string=None - ): # pylint: disable=signature-differs + self, + parser: Any, + args: Any, + values: Optional[Union[str, Sequence[Any]]], + option_string: Any = None, + ) -> None: # pylint: disable=signature-differs checks = _get_checks() + assert isinstance(values, str) output_to_markdown(checks, values) parser.exit() class OutputWiki(argparse.Action): # pylint: disable=too-few-public-methods def __call__( - self, parser, args, values, option_string=None - ): # pylint: disable=signature-differs + self, + parser: Any, + args: Any, + values: Optional[Union[str, Sequence[Any]]], + option_string: Any = None, + ) -> Any: # pylint: disable=signature-differs checks = _get_checks() + assert isinstance(values, str) output_wiki(checks, values) parser.exit() -def _run_checks(detectors): - results = [d.check() for d in detectors] - results = [r for r in results if r] - results = [item for sublist in results for item in sublist] # flatten +def _run_checks(detectors: List[AbstractCheck]) -> List[Dict]: + results_ = [d.check() for d in detectors] + results_ = [r for r in results_ if r] + results = [item for sublist in results_ for item in sublist] # flatten return results -def _checks_on_contract(detectors, contract): - detectors = [ +def _checks_on_contract( + detectors: List[Type[AbstractCheck]], contract: Contract +) -> Tuple[List[Dict], int]: + detectors_ = [ d(logger, contract) for d in detectors if (not d.REQUIRE_PROXY and not d.REQUIRE_CONTRACT_V2) ] - return _run_checks(detectors), len(detectors) + return _run_checks(detectors_), len(detectors_) -def _checks_on_contract_update(detectors, contract_v1, contract_v2): - detectors = [ +def _checks_on_contract_update( + detectors: List[Type[AbstractCheck]], contract_v1: Contract, contract_v2: Contract +) -> Tuple[List[Dict], int]: + detectors_ = [ d(logger, contract_v1, contract_v2=contract_v2) for d in detectors if d.REQUIRE_CONTRACT_V2 ] - return _run_checks(detectors), len(detectors) + return _run_checks(detectors_), len(detectors_) -def _checks_on_contract_and_proxy(detectors, contract, proxy): - detectors = [d(logger, contract, proxy=proxy) for d in detectors if d.REQUIRE_PROXY] - return _run_checks(detectors), len(detectors) +def _checks_on_contract_and_proxy( + detectors: List[Type[AbstractCheck]], contract: Contract, proxy: Contract +) -> Tuple[List[Dict], int]: + detectors_ = [d(logger, contract, proxy=proxy) for d in detectors if d.REQUIRE_PROXY] + return _run_checks(detectors_), len(detectors_) # endregion @@ -168,8 +193,8 @@ def _checks_on_contract_and_proxy(detectors, contract, proxy): ################################################################################### # pylint: disable=too-many-statements,too-many-branches,too-many-locals -def main(): - json_results = { +def main() -> None: + json_results: Dict = { "proxy-present": False, "contract_v2-present": False, "detectors": [], @@ -254,7 +279,7 @@ def main(): number_detectors_run += number_detectors # If there is a V2, we run the contract-only check on the V2 - detectors_results, _ = _checks_on_contract(detectors, v2_contract) + detectors_results, number_detectors = _checks_on_contract(detectors, v2_contract) json_results["detectors"] += detectors_results number_detectors_run += number_detectors diff --git a/slither/tools/upgradeability/utils/command_line.py b/slither/tools/upgradeability/utils/command_line.py index 6ab3f82f9..88b61ceed 100644 --- a/slither/tools/upgradeability/utils/command_line.py +++ b/slither/tools/upgradeability/utils/command_line.py @@ -1,8 +1,10 @@ -from slither.tools.upgradeability.checks.abstract_checks import classification_txt +from typing import List, Union, Dict, Type + +from slither.tools.upgradeability.checks.abstract_checks import classification_txt, AbstractCheck from slither.utils.myprettytable import MyPrettyTable -def output_wiki(detector_classes, filter_wiki): +def output_wiki(detector_classes: List[Type[AbstractCheck]], filter_wiki: str) -> None: # Sort by impact, confidence, and name detectors_list = sorted( detector_classes, key=lambda element: (element.IMPACT, element.ARGUMENT) @@ -31,7 +33,7 @@ def output_wiki(detector_classes, filter_wiki): print(recommendation) -def output_detectors(detector_classes): +def output_detectors(detector_classes: List[Type[AbstractCheck]]) -> None: detectors_list = [] for detector in detector_classes: argument = detector.ARGUMENT @@ -48,7 +50,7 @@ def output_detectors(detector_classes): for (argument, help_info, impact, proxy, v2) in detectors_list: table.add_row( [ - idx, + str(idx), argument, help_info, classification_txt[impact], @@ -60,8 +62,8 @@ def output_detectors(detector_classes): print(table) -def output_to_markdown(detector_classes, _filter_wiki): - def extract_help(cls): +def output_to_markdown(detector_classes: List[Type[AbstractCheck]], _filter_wiki: str) -> None: + def extract_help(cls: AbstractCheck) -> str: if cls.WIKI == "": return cls.HELP return f"[{cls.HELP}]({cls.WIKI})" @@ -85,7 +87,9 @@ def output_to_markdown(detector_classes, _filter_wiki): idx = idx + 1 -def output_detectors_json(detector_classes): +def output_detectors_json( + detector_classes: List[Type[AbstractCheck]], +) -> List[Dict[str, Union[str, int]]]: detectors_list = [] for detector in detector_classes: argument = detector.ARGUMENT @@ -110,7 +114,7 @@ def output_detectors_json(detector_classes): # Sort by impact, confidence, and name detectors_list = sorted(detectors_list, key=lambda element: (element[2], element[0])) idx = 1 - table = [] + table: List[Dict[str, Union[str, int]]] = [] for ( argument, help_info, diff --git a/slither/utils/arithmetic.py b/slither/utils/arithmetic.py index 06e8956dd..18ffaec51 100644 --- a/slither/utils/arithmetic.py +++ b/slither/utils/arithmetic.py @@ -1,17 +1,12 @@ -from decimal import Decimal - from slither.exceptions import SlitherException +from slither.utils.integer_conversion import convert_string_to_fraction # pylint: disable=too-many-branches def convert_subdenomination( value: str, sub: str ) -> int: # pylint: disable=too-many-return-statements - # to allow 0.1 ether conversion - if value[0:2] == "0x": - decimal_value = Decimal(int(value, 16)) - else: - decimal_value = Decimal(value) + decimal_value = convert_string_to_fraction(value) if sub == "wei": return int(decimal_value) if sub == "gwei": diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index d0d77c45f..c2fef5eca 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -1,13 +1,17 @@ +import argparse import json import os import re import logging from collections import defaultdict +from typing import Dict, List, Type, Union + from crytic_compile.cryticparser.defaults import ( DEFAULTS_FLAG_IN_CONFIG as DEFAULTS_FLAG_IN_CONFIG_CRYTIC_COMPILE, ) -from slither.detectors.abstract_detector import classification_txt +from slither.detectors.abstract_detector import classification_txt, AbstractDetector +from slither.printers.abstract_printer import AbstractPrinter from slither.utils.colors import yellow, red from slither.utils.myprettytable import MyPrettyTable @@ -34,7 +38,7 @@ defaults_flag_in_config = { "exclude_low": False, "exclude_medium": False, "exclude_high": False, - "fail_pedantic": False, + "fail_pedantic": True, "fail_low": False, "fail_medium": False, "fail_high": False, @@ -54,7 +58,7 @@ defaults_flag_in_config = { } -def read_config_file(args): +def read_config_file(args: argparse.Namespace) -> None: # No config file was provided as an argument if args.config_file is None: # Check wether the default config file is present @@ -83,8 +87,12 @@ def read_config_file(args): logger.error(yellow("Falling back to the default settings...")) -def output_to_markdown(detector_classes, printer_classes, filter_wiki): - def extract_help(cls): +def output_to_markdown( + detector_classes: List[Type[AbstractDetector]], + printer_classes: List[Type[AbstractPrinter]], + filter_wiki: str, +) -> None: + def extract_help(cls: Union[Type[AbstractDetector], Type[AbstractPrinter]]) -> str: if cls.WIKI == "": return cls.HELP return f"[{cls.HELP}]({cls.WIKI})" @@ -127,7 +135,7 @@ def output_to_markdown(detector_classes, printer_classes, filter_wiki): idx = idx + 1 -def get_level(l): +def get_level(l: str) -> int: tab = l.count("\t") + 1 if l.replace("\t", "").startswith(" -"): tab = tab + 1 @@ -136,7 +144,7 @@ def get_level(l): return tab -def convert_result_to_markdown(txt): +def convert_result_to_markdown(txt: str) -> str: # -1 to remove the last \n lines = txt[0:-1].split("\n") ret = [] @@ -154,16 +162,21 @@ def convert_result_to_markdown(txt): return "".join(ret) -def output_results_to_markdown(all_results, checklistlimit: str): +def output_results_to_markdown(all_results: List[Dict], checklistlimit: str) -> None: checks = defaultdict(list) - info = defaultdict(dict) - for results in all_results: - checks[results["check"]].append(results) - info[results["check"]] = {"impact": results["impact"], "confidence": results["confidence"]} + info: Dict = defaultdict(dict) + for results_ in all_results: + checks[results_["check"]].append(results_) + info[results_["check"]] = { + "impact": results_["impact"], + "confidence": results_["confidence"], + } print("Summary") - for check in checks: - print(f" - [{check}](#{check}) ({len(checks[check])} results) ({info[check]['impact']})") + for check_ in checks: + print( + f" - [{check_}](#{check_}) ({len(checks[check_])} results) ({info[check_]['impact']})" + ) counter = 0 for (check, results) in checks.items(): @@ -185,8 +198,7 @@ def output_results_to_markdown(all_results, checklistlimit: str): print(f"**More results were found, check [{checklistlimit}]({checklistlimit})**") -def output_wiki(detector_classes, filter_wiki): - detectors_list = [] +def output_wiki(detector_classes: List[Type[AbstractDetector]], filter_wiki: str) -> None: # Sort by impact, confidence, and name detectors_list = sorted( @@ -223,7 +235,7 @@ def output_wiki(detector_classes, filter_wiki): print(recommendation) -def output_detectors(detector_classes): +def output_detectors(detector_classes: List[Type[AbstractDetector]]) -> None: detectors_list = [] for detector in detector_classes: argument = detector.ARGUMENT @@ -242,12 +254,15 @@ def output_detectors(detector_classes): ) idx = 1 for (argument, help_info, impact, confidence) in detectors_list: - table.add_row([idx, argument, help_info, classification_txt[impact], confidence]) + table.add_row([str(idx), argument, help_info, classification_txt[impact], confidence]) idx = idx + 1 print(table) -def output_detectors_json(detector_classes): # pylint: disable=too-many-locals +# pylint: disable=too-many-locals +def output_detectors_json( + detector_classes: List[Type[AbstractDetector]], +) -> List[Dict]: detectors_list = [] for detector in detector_classes: argument = detector.ARGUMENT @@ -307,7 +322,7 @@ def output_detectors_json(detector_classes): # pylint: disable=too-many-locals return table -def output_printers(printer_classes): +def output_printers(printer_classes: List[Type[AbstractPrinter]]) -> None: printers_list = [] for printer in printer_classes: argument = printer.ARGUMENT @@ -319,12 +334,12 @@ def output_printers(printer_classes): printers_list = sorted(printers_list, key=lambda element: (element[0])) idx = 1 for (argument, help_info) in printers_list: - table.add_row([idx, argument, help_info]) + table.add_row([str(idx), argument, help_info]) idx = idx + 1 print(table) -def output_printers_json(printer_classes): +def output_printers_json(printer_classes: List[Type[AbstractPrinter]]) -> List[Dict]: printers_list = [] for printer in printer_classes: argument = printer.ARGUMENT diff --git a/slither/utils/integer_conversion.py b/slither/utils/integer_conversion.py index f5cf453b5..e4dff333c 100644 --- a/slither/utils/integer_conversion.py +++ b/slither/utils/integer_conversion.py @@ -1,28 +1,35 @@ -from decimal import Decimal +from fractions import Fraction from typing import Union from slither.exceptions import SlitherError -def convert_string_to_int(val: Union[str, int]) -> int: +def convert_string_to_fraction(val: Union[str, int]) -> Fraction: if isinstance(val, int): - return val + return Fraction(val) if val.startswith(("0x", "0X")): - return int(val, 16) + return Fraction(int(val, 16)) + + # Fractions do not support underscore separators (on Python <3.11) + val = val.replace("_", "") if "e" in val or "E" in val: base, expo = val.split("e") if "e" in val else val.split("E") - base, expo = Decimal(base), int(expo) + base, expo = Fraction(base), int(expo) # The resulting number must be < 2**256-1, otherwise solc # Would not be able to compile it # 10**77 is the largest exponent that fits # See https://github.com/ethereum/solidity/blob/9e61f92bd4d19b430cb8cb26f1c7cf79f1dff380/libsolidity/ast/Types.cpp#L1281-L1290 if expo > 77: - if base != Decimal(0): + if base != Fraction(0): raise SlitherError( f"{base}e{expo} is too large to fit in any Solidity integer size" ) return 0 - return int(Decimal(base) * Decimal(10 ** expo)) + return Fraction(base) * Fraction(10**expo) + + return Fraction(val) - return int(Decimal(val)) + +def convert_string_to_int(val: Union[str, int]) -> int: + return int(convert_string_to_fraction(val)) diff --git a/slither/utils/output.py b/slither/utils/output.py index 6296e35d3..5db6492db 100644 --- a/slither/utils/output.py +++ b/slither/utils/output.py @@ -4,7 +4,7 @@ import json import logging import zipfile from collections import OrderedDict -from typing import Optional, Dict, List, Union, Any, TYPE_CHECKING +from typing import Optional, Dict, List, Union, Any, TYPE_CHECKING, Type from zipfile import ZipFile from pkg_resources import require @@ -129,7 +129,7 @@ def _output_result_to_sarif( def output_to_sarif( - filename: Optional[str], results: Dict, detectors_classes: List["AbstractDetector"] + filename: Optional[str], results: Dict, detectors_classes: List[Type["AbstractDetector"]] ) -> None: """ diff --git a/slither/utils/output_capture.py b/slither/utils/output_capture.py index 5282afb91..aec170d7f 100644 --- a/slither/utils/output_capture.py +++ b/slither/utils/output_capture.py @@ -28,7 +28,7 @@ class StandardOutputCapture: original_logger_handlers = None @staticmethod - def enable(block_original=True): + def enable(block_original: bool = True) -> None: """ Redirects stdout and stderr to a capturable StringIO. :param block_original: If True, blocks all output to the original stream. If False, duplicates output. @@ -54,7 +54,7 @@ class StandardOutputCapture: root_logger.handlers = [logging.StreamHandler(sys.stderr)] @staticmethod - def disable(): + def disable() -> None: """ Disables redirection of stdout/stderr, if previously enabled. :return: None @@ -78,7 +78,7 @@ class StandardOutputCapture: StandardOutputCapture.original_logger_handlers = None @staticmethod - def get_stdout_output(): + def get_stdout_output() -> str: """ Obtains the output from the currently set stdout :return: Returns stdout output as a string @@ -87,7 +87,7 @@ class StandardOutputCapture: return sys.stdout.read() @staticmethod - def get_stderr_output(): + def get_stderr_output() -> str: """ Obtains the output from the currently set stderr :return: Returns stderr output as a string diff --git a/slither/visitors/expression/constants_folding.py b/slither/visitors/expression/constants_folding.py index 1758c83dd..250104f5e 100644 --- a/slither/visitors/expression/constants_folding.py +++ b/slither/visitors/expression/constants_folding.py @@ -1,5 +1,5 @@ from slither.core.expressions import BinaryOperationType, Literal, UnaryOperationType -from slither.utils.integer_conversion import convert_string_to_int +from slither.utils.integer_conversion import convert_string_to_fraction, convert_string_to_int from slither.visitors.expression.expression import ExpressionVisitor @@ -72,15 +72,15 @@ class ConstantFolding(ExpressionVisitor): cf = ConstantFolding(expr, self._type) expr = cf.result() assert isinstance(expr, Literal) - set_val(expression, int(expr.value)) + set_val(expression, -convert_string_to_fraction(expr.value)) else: raise NotConstant def _post_literal(self, expression): - if expression.value.isdigit(): - set_val(expression, int(expression.value)) - else: - raise NotConstant + try: + set_val(expression, convert_string_to_fraction(expression.value)) + except ValueError as e: + raise NotConstant from e def _post_assignement_operation(self, expression): raise NotConstant @@ -115,7 +115,7 @@ class ConstantFolding(ExpressionVisitor): cf = ConstantFolding(expression.expressions[0], self._type) expr = cf.result() assert isinstance(expr, Literal) - set_val(expression, int(expr.value)) + set_val(expression, convert_string_to_fraction(expr.value)) return raise NotConstant diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-compact.zip new file mode 100644 index 000000000..eab87a486 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-legacy.zip new file mode 100644 index 000000000..b5946691d Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.0-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-compact.zip new file mode 100644 index 000000000..3d960b6b4 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-legacy.zip new file mode 100644 index 000000000..c19cda479 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.1-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-compact.zip new file mode 100644 index 000000000..065df29b3 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-legacy.zip new file mode 100644 index 000000000..4f749c9ca Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.2-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-compact.zip new file mode 100644 index 000000000..24b6863ae Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-legacy.zip new file mode 100644 index 000000000..ed1aec78b Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.3-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-compact.zip new file mode 100644 index 000000000..bcd70d56a Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-legacy.zip new file mode 100644 index 000000000..4eaa1a25e Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.4-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-compact.zip new file mode 100644 index 000000000..1e5f938ad Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-legacy.zip new file mode 100644 index 000000000..daa91f7bf Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.5-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-compact.zip new file mode 100644 index 000000000..c69f3f426 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-legacy.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-legacy.zip new file mode 100644 index 000000000..db8047403 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.7.6-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.0-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.0-compact.zip new file mode 100644 index 000000000..9d472762d Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.1-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.1-compact.zip new file mode 100644 index 000000000..1aafa0cbe Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.10-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.10-compact.zip new file mode 100644 index 000000000..70882f214 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.10-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.11-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.11-compact.zip new file mode 100644 index 000000000..94bc29af8 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.11-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.12-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.12-compact.zip new file mode 100644 index 000000000..ffa634d55 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.12-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.13-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.13-compact.zip new file mode 100644 index 000000000..c56bc86aa Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.13-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.14-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.14-compact.zip new file mode 100644 index 000000000..d833db792 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.14-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.15-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.15-compact.zip new file mode 100644 index 000000000..466a99699 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.15-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.2-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.2-compact.zip new file mode 100644 index 000000000..59e68af7a Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.3-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.3-compact.zip new file mode 100644 index 000000000..f477ad171 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.4-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.4-compact.zip new file mode 100644 index 000000000..721779db1 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.5-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.5-compact.zip new file mode 100644 index 000000000..5bafac6b9 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.6-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.6-compact.zip new file mode 100644 index 000000000..e0358444c Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.7-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.7-compact.zip new file mode 100644 index 000000000..f9d887546 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.7-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.8-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.8-compact.zip new file mode 100644 index 000000000..ddcc81093 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.8-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.9-compact.zip b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.9-compact.zip new file mode 100644 index 000000000..ebd1e7f23 Binary files /dev/null and b/tests/ast-parsing/compile/modifier-0.7.0.sol-0.8.9-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.0-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.0-compact.zip index cfddc0391..c6e39a8f0 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.0-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.0-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.0-legacy.zip index 39d95cfe6..512e114a1 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.0-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.0-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.1-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.1-compact.zip index 69a7a8fe4..38729e076 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.1-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.1-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.1-legacy.zip index 26988bdc6..46a1a7d69 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.1-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.1-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.10-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.10-compact.zip index c816e1db5..16f0e3694 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.10-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.10-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.10-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.10-legacy.zip index c816e1db5..16f0e3694 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.10-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.10-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.11-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.11-compact.zip index eb7c8fe70..9eb504d53 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.11-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.11-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.11-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.11-legacy.zip index eb7c8fe70..9eb504d53 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.11-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.11-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.12-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.12-compact.zip index 18b5c0023..bda6fe0e3 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.12-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.12-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.12-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.12-legacy.zip index 18b5c0023..bda6fe0e3 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.12-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.12-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.13-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.13-compact.zip index 05e511d79..d0d183716 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.13-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.13-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.13-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.13-legacy.zip index 4f1ca3c92..579d9f6d0 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.13-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.13-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.14-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.14-compact.zip index db0a0f3fd..ff506a007 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.14-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.14-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.14-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.14-legacy.zip index d42f602b7..61a37cac3 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.14-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.14-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.15-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.15-compact.zip index 0483a7aab..062329dc3 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.15-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.15-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.15-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.15-legacy.zip index 547e3a7fd..148b2f868 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.15-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.15-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.16-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.16-compact.zip index 017670d1c..1259e4e03 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.16-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.16-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.16-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.16-legacy.zip index 07ae0f8be..97c4f577c 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.16-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.16-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.17-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.17-compact.zip index 66e5c9957..2106dc2cb 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.17-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.17-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.17-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.17-legacy.zip index 44bda80fa..c7c6c92cb 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.17-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.17-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.18-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.18-compact.zip index 025fafec4..8dcf47e25 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.18-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.18-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.18-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.18-legacy.zip index 2900f1013..8c756b719 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.18-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.18-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.19-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.19-compact.zip index b141c15d6..b90f8c07e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.19-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.19-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.19-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.19-legacy.zip index 7f575de73..8c8fbab7d 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.19-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.19-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.2-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.2-compact.zip index 8bc67d877..61e616857 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.2-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.2-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.2-legacy.zip index 7c3aed134..d5d0691db 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.2-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.2-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.20-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.20-compact.zip index 9ad17df8c..7dbfd796b 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.20-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.20-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.20-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.20-legacy.zip index 35c6a0757..f2f57278f 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.20-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.20-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.21-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.21-compact.zip index 1ed1491e8..620bceadb 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.21-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.21-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.21-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.21-legacy.zip index 739750ff4..bbe5db5a4 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.21-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.21-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.22-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.22-compact.zip index 4b148ba56..6d0ac5e34 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.22-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.22-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.22-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.22-legacy.zip index c2be37ba9..ecf80602f 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.22-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.22-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.23-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.23-compact.zip index 19c1a4293..a7b910323 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.23-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.23-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.23-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.23-legacy.zip index fe5195a08..ba2050320 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.23-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.23-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.24-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.24-compact.zip index 3760c5f0b..1222d8d8d 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.24-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.24-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.24-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.24-legacy.zip index 25d4442ea..873ee11fe 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.24-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.24-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.25-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.25-compact.zip index f66a17d9a..c1b054e2e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.25-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.25-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.25-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.25-legacy.zip index fc9d9d792..cb8cfb064 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.25-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.25-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.26-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.26-compact.zip index d46b4535b..33c4637d4 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.26-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.26-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.26-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.26-legacy.zip index 167c10fb1..426d2c8c4 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.26-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.26-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.3-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.3-compact.zip index b19bf3a39..a1086e508 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.3-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.3-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.3-legacy.zip index 14e02b8c2..66a2c1e66 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.3-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.3-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.4-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.4-compact.zip index 842c67c65..ca622d7f7 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.4-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.4-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.4-legacy.zip index 560ee388b..380b08cfc 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.4-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.4-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.5-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.5-compact.zip index 44f3dac3f..f19c5297d 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.5-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.5-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.5-legacy.zip index 6c909e4f2..0c3808e7f 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.5-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.5-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.6-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.6-compact.zip index f4407df85..ca3a1023f 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.6-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.6-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.6-legacy.zip index 8164be969..886617fd8 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.6-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.6-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.7-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.7-compact.zip index 6f439ed9e..081953928 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.7-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.7-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.7-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.7-legacy.zip index ed1708f04..f5374b523 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.7-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.7-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.8-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.8-compact.zip index 46807909d..ad369947e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.8-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.8-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.8-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.8-legacy.zip index f90a3f74b..91de2e82a 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.8-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.8-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.9-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.9-compact.zip index b735fe419..2646618af 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.9-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.9-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.4.9-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.4.9-legacy.zip index b735fe419..2646618af 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.4.9-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.4.9-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.0-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.0-compact.zip index 75023f81a..e4ba62b56 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.0-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.0-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.0-legacy.zip index da4e7d59a..37484452a 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.0-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.0-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.1-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.1-compact.zip index 54dbdf88e..87ea809a4 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.1-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.1-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.1-legacy.zip index 5b2633e0e..af5d001c3 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.1-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.1-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.10-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.10-compact.zip index 22c051ae9..77d916a4b 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.10-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.10-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.10-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.10-legacy.zip index ee2390a86..0841d5658 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.10-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.10-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.11-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.11-compact.zip index 97cb59479..d032f2b7a 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.11-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.11-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.11-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.11-legacy.zip index a7ce558d9..0d335e734 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.11-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.11-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.12-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.12-compact.zip index 20896d7d4..5be174302 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.12-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.12-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.12-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.12-legacy.zip index 5ce65aeb8..8cab71b12 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.12-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.12-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.13-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.13-compact.zip index 484e9fd8d..8d47c01ba 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.13-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.13-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.13-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.13-legacy.zip index e3bbd21f1..9d238eedd 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.13-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.13-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.14-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.14-compact.zip index 10bbc7d75..ce2f2fee0 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.14-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.14-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.14-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.14-legacy.zip index d0125916c..a19d27957 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.14-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.14-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.15-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.15-compact.zip index 263785eb5..1cdc76aa5 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.15-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.15-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.15-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.15-legacy.zip index 27f726f89..1bb72e452 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.15-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.15-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.16-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.16-compact.zip index 9dba82dfe..d1b0b62b7 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.16-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.16-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.16-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.16-legacy.zip index 7d72a38b3..689a5c537 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.16-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.16-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.17-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.17-compact.zip index ef73090bc..ff7a96a21 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.17-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.17-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.17-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.17-legacy.zip index 1c741923a..5ac31105d 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.17-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.17-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.2-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.2-compact.zip index 74816482e..f7ab71d36 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.2-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.2-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.2-legacy.zip index 05bd06b7c..edd73a4f2 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.2-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.2-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.3-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.3-compact.zip index 11a20496d..adc49dd65 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.3-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.3-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.3-legacy.zip index 057444fbd..2d796d9d2 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.3-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.3-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.4-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.4-compact.zip index a54f0cb10..9e67e1ca4 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.4-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.4-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.4-legacy.zip index 999da3b11..b3155aa1e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.4-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.4-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.5-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.5-compact.zip index 8ed211536..161c2c949 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.5-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.5-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.5-legacy.zip index e59d05a61..a48e14e83 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.5-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.5-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.6-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.6-compact.zip index 5a58463bf..ab38ddb1b 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.6-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.6-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.6-legacy.zip index 83de17a29..859da901f 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.6-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.6-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.7-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.7-compact.zip index 7614bb79e..6c6c20763 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.7-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.7-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.7-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.7-legacy.zip index 987af0e38..766b7c3ce 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.7-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.7-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.8-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.8-compact.zip index 7cf133ae4..71684668d 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.8-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.8-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.8-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.8-legacy.zip index 241d8b445..81f0cf7bc 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.8-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.8-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.9-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.9-compact.zip index c57077d1d..1bf4d20c7 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.9-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.9-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.5.9-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.5.9-legacy.zip index ea69f7fbf..a0b755b69 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.5.9-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.5.9-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.0-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.0-compact.zip index 2decd51e2..ef0921946 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.0-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.0-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.0-legacy.zip index d4ed5b8d1..8cc3597bb 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.0-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.0-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.1-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.1-compact.zip index a0b337bc6..0eb1ab76c 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.1-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.1-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.1-legacy.zip index 50513f8a1..fe374bfc8 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.1-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.1-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.10-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.10-compact.zip index 12fcd3893..a3242275a 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.10-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.10-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.10-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.10-legacy.zip index 99ec8d204..0d32b9295 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.10-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.10-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.11-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.11-compact.zip index daf0b8f25..f451b3b4c 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.11-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.11-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.11-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.11-legacy.zip index b59a21cdc..ec059f545 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.11-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.11-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.12-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.12-compact.zip index 5b146bee6..6c3f55506 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.12-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.12-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.12-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.12-legacy.zip index 5b4e598e3..660fee4d8 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.12-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.12-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.2-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.2-compact.zip index 25b265f54..c8505fd5e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.2-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.2-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.2-legacy.zip index a3591a1f0..5bb2253c7 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.2-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.2-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.3-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.3-compact.zip index 29f4032aa..d69bb15d1 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.3-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.3-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.3-legacy.zip index 960422bd5..cb0ed5559 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.3-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.3-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.4-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.4-compact.zip index d236e34ca..9324b2642 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.4-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.4-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.4-legacy.zip index 28f2a0b1f..7e2fab9ca 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.4-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.4-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.5-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.5-compact.zip index ea316dc6b..475877da5 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.5-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.5-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.5-legacy.zip index cee34d9e5..2f7403ebb 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.5-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.5-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.6-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.6-compact.zip index 2a1cfe4a7..a1d38344e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.6-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.6-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.6-legacy.zip index 7e229b641..1c1675d37 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.6-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.6-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.7-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.7-compact.zip index 530bb433e..0ee4e9521 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.7-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.7-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.7-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.7-legacy.zip index ed0510517..a58bb7027 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.7-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.7-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.8-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.8-compact.zip index 23aea0c75..cd1f9b9e6 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.8-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.8-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.8-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.8-legacy.zip index 56013943e..9366754ec 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.8-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.8-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.9-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.9-compact.zip index 7b9a86ea9..5076082d6 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.9-compact.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.9-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.6.9-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.6.9-legacy.zip index f6151d928..f91f96d4e 100644 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.6.9-legacy.zip and b/tests/ast-parsing/compile/modifier-all.sol-0.6.9-legacy.zip differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.0-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.0-compact.zip deleted file mode 100644 index cfdc87ec0..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.0-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.0-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.0-legacy.zip deleted file mode 100644 index d1113027b..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.0-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.1-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.1-compact.zip deleted file mode 100644 index b0995d507..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.1-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.1-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.1-legacy.zip deleted file mode 100644 index 377809f67..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.1-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.2-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.2-compact.zip deleted file mode 100644 index 4117212da..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.2-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.2-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.2-legacy.zip deleted file mode 100644 index 3dc1958e1..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.2-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.3-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.3-compact.zip deleted file mode 100644 index fc3c697b1..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.3-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.3-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.3-legacy.zip deleted file mode 100644 index 1936c5cf4..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.3-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.4-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.4-compact.zip deleted file mode 100644 index 819497795..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.4-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.4-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.4-legacy.zip deleted file mode 100644 index f7c156912..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.4-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.5-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.5-compact.zip deleted file mode 100644 index 45075e0bf..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.5-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.5-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.5-legacy.zip deleted file mode 100644 index 971fae4d2..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.5-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.6-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.6-compact.zip deleted file mode 100644 index 18d13d738..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.6-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.7.6-legacy.zip b/tests/ast-parsing/compile/modifier-all.sol-0.7.6-legacy.zip deleted file mode 100644 index 6b4142f33..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.7.6-legacy.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.0-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.0-compact.zip deleted file mode 100644 index 52deeb8f5..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.0-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.1-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.1-compact.zip deleted file mode 100644 index 1f5cce5c6..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.1-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.10-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.10-compact.zip deleted file mode 100644 index 26ea5c5ad..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.10-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.11-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.11-compact.zip deleted file mode 100644 index ff4b57bc4..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.11-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.12-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.12-compact.zip deleted file mode 100644 index 2d9ff7488..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.12-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.13-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.13-compact.zip deleted file mode 100644 index 7845c49f6..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.13-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.14-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.14-compact.zip deleted file mode 100644 index cdc342f12..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.14-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.15-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.15-compact.zip deleted file mode 100644 index d4d53a419..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.15-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.2-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.2-compact.zip deleted file mode 100644 index 0d7b98ce9..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.2-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.3-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.3-compact.zip deleted file mode 100644 index a1a5cb998..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.3-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.4-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.4-compact.zip deleted file mode 100644 index 33e6f9631..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.4-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.5-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.5-compact.zip deleted file mode 100644 index 6751bb8da..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.5-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.6-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.6-compact.zip deleted file mode 100644 index e6393db5c..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.6-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.7-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.7-compact.zip deleted file mode 100644 index ed7cbdfc8..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.7-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.8-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.8-compact.zip deleted file mode 100644 index 1e0c46509..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.8-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier-all.sol-0.8.9-compact.zip b/tests/ast-parsing/compile/modifier-all.sol-0.8.9-compact.zip deleted file mode 100644 index 7c12e4259..000000000 Binary files a/tests/ast-parsing/compile/modifier-all.sol-0.8.9-compact.zip and /dev/null differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.0-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.0-compact.zip index f8a3c1a16..0a7a5738d 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.0-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.0-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.1-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.1-compact.zip index cdb2a9daa..cefe498b5 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.1-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.1-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.10-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.10-compact.zip index 5fb6cde6b..8dd173562 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.10-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.10-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.11-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.11-compact.zip index adf9a336a..5b262c837 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.11-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.11-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.12-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.12-compact.zip index 7e6e7a65f..6159756b9 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.12-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.12-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.13-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.13-compact.zip index 47066aa8b..41d76763d 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.13-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.13-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.14-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.14-compact.zip index 01de606fb..eac4ef5fe 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.14-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.14-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.15-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.15-compact.zip index 233e4a87f..9db5d2399 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.15-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.15-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.2-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.2-compact.zip index b5fea85ed..4cff0e904 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.2-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.2-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.3-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.3-compact.zip index 728beb81f..c5b0b7f1a 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.3-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.3-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.4-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.4-compact.zip index 1eb88493e..fb11df4ae 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.4-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.4-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.5-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.5-compact.zip index 316ec5863..7418627bb 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.5-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.5-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.6-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.6-compact.zip index 6fd91e0e7..b157c944e 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.6-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.6-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.7-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.7-compact.zip index 041c5ea9e..a5d2432e0 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.7-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.7-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.8-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.8-compact.zip index c132ab79a..495688081 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.8-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.8-compact.zip differ diff --git a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.9-compact.zip b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.9-compact.zip index 1a06a3c57..7d915f29b 100644 Binary files a/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.9-compact.zip and b/tests/ast-parsing/compile/modifier_identifier_path.sol-0.8.9-compact.zip differ diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.0-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.1-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.2-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.3-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.4-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.5-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-legacy.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-legacy.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.7.6-legacy.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.0-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.0-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.0-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.1-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.1-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.1-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.10-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.10-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.10-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.11-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.11-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.11-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.12-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.12-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.12-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.13-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.13-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.13-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.14-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.14-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.14-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.15-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.15-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.15-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.2-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.2-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.2-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.3-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.3-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.3-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.4-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.4-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.4-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.5-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.5-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.5-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.6-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.6-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.6-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.7-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.7-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.7-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.8-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.8-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.8-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.9-compact.json b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.9-compact.json new file mode 100644 index 000000000..eaca6e24a --- /dev/null +++ b/tests/ast-parsing/expected/modifier-0.7.0.sol-0.8.9-compact.json @@ -0,0 +1,12 @@ +{ + "A": { + "f()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: EXPRESSION 1\n\"];\n}\n", + "m()": "digraph{\n}\n" + }, + "C": { + "onePlaceholder()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "multiplePlaceholders()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n1->2;\n2[label=\"Node Type: _ 2\n\"];\n2->3;\n3[label=\"Node Type: _ 3\n\"];\n}\n", + "acceptsVar(uint256)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n", + "noParams()": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->1;\n1[label=\"Node Type: _ 1\n\"];\n}\n" + } +} \ No newline at end of file diff --git a/tests/ast-parsing/modifier-0.7.0.sol b/tests/ast-parsing/modifier-0.7.0.sol new file mode 100644 index 000000000..24240ad5e --- /dev/null +++ b/tests/ast-parsing/modifier-0.7.0.sol @@ -0,0 +1,27 @@ +abstract contract A{ + modifier m() virtual; + + function f() public m(){ + + } +} + +contract C { + modifier onePlaceholder() { + _; + } + + modifier multiplePlaceholders() { + _; + _; + _; + } + + modifier acceptsVar(uint a) { + _; + } + + modifier noParams { + _; + } +} diff --git a/tests/check-upgradeability/test_10.txt b/tests/check-upgradeability/test_10.txt index 1527735c5..3d317aca5 100644 --- a/tests/check-upgradeability/test_10.txt +++ b/tests/check-upgradeability/test_10.txt @@ -10,4 +10,4 @@ Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#missing- INFO:Slither: Initializable contract not found, the contract does not follow a standard initalization schema. Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#initializable-is-missing -INFO:Slither:4 findings, 18 detectors run +INFO:Slither:4 findings, 21 detectors run diff --git a/tests/check-upgradeability/test_2.txt b/tests/check-upgradeability/test_2.txt index 7641e8335..dcf910c00 100644 --- a/tests/check-upgradeability/test_2.txt +++ b/tests/check-upgradeability/test_2.txt @@ -4,4 +4,4 @@ Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#initiali INFO:Slither: Initializable contract not found, the contract does not follow a standard initalization schema. Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#initializable-is-missing -INFO:Slither:2 findings, 22 detectors run +INFO:Slither:2 findings, 25 detectors run diff --git a/tests/check-upgradeability/test_3.txt b/tests/check-upgradeability/test_3.txt index b3c7c0a15..fb694d5fb 100644 --- a/tests/check-upgradeability/test_3.txt +++ b/tests/check-upgradeability/test_3.txt @@ -20,4 +20,4 @@ Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#extra-va INFO:Slither: Initializable contract not found, the contract does not follow a standard initalization schema. Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#initializable-is-missing -INFO:Slither:6 findings, 22 detectors run +INFO:Slither:6 findings, 25 detectors run diff --git a/tests/check-upgradeability/test_4.txt b/tests/check-upgradeability/test_4.txt index 4e32dc904..4752eb706 100644 --- a/tests/check-upgradeability/test_4.txt +++ b/tests/check-upgradeability/test_4.txt @@ -17,4 +17,4 @@ Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#extra-va INFO:Slither: Initializable contract not found, the contract does not follow a standard initalization schema. Reference: https://github.com/crytic/slither/wiki/Upgradeability-Checks#initializable-is-missing -INFO:Slither:5 findings, 22 detectors run +INFO:Slither:5 findings, 25 detectors run diff --git a/tests/constant_folding_rational.sol b/tests/constant_folding_rational.sol new file mode 100644 index 000000000..193133824 --- /dev/null +++ b/tests/constant_folding_rational.sol @@ -0,0 +1,9 @@ +contract C { + uint256 constant a = 2.5 + 7 + 0.5; + int128 b = 6 / 3.0; + int64 constant c = 5 * 0.5 + 0.5; + int256 d = 1e3 + 5E2; + uint256 e = 2 ** 255; + uint256 f = 115792089237316195423570985008687907853269984665640564039457584_007_913_129_639_935; + int64 constant g = -7.0; +} \ No newline at end of file diff --git a/tests/test_ast_parsing.py b/tests/test_ast_parsing.py index 77d0b86cd..e950892b3 100644 --- a/tests/test_ast_parsing.py +++ b/tests/test_ast_parsing.py @@ -12,13 +12,13 @@ from solc_select.solc_select import installed_versions as get_installed_solc_ver from crytic_compile import CryticCompile, save_to_zip from crytic_compile.utils.zip import load_from_zip - from slither import Slither from slither.printers.guidance.echidna import Echidna SLITHER_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEST_ROOT = os.path.join(SLITHER_ROOT, "tests", "ast-parsing") + # pylint: disable=too-few-public-methods class Test: def __init__(self, test_file: str, solc_versions: List[str], disable_legacy: bool = False): @@ -282,7 +282,11 @@ ALL_TESTS = [ ), Test( "modifier-all.sol", - ALL_VERSIONS, + VERSIONS_04 + VERSIONS_05 + VERSIONS_06, + ), + Test( + "modifier-0.7.0.sol", + VERSIONS_07 + VERSIONS_08, ), Test("library_implicit_conversion-0.4.0.sol", VERSIONS_04), Test( diff --git a/tests/test_constant_folding.py b/tests/test_constant_folding.py new file mode 100644 index 000000000..efc3119a8 --- /dev/null +++ b/tests/test_constant_folding.py @@ -0,0 +1,45 @@ +from slither import Slither +from slither.visitors.expression.constants_folding import ConstantFolding + + +def test_constant_folding_unary(): + Slither("./tests/constant_folding_unary.sol") + + +def test_constant_folding_rational(): + s = Slither("./tests/constant_folding_rational.sol") + contract = s.get_contract_from_name("C")[0] + + variable_a = contract.get_state_variable_from_name("a") + assert str(variable_a.type) == "uint256" + assert str(ConstantFolding(variable_a.expression, "uint256").result()) == "10" + + variable_b = contract.get_state_variable_from_name("b") + assert str(variable_b.type) == "int128" + assert str(ConstantFolding(variable_b.expression, "int128").result()) == "2" + + variable_c = contract.get_state_variable_from_name("c") + assert str(variable_c.type) == "int64" + assert str(ConstantFolding(variable_c.expression, "int64").result()) == "3" + + variable_d = contract.get_state_variable_from_name("d") + assert str(variable_d.type) == "int256" + assert str(ConstantFolding(variable_d.expression, "int256").result()) == "1500" + + variable_e = contract.get_state_variable_from_name("e") + assert str(variable_e.type) == "uint256" + assert ( + str(ConstantFolding(variable_e.expression, "uint256").result()) + == "57896044618658097711785492504343953926634992332820282019728792003956564819968" + ) + + variable_f = contract.get_state_variable_from_name("f") + assert str(variable_f.type) == "uint256" + assert ( + str(ConstantFolding(variable_f.expression, "uint256").result()) + == "115792089237316195423570985008687907853269984665640564039457584007913129639935" + ) + + variable_g = contract.get_state_variable_from_name("g") + assert str(variable_g.type) == "int64" + assert str(ConstantFolding(variable_g.expression, "int64").result()) == "-7" diff --git a/tests/test_constant_folding_unary.py b/tests/test_constant_folding_unary.py deleted file mode 100644 index fa51d0934..000000000 --- a/tests/test_constant_folding_unary.py +++ /dev/null @@ -1,5 +0,0 @@ -from slither import Slither - - -def test_constant_folding_unary(): - Slither("./tests/constant_folding_unary.sol") diff --git a/tests/test_path_filtering/libs/ReentrancyMock1.sol b/tests/test_path_filtering/libs/ReentrancyMock1.sol new file mode 100644 index 000000000..9c8599081 --- /dev/null +++ b/tests/test_path_filtering/libs/ReentrancyMock1.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +contract ReentrancyMock1 { + mapping(address => uint256) public userBalances1; + + function withdraw1() external { + uint256 userBalance = userBalances1[msg.sender]; + require(userBalance > 0); + (bool success, ) = msg.sender.call{value: userBalance}(""); + require(success); + userBalances1[msg.sender] = 0; + } +} diff --git a/tests/test_path_filtering/libs/ReentrancyMock2.sol b/tests/test_path_filtering/libs/ReentrancyMock2.sol new file mode 100644 index 000000000..42b71c6a6 --- /dev/null +++ b/tests/test_path_filtering/libs/ReentrancyMock2.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +contract ReentrancyMock2 { + mapping(address => uint256) public userBalances2; + + function withdraw2() external { + uint256 userBalance = userBalances2[msg.sender]; + require(userBalance > 0); + (bool success, ) = msg.sender.call{value: userBalance}(""); + require(success); + userBalances2[msg.sender] = 0; + } +} diff --git a/tests/test_path_filtering/libs/ReentrancyMock3.sol b/tests/test_path_filtering/libs/ReentrancyMock3.sol new file mode 100644 index 000000000..097aea25a --- /dev/null +++ b/tests/test_path_filtering/libs/ReentrancyMock3.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +contract ReentrancyMock3 { + mapping(address => uint256) public userBalances3; + + function withdraw3() external { + uint256 userBalance = userBalances3[msg.sender]; + require(userBalance > 0); + (bool success, ) = msg.sender.call{value: userBalance}(""); + require(success); + userBalances3[msg.sender] = 0; + } +} diff --git a/tests/test_path_filtering/slither.config.json b/tests/test_path_filtering/slither.config.json new file mode 100644 index 000000000..95aac92b0 --- /dev/null +++ b/tests/test_path_filtering/slither.config.json @@ -0,0 +1,7 @@ +{ + "detectors_to_run": "all", + "exclude_informational": true, + "exclude_low": true, + "fail_pedantic": false, + "filter_paths": "libs|src/ReentrancyMock.sol" +} diff --git a/tests/test_path_filtering/src/ReentrancyMock.sol b/tests/test_path_filtering/src/ReentrancyMock.sol new file mode 100644 index 000000000..02d34e6ae --- /dev/null +++ b/tests/test_path_filtering/src/ReentrancyMock.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +contract ReentrancyMock { + mapping(address => uint256) public userBalances; + + function withdraw() external { + uint256 userBalance = userBalances[msg.sender]; + require(userBalance > 0); + (bool success, ) = msg.sender.call{value: userBalance}(""); + require(success); + userBalances[msg.sender] = 0; + } +} diff --git a/tests/test_path_filtering/test_path_filtering.sol b/tests/test_path_filtering/test_path_filtering.sol new file mode 100644 index 000000000..4e6859a02 --- /dev/null +++ b/tests/test_path_filtering/test_path_filtering.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.0; + +import "./src/ReentrancyMock.sol"; +import "./libs/ReentrancyMock1.sol"; +import "./libs/ReentrancyMock2.sol"; +import "./libs/ReentrancyMock3.sol"; + +contract TestPathFiltering is ReentrancyMock, ReentrancyMock1, ReentrancyMock2, ReentrancyMock3 {}